Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature/transition-to-capgen-1: remove DDT dependency in radiation physics, correct units #506

Merged
Merged
Changes from 1 commit
Commits
Show all changes
28 commits
Select commit Hold shift + click to select a range
dc8feed
remove dependency on GFS_typedefs for rrtmg_sw_pre
grantfirl Jan 17, 2020
fda501e
remove dependency on GFS_typedefs.F90 for rrtmg_sw_post scheme
grantfirl Jan 21, 2020
2d353c0
remove dependency on GFS_typedefs.F90 for rrtmg_lw_pre scheme
grantfirl Jan 21, 2020
eeaa98b
remove dependency on GFS_typedefs.F90 for rrtmg_lw_post scheme
grantfirl Jan 21, 2020
c7dbbce
remove dependency on GFS_typedefs for GFS_phys_time_vary_init for the…
grantfirl Jan 23, 2020
3f95c12
Merge branch 'interstitial_cleanup' into GFS_DDT_removal
grantfirl Aug 21, 2020
4a2ea3f
swap aero_in for iaerclm in GFS_phys_time_vary.scm
grantfirl Aug 21, 2020
b76bb2c
revert some changes in meta files accidentally merged in
grantfirl Aug 22, 2020
eea20ed
remove DDTs from GFS_phys_time_vary_init (SCM), GFS_rad_time_vary (SC…
grantfirl Aug 25, 2020
b1e393d
cleanup GFS_phys_time_vary.scm
grantfirl Aug 26, 2020
cd06bbd
clean up GFS_rrtmg_post
grantfirl Aug 26, 2020
f7e6770
clean upu rrtmg_lw_post
grantfirl Aug 26, 2020
5fe8234
cleanup rrtmg_[sw,lw]_[pre,post]
grantfirl Aug 26, 2020
7349ae5
remove GFS DDTs and physcons from GFS_rrtmg_pre
grantfirl Aug 27, 2020
d4d823e
add fluxr and uncomment radiation diagnostics for rrtmgp_[sw,lw]_post
grantfirl Aug 27, 2020
6e1d848
switch to horizontal_loop_extent in radiation interstitials that were…
grantfirl Aug 27, 2020
b378619
revert changes to time_vary.scm files
grantfirl Aug 27, 2020
ef4d4f0
Merge branch 'master' into GFS_DDT_removal
grantfirl Aug 31, 2020
915f71a
remove do_sfcperts and pertabl from GFS_rrtmg_pre
grantfirl Aug 31, 2020
04af628
Merge branch 'master' into GFS_DDT_removal
grantfirl Sep 3, 2020
28f96f9
initialize correct_unit branch
mzhangw Sep 10, 2020
b38a49a
unit fix
mzhangw Sep 14, 2020
862b464
unit fix
mzhangw Sep 16, 2020
423c6bd
revert some changes per Doms comments
mzhangw Oct 1, 2020
474144f
Merge branch 'GFS_DDT_removal' of https://github.com/grantfirl/ccpp-p…
climbfuji Oct 6, 2020
5aaa8db
Add missing arguments to physics/GFS_rrtmg_pre.* after merge
climbfuji Oct 6, 2020
e6e8ef1
Merge branch 'correct_unit' of https://github.com/mzhangw/ccpp-physic…
climbfuji Oct 6, 2020
8ee53cc
Bugfixes in physics/GFS_rrtmg_pre.meta that creeped in during the merge
climbfuji Oct 6, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
remove dependency on GFS_typedefs.F90 for rrtmg_sw_post scheme
grantfirl committed Jan 21, 2020
commit fda501ec210d8accff5854dc5f18f9d952451e76
106 changes: 53 additions & 53 deletions physics/rrtmg_sw_post.F90
Original file line number Diff line number Diff line change
@@ -15,29 +15,29 @@ end subroutine rrtmg_sw_post_init
!! \htmlinclude rrtmg_sw_post_run.html
!!
#endif
subroutine rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, &
im, ltp, nday, lm, kd, htswc, htsw0, &
sfcalb1, sfcalb2, sfcalb3, sfcalb4, scmpsw, errmsg, errflg)
subroutine rrtmg_sw_post_run (im, levr, levs, ltp, nday, lm, kd, lsswr, &
swhtr, htswc, htsw0, sfcalb1, sfcalb2, sfcalb3, sfcalb4, &
scmpsw, sfcfsw, topfsw, nirbmdi, nirdfdi, visbmdi, visdfdi, &
nirbmui, nirdfui, visbmui, visdfui, sfcdsw, sfcnsw, htrsw, &
swhc, errmsg, errflg)

