diff --git a/.gitmodules b/.gitmodules
index 8f621bf7c2..dcc3b7cd98 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -104,7 +104,7 @@
url = https://github.com/larson-group/clubb_release
fxrequired = AlwaysRequired
fxsparse = ../.clubb_sparse_checkout
- fxtag = clubb_4ncar_20240605_73d60f6_gpufixes_posinf
+ fxtag = clubb_4ncar_20260109_ddf5110
fxDONOTUSEurl = https://github.com/larson-group/clubb_release
[submodule "rtm"]
diff --git a/bld/build-namelist b/bld/build-namelist
index 175aef4298..ed87e4bea1 100755
--- a/bld/build-namelist
+++ b/bld/build-namelist
@@ -3503,6 +3503,7 @@ if ($clubb_sgs =~ /$TRUE/io) {
die "$ProgName - ERROR: clubb_history = .true. with multiple threads is not supported. \n";
}
+ add_default($nl, 'clubb_l_ascending_grid');
add_default($nl, 'clubb_do_icesuper');
add_default($nl, 'clubb_do_energyfix');
add_default($nl, 'clubb_cloudtop_cooling');
@@ -3594,9 +3595,13 @@ if ($clubb_sgs =~ /$TRUE/io) {
add_default($nl, 'clubb_detphase_lowtemp');
add_default($nl, 'clubb_do_energyfix');
add_default($nl, 'clubb_do_liqsupersat');
+ add_default($nl, 'clubb_grid_adapt_in_time_method');
+ add_default($nl, 'clubb_fill_holes_type');
+ add_default($nl, 'clubb_grid_remap_method');
add_default($nl, 'clubb_ipdf_call_placement');
add_default($nl, 'clubb_lambda0_stability_coef');
add_default($nl, 'clubb_lmin_coef');
+ add_default($nl, 'clubb_l_add_dycore_grid');
add_default($nl, 'clubb_l_brunt_vaisala_freq_moist');
add_default($nl, 'clubb_l_call_pdf_closure_twice');
add_default($nl, 'clubb_l_damp_wp2_using_em');
@@ -3618,6 +3623,8 @@ if ($clubb_sgs =~ /$TRUE/io) {
add_default($nl, 'clubb_l_mono_flux_lim_vm');
add_default($nl, 'clubb_l_partial_upwind_wp3');
add_default($nl, 'clubb_l_predict_upwp_vpwp');
+ add_default($nl, 'clubb_l_ho_nontrad_coriolis');
+ add_default($nl, 'clubb_l_ho_trad_coriolis');
add_default($nl, 'clubb_l_rcm_supersat_adj');
add_default($nl, 'clubb_l_smooth_Heaviside_tau_wpxp');
add_default($nl, 'clubb_l_stability_correct_tau_zm');
diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml
index c75c36c473..17202b3739 100644
--- a/bld/namelist_files/namelist_defaults_cam.xml
+++ b/bld/namelist_files/namelist_defaults_cam.xml
@@ -2120,6 +2120,7 @@
300.0D0
1.0D0
.false.
+ .false.
@@ -2180,9 +2181,13 @@
0.280
0.32
0.3
+ 0
+ 2
+ 1
2
0.04
0.1
+ .false.
.false.
.false.
.true.
@@ -2215,6 +2220,8 @@
.false.
.false.
.true.
+ .false.
+ .false.
.false.
.false.
.false.
diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml
index efb62cac72..b6ea1854fc 100644
--- a/bld/namelist_files/namelist_definition.xml
+++ b/bld/namelist_files/namelist_definition.xml
@@ -3672,6 +3672,13 @@ Switch for CLUBB_ADV parameter that turns on advection of CLUBB pdf moments by
the dynamics core. Very experimental.
+
+Causes advance_clubb_core to run in ascending mode, where the surface is at k=1, which is opposite
+of the descending cam grid. This is mainly a testing/debugging option - it requires an expensive
+data flipping step and should not change answers significantly.
+
+
@@ -3940,6 +3947,32 @@ Gaussian PDF, and also decreases the difference between the means of w from
each Gaussian.
+
+Specifier for method to construct a grid density function to adapt grid to.
+Valid values: 0 (no grid adaptation), 1 (use Lscale and wp2)
+
+
+
+Selects which algorithm the fill_holes routine uses to correct
+below threshold values in field solutions.
+0: off - Skip the mass conservative hole filling step, rely on blunt clipping
+1: global - Fast but minimally local, most methods use this as a fallback step
+2: sliding_window - Expensive but highly local when possible, falls back to global fill if needed
+3: widening_windows - Slightly parallelizable, local when possible, falls back to global if needed
+4: smart_window - Uses hueristics to determine ranges to fill, fast and highly local when possible, falls back to global if needed
+5: smart_window_smooth - Same as smart_window, but with experimental smoothing features that slightly increases cost, NO GLOBAL FALLBACK
+6: parallel_fill - Highly local when possible, completely parallelizable but computationally wasteful, falls back to global if needed
+See CLUBB_core/model_flags.F90 or CLUBB_core/fill_holes.F90 for more detail.
+
+
+
+Specifier for method to remap values from one grid to another.
+Valid values: 1 (ullrich remapping)
+
+
Selected option for the two-component normal (double Gaussian) PDF type to use for the w, rt,
@@ -3966,6 +3999,11 @@ scale (Lscale) in a grid-spacing dependent formula. Increasing the value of
clubb_lmin_coef increases the minimum allowable value for length scale.
+
+Flag to remap values from the dycore grid.
+
+
Flag to uses an alternate equation to calculate the Brunt-Vaisala frequency.
@@ -4147,6 +4185,18 @@ horizontal winds um and vm. When this flag is turned off, upwp and vpwp are
calculated by down-gradient diffusion.
+
+Flag to implement the nontraditional Coriolis terms in the
+prognostic equations of w'w', u'w', and u'u.
+
+
+
+Flag to implement the traditional Coriolis terms in the
+prognostic equations of v'w' and u'w'.
+
+
used in adj_low_res_nu. If .true., avg_deltaz = deltaz
diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90
index d1cfa8efeb..dbb2340f67 100644
--- a/src/physics/cam/clubb_intr.F90
+++ b/src/physics/cam/clubb_intr.F90
@@ -20,7 +20,7 @@ module clubb_intr
use shr_kind_mod, only: r8=>shr_kind_r8
use ppgrid, only: pver, pverp, pcols, begchunk, endchunk
use phys_control, only: phys_getopts
- use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o, karman, pi, rair
+ use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o, karman, pi, rair, omega
use air_composition, only: rairv, cpairv
use cam_history_support, only: max_fieldname_len
@@ -29,103 +29,87 @@ module clubb_intr
use atmos_phys_pbl_utils,only: calc_friction_velocity, calc_kinematic_heat_flux, calc_ideal_gas_rrho, &
calc_kinematic_water_vapor_flux, calc_kinematic_buoyancy_flux, calc_obukhov_length
use ref_pres, only: top_lev => trop_cloud_top_lev
+ use scamMOD, only: single_column, scm_clubb_iop_name, scm_cambfb_mode
#ifdef CLUBB_SGS
- use clubb_api_module, only: pdf_parameter, implicit_coefs_terms
- use clubb_api_module, only: clubb_config_flags_type, grid, stats, &
+ use clubb_api_module, only: pdf_parameter, implicit_coefs_terms, &
+ clubb_config_flags_type, grid, stats, &
nu_vertical_res_dep, stats_metadata_type, &
- hm_metadata_type, sclr_idx_type
+ hm_metadata_type, sclr_idx_type, &
+ nparams
- use clubb_api_module, only: nparams
use clubb_mf, only: do_clubb_mf, do_clubb_mf_diag
use cloud_fraction, only: dp1, dp2
#endif
- use scamMOD, only: single_column,scm_clubb_iop_name,scm_cambfb_mode
implicit none
#ifdef CLUBB_SGS
- ! Variables that contains all the statistics
- type (stats), target, save :: stats_zt(pcols), & ! stats_zt grid
- stats_zm(pcols), & ! stats_zm grid
- stats_rad_zt(pcols), & ! stats_rad_zt grid
- stats_rad_zm(pcols), & ! stats_rad_zm grid
- stats_sfc(pcols) ! stats_sfc
- type (hm_metadata_type) :: &
- hm_metadata
-
- type (stats_metadata_type) :: &
- stats_metadata
- type (sclr_idx_type) :: &
- sclr_idx
-
- integer :: &
- nzm_clubb, & !Number of vertical levels used by CLUBB momentum variables
- nzt_clubb !Number of vertical levels used by CLUBB thermodynamic variables
#endif
private
- save
- ! ----------------- !
- ! Public interfaces !
- ! ----------------- !
+ save
+ ! Subroutines to make public
public :: clubb_ini_cam, clubb_register_cam, clubb_tend_cam, clubb_emissions_cam, &
-#ifdef CLUBB_SGS
- ! This utilizes CLUBB specific variables in its interface
- stats_init_clubb, &
- stats_metadata, &
- stats_zt, stats_zm, stats_sfc, &
- stats_rad_zt, stats_rad_zm, &
- stats_end_timestep_clubb, &
-#endif
- clubb_readnl, &
- clubb_init_cnst, &
- clubb_implements_cnst
+ clubb_readnl, clubb_init_cnst, clubb_implements_cnst
#ifdef CLUBB_SGS
- ! Both of these utilize CLUBB specific variables in their interface
- private :: stats_zero, stats_avg
-#endif
+
+ ! NOTE: the only reason for anything in this section being set to public is for use with SILHS
- logical, public :: do_cldcool
- logical :: clubb_do_icesuper
+ public :: stats_init_clubb, stats_end_timestep_clubb
-#ifdef CLUBB_SGS
- type(clubb_config_flags_type), public :: clubb_config_flags
- real(r8), dimension(nparams), public :: clubb_params_single_col ! Adjustable CLUBB parameters (C1, C2 ...)
-#endif
+ type(clubb_config_flags_type), public :: &
+ clubb_config_flags
+
+ real(r8), dimension(1,nparams), public :: &
+ clubb_params_single_col ! Adjustable CLUBB parameters (C1, C2 ...)
+
+ ! Variables that contains all the statistics
+ type (stats), public :: &
+ stats_zt(pcols), & ! stats_zt grid
+ stats_zm(pcols), & ! stats_zm grid
+ stats_rad_zt(pcols), & ! stats_rad_zt grid
+ stats_rad_zm(pcols), & ! stats_rad_zm grid
+ stats_sfc(pcols) ! stats_sfc
+
+ type (hm_metadata_type), public :: &
+ hm_metadata
+
+ type (stats_metadata_type), public :: &
+ stats_metadata
+
+ type (sclr_idx_type), public :: &
+ sclr_idx
+
+ integer, public :: &
+ nzm_clubb, & ! Number of vertical levels used by CLUBB momentum variables
+ nzt_clubb ! Number of vertical levels used by CLUBB thermodynamic variables
! These are zero by default, but will be set by SILHS before they are used by subcolumns
- integer :: &
- hydromet_dim = 0, &
- pdf_dim = 0
+ integer, public :: &
+ hydromet_dim = 0, &
+ pdf_dim = 0
+ type(pdf_parameter), allocatable, public :: &
+ pdf_params_chnk(:) ! PDF parameters (thermo. levs.) [units vary]
- ! ------------------------ !
- ! Sometimes private data !
- ! ------------------------ !
-#ifdef CLUBB_SGS
-#ifdef SILHS
- ! If SILHS is in use, it will initialize these
- public :: &
- hydromet_dim, &
- pdf_dim, &
- hm_metadata
-#else
- ! If SILHS is not in use, there is no need for them to be public
- private :: &
- hydromet_dim, &
- pdf_dim, &
- hm_metadata
-#endif
+ type(pdf_parameter), allocatable :: &
+ pdf_params_zm_chnk(:) ! PDF parameters on momentum levs. [units vary]
+
+ type(implicit_coefs_terms), allocatable :: &
+ pdf_implicit_coefs_terms_chnk(:) ! PDF impl. coefs. & expl. terms [units vary]
+
+ real(r8), public :: &
+ ztodt ! model timestep
#endif
- ! ------------ !
- ! Private data !
- ! ------------ !
+ ! ------------------------------------------------------------ !
+ ! CONSTANTS !
+ ! ------------------------------------------------------------ !
integer, parameter :: &
grid_type = 3, & ! The 2 option specifies stretched thermodynamic levels
@@ -137,9 +121,12 @@ module clubb_intr
sclr_tol = 1.e-8_r8 ! Total water in kg/kg
real(r8), parameter :: &
- theta0 = 300._r8, & ! Reference temperature [K]
- ts_nudge = 86400._r8, & ! Time scale for u/v nudging (not used) [s]
- p0_clubb = 100000._r8
+ rtm_min = epsilon( rtm_min ), & ! Value below which rtm will be nudged [kg/kg]
+ rtm_nudge_max_altitude = 10000._r8, & ! Highest altitude at which to nudge rtm [m]
+ theta0 = 300._r8, & ! Reference temperature [K]
+ ts_nudge = 86400._r8, & ! Time scale for u/v nudging (not used) [s]
+ p0_clubb = 100000._r8, &
+ inv_p0_clubb = 1._r8 / 100000._r8
real(r8), parameter :: &
wp3_const = 1._r8 ! Constant to add to wp3 when moments are advected
@@ -154,11 +141,68 @@ module clubb_intr
rtpthlp_const = 0.01_r8 ! Constant to add to rtpthlp when moments are advected
real(r8), parameter :: unset_r8 = huge(1.0_r8)
+
integer, parameter :: unset_i = huge(1)
! Commonly used temperature for the melting temp of ice crystals [K]
real(r8), parameter :: meltpt_temp = 268.15_r8
+ logical, parameter, private :: &
+ l_implemented = .true. ! Implemented in a host model (always true)
+
+ ! ----------------------------------------------------------------- !
+ ! Things shared between subroutines: generally because they are !
+ ! set by an initialization routine, then used by clubb_tend_cam !
+ ! ----------------------------------------------------------------- !
+
+ logical :: do_cldcool
+ logical :: clubb_do_icesuper
+
+ logical :: &
+ clubb_l_intr_sfc_flux_smooth = .false. ! Add a locally calculated roughness to upwp and vpwp sfc fluxes
+
+ logical :: &
+ clubb_l_ascending_grid = .false. ! Run clubb in ascending mode, which is opposite of the
+ ! cam grid the rest of this code uses, thus it requires
+ ! an expensive array flipping step before calling advance_clubb_core.
+ ! This is mainly for testing, it should not significantly change answers
+
+ logical :: lq(pcnst)
+ logical :: do_rainturb
+ logical :: clubb_do_adv
+ logical :: clubb_do_liqsupersat = .false.
+ logical :: clubb_do_energyfix = .true.
+ integer :: edsclr_dim ! Number of scalars to transport in CLUBB
+
+ integer :: &
+ ixthlp2 = 0, &
+ ixwpthlp = 0, &
+ ixwprtp = 0, &
+ ixwp2 = 0, &
+ ixwp3 = 0, &
+ ixrtpthlp = 0, &
+ ixrtp2 = 0, &
+ ixup2 = 0, &
+ ixvp2 = 0
+
+ ! Output arrays for CLUBB statistics
+ real(r8), allocatable, dimension(:,:,:) :: out_zt, out_zm, out_radzt, out_radzm, out_sfc
+
+ ! Outputs from phys_getopts
+ character(len=16) :: eddy_scheme ! Default set in phys_control.F90
+ character(len=16) :: deep_scheme ! Default set in phys_control.F90
+ logical :: history_budget
+ integer :: history_budget_histfile_num
+ logical :: do_hb_above_clubb = .false.
+
+ character(len=16) :: subcol_scheme
+
+ ! For clubb_do_adv
+ integer, parameter :: ncnst=9
+ character(len=8) :: cnst_names(ncnst)
+ logical :: do_cnst=.false.
+
+
real(r8) :: clubb_timestep = unset_r8 ! Default CLUBB timestep, unless overwriten by namelist
real(r8) :: clubb_rnevap_effic = unset_r8
@@ -219,157 +263,152 @@ module clubb_intr
real(r8) :: clubb_z_displace = unset_r8
integer :: &
- clubb_iiPDF_type, & ! Selected option for the two-component normal
- ! (double Gaussian) PDF type to use for the w, rt,
- ! and theta-l (or w, chi, and eta) portion of
- ! CLUBB's multivariate, two-component PDF.
- clubb_ipdf_call_placement = unset_i, & ! Selected option for the placement of the call to
- ! CLUBB's PDF.
- clubb_penta_solve_method = unset_i, & ! Specifier for method to solve the penta-diagonal system
- clubb_tridiag_solve_method = unset_i,& ! Specifier for method to solve tri-diagonal systems
- clubb_saturation_equation = unset_i ! Specifier for which saturation formula to use
-
+ clubb_iiPDF_type, & ! Selected option for the two-component normal
+ ! (double Gaussian) PDF type to use for the w, rt,
+ ! and theta-l (or w, chi, and eta) portion of
+ ! CLUBB's multivariate, two-component PDF.
+ clubb_ipdf_call_placement = unset_i, & ! Selected option for the placement of the call to
+ ! CLUBB's PDF.
+ clubb_penta_solve_method = unset_i, & ! Specifier for method to solve the penta-diagonal system
+ clubb_tridiag_solve_method = unset_i, & ! Specifier for method to solve tri-diagonal systems
+ clubb_saturation_equation = unset_i, & ! Specifier for which saturation formula to use
+ clubb_grid_remap_method = unset_i, & ! Specifier for which method should be used to
+ ! map values from one grid to another
+ ! (starts at 1, so 0 is an invalid option for this flag)
+ clubb_grid_adapt_in_time_method = unset_i, & ! Specifier for how the grid density method should
+ ! be constructed if the grid should be adapted over time
+ ! (set to 0 for no adaptation)
+ clubb_fill_holes_type = unset_i ! Option for which type of hole filler to use in the
+ ! fill_holes_vertical procedure
- logical :: &
- clubb_l_use_precip_frac, & ! Flag to use precipitation fraction in KK microphysics. The
- ! precipitation fraction is automatically set to 1 when this
- ! flag is turned off.
- clubb_l_predict_upwp_vpwp, & ! Flag to predict and along with and
- ! alongside the advancement of