Skip to content

Commit

Permalink
Changes to FV3 for ccpp-physics NCAR#782 (NCAR#428)
Browse files Browse the repository at this point in the history
This PR contains changes to the RRTMGP code in the ccpp-physics PR#782.
  • Loading branch information
dustinswales authored Dec 9, 2021
1 parent 4545b4d commit 86d4bb3
Show file tree
Hide file tree
Showing 7 changed files with 437 additions and 101 deletions.
2 changes: 1 addition & 1 deletion atmos_cubed_sphere
77 changes: 46 additions & 31 deletions ccpp/data/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -435,6 +435,13 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: visbmui(:) => null() !< sfc uv+vis beam sw upward flux (w/m2)
real (kind=kind_phys), pointer :: visdfui(:) => null() !< sfc uv+vis diff sw upward flux (w/m2)

! RRTMGP
real (kind=kind_phys), pointer :: fluxlwUP_jac(:,:) => null() !< RRTMGP Jacobian of upward longwave all-sky flux
real (kind=kind_phys), pointer :: htrlw(:,:) => null() !< RRTMGP updated LW heating rate
real (kind=kind_phys), pointer :: tsfc_radtime(:) => null() !< RRTMGP surface temperature on radiation timestep
real (kind=kind_phys), pointer :: fluxlwUP_radtime(:,:) => null() !< RRTMGP upward longwave all-sky flux profile
real (kind=kind_phys), pointer :: fluxlwDOWN_radtime(:,:) => null() !< RRTMGP downward longwave all-sky flux profile

!--- In (physics only)
real (kind=kind_phys), pointer :: sfcdsw(:) => null() !< total sky sfc downward sw flux ( w/m**2 )
!< GFS_radtend_type%sfcfsw%dnfxc
Expand All @@ -443,11 +450,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: sfcdlw(:) => null() !< total sky sfc downward lw flux ( w/m**2 )
!< GFS_radtend_type%sfclsw%dnfxc
real (kind=kind_phys), pointer :: sfculw(:) => null() !< total sky sfc upward lw flux ( w/m**2 )
real (kind=kind_phys), pointer :: fluxlwUP_jac(:,:) => null() !< GP Jacobian up LW total sky flux profile ( w/m**2/K )
real (kind=kind_phys), pointer :: fluxlwUP_allsky(:,:) => null() !< GP up LW total sky flux profile ( w/m**2/K )
real (kind=kind_phys), pointer :: fluxlwDOWN_allsky(:,:) => null() !< GP down LW total sky flux profile ( w/m**2/K )
real (kind=kind_phys), pointer :: htrlw(:,:) => null() !< GP updated LW heating rate
real (kind=kind_phys), pointer :: tsfc_radtime(:) => null() !< GP surface temperature on radiation timestep

!--- incoming quantities
real (kind=kind_phys), pointer :: dusfcin_cpl(:) => null() !< aoi_fld%dusfcin(item,lan)
Expand Down Expand Up @@ -745,6 +747,9 @@ module GFS_typedefs
real(kind_phys) :: maxGPpres !< Maximum pressure allowed in RRTMGP.
real(kind_phys) :: minGPtemp !< Minimum temperature allowed in RRTMGP.
real(kind_phys) :: maxGPtemp !< Maximum temperature allowed in RRTMGP.
logical :: top_at_1 !< Vertical ordering flag.
integer :: iSFC !< Vertical index for surface
integer :: iTOA !< Vertical index for TOA

!--- microphysical switch
logical :: convert_dry_rho = .true. !< flag for converting mass/number concentrations from moist to dry
Expand Down Expand Up @@ -2101,8 +2106,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: dudt_tms(:,:) => null() !< daily aver u-wind tend due to TMS

