Skip to content

Commit

Permalink
Added by-band lw fluxes to diagnostic output. New namelist parameter …
Browse files Browse the repository at this point in the history
…for RRTMGP: number of gaussian angles for quadrature calculation.
  • Loading branch information
dustinswales committed Jan 14, 2020
1 parent 6c8ecdd commit 64691a6
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 25 deletions.
9 changes: 7 additions & 2 deletions physics/radlw_main.f
Original file line number Diff line number Diff line change
Expand Up @@ -1039,7 +1039,7 @@ subroutine rrtmg_lw_run &
& cldfmc, taucld &
& )
taucld(2,:) = taucld(1,:)
!djs taucld(2,:) = taucld(1,:)
! --- ... save computed layer cloud optical depth for output
! rrtm band-7 is apprx 10mu channel (or use spectral mean of bands 6-8)
Expand Down Expand Up @@ -3690,7 +3690,6 @@ subroutine rtrnmc &

!> -# Process longwave output from band for total and clear streams.
!! Calculate upward, downward, and net flux.

flxfac = wtdiff * fluxfac

do k = 0, nlay
Expand All @@ -3707,6 +3706,12 @@ subroutine rtrnmc &
totdclfl(k) = totdclfl(k) * flxfac
enddo


do k=0,nlay
write(47,"(32f8.2)") toturad(k,:)*flxfac, &
& totdrad(k,:)*flxfac
enddo

!> -# Calculate net fluxes and heating rates.
fnet(0) = totuflux(0) - totdflux(0)

Expand Down
14 changes: 7 additions & 7 deletions physics/rrtmgp_lw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -433,12 +433,12 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr
nLev, & ! IN - Number of vertical layers
lw_cloud_props%get_nband(), & ! IN - Number of LW bands
nrghice, & ! IN - Number of ice-roughness categories
liqmask, & ! IN - Liquid-cloud mask
icemask, & ! IN - Ice-cloud mask
cld_lwp, & ! IN - Cloud liquid water path
cld_iwp, & ! IN - Cloud ice water path
cld_reliq, & ! IN - Cloud liquid effective radius
cld_reice, & ! IN - Cloud ice effective radius
liqmask, & ! IN - Liquid-cloud mask (1)
icemask, & ! IN - Ice-cloud mask (1)
cld_lwp, & ! IN - Cloud liquid water path (g/m2)
cld_iwp, & ! IN - Cloud ice water path (g/m2)
cld_reliq, & ! IN - Cloud liquid effective radius (microns)
cld_reice, & ! IN - Cloud ice effective radius (microns)
lw_optical_props_cloudsByBand)) ! OUT - RRTMGP DDT containing cloud radiative properties
! in each band
else
Expand All @@ -461,7 +461,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr
enddo
enddo

lw_optical_props_cloudsByBand%tau(:,:,2) = lw_optical_props_cloudsByBand%tau(:,:,1)
!lw_optical_props_cloudsByBand%tau(:,:,2) = lw_optical_props_cloudsByBand%tau(:,:,1)

! All-sky LW optical depth ~10microns
cldtaulw = lw_optical_props_cloudsByBand%tau(:,:,7)
Expand Down
33 changes: 18 additions & 15 deletions physics/rrtmgp_lw_rte.F90
Original file line number Diff line number Diff line change
Expand Up @@ -28,15 +28,16 @@ end subroutine rrtmgp_lw_rte_init
!!
subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_gas_props, &
sfc_emiss_byband, sources, lw_optical_props_clrsky, lw_optical_props_clouds, &
lw_optical_props_aerosol, secdiff, fluxlwUP_allsky, fluxlwDOWN_allsky, &
lw_optical_props_aerosol, secdiff, nGauss_angles, fluxlwUP_allsky, fluxlwDOWN_allsky,&
fluxlwUP_clrsky, fluxlwDOWN_clrsky, hlw0, hlwb, errmsg, errflg)

