Skip to content

Commit

Permalink
Change to diagnostic outputs for RRTMGP.
Browse files Browse the repository at this point in the history
  • Loading branch information
dustinswales committed Dec 4, 2019
1 parent 993508d commit 71b6a37
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 32 deletions.
60 changes: 33 additions & 27 deletions physics/GFS_rrtmgp_sw_post.F90
Original file line number Diff line number Diff line change
Expand Up @@ -143,18 +143,18 @@ subroutine GFS_rrtmgp_sw_post_run (Model, Interstitial, Grid, Diag, Radtend, Cou
! Compute SW heating-rates
! #######################################################################################
! Initialize
hswc = 0
Diag%topfsw = topfsw_type ( 0., 0., 0. )
Radtend%sfcfsw = sfcfsw_type ( 0., 0., 0., 0. )
if (l_clrskysw_hr) then
hsw0(:,:) = 0.
endif
if (l_fluxessw2D) then
flxprf_sw = profsw_type ( 0., 0., 0., 0. )
endif
if (l_sfcfluxessw1D) then
scmpsw = cmpfsw_type (0.,0.,0.,0.,0.,0.)
endif
! hswc = 0
! Diag%topfsw = topfsw_type ( 0., 0., 0. )
! Radtend%sfcfsw = sfcfsw_type ( 0., 0., 0., 0. )
! if (l_clrskysw_hr) then
! hsw0(:,:) = 0.
! endif
! if (l_fluxessw2D) then
! flxprf_sw = profsw_type ( 0., 0., 0., 0. )
! endif
! if (l_sfcfluxessw1D) then
! scmpsw = cmpfsw_type (0.,0.,0.,0.,0.,0.)
! endif

if (Model%lsswr .and. nDay .gt. 0) then
! Clear-sky heating-rate (optional)
Expand All @@ -173,29 +173,35 @@ subroutine GFS_rrtmgp_sw_post_run (Model, Interstitial, Grid, Diag, Radtend, Cou
p_lev(idxday,:), &
thetaTendAllSky))
hswc(idxday,:) = thetaTendAllSky

! Copy fluxes from RRTGMP types into model radiation types.
! Mandatory outputs
write(*,"(a11,2i8)") "iTOA/iSFC: ",iTOA,iSFC
write(*,*) "fluxswDOWN_allsky: ",fluxswDOWN_allsky(idxday,:)
write(*,*) "fluxswDOWN_clrsky: ",fluxswDOWN_clrsky(idxday,:)
Diag%topfsw(idxday)%upfxc = fluxswUP_allsky(idxday,iTOA)
Diag%topfsw(idxday)%upfx0 = fluxswUP_clrsky(idxday,iTOA)
Diag%topfsw(idxday)%dnfxc = fluxswDOWN_allsky(idxday,iTOA)
Radtend%sfcfsw(idxday)%upfxc = fluxswUP_allsky(idxday,iSFC)
Radtend%sfcfsw(idxday)%upfx0 = fluxswUP_clrsky(idxday,iSFC)
Radtend%sfcfsw(idxday)%dnfxc = fluxswDOWN_allsky(idxday,iSFC)
Radtend%sfcfsw(idxday)%dnfx0 = fluxswDOWN_clrsky(idxday,iSFC)

write(*,*) "fluxswDOWN_clrsky: ",fluxswDOWN_clrsky(:,:)
Diag%topfsw(:)%upfxc = fluxswUP_allsky(:,iTOA)
Diag%topfsw(:)%upfx0 = fluxswUP_clrsky(:,iTOA)
Diag%topfsw(:)%dnfxc = fluxswDOWN_allsky(:,iTOA)
Radtend%sfcfsw(:)%upfxc = fluxswUP_allsky(:,iSFC)
Radtend%sfcfsw(:)%upfx0 = fluxswUP_clrsky(:,iSFC)
Radtend%sfcfsw(:)%dnfxc = fluxswDOWN_allsky(:,iSFC)
Radtend%sfcfsw(:)%dnfx0 = fluxswDOWN_clrsky(:,iSFC)
!Diag%topfsw(idxday)%upfxc = fluxswUP_allsky(idxday,iTOA)
!Diag%topfsw(idxday)%upfx0 = fluxswUP_clrsky(idxday,iTOA)
!Diag%topfsw(idxday)%dnfxc = fluxswDOWN_allsky(idxday,iTOA)
!Radtend%sfcfsw(idxday)%upfxc = fluxswUP_allsky(idxday,iSFC)
!Radtend%sfcfsw(idxday)%upfx0 = fluxswUP_clrsky(idxday,iSFC)
!Radtend%sfcfsw(idxday)%dnfxc = fluxswDOWN_allsky(idxday,iSFC)
!Radtend%sfcfsw(idxday)%dnfx0 = fluxswDOWN_clrsky(idxday,iSFC)

! Optional output
if(l_fluxessw2D) then
flxprf_sw(idxday,:)%upfxc = fluxswUP_allsky(idxday,:)
flxprf_sw(idxday,:)%dnfxc = fluxswDOWN_allsky(idxday,:)
flxprf_sw(idxday,:)%upfx0 = fluxswUP_clrsky(idxday,:)
flxprf_sw(idxday,:)%dnfx0 = fluxswDOWN_clrsky(idxday,:)
flxprf_sw(:,:)%upfxc = fluxswUP_allsky(:,:)
flxprf_sw(:,:)%dnfxc = fluxswDOWN_allsky(:,:)
flxprf_sw(:,:)%upfx0 = fluxswUP_clrsky(:,:)
flxprf_sw(:,:)%dnfx0 = fluxswDOWN_clrsky(:,:)
endif
endif

! #######################################################################################
! Save SW outputs
! #######################################################################################
Expand Down
2 changes: 1 addition & 1 deletion physics/rrtmgp_sw_rte.F90
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ subroutine rrtmgp_sw_rte_run(Model, Interstitial, Radtend, Statein, ncol, sw_gas
! Outputs
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
real(kind_phys), dimension(ncol,Model%levs+1), intent(out) :: &
real(kind_phys), dimension(ncol,Model%levs+1), intent(inout) :: &
fluxswUP_allsky, & ! All-sky flux (W/m2)
fluxswDOWN_allsky, & ! All-sky flux (W/m2)
fluxswUP_clrsky, & ! Clear-sky flux (W/m2)
Expand Down
8 changes: 4 additions & 4 deletions physics/rrtmgp_sw_rte.meta
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = out
intent = inout
optional = F
[fluxswDOWN_allsky]
standard_name = RRTMGP_sw_flux_profile_downward_allsky
Expand All @@ -174,7 +174,7 @@
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = out
intent = inout
optional = F
[fluxswUP_clrsky]
standard_name = RRTMGP_sw_flux_profile_upward_clrsky
Expand All @@ -183,7 +183,7 @@
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = out
intent = inout
optional = F
[fluxswDOWN_clrsky]
standard_name = RRTMGP_sw_flux_profile_downward_clrsky
Expand All @@ -192,7 +192,7 @@
dimensions = (horizontal_dimension,vertical_dimension_plus_one)
type = real
kind = kind_phys
intent = out
intent = inout
optional = F
[errmsg]
standard_name = ccpp_error_message
Expand Down

0 comments on commit 71b6a37

Please sign in to comment.