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

RRTMGP coupling to Thompson MP in ccpp-physics #208

Merged
merged 14 commits into from
Dec 17, 2020
Merged
Show file tree
Hide file tree
Changes from 10 commits
Commits
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
4 changes: 2 additions & 2 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@
branch = master
[submodule "ccpp/physics"]
path = ccpp/physics
url = https://github.com/NCAR/ccpp-physics
branch = master
url = https://github.com/dustinswales/ccpp-physics
branch = master-ncar-addThompsonMP
14 changes: 2 additions & 12 deletions ccpp/config/ccpp_prebuild_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,8 +201,10 @@
'ccpp/physics/physics/rrtmgp_lw_cloud_sampling.F90',
'ccpp/physics/physics/rrtmgp_sw_cloud_sampling.F90',
'ccpp/physics/physics/GFS_cloud_diagnostics.F90',
'ccpp/physics/physics/GFS_rrtmgp_thompsonmp_pre.F90',
'ccpp/physics/physics/GFS_rrtmgp_gfdlmp_pre.F90',
'ccpp/physics/physics/GFS_rrtmgp_zhaocarr_pre.F90',
'ccpp/physics/physics/GFS_rrtmgp_cloud_overlap_pre.F90',
'ccpp/physics/physics/GFS_rrtmgp_sw_post.F90'
]

Expand Down Expand Up @@ -297,12 +299,6 @@
'rime_factor',
],
},
'rrtmgp_lw_rte' : {
'rrtmgp_lw_rte_run' : [
'RRTMGP_jacobian_of_lw_flux_profile_upward',
'RRTMGP_jacobian_of_lw_flux_profile_downward',
],
},
'rrtmgp_sw_rte' : {
'rrtmgp_sw_rte_run' : [
'components_of_surface_downward_shortwave_fluxes',
Expand All @@ -319,12 +315,6 @@
'tendency_of_air_temperature_due_to_longwave_heating_assuming_clear_sky_on_radiation_time_step',
],
},
'GFS_suite_interstitial_2' : {
'GFS_suite_interstitial_2_run' : [
'RRTMGP_jacobian_of_lw_flux_profile_upward',
'RRTMGP_lw_flux_profile_upward_allsky',
],
},
#'subroutine_name_1' : 'all',
#'subroutine_name_2' : 'none',
#'subroutine_name_2' : [ 'var1', 'var3'],
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmgp_pre</scheme>
<scheme>GFS_rrtmgp_gfdlmp_pre</scheme>
<scheme>GFS_rrtmgp_cloud_overlap_pre</scheme>
<scheme>GFS_cloud_diagnostics</scheme>
<scheme>GFS_rrtmgp_sw_pre</scheme>
<scheme>rrtmgp_sw_gas_optics</scheme>
Expand Down
1 change: 1 addition & 0 deletions ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>GFS_rrtmgp_pre</scheme>
<scheme>GFS_rrtmgp_gfdlmp_pre</scheme>
<scheme>GFS_rrtmgp_cloud_overlap_pre</scheme>
<scheme>GFS_cloud_diagnostics</scheme>
<scheme>GFS_rrtmgp_sw_pre</scheme>
<scheme>rrtmgp_sw_gas_optics</scheme>
Expand Down
104 changes: 104 additions & 0 deletions ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
<?xml version="1.0" encoding="UTF-8"?>