! Inputs
logical, intent(in) :: &
doLWrad ! Logical flag for longwave radiation call
integer, intent(in) :: &
nCol, & ! Number of horizontal gridpoints
nLev ! Number of vertical levels
nLev, & ! Number of vertical levels
nGauss_angles ! Number of angles used in Gaussian quadrature
real(kind_phys), dimension(ncol,nLev), intent(in) :: &
p_lay, & ! Pressure @ model layer-centers (hPa)
t_lay ! Temperature (K)
Expand All @@ -51,9 +52,9 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
type(ty_source_func_lw),intent(in) :: &
sources ! RRTMGP DDT: longwave source functions
type(ty_optical_props_1scl),intent(inout) :: &
lw_optical_props_clouds, & ! RRTMGP DDT: longwave cloud radiative properties
lw_optical_props_clrsky ! RRTMGP DDT: longwave clear-sky radiative properties
type(ty_optical_props_1scl),intent(in) :: &
lw_optical_props_clouds, & ! RRTMGP DDT: longwave cloud radiative properties
lw_optical_props_aerosol ! RRTMGP DDT: longwave aerosol radiative properties
real(kind_phys), dimension(lw_gas_props%get_nband(),ncol),intent(in) :: &
secdiff
Expand Down Expand Up @@ -119,11 +120,12 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
! Call RTE solver
if (l_ClrSky_HR) then
call check_error_msg('rrtmgp_lw_rte_run',rte_lw( &
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_clrsky,n_gauss_angles=3))
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_clrsky, & ! OUT - Fluxes
n_gauss_angles = nGauss_angles))
! Store fluxes
fluxlwUP_clrsky = sum(flux_clrsky%bnd_flux_up,dim=3)
fluxlwDOWN_clrsky = sum(flux_clrsky%bnd_flux_dn,dim=3)
Expand All @@ -136,19 +138,20 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
! Apply diffusivity angle adjustment (RRTMG legacy)
do iCol=1,nCol
do iBand=1,lw_gas_props%get_nband()
lw_optical_props_clrsky%tau(iCol,1:nLev,iBand) = lw_optical_props_clrsky%tau(iCol,1:nLev,iBand)*secdiff(iBand,iCol)
lw_optical_props_clouds%tau(iCol,1:nLev,iBand) = lw_optical_props_clouds%tau(iCol,1:nLev,iBand)*secdiff(iBand,iCol)
enddo
enddo
! Add cloud optics to clear-sky optics
call check_error_msg('rrtmgp_lw_rte_run',lw_optical_props_clouds%increment(lw_optical_props_clrsky))

! Call RTE solver
call check_error_msg('rrtmgp_lw_rte_run',rte_lw( &
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_allsky,n_gauss_angles=3))
lw_optical_props_clrsky, & ! IN - optical-properties
top_at_1, & ! IN - veritcal ordering flag
sources, & ! IN - source function
sfc_emiss_byband, & ! IN - surface emissivity in each LW band
flux_allsky, & ! OUT - Flxues
n_gauss_angles = nGauss_angles))
! Store fluxes
fluxlwUP_allsky = sum(flux_allsky%bnd_flux_up,dim=3)
fluxlwDOWN_allsky = sum(flux_allsky%bnd_flux_dn,dim=3)
Expand All @@ -160,7 +163,7 @@ subroutine rrtmgp_lw_rte_run(doLWrad, nCol, nLev, p_lay, t_lay, p_lev, skt, lw_g
write(47,*) "In rrtmgp_lw_rte: "
do iCol=1,nCol
do iLay=1,nLev+1
write(47,"(5f8.2)") p_lev(iCol,iLay)/100.,fluxlwUP_allsky(iCol,iLay),fluxlwDOWN_allsky(iCol,iLay),&
write(47,"(35f8.2)") p_lev(iCol,iLay)/100.,flux_allsky%bnd_flux_up(iCol,iLay,:),flux_allsky%bnd_flux_dn(iCol,iLay,:),&
fluxlwUP_clrsky(iCol,iLay),fluxlwDOWN_clrsky(iCol,iLay)
enddo
enddo
Expand Down
10 changes: 9 additions & 1 deletion physics/rrtmgp_lw_rte.meta
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,14 @@
type = integer
intent = in
optional = F
[nGauss_angles]
standard_name = number_of_angles_used_in_gaussian_quadrature
long_name = Number of angles used in Gaussian quadrature
units = count
dimensions = ()
type = integer
intent = in
optional = F
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
long_name = air pressure layer
Expand Down Expand Up @@ -92,7 +100,7 @@
units = DDT
dimensions = ()
type = ty_optical_props_1scl
intent = in
intent = inout
optional = F
[lw_optical_props_aerosol]
standard_name = longwave_optical_properties_for_aerosols
Expand Down

0 comments on commit 64691a6

Please sign in to comment.