! RRTMGP
integer :: ipsdlw0 !<
integer :: ipsdsw0 !<
real (kind=kind_phys), pointer :: p_lay(:,:) => null() !<
real (kind=kind_phys), pointer :: p_lev(:,:) => null() !<
real (kind=kind_phys), pointer :: t_lev(:,:) => null() !<
Expand All @@ -2127,6 +2130,8 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: cld_rwp(:,:) => null() !< Cloud rain water path
real (kind=kind_phys), pointer :: cld_rerain(:,:) => null() !< Cloud rain effective radius
real (kind=kind_phys), pointer :: precip_frac(:,:) => null() !< Precipitation fraction
real (kind=kind_phys), pointer :: fluxlwUP_allsky(:,:) => null() !< RRTMGP upward longwave all-sky flux profile
real (kind=kind_phys), pointer :: fluxlwDOWN_allsky(:,:) => null() !< RRTMGP downward longwave all-sky flux profile
real (kind=kind_phys), pointer :: fluxlwUP_clrsky(:,:) => null() !< RRTMGP upward longwave clr-sky flux profile
real (kind=kind_phys), pointer :: fluxlwDOWN_clrsky(:,:) => null() !< RRTMGP downward longwave clr-sky flux profile
real (kind=kind_phys), pointer :: fluxswUP_allsky(:,:) => null() !< RRTMGP upward shortwave all-sky flux profile
Expand All @@ -2141,8 +2146,6 @@ module GFS_typedefs
real (kind=kind_phys), pointer :: sfc_alb_uvvis_dif(:,:) => null() !<
real (kind=kind_phys), pointer :: toa_src_lw(:,:) => null() !<
real (kind=kind_phys), pointer :: toa_src_sw(:,:) => null() !<
integer, pointer :: icseed_lw(:) => null() !< RRTMGP seed for RNG for longwave radiation
integer, pointer :: icseed_sw(:) => null() !< RRTMGP seed for RNG for shortwave radiation
type(proflw_type), pointer :: flxprf_lw(:,:) => null() !< DDT containing RRTMGP longwave fluxes
type(profsw_type), pointer :: flxprf_sw(:,:) => null() !< DDT containing RRTMGP shortwave fluxes
type(ty_optical_props_2str) :: lw_optical_props_cloudsByBand !< RRTMGP DDT
Expand Down Expand Up @@ -2744,18 +2747,17 @@ subroutine coupling_create (Coupling, IM, Model)
Coupling%sfcdlw = clear_val
Coupling%sfculw = clear_val

! Coupling to RRTMGP, used for time step LW rad adjustment.
if (Model%do_RRTMGP) then
allocate (Coupling%fluxlwUP_jac (IM,Model%levs+1))
allocate (Coupling%fluxlwUP_allsky (IM,Model%levs+1))
allocate (Coupling%fluxlwDOWN_allsky (IM,Model%levs+1))
allocate (Coupling%htrlw (IM,Model%levs))
allocate (Coupling%tsfc_radtime (IM))
Coupling%fluxlwUP_jac = clear_val
Coupling%fluxlwUP_allsky = clear_val
Coupling%fluxlwDOWN_allsky = clear_val
Coupling%htrlw = clear_val
Coupling%tsfc_radtime = clear_val
allocate (Coupling%fluxlwUP_radtime (IM, Model%levs+1))
allocate (Coupling%fluxlwDOWN_radtime (IM, Model%levs+1))
allocate (Coupling%fluxlwUP_jac (IM, Model%levs+1))
allocate (Coupling%htrlw (IM, Model%levs))
allocate (Coupling%tsfc_radtime (IM))
Coupling%fluxlwUP_radtime = clear_val
Coupling%fluxlwDOWN_radtime = clear_val
Coupling%fluxlwUP_jac = clear_val
Coupling%htrlw = clear_val
Coupling%tsfc_radtime = clear_val
endif

if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then
Expand Down Expand Up @@ -7160,6 +7162,8 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%t_lay (IM, Model%levs))
allocate (Interstitial%cloud_overlap_param (IM, Model%levs))
allocate (Interstitial%precip_overlap_param (IM, Model%levs))
allocate (Interstitial%fluxlwUP_allsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwDOWN_allsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwUP_clrsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwDOWN_clrsky (IM, Model%levs+1))
allocate (Interstitial%fluxswUP_allsky (IM, Model%levs+1))
Expand All @@ -7178,8 +7182,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%cld_rwp (IM, Model%levs))
allocate (Interstitial%cld_rerain (IM, Model%levs))
allocate (Interstitial%precip_frac (IM, Model%levs))
allocate (Interstitial%icseed_lw (IM))
allocate (Interstitial%icseed_sw (IM))
allocate (Interstitial%flxprf_lw (IM, Model%levs+1))
allocate (Interstitial%flxprf_sw (IM, Model%levs+1))
allocate (Interstitial%sfc_emiss_byband (Model%rrtmgp_nBandsLW,IM))
Expand Down Expand Up @@ -7552,18 +7554,19 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%plyr = clear_val
Interstitial%qlyr = clear_val
Interstitial%raddt = clear_val
Interstitial%scmpsw%uvbfc = clear_val
Interstitial%scmpsw%uvbf0 = clear_val
Interstitial%scmpsw%nirbm = clear_val
Interstitial%scmpsw%nirdf = clear_val
Interstitial%scmpsw%visbm = clear_val
Interstitial%scmpsw%visdf = clear_val
Interstitial%sfcalb = clear_val
Interstitial%tlvl = clear_val
Interstitial%tlyr = clear_val
Interstitial%tsfa = clear_val
Interstitial%tsfg = clear_val