use machine, only: kind_phys
use module_radsw_parameters, only: topfsw_type, sfcfsw_type, &
cmpfsw_type
use GFS_typedefs, only: GFS_coupling_type, &
GFS_control_type, &
GFS_grid_type, &
GFS_radtend_type, &
GFS_diag_type

implicit none
type(GFS_control_type), intent(in) :: Model
type(GFS_coupling_type), intent(inout) :: Coupling
type(GFS_radtend_type), intent(inout) :: Radtend
type(GFS_grid_type), intent(in) :: Grid
type(GFS_diag_type), intent(inout) :: Diag
integer, intent(in) :: im, lm, kd, nday, ltp
type(cmpfsw_type), dimension(size(Grid%xlon,1)), intent(inout) :: scmpsw
real(kind=kind_phys), dimension(Size(Grid%xlon,1), Model%levr+LTP), intent(in) :: htswc, htsw0
real(kind=kind_phys), dimension(size(Grid%xlon,1)), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4

integer, intent(in) :: im, lm, kd, nday, levr, levs, ltp
logical, intent(in) :: lsswr, swhtr
real(kind=kind_phys), dimension(im, levr+LTP), intent(in) :: htswc, htsw0
real(kind=kind_phys), dimension(im), intent(in) :: sfcalb1, sfcalb2, sfcalb3, sfcalb4
type(cmpfsw_type), dimension(im), intent(inout) :: scmpsw
type(sfcfsw_type), dimension(im), intent(inout) :: sfcfsw
type(topfsw_type), dimension(im), intent(inout) :: topfsw
real(kind=kind_phys), dimension(im), intent(inout) :: nirbmdi, nirdfdi, visbmdi, &
visdfdi, nirbmui, nirdfui, &
visbmui, visdfui, sfcdsw, sfcnsw
real(kind=kind_phys), dimension(im,levs), intent(inout) :: htrsw, swhc
character(len=*), intent(out) :: errmsg
integer, intent(out) :: errflg
! Local variables
@@ -47,29 +47,29 @@ subroutine rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, &
errmsg = ''
errflg = 0

if (Model%lsswr) then
if (lsswr) then
if (nday > 0) then
do k = 1, LM
k1 = k + kd
Radtend%htrsw(1:im,k) = htswc(1:im,k1)
htrsw(1:im,k) = htswc(1:im,k1)
enddo
! We are assuming that radiative tendencies are from bottom to top
! --- repopulate the points above levr i.e. LM
if (lm < Model%levs) then
do k = lm,Model%levs
Radtend%htrsw (1:im,k) = Radtend%htrsw (1:im,LM)
if (lm < levs) then
do k = lm, levs
htrsw (1:im,k) = htrsw (1:im,LM)
enddo
endif

