Skip to content

Commit

Permalink
Added diagnostics for LW clouds.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Jan 6, 2020
1 parent ec093b2 commit 5542aca
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 4 deletions.
16 changes: 14 additions & 2 deletions physics/radlw_main.f
Original file line number Diff line number Diff line change
Expand Up @@ -353,8 +353,9 @@ module rrtmg_lw
contains
! ================
subroutine rrtmg_lw_init ()
end subroutine rrtmg_lw_init
subroutine rrtmg_lw_init ()
open(47,file='rrtmg_clds.txt',status='unknown')
end subroutine rrtmg_lw_init
!> \defgroup module_radlw_main GFS RRTMG Longwave Module
!! \brief This module includes NCEP's modifications of the RRTMG-LW radiation
Expand Down Expand Up @@ -717,6 +718,9 @@ subroutine rrtmg_lw_run &
! endif
! --- ... loop over horizontal npts profiles
write(47,*) "In radlw_main: "
write(47,*),"nCol: ",npts
write(47,*),"nLay: ",nLay
lab_do_iplon : do iplon = 1, npts
Expand Down Expand Up @@ -1162,6 +1166,13 @@ subroutine rrtmg_lw_run &
!> -# Save outputs.
do k=1,nlay
write(47,"(21f8.2)") plyr(iplon,k),clwp(k),relw(k),ciwp(k), &
& reiw(k),taucld(:,k)
enddo
topflx(iplon)%upfxc = totuflux(nlay)
topflx(iplon)%upfx0 = totuclfl(nlay)
Expand Down Expand Up @@ -1247,6 +1258,7 @@ end subroutine rrtmg_lw_run
!-----------------------------------
!> @}
subroutine rrtmg_lw_finalize ()
close(47)
end subroutine rrtmg_lw_finalize
Expand Down
20 changes: 18 additions & 2 deletions physics/rrtmgp_lw_cloud_optics.F90
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,8 @@ subroutine rrtmgp_lw_cloud_optics_init(cld_optics_scheme, nrghice, rrtmgp_root_d
errmsg = ''
errflg = 0

open(47,file='rrtmgp_clds.txt',status='unknown')

if (cld_optics_scheme .eq. 0) return

! Filenames are set in the physics_nml
Expand Down Expand Up @@ -357,8 +359,8 @@ end subroutine rrtmgp_lw_cloud_optics_init
!!
subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nrghice, &
cld_frac, cld_lwp, cld_reliq, cld_iwp, cld_reice, cld_swp, cld_resnow, cld_rwp, &
cld_rerain, lw_cloud_props, lw_gas_props, cldtaulw, lw_optical_props_cloudsByBand, &
errmsg, errflg)
cld_rerain, p_lay, lw_cloud_props, lw_gas_props, &
cldtaulw, lw_optical_props_cloudsByBand, errmsg, errflg)

! Inputs
logical, intent(in) :: &
Expand All @@ -369,6 +371,7 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr
nrghice, & ! Number of ice-roughness categories
cld_optics_scheme ! Cloud-optics scheme
real(kind_phys), dimension(ncol,nLev),intent(in) :: &
p_lay, & ! Layer pressure (Pa)
cld_frac, & ! Total cloud fraction by layer
cld_lwp, & ! Cloud liquid water path
cld_reliq, & ! Cloud liquid effective radius
Expand Down Expand Up @@ -397,10 +400,12 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr
logical,dimension(ncol,nLev) :: liqmask, icemask
real(kind_phys), dimension(ncol,nLev,lw_gas_props%get_nband()) :: &
tau_cld
integer :: iCol, iLay

! Initialize CCPP error handling variables
errmsg = ''
errflg = 0
tau_cld = 0.

if (.not. doLWrad) return

Expand Down Expand Up @@ -438,6 +443,16 @@ subroutine rrtmgp_lw_cloud_optics_run(doLWrad, nCol, nLev, cld_optics_scheme, nr
lw_optical_props_cloudsByBand%tau = tau_cld
endif
endif

write(47,*) "In rrtmgp_lw_cloud_optics: "
write(47,*),"nCol: ",nCol
write(47,*),"nLay: ",nLev
do iCol=1,nCol
do iLay=1,nLev
write(47,"(21f8.2)") p_lay(iCol,iLay)/100.,cld_lwp(iCol,iLay),cld_reliq(iCol,iLay),&
cld_iwp(iCol,iLay),cld_reice(iCol,iLay),tau_cld(iCol,iLay,:)
enddo
enddo

! All-sky LW optical depth ~10microns
cldtaulw = lw_optical_props_cloudsByBand%tau(:,:,7)
Expand All @@ -448,5 +463,6 @@ end subroutine rrtmgp_lw_cloud_optics_run
! SUBROUTINE rrtmgp_lw_cloud_optics_finalize()
! #########################################################################################
subroutine rrtmgp_lw_cloud_optics_finalize()
close(47)
end subroutine rrtmgp_lw_cloud_optics_finalize
end module rrtmgp_lw_cloud_optics
9 changes: 9 additions & 0 deletions physics/rrtmgp_lw_cloud_optics.meta
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,15 @@
type = real
intent = in
kind = kind_phys
[p_lay]
standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa
long_name = air pressure layer
units = hPa
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = in
optional = F
[lw_gas_props]
standard_name = coefficients_for_lw_gas_optics
long_name = DDT containing spectral information for RRTMGP LW radiation scheme
Expand Down

0 comments on commit 5542aca

Please sign in to comment.