From 164d4439a3bf2e514d9908a29e5e9855e24556d0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 15 Feb 2021 17:46:52 +0000 Subject: [PATCH 01/35] Initial commit --- ccpp/data/GFS_typedefs.F90 | 14 ++++++++++---- ccpp/data/GFS_typedefs.meta | 7 +++++++ ccpp/physics | 2 +- 3 files changed, 18 insertions(+), 5 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 14d5d31f4..cea9948cc 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1997,6 +1997,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dudt_tms(:,:) => null() !< daily aver u-wind tend due to TMS ! RRTMGP + real (kind=kind_phys) :: minGPpres !< Minimum pressure allowed by RRTMGP. integer :: ipsdlw0 !< integer :: ipsdsw0 !< real (kind=kind_phys), pointer :: p_lay(:,:) => null() !< @@ -2046,10 +2047,6 @@ module GFS_typedefs 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_gas_optics_rrtmgp) :: lw_gas_props !< RRTMGP DDT - 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_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 @@ -6138,6 +6135,7 @@ subroutine interstitial_create (Interstitial, IM, Model) class(GFS_interstitial_type) :: Interstitial integer, intent(in) :: IM type(GFS_control_type), intent(in) :: Model + integer :: iGas ! allocate (Interstitial%otspt (Model%ntracp1,2)) ! Set up numbers of tracers for PBL, convection, etc: sets @@ -6421,6 +6419,14 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%toa_src_sw (IM,Model%rrtmgp_nGptsSW)) allocate (Interstitial%toa_src_lw (IM,Model%rrtmgp_nGptsLW)) allocate (Interstitial%active_gases_array (Model%nGases)) + ! ty_gas_concs + Interstitial%gas_concentrations%ncol = IM + Interstitial%gas_concentrations%nlay = Model%levs + allocate(Interstitial%gas_concentrations%gas_name(Model%nGases)) + allocate(Interstitial%gas_concentrations%concs(Model%nGases)) + do iGas=1,Model%nGases + allocate(Interstitial%gas_concentrations%concs(iGas)%conc(IM, Model%levs)) + enddo end if ! CIRES UGWP v0 allocate (Interstitial%gw_dudt (IM,Model%levs)) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 171c8ac4c..c61e99390 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10064,6 +10064,13 @@ type = real kind = kind_phys active = (flag_for_rrtmgp_radiation_scheme) +[minGPpres] + standard_name = minimum_pressure_in_RRTMGP + long_name = minimum pressure allowed in RRTMGP + units = Pa + dimensions = () + type = real + kind = kind_phys [ipsdsw0] standard_name = initial_permutation_seed_sw long_name = initial seed for McICA SW diff --git a/ccpp/physics b/ccpp/physics index 2a8682de0..ab9d45b53 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 2a8682de00fc7ff5c7b04f8fddbf86b12ef7a2b3 +Subproject commit ab9d45b53de63ff854bd40bc3edb784affbd8ce3 From e15f97009dbd134123f27ef95f72163ee0b86d2c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 16 Feb 2021 18:37:35 +0000 Subject: [PATCH 02/35] Define interstitial for minimum temperature allowed by GP. --- .gitmodules | 4 ++-- ccpp/data/GFS_typedefs.F90 | 1 + ccpp/data/GFS_typedefs.meta | 7 +++++++ ccpp/physics | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) diff --git a/.gitmodules b/.gitmodules index d253f6966..b7f81511b 100644 --- a/.gitmodules +++ b/.gitmodules @@ -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 = hotfix_GPthreadsafe diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index cea9948cc..e0b94faa7 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -1998,6 +1998,7 @@ module GFS_typedefs ! RRTMGP real (kind=kind_phys) :: minGPpres !< Minimum pressure allowed by RRTMGP. + real (kind=kind_phys) :: minGPtemp !< Minimum temperature allowed by RRTMGP. integer :: ipsdlw0 !< integer :: ipsdsw0 !< real (kind=kind_phys), pointer :: p_lay(:,:) => null() !< diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index c61e99390..e311630fa 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10071,6 +10071,13 @@ dimensions = () type = real kind = kind_phys +[minGPtemp] + standard_name = minimum_temperature_in_RRTMGP + long_name = minimum temperature allowed in RRTMGP + units = K + dimensions = () + type = real + kind = kind_phys [ipsdsw0] standard_name = initial_permutation_seed_sw long_name = initial seed for McICA SW diff --git a/ccpp/physics b/ccpp/physics index ab9d45b53..7fe6ab42f 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ab9d45b53de63ff854bd40bc3edb784affbd8ce3 +Subproject commit 7fe6ab42fa86812222a94a58ab5a014ff5e5846b From 8178094573689f7a9d8d18b4426019e1280f8778 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 18 Feb 2021 21:35:05 +0000 Subject: [PATCH 03/35] Added MPI to RRTMGP initialization. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 7fe6ab42f..f3393f40b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 7fe6ab42fa86812222a94a58ab5a014ff5e5846b +Subproject commit f3393f40b2858424f6db6b650acab9339e9e9363 From 8346e38a41ec9000e91d742947da7d0cabbc53c6 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 23 Feb 2021 17:58:11 +0000 Subject: [PATCH 04/35] Initial commit --- ccpp/physics | 2 +- .../suite_FV3_GFS_v15_thompson_mynn.xml | 10 +- ...suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml | 100 ++++++++++++++++++ 3 files changed, 106 insertions(+), 6 deletions(-) create mode 100644 ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml diff --git a/ccpp/physics b/ccpp/physics index f3393f40b..373ac912a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f3393f40b2858424f6db6b650acab9339e9e9363 +Subproject commit 373ac912a85756b558237e0b5d35685d464e1c91 diff --git a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml index bfe0763cd..46b0209f5 100644 --- a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml +++ b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml @@ -56,8 +56,8 @@ 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 @@ -66,13 +66,13 @@ get_phi_fv3 GFS_suite_interstitial_3 GFS_DCNV_generic_pre - samfdeepcnv + GFS_DCNV_generic_post GFS_SCNV_generic_pre - samfshalcnv + GFS_SCNV_generic_post GFS_suite_interstitial_4 - cnvc90 + GFS_MP_generic_pre mp_thompson_pre mp_thompson diff --git a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml new file mode 100644 index 000000000..501d38953 --- /dev/null +++ b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml @@ -0,0 +1,100 @@ + + + + + + + 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_noah + sfc_sice + GFS_surface_loop_control_part2 + + + + GFS_surface_composites_post + sfc_diag + sfc_diag_post + GFS_surface_generic_post + mynnedmf_wrapper + GFS_GWD_generic_pre + + + GFS_GWD_generic_post + rayleigh_damp + GFS_suite_stateout_update + ozphys_2015 + h2ophys + get_phi_fv3 + GFS_suite_interstitial_3 + GFS_DCNV_generic_pre + + GFS_DCNV_generic_post + GFS_SCNV_generic_pre + + GFS_SCNV_generic_post + GFS_suite_interstitial_4 + + GFS_MP_generic_pre + mp_thompson_pre + mp_thompson + mp_thompson_post + GFS_MP_generic_post + maximum_hourly_diagnostics + + + + + GFS_stochastics + + + + From 080af1c4815a33d816ba99f73b66d8f2db8a7d61 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 4 Mar 2021 19:10:40 +0000 Subject: [PATCH 05/35] Bug fixes for l127 configuration using RRTMGP --- ccpp/data/GFS_typedefs.F90 | 4 ++-- ccpp/data/GFS_typedefs.meta | 28 ++++++++++++++-------------- ccpp/physics | 2 +- 3 files changed, 17 insertions(+), 17 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index d4ab334d9..1f32bea3a 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -683,6 +683,8 @@ module GFS_typedefs 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 + real(kind_phys) :: minGPpres !< Minimum pressure allowed in RRTMGP. + real(kind_phys) :: minGPtemp !< Minimum temperature allowed in RRTMGP. !--- microphysical switch integer :: ncld !< choice of cloud scheme @@ -2022,8 +2024,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dudt_tms(:,:) => null() !< daily aver u-wind tend due to TMS ! RRTMGP - real (kind=kind_phys) :: minGPpres !< Minimum pressure allowed by RRTMGP. - real (kind=kind_phys) :: minGPtemp !< Minimum temperature allowed by RRTMGP. integer :: ipsdlw0 !< integer :: ipsdsw0 !< real (kind=kind_phys), pointer :: p_lay(:,:) => null() !< diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index a3a1a08f5..76a741239 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -2800,6 +2800,20 @@ units = flag dimensions = () type = logical +[minGPpres] + standard_name = minimum_pressure_in_RRTMGP + long_name = minimum pressure allowed in RRTMGP + units = Pa + dimensions = () + type = real + kind = kind_phys +[minGPtemp] + standard_name = minimum_temperature_in_RRTMGP + long_name = minimum temperature allowed in RRTMGP + units = K + dimensions = () + type = real + kind = kind_phys [ncld] standard_name = number_of_hydrometeors long_name = choice of cloud scheme / number of hydrometeors @@ -10135,20 +10149,6 @@ type = real kind = kind_phys active = (flag_for_rrtmgp_radiation_scheme) -[minGPpres] - standard_name = minimum_pressure_in_RRTMGP - long_name = minimum pressure allowed in RRTMGP - units = Pa - dimensions = () - type = real - kind = kind_phys -[minGPtemp] - standard_name = minimum_temperature_in_RRTMGP - long_name = minimum temperature allowed in RRTMGP - units = K - dimensions = () - type = real - kind = kind_phys [ipsdsw0] standard_name = initial_permutation_seed_sw long_name = initial seed for McICA SW diff --git a/ccpp/physics b/ccpp/physics index 869dfaaf9..1d598eea8 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 869dfaaf9c0fad932dc032a180e02ed50f4b2002 +Subproject commit 1d598eea8c0d261e3754fe5b1f602ffb65c09af2 From 663376ab33c5476550d5ed532737a3a29323658d Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 4 Mar 2021 22:54:59 +0000 Subject: [PATCH 06/35] Initial commit --- ccpp/data/GFS_typedefs.F90 | 7 +++++-- ccpp/data/GFS_typedefs.meta | 9 ++++++++- ccpp/physics | 2 +- 3 files changed, 14 insertions(+), 4 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index d4ab334d9..c71fcf0ab 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -422,7 +422,8 @@ 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 :: sfculw_jac(:) => null() !< Jacobian of total sky sfc upward lw flux ( w/m**2/K ) + real (kind=kind_phys), pointer :: sfculw_jac(:,:)=> null() !< Jacobian of total sky sfc upward lw flux ( w/m**2/K ) + real (kind=kind_phys), pointer :: sfcdlw_jac(:,:)=> null() !< Jacobian of total sky sfc downward 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) @@ -2642,13 +2643,15 @@ subroutine coupling_create (Coupling, IM, Model) allocate (Coupling%sfcnsw (IM)) allocate (Coupling%sfcdlw (IM)) allocate (Coupling%sfculw (IM)) - allocate (Coupling%sfculw_jac (IM)) + allocate (Coupling%sfculw_jac (IM,Model%levs+1)) + allocate (Coupling%sfcdlw_jac (IM,Model%levs+1)) Coupling%sfcdsw = clear_val Coupling%sfcnsw = clear_val Coupling%sfcdlw = clear_val Coupling%sfculw = clear_val Coupling%sfculw_jac = clear_val + Coupling%sfcdlw_jac = clear_val if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then allocate (Coupling%rain_cpl (IM)) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index a3a1a08f5..49b09a919 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -1661,7 +1661,14 @@ 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) + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) + type = real + kind = kind_phys +[sfcdlw_jac] + standard_name = RRTMGP_jacobian_of_lw_flux_downward_at_surface + long_name = RRTMGP Jacobian downward longwave flux at surface + units = W m-2 K-1 + dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) type = real kind = kind_phys [rain_cpl] diff --git a/ccpp/physics b/ccpp/physics index 869dfaaf9..0fd915ff6 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 869dfaaf9c0fad932dc032a180e02ed50f4b2002 +Subproject commit 0fd915ff6ed44e87325ac523bbcce2fd39542aab From 60afd3ce12919a0fb80b4407f8645d97e562638e Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 5 Mar 2021 21:08:07 +0000 Subject: [PATCH 07/35] Full profile LW flux adjustment using RRTMGP Jacobians. --- ccpp/data/GFS_typedefs.F90 | 32 +++++++++++++------------- ccpp/data/GFS_typedefs.meta | 46 +++++++++++++++++++------------------ ccpp/physics | 2 +- 3 files changed, 41 insertions(+), 39 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 8316ad365..e1cb9c28a 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -422,8 +422,10 @@ 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 :: sfculw_jac(:,:)=> null() !< Jacobian of total sky sfc upward lw flux ( w/m**2/K ) - real (kind=kind_phys), pointer :: sfcdlw_jac(:,:)=> null() !< Jacobian of total sky sfc downward lw flux ( w/m**2/K ) + 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 :: fluxlwDOWN_jac(:,:) => null() !< GP Jacobian down 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 ) !--- 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) @@ -2051,16 +2053,12 @@ 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 real (kind=kind_phys), pointer :: fluxswDOWN_allsky(:,:) => null() !< RRTMGP downward shortwave all-sky flux profile real (kind=kind_phys), pointer :: fluxswUP_clrsky(:,:) => null() !< RRTMGP upward shortwave clr-sky flux profile real (kind=kind_phys), pointer :: fluxswDOWN_clrsky(:,:) => null() !< RRTMGP downward shortwave clr-sky flux profile - real (kind=kind_phys), pointer :: fluxlwUP_jac(:,:) => null() !< RRTMGP upward Jacobian of longwave flux - real (kind=kind_phys), pointer :: fluxlwDOWN_jac(:,:) => null() !< RRTMGP downward Jacobian of longwave flux real (kind=kind_phys), pointer :: sfc_emiss_byband(:,:) => null() !< real (kind=kind_phys), pointer :: sec_diff_byband(:,:) => null() !< real (kind=kind_phys), pointer :: sfc_alb_nir_dir(:,:) => null() !< @@ -2643,15 +2641,23 @@ subroutine coupling_create (Coupling, IM, Model) allocate (Coupling%sfcnsw (IM)) allocate (Coupling%sfcdlw (IM)) allocate (Coupling%sfculw (IM)) - allocate (Coupling%sfculw_jac (IM,Model%levs+1)) - allocate (Coupling%sfcdlw_jac (IM,Model%levs+1)) Coupling%sfcdsw = clear_val Coupling%sfcnsw = clear_val Coupling%sfcdlw = clear_val Coupling%sfculw = clear_val - Coupling%sfculw_jac = clear_val - Coupling%sfcdlw_jac = 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%fluxlwDOWN_jac (IM,Model%levs+1)) + allocate (Coupling%fluxlwUP_allsky (IM,Model%levs+1)) + allocate (Coupling%fluxlwDOWN_allsky (IM,Model%levs+1)) + Coupling%fluxlwUP_jac = clear_val + Coupling%fluxlwDOWN_jac = clear_val + Coupling%fluxlwUP_allsky = clear_val + Coupling%fluxlwDOWN_allsky = clear_val + endif if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then allocate (Coupling%rain_cpl (IM)) @@ -6407,9 +6413,7 @@ 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%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)) @@ -6811,7 +6815,6 @@ 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 @@ -6824,7 +6827,6 @@ subroutine interstitial_rad_reset (Interstitial, Model) Interstitial%t_lay = clear_val Interstitial%cloud_overlap_param = clear_val Interstitial%precip_overlap_param = clear_val - Interstitial%fluxlwDOWN_allsky = clear_val Interstitial%fluxlwUP_clrsky = clear_val Interstitial%fluxlwDOWN_clrsky = clear_val Interstitial%fluxswUP_allsky = clear_val @@ -7566,8 +7568,6 @@ subroutine interstitial_print(Interstitial, Model, mpirank, omprank, blkno) write (0,*) 'sum(Interstitial%precip_frac ) = ', sum(Interstitial%precip_frac ) write (0,*) 'sum(Interstitial%icseed_lw ) = ', sum(Interstitial%icseed_lw ) write (0,*) 'sum(Interstitial%icseed_sw ) = ', sum(Interstitial%icseed_sw ) - write (0,*) 'sum(Interstitial%fluxlwUP_allsky ) = ', sum(Interstitial%fluxlwUP_allsky ) - write (0,*) 'sum(Interstitial%fluxlwDOWN_allsky ) = ', sum(Interstitial%fluxlwDOWN_allsky) write (0,*) 'sum(Interstitial%fluxlwUP_clrsky ) = ', sum(Interstitial%fluxlwUP_clrsky ) write (0,*) 'sum(Interstitial%fluxlwDOWN_clrsky ) = ', sum(Interstitial%fluxlwDOWN_clrsky) write (0,*) 'sum(Interstitial%fluxswUP_allsky ) = ', sum(Interstitial%fluxswUP_allsky ) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 2345dc17c..8f01945ad 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -1657,20 +1657,38 @@ 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 +[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_dimension_plus_one) type = real kind = kind_phys -[sfcdlw_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_downward_at_surface - long_name = RRTMGP Jacobian downward longwave flux at surface + active = (flag_for_rrtmgp_radiation_scheme) +[fluxlwDOWN_jac] + standard_name = RRTMGP_jacobian_of_lw_flux_downward + long_name = RRTMGP Jacobian downward longwave flux at profile units = W m-2 K-1 dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) 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_dimension_plus_one) + 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_dimension_plus_one) + type = real + kind = kind_phys + active = (flag_for_rrtmgp_radiation_scheme) [rain_cpl] standard_name = lwe_thickness_of_precipitation_amount_for_coupling long_name = total rain precipitation @@ -10182,22 +10200,6 @@ dimensions = (horizontal_loop_extent,vertical_dimension) type = real kind = kind_phys -[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_dimension_plus_one) - 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_dimension_plus_one) - 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 diff --git a/ccpp/physics b/ccpp/physics index 0fd915ff6..0c37afde1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0fd915ff6ed44e87325ac523bbcce2fd39542aab +Subproject commit 0c37afde177e34a2efa71364bfc51e77d99f5efb From 04053ddb1e442126406f9021b5dc64a2233db14f Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 8 Mar 2021 16:11:43 +0000 Subject: [PATCH 08/35] LW Jacobian adjustment on full profule working. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 0c37afde1..0aa3bfc83 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0c37afde177e34a2efa71364bfc51e77d99f5efb +Subproject commit 0aa3bfc83d0900f56326437ce8ef93b781647204 From 61a24b66b571bd45ae5664f7ee8812b414ffedf0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 8 Mar 2021 18:18:54 +0000 Subject: [PATCH 09/35] Updated SDFs. Cleanup old piece of code from merge. --- ccpp/data/GFS_typedefs.F90 | 2 -- ccpp/data/GFS_typedefs.meta | 14 -------------- ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml | 10 +++++----- .../suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml | 10 +++++----- 4 files changed, 10 insertions(+), 26 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index f7069b369..e1cb9c28a 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -2027,8 +2027,6 @@ module GFS_typedefs real (kind=kind_phys), pointer :: dudt_tms(:,:) => null() !< daily aver u-wind tend due to TMS ! RRTMGP - real (kind=kind_phys) :: minGPpres !< Minimum pressure allowed by RRTMGP. - real (kind=kind_phys) :: minGPtemp !< Minimum temperature allowed by RRTMGP. integer :: ipsdlw0 !< integer :: ipsdsw0 !< real (kind=kind_phys), pointer :: p_lay(:,:) => null() !< diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 810d93c4f..8f01945ad 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -10174,20 +10174,6 @@ type = real kind = kind_phys active = (flag_for_rrtmgp_radiation_scheme) -[minGPpres] - standard_name = minimum_pressure_in_RRTMGP - long_name = minimum pressure allowed in RRTMGP - units = Pa - dimensions = () - type = real - kind = kind_phys -[minGPtemp] - standard_name = minimum_temperature_in_RRTMGP - long_name = minimum temperature allowed in RRTMGP - units = K - dimensions = () - type = real - kind = kind_phys [ipsdsw0] standard_name = initial_permutation_seed_sw long_name = initial seed for McICA SW diff --git a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml index 46b0209f5..bfe0763cd 100644 --- a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml +++ b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn.xml @@ -56,8 +56,8 @@ 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 @@ -66,13 +66,13 @@ get_phi_fv3 GFS_suite_interstitial_3 GFS_DCNV_generic_pre - + samfdeepcnv GFS_DCNV_generic_post GFS_SCNV_generic_pre - + samfshalcnv GFS_SCNV_generic_post GFS_suite_interstitial_4 - + cnvc90 GFS_MP_generic_pre mp_thompson_pre mp_thompson diff --git a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml index 501d38953..29d4e4561 100644 --- a/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml +++ b/ccpp/suites/suite_FV3_GFS_v15_thompson_mynn_RRTMGP.xml @@ -66,8 +66,8 @@ 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 @@ -76,13 +76,13 @@ get_phi_fv3 GFS_suite_interstitial_3 GFS_DCNV_generic_pre - + samfdeepcnv GFS_DCNV_generic_post GFS_SCNV_generic_pre - + samfshalcnv GFS_SCNV_generic_post GFS_suite_interstitial_4 - + cnvc90 GFS_MP_generic_pre mp_thompson_pre mp_thompson From 4ccf5a5cbd63fae122eda840c2824c02b96af867 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 9 Mar 2021 20:22:12 +0000 Subject: [PATCH 10/35] Added adjustment with Jacobian to surface flux, used for coupling. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 0aa3bfc83..d550e982a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 0aa3bfc83d0900f56326437ce8ef93b781647204 +Subproject commit d550e982a2cc9ed02c25f683707fbbb6028fa866 From d7faec14ea11cca4adb928583512c695d9e0b7b1 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 11 Mar 2021 15:44:48 +0000 Subject: [PATCH 11/35] Pass cloud-fraction through GP-2-mpinterfaces when using SGS clouds. Added updated heating-rate to coupling type. --- ccpp/data/GFS_typedefs.F90 | 7 +++++++ ccpp/data/GFS_typedefs.meta | 8 ++++++++ ccpp/physics | 2 +- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index e1cb9c28a..de71fbb54 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -426,6 +426,7 @@ module GFS_typedefs real (kind=kind_phys), pointer :: fluxlwDOWN_jac(:,:) => null() !< GP Jacobian down 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 !--- 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) @@ -2653,10 +2654,12 @@ subroutine coupling_create (Coupling, IM, Model) allocate (Coupling%fluxlwDOWN_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)) Coupling%fluxlwUP_jac = clear_val Coupling%fluxlwDOWN_jac = clear_val Coupling%fluxlwUP_allsky = clear_val Coupling%fluxlwDOWN_allsky = clear_val + Coupling%htrlw = clear_val endif if (Model%cplflx .or. Model%do_sppt .or. Model%cplchm .or. Model%ca_global) then @@ -3770,6 +3773,10 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & write(0,*) "Logic error, RRTMGP Longwave cloud-scattering not supported with RRTMG cloud-optics." stop end if + if (Model%doGP_cldoptics_PADE .and. Model%doGP_cldoptics_LUT) then + write(0,*) "Logic error, Both RRTMGP cloud-optics options cannot be selected. " + 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 diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 8f01945ad..177ffdbe6 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -1657,6 +1657,14 @@ dimensions = (horizontal_loop_extent) type = real kind = kind_phys +[htrlw] + standard_name = updated_tendency_of_air_temperature_due_to_longwave_heating_on_physics_time_step + long_name = total sky longwave heating rate on physics time step + units = K s-1 + dimensions = (horizontal_loop_extent,vertical_dimension) + 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 diff --git a/ccpp/physics b/ccpp/physics index d550e982a..568c65bd3 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d550e982a2cc9ed02c25f683707fbbb6028fa866 +Subproject commit 568c65bd3355a586f0b633dfd9a1984629b07157 From e7fb1d21559c4fb15ebc84a54335cee238f9fd6e Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 18 Mar 2021 23:49:45 +0000 Subject: [PATCH 12/35] Updated physics/rte-rrtmgp hash --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 84dcabc28..c94849fa7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 84dcabc28febbc7a00f848e79cb0eaeb87c896e2 +Subproject commit c94849fa7c67586018bcc5382a26cbbf4703c5de From c8ceb79785b6f239e05c06525640b44cac9f31d3 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 19 Mar 2021 10:51:13 -0600 Subject: [PATCH 13/35] Remove unnecessary build configuration in ccpp/CMakeLists.txt --- ccpp/CMakeLists.txt | 54 --------------------------------------------- 1 file changed, 54 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 760e09a8e..c0ce195ba 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -178,60 +178,6 @@ endif (DYN32) ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM) ADD_DEFINITIONS(-DINTERNAL_FILE_NML) -#------------------------------------------------------------------------------ -# Set OpenMP flags for C/C++/Fortran compiler and preprocessor -if (OPENMP) - include(detect_openmp) - detect_openmp() - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") - message(STATUS "Enable OpenMP support for C/C++/Fortran compiler") - ADD_DEFINITIONS(-DOPENMP) -else (OPENMP) - message (STATUS "Disable OpenMP support for C/C++/Fortran compiler") -endif (OPENMP) - -#------------------------------------------------------------------------------ -# Set SIONlib flags for preprocessor, compiler and linker (if defined) -if (SIONLIB) - execute_process(COMMAND ${SIONLIB}/bin/sionconfig --mpi --cflags --f90 - RESULT_VARIABLE exit_code - OUTPUT_VARIABLE SIONlib_Fortran_FLAGS - ERROR_VARIABLE stderr - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE) - if (NOT exit_code EQUAL "0") - message (FATAL_ERROR "Execution of '${SIONLIB}/bin/sionconfig --mpi --cflags --f90' failed") - endif (NOT exit_code EQUAL "0") - execute_process(COMMAND ${SIONLIB}/bin/sionconfig --mpi --libs --f90 - RESULT_VARIABLE exit_code - OUTPUT_VARIABLE SIONlib_Fortran_LIBS - ERROR_VARIABLE stderr - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE) - if (NOT exit_code EQUAL "0") - message (FATAL_ERROR "Execution of '${SIONLIB}/bin/sionconfig --mpi --libs --f90' failed") - endif (NOT exit_code EQUAL "0") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${SIONlib_Fortran_FLAGS} ${SIONlib_Fortran_LIBS}") - ADD_DEFINITIONS(-DSION) - message (STATUS "Enable SIONlib support") -else (SIONLIB) - message (STATUS "Disable SIONlib support") -endif (SIONLIB) - -#------------------------------------------------------------------------------ -# Set Intel MKL flags for preprocessor, compiler and linker (if defined) -if(MKL_DIR) - set (MKL_INC "-m64 -I${MKL_DIR}/include") - set (MKL_LIB "-L${MKL_DIR}/lib -Wl,-rpath,${MKL_DIR}/lib -lmkl_intel_lp64 -lmkl_sequential -lmkl_core -lpthread -lm -ldl") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${MKL_INC} ${MKL_LIB}") - ADD_DEFINITIONS(-DMKL) - message (STATUS "Enable Intel MKL support") -else(MKL_DIR) - message (STATUS "Disable Intel MKL support") -endif(MKL_DIR) - #------------------------------------------------------------------------------ # Set netCDF flags for preprocessor, compiler and linker (if defined) # Legacy settings for old make build From 8f4b13bf9b118b467e72f366ab4222aaede89ce0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 19 Mar 2021 17:10:12 +0000 Subject: [PATCH 14/35] Updated physics w openmp removed from rte-rrtmgp --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index c94849fa7..f814c9252 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c94849fa7c67586018bcc5382a26cbbf4703c5de +Subproject commit f814c9252412a687d28c7f735c4c38c196d776b1 From cf6f89079a2f41832257d4eaa22dabaf9867b861 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 24 Mar 2021 17:46:37 +0000 Subject: [PATCH 15/35] Moved allocation of LW interstitials to GFS_typedefs. Removed downward LW Jacobian from RRTMGP flux adjustement. --- ccpp/data/GFS_typedefs.F90 | 46 +++++++++++++++++++++++++++++++++---- ccpp/data/GFS_typedefs.meta | 8 ------- ccpp/physics | 2 +- 3 files changed, 43 insertions(+), 13 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index 14dff5fb0..cf120fd05 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -428,7 +428,6 @@ module GFS_typedefs !< 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 :: fluxlwDOWN_jac(:,:) => null() !< GP Jacobian down 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 @@ -2667,12 +2666,10 @@ subroutine coupling_create (Coupling, IM, Model) ! 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%fluxlwDOWN_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)) Coupling%fluxlwUP_jac = clear_val - Coupling%fluxlwDOWN_jac = clear_val Coupling%fluxlwUP_allsky = clear_val Coupling%fluxlwDOWN_allsky = clear_val Coupling%htrlw = clear_val @@ -6497,7 +6494,7 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%toa_src_sw (IM,Model%rrtmgp_nGptsSW)) allocate (Interstitial%toa_src_lw (IM,Model%rrtmgp_nGptsLW)) allocate (Interstitial%active_gases_array (Model%nGases)) - ! ty_gas_concs + ! gas_concentrations (ty_gas_concs) Interstitial%gas_concentrations%ncol = IM Interstitial%gas_concentrations%nlay = Model%levs allocate(Interstitial%gas_concentrations%gas_name(Model%nGases)) @@ -6505,6 +6502,32 @@ subroutine interstitial_create (Interstitial, IM, Model) do iGas=1,Model%nGases allocate(Interstitial%gas_concentrations%concs(iGas)%conc(IM, Model%levs)) enddo + ! lw_optical_props_clrsky (ty_optical_props_1scl) + allocate(Interstitial%lw_optical_props_clrsky%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! lw_optical_props_aerosol (ty_optical_props_1scl) + allocate(Interstitial%lw_optical_props_aerosol%tau( IM, Model%levs, Model%rrtmgp_nBandsLW )) + ! lw_optical_props_cloudsByBand (ty_optical_props_2str) + allocate(Interstitial%lw_optical_props_cloudsByBand%tau(IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_cloudsByBand%ssa(IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_cloudsByBand%g( IM, Model%levs, Model%rrtmgp_nBandsLW )) + ! lw_optical_props_precipByBand (ty_optical_props_2str) + allocate(Interstitial%lw_optical_props_precipByBand%tau(IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precipByBand%ssa(IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precipByBand%g( IM, Model%levs, Model%rrtmgp_nBandsLW )) + ! lw_optical_props_clouds (ty_optical_props_2str) + allocate(Interstitial%lw_optical_props_clouds%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clouds%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clouds%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! lw_optical_props_precip (ty_optical_props_2str) + allocate(Interstitial%lw_optical_props_precip%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_precip%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_precip%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! sources (ty_source_func_lw) + allocate(Interstitial%sources%sfc_source( IM, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lay_source( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lev_source_inc( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lev_source_dec( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%sfc_source_Jac( IM, Model%rrtmgp_nGptsLW )) end if ! UGWP common @@ -6911,6 +6934,21 @@ subroutine interstitial_rad_reset (Interstitial, Model) do iGas=1,Model%nGases Interstitial%gas_concentrations%concs(iGas)%conc = clear_val end do + Interstitial%lw_optical_props_clrsky%tau = clear_val + Interstitial%lw_optical_props_aerosol%tau = clear_val + Interstitial%lw_optical_props_clouds%tau = clear_val + Interstitial%lw_optical_props_clouds%ssa = clear_val + Interstitial%lw_optical_props_clouds%g = clear_val + 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 end if ! end subroutine interstitial_rad_reset diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 94cbc0df8..7b50fd4c7 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -1713,14 +1713,6 @@ type = real kind = kind_phys active = (flag_for_rrtmgp_radiation_scheme) -[fluxlwDOWN_jac] - standard_name = RRTMGP_jacobian_of_lw_flux_downward - long_name = RRTMGP Jacobian downward longwave flux at profile - units = W m-2 K-1 - dimensions = (horizontal_loop_extent,vertical_dimension_plus_one) - 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 diff --git a/ccpp/physics b/ccpp/physics index f814c9252..4e9b59a87 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f814c9252412a687d28c7f735c4c38c196d776b1 +Subproject commit 4e9b59a87e5e5bd24a4badc8b1aea384465b8b61 From 47f3ec078e949212725c70d8f6eb879e3462c3e7 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 24 Mar 2021 18:04:52 +0000 Subject: [PATCH 16/35] Updated my physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 4e9b59a87..5b38f90b1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 4e9b59a87e5e5bd24a4badc8b1aea384465b8b61 +Subproject commit 5b38f90b109ef729a1356d6e85a7745446b419ff From 9bac131e14c46e5a9b7202faf1dd9d135dd9971b Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 26 Mar 2021 16:45:47 +0000 Subject: [PATCH 17/35] Moved assignment of spectral information from _init()'s to _run() for RRTMGP. --- ccpp/data/GFS_typedefs.F90 | 61 ++++++++++++++++++++++++++++++-------- ccpp/physics | 2 +- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index b2acfeb82..bc817db2a 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -6513,7 +6513,9 @@ subroutine interstitial_create (Interstitial, IM, Model) allocate (Interstitial%toa_src_sw (IM,Model%rrtmgp_nGptsSW)) allocate (Interstitial%toa_src_lw (IM,Model%rrtmgp_nGptsLW)) allocate (Interstitial%active_gases_array (Model%nGases)) + ! ! gas_concentrations (ty_gas_concs) + ! Interstitial%gas_concentrations%ncol = IM Interstitial%gas_concentrations%nlay = Model%levs allocate(Interstitial%gas_concentrations%gas_name(Model%nGases)) @@ -6521,32 +6523,67 @@ subroutine interstitial_create (Interstitial, IM, Model) do iGas=1,Model%nGases allocate(Interstitial%gas_concentrations%concs(iGas)%conc(IM, Model%levs)) enddo + ! ! lw_optical_props_clrsky (ty_optical_props_1scl) - allocate(Interstitial%lw_optical_props_clrsky%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! + allocate(Interstitial%lw_optical_props_clrsky%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clrsky%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_clrsky%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_clrsky%gpt2band( Model%rrtmgp_nGptsLW )) + ! ! lw_optical_props_aerosol (ty_optical_props_1scl) + ! allocate(Interstitial%lw_optical_props_aerosol%tau( IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_aerosol%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_aerosol%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_aerosol%gpt2band( Model%rrtmgp_nBandsLW )) + ! ! lw_optical_props_cloudsByBand (ty_optical_props_2str) + ! allocate(Interstitial%lw_optical_props_cloudsByBand%tau(IM, Model%levs, Model%rrtmgp_nBandsLW )) allocate(Interstitial%lw_optical_props_cloudsByBand%ssa(IM, Model%levs, Model%rrtmgp_nBandsLW )) allocate(Interstitial%lw_optical_props_cloudsByBand%g( IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_cloudsByBand%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_cloudsByBand%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_cloudsByBand%gpt2band( Model%rrtmgp_nBandsLW )) + ! ! lw_optical_props_precipByBand (ty_optical_props_2str) + ! allocate(Interstitial%lw_optical_props_precipByBand%tau(IM, Model%levs, Model%rrtmgp_nBandsLW )) allocate(Interstitial%lw_optical_props_precipByBand%ssa(IM, Model%levs, Model%rrtmgp_nBandsLW )) allocate(Interstitial%lw_optical_props_precipByBand%g( IM, Model%levs, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precipByBand%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precipByBand%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precipByBand%gpt2band( Model%rrtmgp_nBandsLW )) + ! ! lw_optical_props_clouds (ty_optical_props_2str) - allocate(Interstitial%lw_optical_props_clouds%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%lw_optical_props_clouds%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%lw_optical_props_clouds%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! + allocate(Interstitial%lw_optical_props_clouds%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clouds%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clouds%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_clouds%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_clouds%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_clouds%gpt2band( Model%rrtmgp_nGptsLW )) + ! ! lw_optical_props_precip (ty_optical_props_2str) - allocate(Interstitial%lw_optical_props_precip%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%lw_optical_props_precip%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%lw_optical_props_precip%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + ! + allocate(Interstitial%lw_optical_props_precip%tau( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_precip%ssa( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_precip%g( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%lw_optical_props_precip%band2gpt (2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precip%band_lims_wvn(2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%lw_optical_props_precip%gpt2band( Model%rrtmgp_nGptsLW )) + ! ! sources (ty_source_func_lw) - allocate(Interstitial%sources%sfc_source( IM, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%sources%lay_source( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%sources%lev_source_inc( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%sources%lev_source_dec( IM, Model%levs, Model%rrtmgp_nGptsLW )) - allocate(Interstitial%sources%sfc_source_Jac( IM, Model%rrtmgp_nGptsLW )) + ! + allocate(Interstitial%sources%sfc_source( IM, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lay_source( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lev_source_inc( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%lev_source_dec( IM, Model%levs, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%sfc_source_Jac( IM, Model%rrtmgp_nGptsLW )) + allocate(Interstitial%sources%band2gpt ( 2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%sources%band_lims_wvn ( 2, Model%rrtmgp_nBandsLW )) + allocate(Interstitial%sources%gpt2band( Model%rrtmgp_nGptsLW )) end if ! UGWP common diff --git a/ccpp/physics b/ccpp/physics index 5b38f90b1..ad4515a48 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 5b38f90b109ef729a1356d6e85a7745446b419ff +Subproject commit ad4515a48961a8cdaa9042c6a3c852312a153867 From 507c5790e9ffa91e48ac42ce481d31bf22c4fbab Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 9 Apr 2021 14:56:46 +0000 Subject: [PATCH 18/35] Bugfixes for GP/ThompsonMP coupling --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index ad4515a48..ead8bd619 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit ad4515a48961a8cdaa9042c6a3c852312a153867 +Subproject commit ead8bd6194a771a19b34a0579e722ca1b0c29bae From eebd2a67d064bf217baa444ca785c25dafd508d3 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 9 Apr 2021 16:36:53 +0000 Subject: [PATCH 19/35] Updated .gitmodules --- .gitmodules | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.gitmodules b/.gitmodules index 58a3477e1..d18c70823 100644 --- a/.gitmodules +++ b/.gitmodules @@ -9,4 +9,4 @@ [submodule "ccpp/physics"] path = ccpp/physics url = https://github.com/dustinswales/ccpp-physics - branch = hotfix_GPthreadsafe + branch = addLWadj_fullProfile From f3eea3c2c63c1bd91a273f9c402056b1c045fdda Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Fri, 9 Apr 2021 20:34:01 +0000 Subject: [PATCH 20/35] Fix conflict bug from previous merge. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index cc85d948b..c86bb23b7 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit cc85d948b3c7910556507bd57c5fef9fae1f16b7 +Subproject commit c86bb23b739c78d90ebc2fe6bef0243a62cffec6 From 26012a7dfafc84cdedbe541591f7f8c0803cffc6 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 15 Apr 2021 10:10:20 -0600 Subject: [PATCH 21/35] Update .gitmodules, submodule pointer for ccpp-physics, and ccpp/config/ccpp_prebuild_config.py --- .gitmodules | 6 ++++-- ccpp/config/ccpp_prebuild_config.py | 7 ------- ccpp/physics | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) diff --git a/.gitmodules b/.gitmodules index 1f7526633..47e4e5892 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,5 +8,7 @@ branch = master [submodule "ccpp/physics"] path = ccpp/physics - url = https://github.com/NCAR/ccpp-physics - branch = master + #url = https://github.com/NCAR/ccpp-physics + #branch = master + url = https://github.com/climbfuji/ccpp-physics + branch = capgen_fixes_assumed_sizes diff --git a/ccpp/config/ccpp_prebuild_config.py b/ccpp/config/ccpp_prebuild_config.py index efc4cb6ec..048d461d0 100755 --- a/ccpp/config/ccpp_prebuild_config.py +++ b/ccpp/config/ccpp_prebuild_config.py @@ -294,13 +294,6 @@ # *DH 2020-06-01 ], }, - 'mp_fer_hires' : { - 'mp_fer_hires_init' : [ - 'fraction_of_ice_water_cloud', - 'fraction_of_rain_water_cloud', - 'rime_factor', - ], - }, 'rrtmgp_sw_rte' : { 'rrtmgp_sw_rte_run' : [ 'components_of_surface_downward_shortwave_fluxes', diff --git a/ccpp/physics b/ccpp/physics index 990b9d041..b39b3134c 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 990b9d0416e340e40e4b136561a85f63d46671e2 +Subproject commit b39b3134cfedaeacdf9f6ef7ead518b09af426f8 From aa237f8a9fc045a333a739ac8ceb363c07134942 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Mon, 19 Apr 2021 14:40:17 -0600 Subject: [PATCH 22/35] Update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index b0cebc2a8..8bf580244 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit b0cebc2a831554db4d5b5b5696df0c9bc361a19c +Subproject commit 8bf5802443d3500e6beb01e543e9f99e075cf8ba From 6e75fe95c4481efffbe9420f37b1514d270ce4ca Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Apr 2021 15:21:06 -0600 Subject: [PATCH 23/35] Update submodule pointer for ccpp-physic --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 8bf580244..5b8973f99 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 8bf5802443d3500e6beb01e543e9f99e075cf8ba +Subproject commit 5b8973f995dfc8b138e0e069dbd88c9eba59e671 From edac0c0c468f2fa57df742cfb1f8b73497fcbf47 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 22 Apr 2021 16:57:39 -0600 Subject: [PATCH 24/35] update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 5b8973f99..b35cf894b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 5b8973f995dfc8b138e0e069dbd88c9eba59e671 +Subproject commit b35cf894b4573f91afd85ba0c48c1a662b6f26f0 From 4eb0cb1481ed04ac0eca1e0b97efa3ffd757a237 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Mon, 26 Apr 2021 19:00:25 +0000 Subject: [PATCH 25/35] Update to RRTMGP radiation in ccpp-physics. --- ccpp/CMakeLists.txt | 43 --------------------- ccpp/data/GFS_typedefs.F90 | 76 ++++++++++++++++++++------------------ ccpp/physics | 2 +- 3 files changed, 42 insertions(+), 79 deletions(-) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index 42dbe049f..5468863c7 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -178,49 +178,6 @@ endif (DYN32) ADD_DEFINITIONS(-DMOIST_CAPPA -DUSE_COND -DNEMS_GSM) ADD_DEFINITIONS(-DINTERNAL_FILE_NML) -#------------------------------------------------------------------------------ - -# Set OpenMP flags for C/C++/Fortran compiler and preprocessor -if (OPENMP) - include(detect_openmp) - detect_openmp() - set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} ${OpenMP_C_FLAGS}") - set (CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} ${OpenMP_CXX_FLAGS}") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${OpenMP_Fortran_FLAGS}") - message(STATUS "Enable OpenMP support for C/C++/Fortran compiler") - ADD_DEFINITIONS(-DOPENMP) -else (OPENMP) - message (STATUS "Disable OpenMP support for C/C++/Fortran compiler") -endif (OPENMP) - -#------------------------------------------------------------------------------ -# Set SIONlib flags for preprocessor, compiler and linker (if defined) -if (SIONLIB) - execute_process(COMMAND ${SIONLIB}/bin/sionconfig --mpi --cflags --f90 - RESULT_VARIABLE exit_code - OUTPUT_VARIABLE SIONlib_Fortran_FLAGS - ERROR_VARIABLE stderr - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE) - if (NOT exit_code EQUAL "0") - message (FATAL_ERROR "Execution of '${SIONLIB}/bin/sionconfig --mpi --cflags --f90' failed") - endif (NOT exit_code EQUAL "0") - execute_process(COMMAND ${SIONLIB}/bin/sionconfig --mpi --libs --f90 - RESULT_VARIABLE exit_code - OUTPUT_VARIABLE SIONlib_Fortran_LIBS - ERROR_VARIABLE stderr - OUTPUT_STRIP_TRAILING_WHITESPACE - ERROR_STRIP_TRAILING_WHITESPACE) - if (NOT exit_code EQUAL "0") - message (FATAL_ERROR "Execution of '${SIONLIB}/bin/sionconfig --mpi --libs --f90' failed") - endif (NOT exit_code EQUAL "0") - set (CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} ${SIONlib_Fortran_FLAGS} ${SIONlib_Fortran_LIBS}") - ADD_DEFINITIONS(-DSION) - message (STATUS "Enable SIONlib support") -else (SIONLIB) - message (STATUS "Disable SIONlib support") -endif (SIONLIB) - #------------------------------------------------------------------------------ # Set netCDF flags for preprocessor, compiler and linker (if defined) # Legacy settings for old make build diff --git a/ccpp/data/GFS_typedefs.F90 b/ccpp/data/GFS_typedefs.F90 index a81c7fa55..3e10e5a8f 100644 --- a/ccpp/data/GFS_typedefs.F90 +++ b/ccpp/data/GFS_typedefs.F90 @@ -3038,16 +3038,16 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & 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. + integer :: rrtmgp_nBandsSW = -999 !< Number of RRTMGP SW bands. # *NOTE* + integer :: rrtmgp_nGptsSW = -999 !< Number of RRTMGP SW spectral points. # The RRTMGP spectral dimensions in the files + integer :: rrtmgp_nBandsLW = -999 !< Number of RRTMGP LW bands. # need to be provided via namelsit. + integer :: rrtmgp_nGptsLW = -999 !< Number of RRTMGP LW 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_nrghice = 3 !< 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. @@ -3770,40 +3770,47 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%swhtr = swhtr ! RRTMGP - Model%do_RRTMGP = do_RRTMGP - Model%rrtmgp_nrghice = rrtmgp_nrghice - Model%rrtmgp_nGauss_ang = rrtmgp_nGauss_ang - Model%do_GPsw_Glw = do_GPsw_Glw - Model%active_gases = active_gases - Model%ngases = nGases - Model%rrtmgp_root = rrtmgp_root - Model%lw_file_gas = lw_file_gas - Model%lw_file_clouds = lw_file_clouds - Model%rrtmgp_nBandsLW = rrtmgp_nBandsLW - Model%rrtmgp_nGptsLW = rrtmgp_nGptsLW - Model%sw_file_gas = sw_file_gas - Model%sw_file_clouds = sw_file_clouds - Model%rrtmgp_nBandsSW = rrtmgp_nBandsSW - Model%rrtmgp_nGptsSW = rrtmgp_nGptsSW + Model%do_RRTMGP = do_RRTMGP + Model%rrtmgp_nrghice = rrtmgp_nrghice + Model%rrtmgp_nGauss_ang = rrtmgp_nGauss_ang + Model%do_GPsw_Glw = do_GPsw_Glw + Model%active_gases = active_gases + Model%ngases = nGases + Model%rrtmgp_root = rrtmgp_root + Model%lw_file_gas = lw_file_gas + Model%lw_file_clouds = lw_file_clouds + Model%rrtmgp_nBandsLW = rrtmgp_nBandsLW + Model%rrtmgp_nGptsLW = rrtmgp_nGptsLW + Model%sw_file_gas = sw_file_gas + Model%sw_file_clouds = sw_file_clouds + Model%rrtmgp_nBandsSW = rrtmgp_nBandsSW + Model%rrtmgp_nGptsSW = rrtmgp_nGptsSW Model%doG_cldoptics = doG_cldoptics 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 - if (Model%doGP_cldoptics_PADE .and. Model%doGP_cldoptics_LUT) then - write(0,*) "Logic error, Both RRTMGP cloud-optics options cannot be selected. " - stop - end if + if (Model%do_RRTMGP) then + ! RRTMGP incompatible with levr /= levs + if (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 + if (Model%doGP_cldoptics_PADE .and. Model%doGP_cldoptics_LUT) then + write(0,*) "Logic error, Both RRTMGP cloud-optics options cannot be selected. " + stop + end if + if (Model%rrtmgp_nGptsSW .lt. 0 .or. Model%rrtmgp_nGptsLW .lt. 0 .or. & + Model%rrtmgp_nBandsSW .lt. 0 .or. Model%rrtmgp_nBandsLW .lt. 0) then + write(0,*) "Logic error, RRTMGP spectral dimensions (bands/gpts) need to be provided." + stop + endif + endif ! The CCPP versions of the RRTMG lw/sw schemes are configured ! such that lw and sw heating rate are output, i.e. they rely @@ -4951,7 +4958,6 @@ subroutine control_print(Model) print *, ' lwhtr : ', Model%lwhtr print *, ' swhtr : ', Model%swhtr if (Model%do_RRTMGP) then - print *, ' rrtmgp_nrghice : ', Model%rrtmgp_nrghice print *, ' rrtmgp_nrghice : ', Model%rrtmgp_nrghice print *, ' do_GPsw_Glw : ', Model%do_GPsw_Glw print *, ' active_gases : ', Model%active_gases diff --git a/ccpp/physics b/ccpp/physics index c86bb23b7..a91a5cf73 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit c86bb23b739c78d90ebc2fe6bef0243a62cffec6 +Subproject commit a91a5cf7308e08076a9ba5aed63b756fbe0e89bc From 4a7b37b4643d62b53c38993da8d8cc79d8d2cf78 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Tue, 27 Apr 2021 20:35:28 +0000 Subject: [PATCH 26/35] Updates to ccpp-physics from code review. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index a91a5cf73..e39824a87 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit a91a5cf7308e08076a9ba5aed63b756fbe0e89bc +Subproject commit e39824a871638aed7affe9fc881b87a63fa09c52 From 341f49fc66a2882fc056b89266a5c842ffbc7bce Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 28 Apr 2021 14:46:07 +0000 Subject: [PATCH 27/35] Renamed rrtmgp_aux.F90 to radiation_tools.F90 --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index e39824a87..64b6fae2a 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit e39824a871638aed7affe9fc881b87a63fa09c52 +Subproject commit 64b6fae2a7a918f6c7a88ced574d2cb0e776708a From 2506f1ab209fdb987d3e5b64afcc2f4e9c5f3be0 Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 28 Apr 2021 15:04:11 +0000 Subject: [PATCH 28/35] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 64b6fae2a..aa277396b 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 64b6fae2a7a918f6c7a88ced574d2cb0e776708a +Subproject commit aa277396ba7662a0f94c77d06290d77d0c9134a3 From fb7d62618e51b63be1a1eb22b357e0df7d368b29 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 28 Apr 2021 09:21:06 -0600 Subject: [PATCH 29/35] Fix tiny bug in ccpp/data/GFS_typedefs.meta: active attribute for [aux3d] --- ccpp/data/GFS_typedefs.meta | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/data/GFS_typedefs.meta b/ccpp/data/GFS_typedefs.meta index 478737b84..878aa1175 100644 --- a/ccpp/data/GFS_typedefs.meta +++ b/ccpp/data/GFS_typedefs.meta @@ -7423,7 +7423,7 @@ dimensions = (horizontal_loop_extent,vertical_dimension,number_of_3d_auxiliary_arrays) type = real kind = kind_phys - active = (number_of_2d_auxiliary_arrays > 0) + active = (number_of_3d_auxiliary_arrays > 0) ######################################################################## [ccpp-table-properties] From 788cb5d0c27f25f09cefb00ec92759d8b26f0258 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Wed, 28 Apr 2021 13:42:18 -0600 Subject: [PATCH 30/35] Update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index d158c5c1d..6a9de1715 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit d158c5c1d56d99c2859711827128f15ddff2b611 +Subproject commit 6a9de17151f695f1127d93a47e0b3d47db733000 From 13dcd05b01c2309a823899e233e393319d3f701c Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Wed, 28 Apr 2021 20:42:12 +0000 Subject: [PATCH 31/35] Reverted deprecated code in ccpp-physics. --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index aa277396b..f3ef95327 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit aa277396ba7662a0f94c77d06290d77d0c9134a3 +Subproject commit f3ef95327d5640535d72c5817ecd08555a4498dd From e0fbb6345307efd50b4ff7d5ef6fadacc0a828db Mon Sep 17 00:00:00 2001 From: Dustin Swales Date: Thu, 29 Apr 2021 17:12:09 +0000 Subject: [PATCH 32/35] Updated physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index f3ef95327..d22cb6d28 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit f3ef95327d5640535d72c5817ecd08555a4498dd +Subproject commit d22cb6d28d3bd60e08491e513ba5e483120f91c9 From 219dbe4b87bd90962bfbd973341eb245f2f37e8f Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 29 Apr 2021 16:04:24 -0600 Subject: [PATCH 33/35] Quick workaround to pass REPRO/Bitforbit flags correctly to CCPP --- ccpp/CMakeLists.txt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/ccpp/CMakeLists.txt b/ccpp/CMakeLists.txt index d4665b2f1..8225a39f3 100644 --- a/ccpp/CMakeLists.txt +++ b/ccpp/CMakeLists.txt @@ -30,6 +30,13 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/physics) # Generate Compiler flags for C/CXX/Fortran - set to match NEMSfv3gfs flags # for DEBUG, REPRO and PROD mode for all three compilers +# DH* 20210429 - quick workaround to get REPRO mode propagated +# correctly to CCPP - will be cleaned up in Dusan's next PR +if(REPRO) + set(CMAKE_BUILD_TYPE Bitforbit CACHE STRING "Choose the type of build." FORCE) +endif() +# *DH 20210429 + # Set basic compiler optimization levels, depending on build type if (${CMAKE_BUILD_TYPE} MATCHES "Debug") ADD_DEFINITIONS(-DDEBUG) From c0a7d88c807dc668f45f1835849f2681723c4e5b Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Thu, 29 Apr 2021 18:19:57 -0600 Subject: [PATCH 34/35] Update submodule pointer for ccpp-physics --- ccpp/physics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ccpp/physics b/ccpp/physics index 05bf214a6..1ed27c125 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 05bf214a6937a742d5971d88f2da6ba605b8580b +Subproject commit 1ed27c125a5113fbf15095175701d6850101dba9 From ffb952a4dab3bf50515c04397c766a8709851a92 Mon Sep 17 00:00:00 2001 From: Dom Heinzeller Date: Fri, 30 Apr 2021 14:11:26 -0600 Subject: [PATCH 35/35] Revert change to .gitmodules and update submodule pointer for ccpp-physics --- .gitmodules | 6 ++---- ccpp/physics | 2 +- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/.gitmodules b/.gitmodules index 47e4e5892..1f7526633 100644 --- a/.gitmodules +++ b/.gitmodules @@ -8,7 +8,5 @@ branch = master [submodule "ccpp/physics"] path = ccpp/physics - #url = https://github.com/NCAR/ccpp-physics - #branch = master - url = https://github.com/climbfuji/ccpp-physics - branch = capgen_fixes_assumed_sizes + url = https://github.com/NCAR/ccpp-physics + branch = master diff --git a/ccpp/physics b/ccpp/physics index 1ed27c125..6237270d1 160000 --- a/ccpp/physics +++ b/ccpp/physics @@ -1 +1 @@ -Subproject commit 1ed27c125a5113fbf15095175701d6850101dba9 +Subproject commit 6237270d1a8fe79b22cedd364d9e5429e141bbef