<suite name="FV3_GSD_v0_RRTMGP" version="1">
<!-- <init></init> -->
<group name="time_vary">
<subcycle loop="1">
<scheme>GFS_time_vary_pre</scheme>
<scheme>GFS_rrtmgp_setup</scheme>
<scheme>GFS_rad_time_vary</scheme>
<scheme>GFS_phys_time_vary</scheme>
</subcycle>
</group>
<group name="radiation">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_rad_reset</scheme>
<scheme>sgscloud_radpre</scheme>
<scheme>GFS_rrtmgp_pre</scheme>
<scheme>GFS_rrtmgp_thompsonmp_pre</scheme>
<scheme>GFS_rrtmgp_cloud_overlap_pre</scheme>
<scheme>GFS_cloud_diagnostics</scheme>
<scheme>GFS_rrtmgp_sw_pre</scheme>
<scheme>rrtmgp_sw_gas_optics</scheme>
<scheme>rrtmgp_sw_aerosol_optics</scheme>
<scheme>rrtmgp_sw_cloud_optics</scheme>
<scheme>rrtmgp_sw_cloud_sampling</scheme>
<scheme>rrtmgp_sw_rte</scheme>
<scheme>GFS_rrtmgp_sw_post</scheme>
<scheme>rrtmgp_lw_pre</scheme>
<scheme>rrtmgp_lw_gas_optics</scheme>
<scheme>rrtmgp_lw_aerosol_optics</scheme>
<scheme>rrtmgp_lw_cloud_optics</scheme>
<scheme>rrtmgp_lw_cloud_sampling</scheme>
<scheme>rrtmgp_lw_rte</scheme>
<scheme>sgscloud_radpost</scheme>
<scheme>GFS_rrtmgp_lw_post</scheme>
</subcycle>
</group>
<group name="physics">
<subcycle loop="1">
<scheme>GFS_suite_interstitial_phys_reset</scheme>
<scheme>GFS_suite_stateout_reset</scheme>
<scheme>get_prs_fv3</scheme>
<scheme>GFS_suite_interstitial_1</scheme>
<scheme>GFS_surface_generic_pre</scheme>
<scheme>GFS_surface_composites_pre</scheme>
<scheme>dcyc2t3</scheme>
<scheme>GFS_surface_composites_inter</scheme>
<scheme>GFS_suite_interstitial_2</scheme>
</subcycle>
<!-- Surface iteration loop -->
<subcycle loop="2">
<scheme>sfc_diff</scheme>
<scheme>GFS_surface_loop_control_part1</scheme>
<scheme>sfc_nst_pre</scheme>
<scheme>sfc_nst</scheme>
<scheme>sfc_nst_post</scheme>
<scheme>lsm_ruc</scheme>
<scheme>lsm_ruc_sfc_sice_pre</scheme>
<scheme>sfc_sice</scheme>
<scheme>lsm_ruc_sfc_sice_post</scheme>
<scheme>GFS_surface_loop_control_part2</scheme>
</subcycle>
<!-- End of surface iteration loop -->
<subcycle loop="1">
<scheme>GFS_surface_composites_post</scheme>
<scheme>sfc_diag</scheme>
<scheme>sfc_diag_post</scheme>
<scheme>GFS_surface_generic_post</scheme>
<scheme>mynnedmf_wrapper</scheme>
<scheme>GFS_GWD_generic_pre</scheme>
<scheme>cires_ugwp</scheme>
<scheme>cires_ugwp_post</scheme>
<scheme>GFS_GWD_generic_post</scheme>
<scheme>rayleigh_damp</scheme>
<scheme>GFS_suite_stateout_update</scheme>
<scheme>ozphys_2015</scheme>
<scheme>h2ophys</scheme>
<scheme>get_phi_fv3</scheme>
<scheme>GFS_suite_interstitial_3</scheme>
<scheme>GFS_DCNV_generic_pre</scheme>
<scheme>cu_gf_driver_pre</scheme>
<scheme>cu_gf_driver</scheme>
<scheme>GFS_DCNV_generic_post</scheme>
<scheme>GFS_SCNV_generic_pre</scheme>
<scheme>GFS_SCNV_generic_post</scheme>
<scheme>GFS_suite_interstitial_4</scheme>
<scheme>cnvc90</scheme>
<scheme>GFS_MP_generic_pre</scheme>
<scheme>mp_thompson_pre</scheme>
<scheme>mp_thompson</scheme>
<scheme>mp_thompson_post</scheme>
<scheme>GFS_MP_generic_post</scheme>
<scheme>cu_gf_driver_post</scheme>
<scheme>maximum_hourly_diagnostics</scheme>
</subcycle>
</group>
<group name="stochastics">
<subcycle loop="1">
<scheme>GFS_stochastics</scheme>
<scheme>phys_tend</scheme>
</subcycle>
</group>
<!-- <finalize></finalize> -->
</suite>
71 changes: 41 additions & 30 deletions gfsphysics/GFS_layer/GFS_typedefs.F90
Original file line number Diff line number Diff line change
Expand Up @@ -437,7 +437,8 @@ module GFS_typedefs
!< difference of dnfxc & upfxc from GFS_radtend_type%sfcfsw
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 :: sfculw_jac(:) => null() !< Jacobian of total sky sfc upward lw flux ( w/m**2/K )
!--- incoming quantities
real (kind=kind_phys), pointer :: dusfcin_cpl(:) => null() !< aoi_fld%dusfcin(item,lan)
real (kind=kind_phys), pointer :: dvsfcin_cpl(:) => null() !< aoi_fld%dvsfcin(item,lan)
Expand Down Expand Up @@ -711,6 +712,7 @@ module GFS_typedefs
logical :: do_GPsw_Glw !< If set to true use rrtmgp for SW calculation, rrtmg for LW.
character(len=128) :: active_gases_array(100) !< character array for each trace gas name
logical :: use_LW_jacobian !< If true, use Jacobian of LW to update radiation tendency.
logical :: doGP_lwscat !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
#endif
!--- microphysical switch
integer :: ncld !< choice of cloud scheme
Expand Down Expand Up @@ -2076,7 +2078,6 @@ module GFS_typedefs
! RRTMGP
integer :: ipsdlw0 !<
integer :: ipsdsw0 !<
real (kind=kind_phys), pointer :: sktp1r(:) => null() !<
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 Down Expand Up @@ -2128,10 +2129,10 @@ module GFS_typedefs
type(ty_gas_optics_rrtmgp) :: sw_gas_props !< RRTMGP DDT
type(ty_cloud_optics) :: lw_cloud_props !< RRTMGP DDT
type(ty_cloud_optics) :: sw_cloud_props !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_cloudsByBand !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_clouds !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_precipByBand !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_precip !< RRTMGP DDT
type(ty_optical_props_2str) :: lw_optical_props_cloudsByBand !< RRTMGP DDT
type(ty_optical_props_2str) :: lw_optical_props_clouds !< RRTMGP DDT
type(ty_optical_props_2str) :: lw_optical_props_precipByBand !< RRTMGP DDT
type(ty_optical_props_2str) :: lw_optical_props_precip !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_clrsky !< RRTMGP DDT
type(ty_optical_props_1scl) :: lw_optical_props_aerosol !< RRTMGP DDT
type(ty_optical_props_2str) :: sw_optical_props_cloudsByBand !< RRTMGP DDT
Expand Down Expand Up @@ -2708,10 +2709,14 @@ subroutine coupling_create (Coupling, IM, Model)
allocate (Coupling%sfcdsw (IM))
allocate (Coupling%sfcnsw (IM))
allocate (Coupling%sfcdlw (IM))
allocate (Coupling%sfculw (IM))
allocate (Coupling%sfculw_jac (IM))

