From f5a6d1a97e0a723b28b6b5a8f4252400296a7b9c Mon Sep 17 00:00:00 2001 From: dustinswales Date: Thu, 17 Dec 2020 10:41:10 -0700 Subject: [PATCH] RRTMGP coupling to Thompson MP in ccpp-physics (#208) * Updated physics. Added infrastructure to FV3 to handle new GP capabilities. Thompson MP, LW scattering, Use of LW-jacobian to update surface tendencies. * Some small changes to work with physics improvements to RRTMGP. * RRTMGP working with Thompson MP. * Updated .gitmodules. * Updated physics. New interstitials. * Synced with NCAR/master * Updated ccpp-physics * Updated physics submodule. * Cleanup * Update physics * Updated physics submodule pointer. * Updated physics submodule hash. --- ccpp/config/ccpp_prebuild_config.py | 14 +-- ccpp/physics | 2 +- ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml | 1 + ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml | 1 + ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml | 104 +++++++++++++++++++ gfsphysics/GFS_layer/GFS_typedefs.F90 | 65 +++++++----- gfsphysics/GFS_layer/GFS_typedefs.meta | 67 +++++++----- 7 files changed, 189 insertions(+), 65 deletions(-) create mode 100644 ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index f954a07f52..c277e5c834 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -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' ] @@ -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', @@ -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'], diff --git a/ccpp/physics b/ccpp/physics index 8f4e4e1c94..d1be22de95 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8f4e4e1c9433e099a24fb0f541ec87f04ca50f70 +Subproject commit d1be22de95ecd7519bacc08e335325f69806e7f1 diff --git a/ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml b/ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml index 244345a956..983b7b2e7e 100644 --- a/ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml +++ b/ccpp/suites/suite_FV3_GFS_v15p2_RRTMGP.xml @@ -20,6 +20,7 @@ GFS_suite_interstitial_rad_reset GFS_rrtmgp_pre GFS_rrtmgp_gfdlmp_pre + GFS_rrtmgp_cloud_overlap_pre GFS_cloud_diagnostics GFS_rrtmgp_sw_pre rrtmgp_sw_gas_optics diff --git a/ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml b/ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml index d27a3f7d30..fab16d2945 100644 --- a/ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml +++ b/ccpp/suites/suite_FV3_GFS_v16beta_RRTMGP.xml @@ -20,6 +20,7 @@ GFS_suite_interstitial_rad_reset GFS_rrtmgp_pre GFS_rrtmgp_gfdlmp_pre + GFS_rrtmgp_cloud_overlap_pre GFS_cloud_diagnostics GFS_rrtmgp_sw_pre rrtmgp_sw_gas_optics diff --git a/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml b/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml new file mode 100644 index 0000000000..2d4ac468e2 --- /dev/null +++ b/ccpp/suites/suite_FV3_GSD_v0_RRTMGP.xml @@ -0,0 +1,104 @@ + + + + + + + GFS_time_vary_pre + GFS_rrtmgp_setup + GFS_rad_time_vary + GFS_phys_time_vary + + + + + GFS_suite_interstitial_rad_reset + sgscloud_radpre + GFS_rrtmgp_pre + GFS_rrtmgp_thompsonmp_pre + GFS_rrtmgp_cloud_overlap_pre + GFS_cloud_diagnostics + GFS_rrtmgp_sw_pre + rrtmgp_sw_gas_optics + rrtmgp_sw_aerosol_optics + rrtmgp_sw_cloud_optics + rrtmgp_sw_cloud_sampling + rrtmgp_sw_rte + GFS_rrtmgp_sw_post + rrtmgp_lw_pre + rrtmgp_lw_gas_optics + rrtmgp_lw_aerosol_optics + rrtmgp_lw_cloud_optics + rrtmgp_lw_cloud_sampling + rrtmgp_lw_rte + sgscloud_radpost + GFS_rrtmgp_lw_post + + + + + GFS_suite_interstitial_phys_reset + GFS_suite_stateout_reset + get_prs_fv3 + GFS_suite_interstitial_1 + GFS_surface_generic_pre + GFS_surface_composites_pre + dcyc2t3 + GFS_surface_composites_inter + GFS_suite_interstitial_2 + + + + sfc_diff + GFS_surface_loop_control_part1 + sfc_nst_pre + sfc_nst + sfc_nst_post + lsm_ruc + lsm_ruc_sfc_sice_pre + sfc_sice + lsm_ruc_sfc_sice_post + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + cires_ugwp + cires_ugwp_post + GFS_GWD_generic_post + rayleigh_damp + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + cu_gf_driver_pre + cu_gf_driver + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + cnvc90 + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + cu_gf_driver_post + maximum_hourly_diagnostics + + + + + GFS_stochastics + phys_tend + + + + diff --git a/gfsphysics/GFS_layer/GFS_typedefs.F90 b/gfsphysics/GFS_layer/GFS_typedefs.F90 index b5b50b6af8..08af63eb07 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.F90 +++ b/gfsphysics/GFS_layer/GFS_typedefs.F90 @@ -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) @@ -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 @@ -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() !< @@ -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 @@ -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)) @@ -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 @@ -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, & @@ -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 @@ -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 *, ' ' @@ -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)) @@ -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)) @@ -7067,6 +7077,7 @@ subroutine interstitial_rad_reset (Interstitial, Model) end if if (Model%do_RRTMGP) then + Interstitial%fluxlwUP_allsky = clear_val Interstitial%tracer = clear_val Interstitial%tv_lay = clear_val Interstitial%relhum = clear_val diff --git a/gfsphysics/GFS_layer/GFS_typedefs.meta b/gfsphysics/GFS_layer/GFS_typedefs.meta index 84e447237d..656f851fc0 100644 --- a/gfsphysics/GFS_layer/GFS_typedefs.meta +++ b/gfsphysics/GFS_layer/GFS_typedefs.meta @@ -1619,6 +1619,20 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[sfculw] + standard_name = surface_upwelling_longwave_flux_on_radiation_time_step + long_name = total sky sfc upward lw flux + units = W m-2 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys +[sfculw_jac] + standard_name = RRTMGP_jacobian_of_lw_flux_upward_at_surface + long_name = RRTMGP Jacobian upward longwave flux at surface + units = W m-2 K-1 + dimensions = (horizontal_loop_extent) + type = real + kind = kind_phys [rain_cpl] standard_name = lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation @@ -2718,6 +2732,12 @@ units = flag dimensions = () type = logical +[doGP_lwscat] + standard_name = flag_to_include_longwave_scattering_in_cloud_optics + long_name = logical flag to control the addition of LW scattering in RRTMGP + units = flag + dimensions = () + type = logical [rrtmgp_nrghice] standard_name = number_of_rrtmgp_ice_roughness long_name = number of ice-roughness categories in RRTMGP calculation (Model%rrtmgp_nrghice) @@ -9878,6 +9898,24 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys +[qs_lay] + standard_name = saturation_vapor_pressure + long_name = saturation vapor pressure + units = Pa + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + optional = F + active = (flag_for_rrtmgp_radiation_scheme) +[q_lay] + standard_name = water_vapor_mixing_ratio + long_name = water vaport mixing ratio + units = kg/kg + dimensions = (horizontal_dimension,vertical_dimension) + type = real + kind = kind_phys + optional = F + active = (flag_for_rrtmgp_radiation_scheme) [p_lay] standard_name = air_pressure_at_layer_for_RRTMGP_in_hPa long_name = air pressure layer @@ -10016,27 +10054,6 @@ type = real kind = kind_phys active = (flag_for_rrtmgp_radiation_scheme) -[sktp1r] - standard_name = surface_skin_temperature_at_previous_time_step - long_name = surface skin temperature at previous time step - units = K - dimensions = (horizontal_loop_extent) - type = real - kind = kind_phys -[fluxlwUP_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_profile_upward - long_name = RRTMGP Jacobian upward longwave flux profile - units = W m-2 K-1 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys -[fluxlwDOWN_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_profile_downward - long_name = RRTMGP Jacobian downward of longwave flux profile - units = W m-2 K-1 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - type = real - kind = kind_phys [fluxswUP_allsky] standard_name = RRTMGP_sw_flux_profile_upward_allsky long_name = RRTMGP upward shortwave all-sky flux profile @@ -10246,25 +10263,25 @@ long_name = Fortran DDT containing RRTMGP optical properties units = DDT dimensions = () - type = ty_optical_props_1scl + type = ty_optical_props_2str [lw_optical_props_precip] standard_name = longwave_optical_properties_for_precipitation long_name = Fortran DDT containing RRTMGP optical properties units = DDT dimensions = () - type = ty_optical_props_1scl + type = ty_optical_props_2str [lw_optical_props_cloudsByBand] standard_name = longwave_optical_properties_for_cloudy_atmosphere_by_band long_name = Fortran DDT containing RRTMGP optical properties units = DDT dimensions = () - type = ty_optical_props_1scl + type = ty_optical_props_2str [lw_optical_props_precipByBand] standard_name = longwave_optical_properties_for_precipitation_by_band long_name = Fortran DDT containing RRTMGP optical properties units = DDT dimensions = () - type = ty_optical_props_1scl + type = ty_optical_props_2str [lw_optical_props_aerosol] standard_name = longwave_optical_properties_for_aerosols long_name = Fortran DDT containing RRTMGP optical properties