! Interstitials used by both RRTMG and RRTMGP
Interstitial%scmpsw%uvbfc = clear_val
Interstitial%scmpsw%uvbf0 = clear_val
Interstitial%scmpsw%nirbm = clear_val
Interstitial%scmpsw%nirdf = clear_val
Interstitial%scmpsw%visbm = clear_val
Interstitial%scmpsw%visdf = clear_val
if (Model%do_RRTMGP) then
Interstitial%tracer = clear_val
Interstitial%tv_lay = clear_val
Expand All @@ -7577,6 +7580,8 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%t_lay = clear_val
Interstitial%cloud_overlap_param = clear_val
Interstitial%precip_overlap_param = clear_val
Interstitial%fluxlwUP_allsky = clear_val
Interstitial%fluxlwDOWN_allsky = clear_val
Interstitial%fluxlwUP_clrsky = clear_val
Interstitial%fluxlwDOWN_clrsky = clear_val
Interstitial%fluxswUP_allsky = clear_val
Expand All @@ -7595,8 +7600,6 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%cld_rwp = clear_val
Interstitial%cld_rerain = clear_val
Interstitial%precip_frac = clear_val
Interstitial%icseed_lw = clear_val
Interstitial%icseed_sw = clear_val
Interstitial%sfc_emiss_byband = clear_val
Interstitial%sec_diff_byband = clear_val
Interstitial%sfc_alb_nir_dir = clear_val
Expand All @@ -7616,13 +7619,25 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%lw_optical_props_precip%tau = clear_val
Interstitial%lw_optical_props_precip%ssa = clear_val
Interstitial%lw_optical_props_precip%g = clear_val
Interstitial%lw_optical_props_clrsky%tau = clear_val
Interstitial%lw_optical_props_cloudsByBand%tau = clear_val
Interstitial%lw_optical_props_cloudsByBand%ssa = clear_val
Interstitial%lw_optical_props_cloudsByBand%g = clear_val
Interstitial%lw_optical_props_precipByBand%tau = clear_val
Interstitial%lw_optical_props_precipByBand%ssa = clear_val
Interstitial%lw_optical_props_precipByBand%g = clear_val
Interstitial%sources%sfc_source = clear_val
Interstitial%sources%lay_source = clear_val
Interstitial%sources%lev_source_inc = clear_val
Interstitial%sources%lev_source_dec = clear_val
Interstitial%sources%sfc_source_Jac = clear_val
Interstitial%flxprf_lw%upfxc = clear_val
Interstitial%flxprf_lw%dnfxc = clear_val
Interstitial%flxprf_lw%upfx0 = clear_val
Interstitial%flxprf_lw%dnfx0 = clear_val
Interstitial%flxprf_sw%upfxc = clear_val
Interstitial%flxprf_sw%dnfxc = clear_val
Interstitial%flxprf_sw%upfx0 = clear_val
Interstitial%flxprf_sw%dnfx0 = clear_val
end if
!
end subroutine interstitial_rad_reset
Expand Down
144 changes: 76 additions & 68 deletions ccpp/data/GFS_typedefs.meta
Original file line number Diff line number Diff line change
Expand Up @@ -1798,46 +1798,6 @@
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
[htrlw]
standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_timestep
long_name = total sky longwave heating rate on physics time step
units = K s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[tsfc_radtime]
standard_name = surface_skin_temperature_on_radiation_timestep
long_name = surface skin temperature on radiation timestep
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwUP_jac]
standard_name = RRTMGP_jacobian_of_lw_flux_upward
long_name = RRTMGP Jacobian upward longwave flux profile
units = W m-2 K-1
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwUP_allsky]
standard_name = RRTMGP_lw_flux_profile_upward_allsky
long_name = RRTMGP upward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwDOWN_allsky]
standard_name = RRTMGP_lw_flux_profile_downward_allsky
long_name = RRTMGP downward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[rain_cpl]
standard_name = cumulative_lwe_thickness_of_precipitation_amount_for_coupling
long_name = total rain precipitation
Expand Down Expand Up @@ -2332,6 +2292,46 @@
type = real
kind = kind_phys
active = (flag_for_chemistry_coupling)
[htrlw]
standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_timestep
long_name = total sky longwave heating rate on physics time step
units = K s-1
dimensions = (horizontal_loop_extent,vertical_layer_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[tsfc_radtime]
standard_name = surface_skin_temperature_on_radiation_timestep
long_name = surface skin temperature on radiation timestep
units = K
dimensions = (horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwUP_jac]
standard_name = RRTMGP_jacobian_of_lw_flux_upward
long_name = RRTMGP Jacobian upward longwave flux profile
units = W m-2 K-1
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwUP_radtime]
standard_name = RRTMGP_lw_flux_profile_upward_allsky_on_radiation_timestep
long_name = RRTMGP upward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwDOWN_radtime]
standard_name = RRTMGP_lw_flux_profile_downward_allsky_on_radiation_timestep
long_name = RRTMGP downward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)