Coupling%sfcdsw = clear_val
Coupling%sfcnsw = clear_val
Coupling%sfcdlw = clear_val
Coupling%sfculw = clear_val
Coupling%sfculw_jac = clear_val

if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then
allocate (Coupling%rain_cpl (IM))
Expand Down Expand Up @@ -3078,25 +3083,26 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
logical :: swhtr = .true. !< flag to output sw heating rate (Radtend%swhc)
! RRTMGP
#ifdef CCPP
logical :: do_RRTMGP = .false. !< Use RRTMGP?
character(len=128) :: active_gases = '' !< Character list of active gases used in RRTMGP
integer :: nGases = 0 !< Number of active gases
character(len=128) :: rrtmgp_root = '' !< Directory of rte+rrtmgp source code
character(len=128) :: lw_file_gas = '' !< RRTMGP K-distribution file, coefficients to compute optics for gaseous atmosphere
character(len=128) :: lw_file_clouds = '' !< RRTMGP file containing coefficients used to compute clouds optical properties
integer :: rrtmgp_nBandsLW = 16 !< Number of RRTMGP LW bands.
integer :: rrtmgp_nGptsLW = 256 !< Number of RRTMGP LW spectral points.
character(len=128) :: sw_file_gas = '' !< RRTMGP K-distribution file, coefficients to compute optics for gaseous atmosphere
character(len=128) :: sw_file_clouds = '' !< RRTMGP file containing coefficients used to compute clouds optical properties
integer :: rrtmgp_nBandsSW = 14 !< Number of RRTMGP SW bands.
integer :: rrtmgp_nGptsSW = 224 !< Number of RRTMGP SW spectral points.
logical :: do_RRTMGP = .false. !< Use RRTMGP?
character(len=128) :: active_gases = '' !< Character list of active gases used in RRTMGP
integer :: nGases = 0 !< Number of active gases
character(len=128) :: rrtmgp_root = '' !< Directory of rte+rrtmgp source code
character(len=128) :: lw_file_gas = '' !< RRTMGP K-distribution file, coefficients to compute optics for gaseous atmosphere
character(len=128) :: lw_file_clouds = '' !< RRTMGP file containing coefficients used to compute clouds optical properties
integer :: rrtmgp_nBandsLW = 16 !< Number of RRTMGP LW bands.
integer :: rrtmgp_nGptsLW = 256 !< Number of RRTMGP LW spectral points.
character(len=128) :: sw_file_gas = '' !< RRTMGP K-distribution file, coefficients to compute optics for gaseous atmosphere
character(len=128) :: sw_file_clouds = '' !< RRTMGP file containing coefficients used to compute clouds optical properties
integer :: rrtmgp_nBandsSW = 14 !< Number of RRTMGP SW bands.
integer :: rrtmgp_nGptsSW = 224 !< Number of RRTMGP SW spectral points.
logical :: doG_cldoptics = .false. !< Use legacy RRTMG cloud-optics?
logical :: doGP_cldoptics_PADE = .false. !< Use RRTMGP cloud-optics: PADE approximation?
logical :: doGP_cldoptics_LUT = .false. !< Use RRTMGP cloud-optics: LUTs?
integer :: rrtmgp_nrghice = 0 !< Number of ice-roughness categories
integer :: rrtmgp_nGauss_ang=1 !< Number of angles used in Gaussian quadrature
logical :: do_GPsw_Glw = .false.
logical :: use_LW_jacobian = .false. !< Use Jacobian of LW to update LW radiation tendencies.
integer :: rrtmgp_nrghice = 0 !< Number of ice-roughness categories
integer :: rrtmgp_nGauss_ang = 1 !< Number of angles used in Gaussian quadrature
logical :: do_GPsw_Glw = .false.
logical :: use_LW_jacobian = .false. !< Use Jacobian of LW to update LW radiation tendencies.
logical :: doGP_lwscat = .false. !< If true, include scattering in longwave cloud-optics, only compatible w/ GP cloud-optics
#endif
!--- Z-C microphysical parameters
integer :: ncld = 1 !< choice of cloud scheme
Expand Down Expand Up @@ -3485,7 +3491,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
sw_file_gas, sw_file_clouds, rrtmgp_nBandsSW, rrtmgp_nGptsSW,&
doG_cldoptics, doGP_cldoptics_PADE, doGP_cldoptics_LUT, &
rrtmgp_nrghice, rrtmgp_nGauss_ang, do_GPsw_Glw, &
use_LW_jacobian, &
use_LW_jacobian, doGP_lwscat, &
#endif
! IN CCN forcing
iccn, &
Expand Down Expand Up @@ -3865,11 +3871,17 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, &
Model%doGP_cldoptics_PADE = doGP_cldoptics_PADE
Model%doGP_cldoptics_LUT = doGP_cldoptics_LUT
Model%use_LW_jacobian = use_LW_jacobian
Model%doGP_lwscat = doGP_lwscat
! RRTMGP incompatible with levr /= levs
if (Model%do_RRTMGP .and. Model%levr /= Model%levs) then
write(0,*) "Logic error, RRTMGP only works with levr = levs"
stop
end if
! RRTMGP LW scattering calculation not supported w/ RRTMG cloud-optics
if (Model%doGP_lwscat .and. Model%doG_cldoptics) then
write(0,*) "Logic error, RRTMGP Longwave cloud-scattering not supported with RRTMG cloud-optics."
stop
end if

