From 58d1fe1763ca9db5c8c1538169b88fe8765277a5 Mon Sep 17 00:00:00 2001 From: Grant Firl Date: Thu, 30 Jan 2025 16:15:25 -0500 Subject: [PATCH] Add rest of scalars/control vars for PUMAS (#555) * saving work on adding PUMAS control variables * add the rest of the control/scalar variables for PUMAS * update .gitmodules to point to PUMAS branch of ccpp/physics * save PUMAS new variable work * update ccpp/physics --- .gitmodules | 2 +- scm/src/CCPP_typedefs.F90 | 42 ++++++++++++++++ scm/src/CCPP_typedefs.meta | 98 ++++++++++++++++++++++++++++++++++++++ scm/src/GFS_typedefs.F90 | 25 ++++++++++ scm/src/GFS_typedefs.meta | 83 +++++++++++++++++++++++++++++++- 5 files changed, 248 insertions(+), 2 deletions(-) diff --git a/.gitmodules b/.gitmodules index dc0798c32..257a2a360 100644 --- a/.gitmodules +++ b/.gitmodules @@ -5,7 +5,7 @@ [submodule "ccpp-physics"] path = ccpp/physics url = https://github.com/NCAR/ccpp-physics - branch = main + branch = feature/pumas_microphysics [submodule "CMakeModules"] path = CMakeModules url = https://github.com/noaa-emc/CMakeModules diff --git a/scm/src/CCPP_typedefs.F90 b/scm/src/CCPP_typedefs.F90 index 4cfaeacd7..8f6cf8c90 100644 --- a/scm/src/CCPP_typedefs.F90 +++ b/scm/src/CCPP_typedefs.F90 @@ -201,6 +201,20 @@ module CCPP_typedefs integer :: lmp !< integer, pointer :: mbota(:,:) => null() !< logical :: mg3_as_mg2 !< + real (kind=kind_phys), pointer :: micro_accre_enhan => null() + real (kind=kind_phys), pointer :: micro_numice_tend => null() + real (kind=kind_phys), pointer :: micro_numliq_tend => null() + real (kind=kind_phys), pointer :: micro_pmid_in => null() + real (kind=kind_phys), pointer :: micro_pint => null() + real (kind=kind_phys), pointer :: micro_pdel => null() + real (kind=kind_phys), pointer :: micro_airT => null() + real (kind=kind_phys), pointer :: micro_refl10cm => null() + real (kind=kind_phys), pointer :: micro_arefl => null() + real (kind=kind_phys), pointer :: micro_refl => null() + real (kind=kind_phys), pointer :: micro_acsrfl => null() + real (kind=kind_phys), pointer :: micro_csrfl => null() + real (kind=kind_phys), pointer :: micro_reflz10cm => null() + real (kind=kind_phys), pointer :: micro_areflz => null() integer, pointer :: mtopa(:,:) => null() !< integer :: nbdlw !< integer :: nbdsw !< @@ -589,6 +603,20 @@ subroutine gfs_interstitial_create (Interstitial, IM, Model) allocate (Interstitial%kpbl (IM)) allocate (Interstitial%ktop (IM)) allocate (Interstitial%mbota (IM,3)) + allocate (Interstitial%micro_accre_enhan(IM,Model%micro_nlev)) + allocate (Interstitial%micro_numice_tend(IM,Model%micro_nlev)) + allocate (Interstitial%micro_numliq_tend(IM,Model%micro_nlev)) + allocate (Interstitial%micro_pmid_in(IM,Model%micro_nlev)) + allocate (Interstitial%micro_pint(IM,Model%micro_nlev)) + allocate (Interstitial%micro_pdel(IM,Model%micro_nlev)) + allocate (Interstitial%micro_airT(IM,Model%micro_nlev)) + allocate (Interstitial%micro_refl10cm(IM,Model%micro_nlev)) + allocate (Interstitial%micro_arefl(IM,Model%micro_nlev)) + allocate (Interstitial%micro_refl(IM,Model%micro_nlev)) + allocate (Interstitial%micro_acsrfl(IM,Model%micro_nlev)) + allocate (Interstitial%micro_csrfl(IM,Model%micro_nlev)) + allocate (Interstitial%micro_reflz10cm(IM,Model%micro_nlev)) + allocate (Interstitial%micro_areflz(IM,Model%micro_nlev)) allocate (Interstitial%mtopa (IM,3)) allocate (Interstitial%oa4 (IM,4)) allocate (Interstitial%oc (IM)) @@ -1060,6 +1088,20 @@ subroutine gfs_interstitial_rad_reset (Interstitial, Model) Interstitial%kd = 0 Interstitial%kt = 0 Interstitial%mbota = 0 + Interstitial%micro_accre_enhan = clear_val + Interstitial%micro_numice_tend = clear_val + Interstitial%micro_numliq_tend = clear_val + Interstitial%micro_pmid_in = clear_val + Interstitial%micro_pint = clear_val + Interstitial%micro_pdel = clear_val + Interstitial%micro_airT = clear_val + Interstitial%micro_refl10cm = clear_val + Interstitial%micro_arefl = clear_val + Interstitial%micro_refl = clear_val + Interstitial%micro_acsrfl = clear_val + Interstitial%micro_csrfl = clear_val + Interstitial%micro_reflz10cm = clear_val + Interstitial%micro_areflz = clear_val Interstitial%mtopa = 0 Interstitial%nday = 0 Interstitial%olyr = clear_val diff --git a/scm/src/CCPP_typedefs.meta b/scm/src/CCPP_typedefs.meta index adffe90c2..3217fbea7 100644 --- a/scm/src/CCPP_typedefs.meta +++ b/scm/src/CCPP_typedefs.meta @@ -1364,6 +1364,104 @@ units = flag dimensions = () type = logical +[micro_accre_enhan] + standard_name = microphysics_accretion_enhancement_factor + long_name = microphysics accretion enhancement factor + units = 1 + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_numice_tend] + standard_name = mass_number_concentration_of_cloud_ice_wrt_moist_air_and_condensed_water + long_name = mass number concentration of cloud ice wrt moist air and condensed water + units = kg-1 s-1 + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_numliq_tend] + standard_name = mass_number_concentration_of_cloud_liquid_water_wrt_moist_air_and_condensed_water + long_name = mass number concentration of cloud liquid water wrt moist air and condensed water + units = kg-1 s-1 + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_pmid] + standard_name = microphysics_air_pressure + long_name = microphysics air pressure + units = Pa + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_pint] + standard_name = microphysics_air_pressure_at_interfaces + long_name = microphysics air pressure at interfaces + units = Pa + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_pdel] + standard_name = microphysics_air_pressure_thickness + long_name = microphysics air pressure thickness + units = Pa + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_airT] + standard_name = microphysics_air_temperature + long_name = microphysics air temperature of new state + units = K + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_refl10cm] + standard_name = microphysics_analytic_radar_reflectivity_at_10_cm_wavelength + long_name = microphysics analytic radar reflectivity at 10 cm wavelength + units = dBZ + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_arefl] + standard_name = microphysics_analytic_radar_reflectivity_at_94_GHz + long_name = microphysics analytic radar reflectivity at 94 GHz + units = dBZ + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_refl] + standard_name = microphysics_analytic_radar_reflectivity_at_94_GHz_in_precipitating_fraction_of_gridcell + long_name = microphysics analytic radar reflectivity at 94 GHz in precipitating fraction of gridcell + units = dBZ + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_acsrfl] + standard_name = microphysics_analytic_radar_reflectivity_at_94_GHz_with_cloudsat_thresholds + long_name = microphysics analytic radar reflectivity at 94 GHz with CloudSat thresholds + units = dBZ + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_csrfl] + standard_name = microphysics_analytic_radar_reflectivity_at_94_GHz_with_cloudsat_thresholds_in_precipitating_fraction_of_gridcell + long_name = microphysics analytic radar reflectivity at 94 GHz with CloudSat thresholds in precipitating fraction of gridcell + units = dBZ + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_reflz10cm] + standard_name = microphysics_analytic_radar_reflectivity_z_factor_at_10_cm_wavelength + long_name = microphysics analytic radar reflectivity z factor at 10 cm wavelength + units = mm6 m-3 + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys +[micro_areflz] + standard_name = microphysics_analytic_radar_reflectivity_z_factor_at_94_GHz + long_name = microphysics analytic radar reflectivity z factor at 94 GHz + units = mm6 m-3 + dimensions = (microphysics_horizontal_loop_extent, microphysics_vertical_layer_dimension) + type = real + kind = kind_phys [mtopa] standard_name = model_layer_number_at_cloud_top long_name = vertical indices for low, middle and high cloud tops diff --git a/scm/src/GFS_typedefs.F90 b/scm/src/GFS_typedefs.F90 index f3cc69371..0742eb4ed 100644 --- a/scm/src/GFS_typedefs.F90 +++ b/scm/src/GFS_typedefs.F90 @@ -739,6 +739,8 @@ module GFS_typedefs real(kind=kind_phys), pointer :: bk(:) !< from surface (k=1) to TOA (k=levs) integer :: levsp1 !< number of vertical levels plus one integer :: levsm1 !< number of vertical levels minus one + integer :: micro_nlev !< vertical layer dimension used by microphysics + integer :: micro_nlevp1 !< vertical interface dimension used by microphysics integer :: cnx !< number of points in the i-dir for this cubed-sphere face integer :: cny !< number of points in the j-dir for this cubed-sphere face integer :: lonr !< number of global points in x-dir (i) along the equator @@ -747,6 +749,7 @@ module GFS_typedefs integer :: nblks !< for explicit data blocking: number of blocks integer, pointer :: blksz(:) !< for explicit data blocking: block sizes of all blocks integer :: ncols !< total number of columns for all blocks + integer :: ix_micro !< horizontal loop extent used in microphysics ! integer :: nchunks !< number of chunks of an array that are used in the CCPP run phase integer, pointer :: chunk_begin(:) !< first indices of chunks of an array for the CCPP run phase @@ -786,6 +789,7 @@ module GFS_typedefs !--- calendars and time parameters and activation triggers real(kind=kind_phys) :: dtp !< physics timestep in seconds real(kind=kind_phys) :: dtf !< dynamics timestep in seconds + real(kind=kind_phys) :: dtm !< microphysics timestep in seconds integer :: nscyc !< trigger for surface data cycling integer :: nszero !< trigger for zeroing diagnostic buckets integer :: idat(1:8) !< initialization date and time @@ -1663,6 +1667,15 @@ module GFS_typedefs logical :: micro_mg_evap_scl_ifs !< if True Apply 0.3 scaling factor to evaporation of precipitation for PUMAS microphysics logical :: micro_mg_icenuc_use_meyers !< use temperature dependent ice nucleation from Meyers 1992 for PUMAS microphysics logical :: micro_mg_evap_rhthrsh_ifs !< Do not evaporate precipitation until RH below 90% as done in the for PUMAS microphysics + real(kind=kind_phys) :: micro_mg_homog_size !< radius of drops homogeneously frozen in PUMAS microphysics + real(kind=kind_phys) :: micro_mg_max_nicons !< maximum allowed ice number concentration for PUMAS microphysics + real(kind=kind_phys) :: micro_mg_nrnst !< rain concentration constant for PUMAS microphysics + real(kind=kind_phys) :: micro_mg_nsnst !< snow concentration constant for PUMAS microphysics + real(kind=kind_phys) :: micro_mg_iaccr_factor !< scaling factor for ice accretion in PUMAS microphysics + real(kind=kind_phys) :: micro_mg_vtrmi_factor !< scaling factor for cloud ice fall speed in PUMAS microphysics + real(kind=kind_phys) :: micro_mg_effi_factor !< scaling factor for ice effective radition used by radiation + real(kind=kind_phys) :: micro_mg_vtrms_factor !< scaling factor for snow fall speed in PUMAS microphysics + !--- CCPP suite simulator logical :: do_ccpp_suite_sim ! @@ -4451,6 +4464,8 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%bk = bk Model%levsp1 = Model%levs + 1 Model%levsm1 = Model%levs - 1 + Model%micro_nlev = Model%levs + Model%micro_nlevp1 = Model%levs + 1 Model%cnx = cnx Model%cny = cny Model%lonr = gnx ! number longitudinal points @@ -4459,6 +4474,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & allocate(Model%blksz(1:Model%nblks)) Model%blksz = blksz Model%ncols = sum(Model%blksz) + Model%ix_micro = 1 !!!!!!!! only for SCM for hackathon ! DH* Model%nchunks = size(blksz) allocate(Model%chunk_begin(Model%nchunks)) @@ -4544,6 +4560,7 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & !--- calendars and time parameters and activation triggers Model%dtp = dt_phys Model%dtf = dt_dycore + Model%dtm = Model%dtp Model%nscyc = nint(Model%fhcyc*con_hr/Model%dtp) Model%nszero = nint(Model%fhzero*con_hr/Model%dtp) Model%idat(1:8) = idat(1:8) @@ -5779,6 +5796,14 @@ subroutine control_initialize (Model, nlunit, fn_nml, me, master, & Model%micro_mg_evap_scl_ifs = .false. !!!!!!! Model%micro_mg_icenuc_use_meyers = .false. !!!!!!! Model%micro_mg_evap_rhthrsh_ifs = .false. !!!!!!! + Model%micro_mg_homog_size = 25.0E-6_kind_phys + Model%micro_mg_max_nicons = 1.0E8_kind_phys + Model%micro_mg_nrnst = 1.0_kind_phys !!!!!!! + Model%micro_mg_nsnst = 1.0_kind_phys !!!!!!! + Model%micro_mg_iaccr_factor = 1.0_kind_phys + Model%micro_mg_vtrmi_factor = 1.0_kind_phys + Model%micro_mg_effi_factor = 1.0_kind_phys + Model%micro_mg_vtrms_factor = 1.0_kind_phys !--- quantities to be used to derive phy_f*d totals Model%nshoc_2d = nshoc_2d diff --git a/scm/src/GFS_typedefs.meta b/scm/src/GFS_typedefs.meta index d2edd7156..67f5d21a9 100644 --- a/scm/src/GFS_typedefs.meta +++ b/scm/src/GFS_typedefs.meta @@ -3417,7 +3417,7 @@ [logunit] standard_name = iounit_of_log long_name = fortran unit number for logfile - units = none + units = 1 dimensions = () type = integer [ldiag3d] @@ -3540,6 +3540,18 @@ units = count dimensions = () type = integer +[micro_nlev] + standard_name = microphysics_vertical_layer_dimension + long_name = vertical layer dimension used by microphysics + units = count + dimensions = () + type = integer +[micro_nlevp1] + standard_name = microphysics_vertical_interface_dimension + long_name = vertical interface dimension used by microphysics + units = count + dimensions = () + type = integer [lonr] standard_name = number_of_equatorial_longitude_points long_name = number of global points in x-dir (i) along the equator @@ -3606,6 +3618,12 @@ units = index dimensions = () type = integer +[ix_micro] + standard_name = microphysics_horizontal_loop_extent + long_name = horizontal loop extent used in microphysics + units = count + dimensions = () + type = integer [tile_num] standard_name = index_of_cubed_sphere_tile long_name = tile number @@ -3741,6 +3759,13 @@ dimensions = () type = real kind = kind_phys +[dtm] + standard_name = timestep_for_microphysics + long_name = microphysics time step + units = s + dimensions = () + type = real + kind = kind_phys [idat] standard_name = date_and_time_at_model_initialization_in_iso_order long_name = initialization date and time @@ -7263,6 +7288,62 @@ units = flag dimensions = () type = logical +[micro_mg_homog_size] + standard_name = homogeneous_freezing_radius + long_name = radius of drops homogeneously frozen in MG microphysics + units = m + dimensions = () + type = real + kind = kind_phys +[micro_mg_max_nicons] + standard_name = maximum_ice_number_concentration + long_name = maximum allowed ice number concentration for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys +[micro_mg_nrnst] + standard_name = prescribed_rain_number_concentration + long_name = rain concentration constant for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys +[micro_mg_nsnst_in] + standard_name = prescribed_snow_number_concentration + long_name = snow concentration constant for MG microphysics + units = m-3 + dimensions = () + type = real + kind = kind_phys +[micro_mg_iaccr_factor] + standard_name = scaling_factor_for_ice_accretion + long_name = scaling factor for ice accretion in MG microphysics + units = 1 + dimensions = () + type = real + kind = kind_phys +[micro_mg_vtrmi_factor] + standard_name = scaling_factor_for_ice_fall_speed + long_name = scaling factor for cloud ice fall speed in MG microphysics + units = 1 + dimensions = () + type = real + kind = kind_phys +[micro_mg_effi_factor] + standard_name = scaling_factor_for_ice_in_radiation + long_name = scaling factor for ice effective radition used by radiation + units = 1 + dimensions = () + type = real + kind = kind_phys +[micro_mg_vtrms_factor] + standard_name = scaling_factor_for_snow_fall_speed + long_name = scaling factor for snow fall speed in MG microphysics + units = 1 + dimensions = () + type = real + kind = kind_phys [do_ccpp_suite_sim] standard_name = flag_for_CCPP_suite_simulator long_name = flag for ccpp suite simulator