if (Model%swhtr) then
if (swhtr) then
do k = 1, lm
k1 = k + kd
Radtend%swhc(1:im,k) = htsw0(1:im,k1)
swhc(1:im,k) = htsw0(1:im,k1)
enddo
! --- repopulate the points above levr i.e. LM
if (lm < Model%levs) then
do k = lm,Model%levs
Radtend%swhc(1:im,k) = Radtend%swhc(1:im,LM)
if (lm < levs) then
do k = lm, levs
swhc(1:im,k) = swhc(1:im,LM)
enddo
endif
endif
@@ -79,47 +79,47 @@ subroutine rrtmg_sw_post_run (Model, Grid, Diag, Radtend, Coupling, &
!! output.

do i=1,im
Coupling%nirbmdi(i) = scmpsw(i)%nirbm
Coupling%nirdfdi(i) = scmpsw(i)%nirdf
Coupling%visbmdi(i) = scmpsw(i)%visbm
Coupling%visdfdi(i) = scmpsw(i)%visdf

Coupling%nirbmui(i) = scmpsw(i)%nirbm * sfcalb1(i)
Coupling%nirdfui(i) = scmpsw(i)%nirdf * sfcalb2(i)
Coupling%visbmui(i) = scmpsw(i)%visbm * sfcalb3(i)
Coupling%visdfui(i) = scmpsw(i)%visdf * sfcalb4(i)
nirbmdi(i) = scmpsw(i)%nirbm
nirdfdi(i) = scmpsw(i)%nirdf
visbmdi(i) = scmpsw(i)%visbm
visdfdi(i) = scmpsw(i)%visdf

nirbmui(i) = scmpsw(i)%nirbm * sfcalb1(i)
nirdfui(i) = scmpsw(i)%nirdf * sfcalb2(i)
visbmui(i) = scmpsw(i)%visbm * sfcalb3(i)
visdfui(i) = scmpsw(i)%visdf * sfcalb4(i)
enddo

else ! if_nday_block

Radtend%htrsw(:,:) = 0.0
htrsw(:,:) = 0.0

Radtend%sfcfsw = sfcfsw_type( 0.0, 0.0, 0.0, 0.0 )
Diag%topfsw = topfsw_type( 0.0, 0.0, 0.0 )
scmpsw = cmpfsw_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 )
sfcfsw = sfcfsw_type( 0.0, 0.0, 0.0, 0.0 )
topfsw = topfsw_type( 0.0, 0.0, 0.0 )
scmpsw = cmpfsw_type( 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 )

do i=1,im
Coupling%nirbmdi(i) = 0.0
Coupling%nirdfdi(i) = 0.0
Coupling%visbmdi(i) = 0.0
Coupling%visdfdi(i) = 0.0

Coupling%nirbmui(i) = 0.0
Coupling%nirdfui(i) = 0.0
Coupling%visbmui(i) = 0.0
Coupling%visdfui(i) = 0.0
nirbmdi(i) = 0.0
nirdfdi(i) = 0.0
visbmdi(i) = 0.0
visdfdi(i) = 0.0

nirbmui(i) = 0.0
nirdfui(i) = 0.0
visbmui(i) = 0.0
visdfui(i) = 0.0
enddo

if (Model%swhtr) then
Radtend%swhc(:,:) = 0
if (swhtr) then
swhc(:,:) = 0
endif

endif ! end_if_nday

! --- radiation fluxes for other physics processes
do i=1,im
Coupling%sfcnsw(i) = Radtend%sfcfsw(i)%dnfxc - Radtend%sfcfsw(i)%upfxc
Coupling%sfcdsw(i) = Radtend%sfcfsw(i)%dnfxc
sfcnsw(i) = sfcfsw(i)%dnfxc - sfcfsw(i)%upfxc
sfcdsw(i) = sfcfsw(i)%dnfxc
enddo