! The CCPP versions of the RRTMG lw/sw schemes are configured
! such that lw and sw heating rate are output, i.e. they rely
Expand Down Expand Up @@ -5081,6 +5093,7 @@ subroutine control_print(Model)
print *, ' doGP_cldoptics_PADE: ', Model%doGP_cldoptics_PADE
print *, ' doGP_cldoptics_LUT : ', Model%doGP_cldoptics_LUT
print *, ' use_LW_jacobian : ', Model%use_LW_jacobian
print *, ' doGP_lwscat : ', Model%doGP_lwscat
endif
#endif
print *, ' '
Expand Down Expand Up @@ -6657,10 +6670,6 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%zt1d (IM))

! RRTMGP
allocate (Interstitial%fluxlwDOWN_jac (IM, Model%levs+1))
allocate (Interstitial%fluxlwUP_jac (IM, Model%levs+1))
allocate (Interstitial%sktp1r (IM))
allocate (Interstitial%fluxlwUP_allsky (IM, Model%levs+1))
if (Model%do_RRTMGP) then
allocate (Interstitial%tracer (IM, Model%levs,Model%ntrac))
allocate (Interstitial%tv_lay (IM, Model%levs))
Expand All @@ -6676,6 +6685,7 @@ subroutine interstitial_create (Interstitial, IM, Model)
allocate (Interstitial%precip_overlap_param (IM, Model%levs))
allocate (Interstitial%fluxlwDOWN_allsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwUP_clrsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwUP_allsky (IM, Model%levs+1))
allocate (Interstitial%fluxlwDOWN_clrsky (IM, Model%levs+1))
allocate (Interstitial%fluxswUP_allsky (IM, Model%levs+1))
allocate (Interstitial%fluxswDOWN_allsky (IM, Model%levs+1))
Expand Down Expand Up @@ -7065,8 +7075,9 @@ subroutine interstitial_rad_reset (Interstitial, Model)
Interstitial%cwm = clear_val
end if
end if

