Skip to content

Commit

Permalink
Added number_of_gaussian angles to LW calculation.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Jan 3, 2020
1 parent a564c8b commit 323e6f9
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
29 changes: 25 additions & 4 deletions physics/GFS_rrtmgp_pre.F90
Original file line number Diff line number Diff line change
Expand Up @@ -199,7 +199,8 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,
real(kind_phys),dimension(NCOL,Model%levs) :: vmr_o3, vmr_h2o, coldry, tem0, colamt
real(kind_phys) :: es, qs, tem1, tem2
real(kind_phys), dimension(ncol, NF_ALBD) :: sfcalb
real(kind_phys), dimension(ncol, Model%levs) :: qs_lay, q_lay, deltaZ, deltaP, o3_lay
real(kind_phys), dimension(ncol, Model%levs) :: qs_lay, q_lay, deltaZ, deltaP, o3_lay, p_lay_log
real(kind_phys), dimension(ncol, Model%levs+1) :: p_lev_log
real(kind_phys), dimension(ncol, Model%levs, NF_VGAS) :: gas_vmr
real(kind_phys), dimension(ncol, Model%levs, NF_CLDS) :: clouds
real(kind_phys), dimension(ncol) :: precipitableH2o
Expand Down Expand Up @@ -241,15 +242,35 @@ subroutine GFS_rrtmgp_pre_run (Model, Grid, Statein, Coupling, Radtend, Sfcprop,

! Temperature at layer-interfaces
if (top_at_1) then
! Log of pressure (used for temperature level interpolation)
p_lay_log = log(p_lay)
p_lev_log(:,1) = log(max(1.0e-6,p_lev(:,1)))
p_lev_log(:,2:iSFC+1) = log(p_lev(:,2:iSFC+1))
!
t_lev(1:NCOL,1) = t_lay(1:NCOL,iTOA)
t_lev(1:NCOL,2:iSFC) = (t_lay(1:NCOL,2:iSFC)+t_lay(1:NCOL,1:iSFC-1))/2._kind_phys
do iLay=2,iSFC
t_lev(1:nCol,iLay) = t_lay(1:nCol,iLay) + (t_lay(1:nCol,iLay-1)-t_lay(1:nCol,iLay)) * &
(p_lev_log(1:nCol,iLay) - p_lay_log(1:nCol,iLay)) / &
(p_lay_log(1:nCol,iLay-1) - p_lay_log(1:nCol,iLay))
enddo
!t_lev(1:NCOL,2:iSFC) = (t_lay(1:NCOL,2:iSFC)+t_lay(1:NCOL,1:iSFC-1))/2._kind_phys
t_lev(1:NCOL,iSFC+1) = Sfcprop%tsfc(1:NCOL)
else
! Log of pressure (used for temperature level interpolation)
p_lay_log = log(p_lay)
p_lev_log(:,1) = log(max(1.0e-6,p_lev(:,1)))
p_lev_log(:,2:iTOA+1) = log(p_lev(:,2:iTOA+1))
!
t_lev(1:NCOL,1) = Sfcprop%tsfc(1:NCOL)
t_lev(1:NCOL,2:iTOA) = (t_lay(1:NCOL,2:iTOA)+t_lay(1:NCOL,1:iTOA-1))/2._kind_phys
do iLay=2,iTOA
t_lev(1:nCol,iLay) = t_lay(1:nCol,iLay-1) + (t_lay(1:nCol,iLay)-t_lay(1:nCol,iLay-1)) * &
(p_lev_log(1:nCol,iLay)-p_lay_log(1:nCol,iLay-1)) / &
(p_lay_log(1:nCol,iLay)-p_lay_log(1:nCol,iLay-1))
enddo
!t_lev(1:NCOL,2:iTOA) = (t_lay(1:NCOL,2:iTOA)+t_lay(1:NCOL,1:iTOA-1))/2._kind_phys
t_lev(1:NCOL,iTOA+1) = t_lay(1:NCOL,iTOA)
endif

! Compute layer pressure thicknes
deltaP = abs(p_lev(:,2:model%levs+1)-p_lev(:,1:model%levs))

Expand Down
4 changes: 2 additions & 2 deletions physics/rrtmgp_lw_rte.F90
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_clrsky))
flux_clrsky,n_gauss_angles=3))
! Store fluxes
fluxlwUP_clrsky = sum(flux_clrsky%bnd_flux_up,dim=3)
fluxlwDOWN_clrsky = sum(flux_clrsky%bnd_flux_dn,dim=3)
Expand All @@ -148,7 +148,7 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_allsky))
flux_allsky,n_gauss_angles=3))
! Store fluxes
fluxlwUP_allsky = sum(flux_allsky%bnd_flux_up,dim=3)
fluxlwDOWN_allsky = sum(flux_allsky%bnd_flux_dn,dim=3)
Expand Down

0 comments on commit 323e6f9

Please sign in to comment.