endif ! end_if_lsswr
190 changes: 153 additions & 37 deletions physics/rrtmg_sw_post.meta
Original file line number Diff line number Diff line change
@@ -6,49 +6,25 @@
[ccpp-arg-table]
name = rrtmg_sw_post_run
type = scheme
[Model]
standard_name = GFS_control_type_instance
long_name = Fortran DDT containing FV3-GFS model control parameters
units = DDT
[im]
standard_name = horizontal_dimension
long_name = horizontal dimension
units = count
dimensions = ()
type = GFS_control_type
type = integer
intent = in
optional = F
[Grid]
standard_name = GFS_grid_type_instance
long_name = Fortran DDT containing FV3-GFS grid and interpolation related data
units = DDT
[levr]
standard_name = adjusted_vertical_layer_dimension_for_radiation
long_name = adjusted number of vertical layers for radiation
units = count
dimensions = ()
type = GFS_grid_type
type = integer
intent = in
optional = F
[Diag]
standard_name = GFS_diag_type_instance
long_name = Fortran DDT containing FV3-GFS diagnotics data
units = DDT
dimensions = ()
type = GFS_diag_type
intent = inout
optional = F
[Radtend]
standard_name = GFS_radtend_type_instance
long_name = Fortran DDT containing FV3-GFS fields targetted for diagnostic output
units = DDT
dimensions = ()
type = GFS_radtend_type
intent = inout
optional = F
[Coupling]
standard_name = GFS_coupling_type_instance
long_name = Fortran DDT containing FV3-GFS fields to/from coupling with other components
units = DDT
dimensions = ()
type = GFS_coupling_type
intent = inout
optional = F
[im]
standard_name = horizontal_loop_extent
long_name = horizontal loop extent
[levs]
standard_name = vertical_dimension
long_name = number of vertical levels
units = count
dimensions = ()
type = integer
@@ -86,6 +62,22 @@
type = integer
intent = in
optional = F
[lsswr]
standard_name = flag_to_calc_sw
long_name = logical flags for sw radiation calls
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[swhtr]
standard_name = flag_for_output_of_shortwave_heating_rate
long_name = flag to output sw heating rate (Radtend%swhc)
units = flag
dimensions = ()
type = logical
intent = in
optional = F
[htswc]
standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_time_step
long_name = total sky heating rate due to shortwave radiation
@@ -148,6 +140,130 @@
type = cmpfsw_type
intent = inout
optional = F
[sfcfsw]
standard_name = sw_fluxes_sfc
long_name = sw radiation fluxes at sfc
units = W m-2
dimensions = (horizontal_dimension)
type = sfcfsw_type
intent = inout
optional = F
[topfsw]
standard_name = sw_fluxes_top_atmosphere
long_name = sw radiation fluxes at toa
units = W m-2
dimensions = (horizontal_dimension)
type = topfsw_type
intent = inout
optional = F
[nirbmdi]
standard_name = surface_downwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step
long_name = sfc nir beam sw downward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[nirdfdi]
standard_name = surface_downwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step
long_name = sfc nir diff sw downward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[visbmdi]
standard_name = surface_downwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step
long_name = sfc uv+vis beam sw downward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[visdfdi]
standard_name = surface_downwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step
long_name = sfc uv+vis diff sw downward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[nirbmui]
standard_name = surface_upwelling_direct_near_infrared_shortwave_flux_on_radiation_time_step
long_name = sfc nir beam sw upward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[nirdfui]
standard_name = surface_upwelling_diffuse_near_infrared_shortwave_flux_on_radiation_time_step
long_name = sfc nir diff sw upward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[visbmui]
standard_name = surface_upwelling_direct_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step
long_name = sfc uv+vis beam sw upward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[visdfui]
standard_name = surface_upwelling_diffuse_ultraviolet_and_visible_shortwave_flux_on_radiation_time_step
long_name = sfc uv+vis diff sw upward flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[sfcdsw]
standard_name = surface_downwelling_shortwave_flux_on_radiation_time_step
long_name = total sky sfc downward sw flux
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[sfcnsw]
standard_name = surface_net_downwelling_shortwave_flux_on_radiation_time_step
long_name = total sky sfc netsw flx into ground
units = W m-2
dimensions = (horizontal_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[htrsw]
standard_name = tendency_of_air_temperature_due_to_shortwave_heating_on_radiation_timestep
long_name = total sky sw heating rate
units = K s-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[swhc]
standard_name = tendency_of_air_temperature_due_to_shortwave_heating_assuming_clear_sky_on_radiation_timestep
long_name = clear sky sw heating rates
units = K s-1
dimensions = (horizontal_dimension,vertical_dimension)
type = real
kind = kind_phys
intent = inout
optional = F
[errmsg]
standard_name = ccpp_error_message
long_name = error message for error handling in CCPP