dustinswales marked this conversation as resolved.
Show resolved Hide resolved
if (Model%do_RRTMGP) then
Interstitial%fluxlwUP_allsky = clear_val
Interstitial%tracer = clear_val
Interstitial%tv_lay = clear_val
Interstitial%relhum = clear_val
Expand Down Expand Up @@ -7288,7 +7299,7 @@ subroutine interstitial_phys_reset (Interstitial, Model)
Interstitial%tseal = clear_val
Interstitial%tsfc_ice = huge
Interstitial%tsfc_land = huge
Interstitial%tsfc_ocean = huge
Interstitial%tsfc_ocean = huge
dustinswales marked this conversation as resolved.
Show resolved Hide resolved
Interstitial%tsurf = clear_val
Interstitial%tsurf_ice = huge
Interstitial%tsurf_land = huge
Expand Down Expand Up @@ -7676,7 +7687,7 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno)
write (0,*) 'sum(Interstitial%tsfa ) = ', sum(Interstitial%tsfa )
write (0,*) 'sum(Interstitial%tsfc_ice ) = ', sum(Interstitial%tsfc_ice )
write (0,*) 'sum(Interstitial%tsfc_land ) = ', sum(Interstitial%tsfc_land )
write (0,*) 'sum(Interstitial%tsfc_ocean ) = ', sum(Interstitial%tsfc_ocean )
write (0,*) 'sum(Interstitial%tsfc_ocean ) = ', sum(Interstitial%tsfc_ocean )
dustinswales marked this conversation as resolved.
Show resolved Hide resolved
write (0,*) 'sum(Interstitial%tsfg ) = ', sum(Interstitial%tsfg )
write (0,*) 'sum(Interstitial%tsurf ) = ', sum(Interstitial%tsurf )
write (0,*) 'sum(Interstitial%tsurf_ice ) = ', sum(Interstitial%tsurf_ice )
Expand Down
Loading