diff --git a/.gitmodules b/.gitmodules
index 2c43f24fb1..7702b5918c 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 "ext_co2_cooling"]
diff --git a/bld/build-namelist b/bld/build-namelist
index f6a87f4047..c1045858e6 100755
--- a/bld/build-namelist
+++ b/bld/build-namelist
@@ -3525,6 +3525,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');
@@ -3616,9 +3617,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');
@@ -3640,6 +3645,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 bc57a5e033..894d3c5167 100644
--- a/bld/namelist_files/namelist_defaults_cam.xml
+++ b/bld/namelist_files/namelist_defaults_cam.xml
@@ -2166,6 +2166,7 @@
300.0D0
1.0D0
.false.
+ .false.
@@ -2227,9 +2228,13 @@
0.280
0.32
0.3
+ 0
+ 2
+ 1
2
0.04
0.1
+ .false.
.false.
.false.
.true.
@@ -2262,6 +2267,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 3aefcd0ddc..d8e0e9c390 100644
--- a/bld/namelist_files/namelist_definition.xml
+++ b/bld/namelist_files/namelist_definition.xml
@@ -3696,6 +3696,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.
+
+
@@ -3964,6 +3971,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,
@@ -3990,6 +4023,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.
@@ -4171,6 +4209,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/doc/ChangeLog b/doc/ChangeLog
index 4f942aa1ad..e012f7f77d 100644
--- a/doc/ChangeLog
+++ b/doc/ChangeLog
@@ -1,4 +1,149 @@
+===============================================================
+
+Tag name: cam6_4_166
+Originator(s): huebleruwm, adamrher, cacraigucar
+Date: April 21, 2026
+One-line Summary: CLUBB update and clubb_intr improvements
+Github PR URL: https://github.com/ESCOMP/CAM/pull/1441
+
+Purpose of changes (include the issue number and title text for each relevant GitHub issue):
+ - update CLUBB externals to use CAM vertical indexing: https://github.com/ESCOMP/CAM/issues/1411
+ - refactor CAM interface to CLUBB to use CAM vertical indexing
+ - Fix surface pressure and top_lev bugs
+
+Describe any changes made to build system: N/A
+
+Describe any changes made to the namelist:
+ - Namelists added to accommodate new CLUBB external
+
+List any changes to the defaults for the boundary datasets: N/A
+
+Describe any substantial timing or memory changes:
+ - slight perfromance improvement from no longer copying & flipping arrays
+
+Code reviewed by: adamrher, cacraigucar
+
+List all files eliminated: N/A
+
+List all files added and what they do: N/A
+
+List all existing files that have been modified, and describe the changes:
+M .gitmodules
+M src/physics/clubb
+ - update CLUBB library external
+
+M bld/build-namelist
+M bld/namelist_files/namelist_defaults_cam.xml
+M bld/namelist_files/namelist_definition.xml
+ - New namelists for updated CLUBB external (see above)
+
+M src/physics/cam/clubb_intr.F90
+M src/physics/cam/clubb_mf.F90
+M src/physics/cam/microp_aero.F90
+M src/physics/cam/subcol_SILHS.F90
+ - Changes for CLUBB as described above
+
+If there were any failures reported from running test_driver.sh on any test
+platform, and checkin with these failures has been OK'd by the gatekeeper,
+then copy the lines from the td.*.status files for the failed tests to the
+appropriate machine below. All failed tests must be justified.
+All CLUBB runs have namelist differences
+
+derecho/intel/aux_cam:
+ ERC_D_Ln9.f09_f09_mt232.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERC_D_Ln9.f19_f19_mt232.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details:
+ ERC_D_Ln9.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERC_D_Ln9.mpasa120_mpasa120.FHISTC_LTso.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERC_D_Ln9.mpasa120_mpasa120.QPC7.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details:
+ ERC_D_Ln9.ne30pg2_ne30pg2_mt232.QPC7.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERC_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_LTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERC_Ln9.C96_C96_mt232.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERI_D_Ln18.f09_f09_mt232.FHIST.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
+ ERI_D_Ln18.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq3s_eri (Overall: DIFF) details:
+ ERP_D_Ln9.ne30pg3_ne30pg3_mt232.F1850C_MTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ld3.ne16pg3_ne16pg3_mg17.FHISTC_WAt1ma.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details:
+ ERP_Ld3.ne30pg3_ne30pg3_mt232.FHISTC_MTt4s.derecho_intel.cam-outfrq1d_aoa (Overall: DIFF) details:
+ ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9.ne30pg3_ne30pg3_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERP_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WAma.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERR_Ln9.ne16pg3_ne16pg3_mt232.FHISTC_LTso.derecho_intel.cam-outfrq9s_bwic (Overall: DIFF) details:
+ ERS_Ln9.f09_f09_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9.f19_f19_mg17.FXSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9.ne30pg3_ne30pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s_ctem (Overall: DIFF) details:
+ SMS_C2_D_Ln9.ne16pg3_ne16pg3_mg17.FHISTC_WXma.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f09_f09_mg17.FCts2nudged.derecho_intel.cam-outfrq9s_leapday (Overall: DIFF) details:
+ SMS_D_Ln9.f09_f09_mg17.FCvbsxHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f09_f09_mg17.FSD.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f19_f19_mg17.FCARMA2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f19_f19_mg17.FCHIST_SLH.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.f19_f19_mg17.FWma2000climo.derecho_intel.cam-outfrq9s_waccm_ma_mam4 (Overall: DIFF) details:
+ SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details:
+ SMS_D_Ln9.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_MTso.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mt232.FHISTC_MTt1s.derecho_intel.cam-outfrq9s_Leung_dust (Overall: DIFF) details:
+ SMS_D_Ln9_P1536x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details:
+ SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Ld1.ne30pg3_ne30pg3_mg17.FC2010climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details:
+ SMS_Lh12.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq3h (Overall: DIFF) details:
+ SMS_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-nudging (Overall: DIFF) details:
+ SMS_Ln9.f09_f09_mg17.FW1850.derecho_intel.cam-reduced_hist3s (Overall: DIFF) details:
+ SMS_Ln9.f19_f19_mt232.F2000climo.derecho_intel.cam-silhs (Overall: FAIL) details:
+ SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details:
+ SMS_Ln9.f19_f19_mt232.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details:
+ - Answer differences expected for jobs which run CLUBB
+
+derecho/nvhpc/aux_cam:
+ ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default (Overall: FAIL) details:
+ FAIL ERS_Ln9.ne30pg3_ne30pg3_mt232.FHISTC_LTso.derecho_nvhpc.cam-outfrq9s_gpu_default COMPARE_base_rest
+
+izumi/nag/aux_cam:
+ ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol (Overall: FAIL) details:
+ FAIL ERC_D_Ln9.f10_f10_mt232.FHIST_C5.izumi_nag.cam-outfrq3s_subcol COMPARE_base_rest
+ - pre-existing failure -- see https://github.com/ESCOMP/CAM/issues/1514
+
+ ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details:
+ ERC_D_Ln9.f10_f10_mt232.FHIST.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details:
+ ERC_D_Ln9.mpasa480_mpasa480_mt232.QPC7.izumi_nag.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-cosp_rad_diags (Overall: DIFF) details:
+ ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_nag.cam-outfrq9s_nochem (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mt232.F1850.izumi_nag.cam-outfrq9s (Overall: DIFF) details:
+ - Answer differences expected for jobs which run CLUBB
+
+izumi/gnu/aux_cam:
+ ERC_D_Ln9.C48_C48_mg17.QPC6.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ ERC_D_Ln9.f19_f19_mt232.FHIST.izumi_gnu.cam-lonlat_fv_diags (Overall: DIFF) details:
+ ERC_D_Ln9.mpasa480_mpasa480_mt232.FHISTC_LTso.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHISTC_LTso.izumi_gnu.cam-sat_lcltod (Overall: DIFF) details:
+ ERC_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-nochem_clubbmf (Overall: DIFF) details:
+ ERC_D_Ln9.ne3pg3_ne3pg3_mt232.QPC7.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ ERS_Ln9_P24x1.mpasa480_mpasa480.F2000climo.izumi_gnu.cam-outfrq9s_mpasa480 (Overall: DIFF) details:
+ SMS_D_Ln9.f10_f10_mg37.FWmaHIST.izumi_gnu.cam-outfrq9s_mee_fluxes (Overall: DIFF) details:
+ SUB_D_Ln9.ne3pg3_ne3pg3_mt232.FHIST.izumi_gnu.cam-outfrq9s (Overall: DIFF) details:
+ - Answer differences expected for jobs which run CLUBB
+
+Summarize any changes to answers, i.e.,
+- what code configurations:
+ - FHISTC_LTso and FHISTC_MTso compsets
+
+- what platforms/compilers:
+ - derecho and intel
+
+- nature of change (roundoff; larger than roundoff but same climate; new
+ climate):
+ - answer changes due to several commits; those larger than
+ roundoff were found to not be climate changing
+
+If bitwise differences were observed, how did you show they were no worse
+than roundoff?
+ - ECT failures spurred a science evaluation by adamrher
+ See the PR for further details
+
+===============================================================
===============================================================
Tag name: cam6_4_165
@@ -17,7 +162,7 @@ Describe any changes made to build system: N/A
Describe any changes made to the namelist:
- added SE-VR defaults for new inputdata files and dycore time-stepping
List any changes to the defaults for the boundary datasets:
- - added ncdata, bnd_topo, drydep_srf_file, se_mesh_file for new and existing grids
+ - added ncdata, bnd_topo, drydep_srf_file, se_mesh_file for new and existing grids
Describe any substantial timing or memory changes: N/A
Code reviewed by: cacraigucar, PeterHjortLauritzen
@@ -159084,4 +159229,5 @@ Changes made:
turned on.
(a fix is on the way soon).
+
===============================================================
diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90
index 0d13b4e5c8..5a9a1e34fb 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 :: &
+ ztodtptr ! 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