########################################################################
[ccpp-table-properties]
Expand Down Expand Up @@ -3048,6 +3048,24 @@
dimensions = ()
type = real
kind = kind_phys
[top_at_1]
standard_name = flag_for_vertical_ordering_in_RRTMGP
long_name = flag for vertical ordering in RRTMGP
units = flag
dimensions = ()
type = logical
[iSFC]
standard_name = vertical_index_for_surface_in_RRTMGP
long_name = index for surface layer in RRTMGP
units = flag
dimensions = ()
type = integer
[iTOA]
standard_name = vertical_index_for_TOA_in_RRTMGP
long_name = index for TOA layer in RRTMGP
units = flag
dimensions = ()
type = integer
[convert_dry_rho]
standard_name = flag_for_converting_hydrometeors_from_moist_to_dry_air
long_name = flag for converting hydrometeors from moist to dry air
Expand Down Expand Up @@ -9968,18 +9986,22 @@
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[ipsdsw0]
standard_name = initial_permutation_seed_sw
long_name = initial seed for McICA SW
units = none
dimensions = ()
type = integer
[ipsdlw0]
standard_name = initial_permutation_seed_lw
long_name = initial seed for McICA LW
units = none
dimensions = ()
type = integer
[fluxlwUP_allsky]
standard_name = RRTMGP_lw_flux_profile_upward_allsky
long_name = RRTMGP upward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwDOWN_allsky]
standard_name = RRTMGP_lw_flux_profile_downward_allsky
long_name = RRTMGP downward longwave all-sky flux profile
units = W m-2
dimensions = (horizontal_loop_extent,vertical_interface_dimension)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[fluxlwUP_clrsky]
standard_name = RRTMGP_lw_flux_profile_upward_clrsky
long_name = RRTMGP upward longwave clr-sky flux profile
Expand Down Expand Up @@ -10100,20 +10122,6 @@
dimensions = (horizontal_loop_extent,vertical_layer_dimension, number_of_shortwave_bands)
type = real
kind = kind_phys
[icseed_lw]
standard_name = seed_random_numbers_lw_for_RRTMGP
long_name = seed for random number generation for longwave radiation
units = none
dimensions = (horizontal_loop_extent)
type = integer
active = (flag_for_rrtmgp_radiation_scheme)
[icseed_sw]
standard_name = seed_random_numbers_sw_for_RRTMGP
long_name = seed for random number generation for shortwave radiation
units = none
dimensions = (horizontal_loop_extent)
type = integer
active = (flag_for_rrtmgp_radiation_scheme)
[precip_frac]
standard_name = precipitation_fraction_by_layer
long_name = precipitation fraction in each layer
Expand Down Expand Up @@ -10253,15 +10261,15 @@
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[sfc_alb_uvvis_dir]
standard_name = surface_albedo_uvvis_dir
standard_name = surface_albedo_uvvis_direct
long_name = UVVIS (direct) surface albedo (sfc_alb_uvvis_dir)
units = none
dimensions = (number_of_shortwave_bands,horizontal_loop_extent)
type = real
kind = kind_phys
active = (flag_for_rrtmgp_radiation_scheme)
[sfc_alb_uvvis_dif]
standard_name = surface_albedo_uvvis_dif
standard_name = surface_albedo_uvvis_diffuse
long_name = UVVIS (diffuse) surface albedo (sfc_alb_uvvis_dif)
units = none
dimensions = (number_of_shortwave_bands,horizontal_loop_extent)
Expand Down
Loading

0 comments on commit 86d4bb3

Please sign in to comment.