From 1d5007eb449e352a464489c8f857bfa34cc65213 Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 3 Jan 2024 13:55:55 -0700 Subject: [PATCH 01/17] UWM changes to namelist files for new clubb external --- bld/build-namelist | 3 + bld/namelist_files/namelist_defaults_cam.xml | 4 + bld/namelist_files/namelist_definition.xml | 100 +++++++++++++++++++ 3 files changed, 107 insertions(+) diff --git a/bld/build-namelist b/bld/build-namelist index 0522511cba..8ac7171b61 100755 --- a/bld/build-namelist +++ b/bld/build-namelist @@ -3310,6 +3310,7 @@ if ($clubb_sgs =~ /$TRUE/io) { add_default($nl, 'clubb_gamma_coefb'); } + add_default($nl, 'clubb_bv_efold'); add_default($nl, 'clubb_C7'); add_default($nl, 'clubb_C7b'); add_default($nl, 'clubb_c_K1'); @@ -3374,6 +3375,8 @@ if ($clubb_sgs =~ /$TRUE/io) { add_default($nl, 'clubb_tridiag_solve_method'); add_default($nl, 'clubb_up2_sfc_coef'); add_default($nl, 'clubb_wpxp_L_thresh'); + add_default($nl, 'clubb_wpxp_Ri_exp'); + add_default($nl, 'clubb_z_displace'); #CLUBB+MF options add_default($nl, 'do_clubb_mf'); diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 54ada37312..d0adf77277 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2019,6 +2019,7 @@ 2.4 + 5.0 1.0 1.0 0.7D0 @@ -2121,6 +2122,8 @@ 1 2.0 60.0 + 0.5 + 25.0 .false. .true. .true. @@ -2149,6 +2152,7 @@ 10.0 4.0 0.0 + 5.0 .true. .false. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 3742aa4da9..4be54126e4 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -3732,6 +3732,11 @@ air is supersaturated with respect to ice. Plume widths for theta_l and rt + +E-folding parameter for mixed Brunt Vaisala Frequency + + Limiting value of C1 when skewness of w (vertical velocity) is small in @@ -3971,6 +3976,14 @@ Gaussian PDF, and also decreases the difference between the means of w from each Gaussian. + +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. + + Option for the placement of the call to CLUBB's PDF closure. The options include: ipdf_pre_advance_fields (1) calls the PDF closure before advancing prognostic fields. ipdf_post_advance_fields (2) calls after advancing prognostic fields, and ipdf_pre_post_advance_fields (3) calls both before and after advancing prognostic fields. @@ -3994,6 +4007,22 @@ Flag to uses an alternate equation to calculate the Brunt-Vaisala frequency. This equation calculates an in-cloud Brunt-Vaisala frequency. + +Flag to use cloud fraction to adjust the value of the +turbulent dissipation coefficient, C2. + + + +Include the contribution of radiation to thlp2 + + + +Calculate the correlations between w and the hydrometeors + + Flag to call CLUBB's PDF closure at both thermodynamic and momentum vertical @@ -4001,6 +4030,11 @@ grid levels. When this flag is turned off, CLUBB's PDF closure is only called on thermodynamic grid levels. + +Use a constant cloud droplet conc. within cloud + + Flag to use a dissipation formula of -(2/3)*em/tau_zm, as in Bougeault (1981), @@ -4022,6 +4056,16 @@ is turned off, Lscale is calculated first, and then dissipation time-scale tau is calculated as tau = Lscale / sqrt(tke). + +Diagnose correlations instead of using fixed ones + + + +Diffuses rtm and thlm + + Explicit diffusion on temperature and moisture by CLUBB, in addition to CLUBB's @@ -4038,6 +4082,11 @@ Flag to run CLUBB with E3SM settings. Flag to relax clipping on wpxp in xm_wpxp_clipping_and_stats. + +Use a fixed correlation for s and t Mellor(chi/eta) + + This flag determines whether we want to use an upwind differencing approximation @@ -4132,6 +4181,11 @@ horizontal winds um and vm. When this flag is turned off, upwp and vpwp are calculated by down-gradient diffusion. + +used in adj_low_res_nu. If .true., avg_deltaz = deltaz + + Flag to take any remaining supersaturation after CLUBB PDF call and add it to @@ -4141,6 +4195,11 @@ levels and the momentum grid levels and variables are interpolated between the two grid level types. + +For rtm nudging + + Flag to use smooth Heaviside 'Peskin' in computation of invrs_tau. @@ -4153,6 +4212,11 @@ Use the standard discretization for the turbulent advection terms. Setting to advance_wp2_wp3_module.F90 and in advance_xp2_xpyp_module.F90. + +Divides Kh_N2_zm by a stability factor + + Flag to use a stability corrected version of CLUBB's time scale (tau_zm). This @@ -4160,6 +4224,12 @@ creates a time scale that provides stronger damping at altitudes where Brunt-Vaisala frequency is large. + +For anisotropic turbulent kinetic energy, i.e. +TKE = 1/2 (u'^2 + v'^2 + w'^2) + + Flag that uses the trapezoidal rule to adjust fields calculated by CLUBB's PDF @@ -4176,6 +4246,14 @@ adjacent vertical grid level. The clubb_l_trapezoidal_rule_zt flag applies this adjustment to PDF fields calculated on thermodynamic vertical grid levels. + +This flag determines whether we want to use an upwind +differencing approximation rather than a centered +differencing for turbulent or mean advection terms. It +affects rtm, thlm, sclrm, um and vm. + + Flag to use "upwind" discretization in the turbulent advection term in the @@ -4185,6 +4263,11 @@ potential temperature). When this flag is turned off, centered discretization is used. + +For wind speed nudging. + + Flag to calculate the value of CLUBB's C11 based on Richardson number, where @@ -4207,6 +4290,13 @@ levels influence the amount of cloudiness and amount of cloud water in a grid box. + +Flag to use precipitation fraction in KK microphysics. The +precipitation fraction is automatically set to 1 when this +flag is turned off. + + Flag to use shear in the calculation of Richardson number. @@ -4292,6 +4382,16 @@ clubb_up2_sfc_coef increases the values of up2 and vp2 at the surface. CLUBB tunable parameter - Lscale threshold: damp C6 and C7 (units: m) + +Exponent for Richardson number in calculation of invrs_tau_wpxp term + + + +Displacement of log law profile above ground (units: m) + + From 466d2a48b483f5751e80a4bca49023e71dc5864d Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 10 Jan 2024 13:06:25 -0700 Subject: [PATCH 02/17] Merged in UWM code changes to clubb_intr --- src/physics/cam/clubb_intr.F90 | 841 +++++++++++++++------------------ 1 file changed, 380 insertions(+), 461 deletions(-) diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index bb38481e39..a1aacfab5d 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -20,18 +20,19 @@ 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 + use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o, karman use air_composition, only: rairv, cpairv use cam_history_support, only: max_fieldname_len - use spmd_utils, only: masterproc - use constituents, only: pcnst, cnst_add - use pbl_utils, only: calc_ustar, calc_obklen - use ref_pres, only: top_lev => trop_cloud_top_lev - use zm_conv_intr, only: zmconv_microp + use spmd_utils, only: masterproc + use constituents, only: pcnst, cnst_add + use pbl_utils, only: calc_ustar, calc_obklen + use ref_pres, only: top_lev => trop_cloud_top_lev + use zm_conv_intr, only: zmconv_microp #ifdef CLUBB_SGS use clubb_api_module, only: pdf_parameter, implicit_coefs_terms - use clubb_api_module, only: clubb_config_flags_type, grid, stats, nu_vertical_res_dep + use clubb_api_module, only: clubb_config_flags_type, grid, stats, & + nu_vertical_res_dep, stats_metadata_type use clubb_api_module, only: nparams use clubb_mf, only: do_clubb_mf, do_clubb_mf_diag use cloud_fraction, only: dp1, dp2 @@ -49,6 +50,11 @@ module clubb_intr !$omp threadprivate(stats_zt, stats_zm, stats_rad_zt, stats_rad_zm, stats_sfc) + type (stats_metadata_type) :: & + stats_metadata + +!$omp threadprivate(stats_metadata) + #endif private @@ -62,6 +68,7 @@ module clubb_intr #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, & @@ -77,6 +84,7 @@ module clubb_intr logical, public :: do_cldcool logical :: clubb_do_icesuper + #ifdef CLUBB_SGS type(clubb_config_flags_type), public :: clubb_config_flags real(r8), dimension(nparams), public :: clubb_params ! Adjustable CLUBB parameters (C1, C2 ...) @@ -178,6 +186,9 @@ module clubb_intr real(r8) :: clubb_detliq_rad = unset_r8 real(r8) :: clubb_detice_rad = unset_r8 real(r8) :: clubb_detphase_lowtemp = unset_r8 + real(r8) :: clubb_bv_efold = unset_r8 + real(r8) :: clubb_wpxp_Ri_exp = unset_r8 + real(r8) :: clubb_z_displace = unset_r8 integer :: & clubb_iiPDF_type, & ! Selected option for the two-component normal @@ -291,7 +302,9 @@ module clubb_intr ! Looking at issue #905 on the clubb repo clubb_l_use_tke_in_wp3_pr_turb_term,& ! Use TKE formulation for wp3 pr_turb term clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! Use TKE in eddy diffusion for wp2 and wp3 + clubb_l_use_wp3_lim_with_smth_Heaviside, & ! Flag to activate mods on wp3 limiters for conv test clubb_l_smooth_Heaviside_tau_wpxp, & ! Use smooth Heaviside 'Peskin' in computation of invrs_tau + clubb_l_modify_limiters_for_cnvg_test, & ! Flag to activate mods on limiters for conv test clubb_l_enable_relaxed_clipping, & ! Flag to relax clipping on wpxp in xm_wpxp_clipping_and_stats clubb_l_linearize_pbl_winds, & ! Flag to turn on code to linearize PBL winds clubb_l_single_C2_Skw, & ! Use a single Skewness dependent C2 for rtp2, thlp2, and @@ -305,7 +318,7 @@ module clubb_intr clubb_l_mono_flux_lim_vm, & ! Flag to turn on monotonic flux limiter for vm clubb_l_mono_flux_lim_spikefix, & ! Flag to implement monotonic flux limiter code that ! eliminates spurious drying tendencies at model top - clubb_l_intr_sfc_flux_smooth = .false.! Add a locally calculated roughness to upwp and vpwp sfc fluxes + clubb_l_intr_sfc_flux_smooth = .false. ! Add a locally calculated roughness to upwp and vpwp sfc fluxes ! Constant parameters logical, parameter, private :: & @@ -698,8 +711,7 @@ subroutine clubb_readnl(nlfile) use clubb_api_module, only: & set_default_clubb_config_flags_api, & ! Procedure(s) - initialize_clubb_config_flags_type_api, & - l_stats, l_output_rad_files + initialize_clubb_config_flags_type_api #endif character(len=*), intent(in) :: nlfile ! filepath for file containing namelist input @@ -718,6 +730,7 @@ subroutine clubb_readnl(nlfile) clubb_do_adv, clubb_timestep, & clubb_rnevap_effic,clubb_do_icesuper namelist /clubb_params_nl/ clubb_beta, & + clubb_bv_efold, & clubb_c1, & clubb_c1b, & clubb_c11, & @@ -762,17 +775,25 @@ subroutine clubb_readnl(nlfile) clubb_do_liqsupersat, & clubb_gamma_coef, & clubb_gamma_coefb, & + clubb_iiPDF_type, & clubb_ipdf_call_placement, & clubb_lambda0_stability_coef, & clubb_lmin_coef, & clubb_l_brunt_vaisala_freq_moist, & + clubb_l_C2_cloud_frac, & + clubb_l_calc_thlp2_rad, & + clubb_l_calc_w_corr, & clubb_l_call_pdf_closure_twice, & + clubb_l_const_Nc_in_cloud, & clubb_l_damp_wp2_using_em, & clubb_l_damp_wp3_Skw_squared, & clubb_l_diag_Lscale_from_tau, & + clubb_l_diagnose_correlations, & + clubb_l_diffuse_rtm_and_thlm, & clubb_l_do_expldiff_rtm_thlm, & clubb_l_e3sm_config, & clubb_l_enable_relaxed_clipping, & + clubb_l_fix_w_chi_eta_correlations, & clubb_l_godunov_upwind_wpxp_ta, & clubb_l_godunov_upwind_xpyp_ta, & clubb_l_intr_sfc_flux_smooth, & @@ -780,6 +801,7 @@ subroutine clubb_readnl(nlfile) clubb_l_lscale_plume_centered, & clubb_l_min_wp2_from_corr_wx, & clubb_l_min_xp2_from_corr_wx, & + clubb_l_modify_limiters_for_cnvg_test, & clubb_l_mono_flux_lim_rtm, & clubb_l_mono_flux_lim_spikefix, & clubb_l_mono_flux_lim_thlm, & @@ -787,20 +809,28 @@ subroutine clubb_readnl(nlfile) clubb_l_mono_flux_lim_vm, & clubb_l_partial_upwind_wp3, & clubb_l_predict_upwp_vpwp, & + clubb_l_prescribed_avg_deltaz, & clubb_l_rcm_supersat_adj, & + clubb_l_rtm_nudge, & clubb_l_smooth_Heaviside_tau_wpxp, & + clubb_l_stability_correct_Kh_N2_zm, & clubb_l_stability_correct_tau_zm, & clubb_l_standard_term_ta, & + clubb_l_tke_aniso, & clubb_l_trapezoidal_rule_zm, & clubb_l_trapezoidal_rule_zt, & + clubb_l_upwind_xm_ma, & clubb_l_upwind_xpyp_ta, & clubb_l_use_C11_Richardson, & clubb_l_use_C7_Richardson, & clubb_l_use_cloud_cover, & + clubb_l_use_precip_frac, & clubb_l_use_shear_Richardson, & clubb_l_use_thvm_in_bv_freq, & clubb_l_use_tke_in_wp2_wp3_K_dfsn, & clubb_l_use_tke_in_wp3_pr_turb_term, & + clubb_l_use_wp3_lim_with_smth_Heaviside, & + clubb_l_uv_nudge, & clubb_l_vary_convect_depth, & clubb_l_vert_avg_closure, & clubb_mult_coef, & @@ -811,16 +841,18 @@ subroutine clubb_readnl(nlfile) clubb_skw_max_mag, & clubb_tridiag_solve_method, & clubb_up2_sfc_coef, & - clubb_wpxp_L_thresh + clubb_wpxp_L_thresh, & + clubb_wpxp_Ri_exp, & + clubb_z_displace !----- Begin Code ----- ! Determine if we want clubb_history to be output - clubb_history = .false. ! Initialize to false - l_stats = .false. ! Initialize to false - l_output_rad_files = .false. ! Initialize to false - do_cldcool = .false. ! Initialize to false - do_rainturb = .false. ! Initialize to false + clubb_history = .false. ! Initialize to false + stats_metadata%l_stats = .false. ! Initialize to false + stats_metadata%l_output_rad_files = .false. ! Initialize to false + do_cldcool = .false. ! Initialize to false + do_rainturb = .false. ! Initialize to false ! Initialize namelist variables to clubb defaults call set_default_clubb_config_flags_api( clubb_iiPDF_type, & ! Out @@ -871,7 +903,9 @@ subroutine clubb_readnl(nlfile) clubb_l_vary_convect_depth, & ! Out clubb_l_use_tke_in_wp3_pr_turb_term, & ! Out clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! Out + clubb_l_use_wp3_lim_with_smth_Heaviside, & ! Out clubb_l_smooth_Heaviside_tau_wpxp, & ! Out + clubb_l_modify_limiters_for_cnvg_test, & ! Out clubb_l_enable_relaxed_clipping, & ! Out clubb_l_linearize_pbl_winds, & ! Out clubb_l_mono_flux_lim_thlm, & ! Out @@ -1008,6 +1042,12 @@ subroutine clubb_readnl(nlfile) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_nu9") call mpi_bcast(clubb_C_wp2_splat, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_C_wp2_splat") + call mpi_bcast(clubb_bv_efold, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_bv_efold") + call mpi_bcast(clubb_wpxp_Ri_exp, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_wpxp_Ri_exp") + call mpi_bcast(clubb_z_displace, 1, mpi_real8, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_z_displace") call mpi_bcast(clubb_lambda0_stability_coef, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_lambda0_stability_coef") call mpi_bcast(clubb_l_lscale_plume_centered,1, mpi_logical, mstrid, mpicom, ierr) @@ -1101,8 +1141,12 @@ subroutine clubb_readnl(nlfile) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_use_tke_in_wp3_pr_turb_term") call mpi_bcast(clubb_l_use_tke_in_wp2_wp3_K_dfsn, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_use_tke_in_wp2_wp3_K_dfsn") + call mpi_bcast(clubb_l_use_wp3_lim_with_smth_Heaviside, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_use_wp3_lim_with_smth_Heaviside") call mpi_bcast(clubb_l_smooth_Heaviside_tau_wpxp, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_smooth_Heaviside_tau_wpxp") + call mpi_bcast(clubb_l_modify_limiters_for_cnvg_test, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_modify_limiters_for_cnvg_test") call mpi_bcast(clubb_ipdf_call_placement, 1, mpi_integer, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_ipdf_call_placement") call mpi_bcast(clubb_l_mono_flux_lim_thlm, 1, mpi_logical, mstrid, mpicom, ierr) @@ -1129,8 +1173,8 @@ subroutine clubb_readnl(nlfile) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_partial_upwind_wp3") ! Overwrite defaults if they are true - if (clubb_history) l_stats = .true. - if (clubb_rad_history) l_output_rad_files = .true. + if (clubb_history) stats_metadata%l_stats = .true. + if (clubb_rad_history) stats_metadata%l_output_rad_files = .true. if (clubb_cloudtop_cooling) do_cldcool = .true. if (clubb_rainevap_turb) do_rainturb = .true. @@ -1186,7 +1230,10 @@ subroutine clubb_readnl(nlfile) if(clubb_Skw_denom_coef == unset_r8) call endrun(sub//": FATAL: clubb_Skw_denom_coef is not set") if(clubb_skw_max_mag == unset_r8) call endrun(sub//": FATAL: clubb_skw_max_mag is not set") if(clubb_up2_sfc_coef == unset_r8) call endrun(sub//": FATAL: clubb_up2_sfc_coef is not set") - if(clubb_C_wp2_splat == unset_r8) call endrun(sub//": FATAL: clubb_C_wp2_splatis not set") + if(clubb_C_wp2_splat == unset_r8) call endrun(sub//": FATAL: clubb_C_wp2_splat is not set") + if(clubb_bv_efold == unset_r8) call endrun(sub//": FATAL: clubb_bv_efold is not set") + if(clubb_wpxp_Ri_exp == unset_r8) call endrun(sub//": FATAL: clubb_wpxp_Ri_exp is not set") + if(clubb_z_displace == unset_r8) call endrun(sub//": FATAL: clubb_z_displace is not set") if(clubb_detliq_rad == unset_r8) call endrun(sub//": FATAL: clubb_detliq_rad not set") if(clubb_detice_rad == unset_r8) call endrun(sub//": FATAL: clubb_detice_rad not set") if(clubb_ipdf_call_placement == unset_i) call endrun(sub//": FATAL: clubb_ipdf_call_placement not set") @@ -1243,8 +1290,10 @@ subroutine clubb_readnl(nlfile) clubb_l_e3sm_config, & ! In clubb_l_vary_convect_depth, & ! In clubb_l_use_tke_in_wp3_pr_turb_term, & ! In - clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! In + clubb_l_use_tke_in_wp2_wp3_K_dfsn, & ! In + clubb_l_use_wp3_lim_with_smth_Heaviside, & ! In clubb_l_smooth_Heaviside_tau_wpxp, & ! In + clubb_l_modify_limiters_for_cnvg_test, & ! In clubb_l_enable_relaxed_clipping, & ! In clubb_l_linearize_pbl_winds, & ! In clubb_l_mono_flux_lim_thlm, & ! In @@ -1290,8 +1339,10 @@ subroutine clubb_ini_cam(pbuf2d) iC14, iC_wp3_pr_turb, igamma_coef, igamma_coefb, imult_coef, ilmin_coef, & iSkw_denom_coef, ibeta, iskw_max_mag, & iC_invrs_tau_bkgnd,iC_invrs_tau_sfc,iC_invrs_tau_shear,iC_invrs_tau_N2,iC_invrs_tau_N2_wp2, & - iC_invrs_tau_N2_xp2,iC_invrs_tau_N2_wpxp,iC_invrs_tau_N2_clear_wp3,iC_uu_shr,iC_uu_buoy, & - iC2rt, iC2thl, iC2rtthl, ic_K1, ic_K2, inu2, ic_K8, ic_K9, inu9, iC_wp2_splat, params_list + iC_invrs_tau_N2_xp2,iC_invrs_tau_N2_wpxp,iC_invrs_tau_N2_clear_wp3, & + iC2rt, iC2thl, iC2rtthl, ic_K1, ic_K2, inu2, ic_K8, ic_K9, inu9, iC_wp2_splat, ibv_efold, & + iwpxp_Ri_exp, iz_displace, & + params_list use clubb_api_module, only: & print_clubb_config_flags_api, & @@ -1304,9 +1355,6 @@ subroutine clubb_ini_cam(pbuf2d) nparams, & set_default_parameters_api, & read_parameters_api, & - l_stats, & - l_stats_samp, & - l_grads, & w_tol_sqd, & rt_tol, & thl_tol @@ -1372,7 +1420,8 @@ subroutine clubb_ini_cam(pbuf2d) C_invrs_tau_shear, C_invrs_tau_N2, C_invrs_tau_N2_wp2, & C_invrs_tau_N2_xp2, C_invrs_tau_N2_wpxp, C_invrs_tau_N2_clear_wp3, & C_invrs_tau_wpxp_Ri, C_invrs_tau_wpxp_N2_thresh, & - Cx_min, Cx_max, Richardson_num_min, Richardson_num_max, a3_coef_min + Cx_min, Cx_max, Richardson_num_min, Richardson_num_max, wpxp_Ri_exp, & + a3_coef_min, a_const, bv_efold, z_displace !----- Begin Code ----- @@ -1449,11 +1498,11 @@ subroutine clubb_ini_cam(pbuf2d) ! Defaults - l_stats_samp = .false. - l_grads = .false. + stats_metadata%l_stats_samp = .false. + stats_metadata%l_grads = .false. ! Overwrite defaults if needbe - if (l_stats) l_stats_samp = .true. + if (stats_metadata%l_stats) stats_metadata%l_stats_samp = .true. ! Define physics buffers indexes cld_idx = pbuf_get_index('CLD') ! Cloud fraction @@ -1527,8 +1576,8 @@ subroutine clubb_ini_cam(pbuf2d) C_invrs_tau_N2_wp2, C_invrs_tau_N2_xp2, & C_invrs_tau_N2_wpxp, C_invrs_tau_N2_clear_wp3, & C_invrs_tau_wpxp_Ri, C_invrs_tau_wpxp_N2_thresh, & - Cx_min, Cx_max, Richardson_num_min, & - Richardson_num_max, a3_coef_min ) + Cx_min, Cx_max, Richardson_num_min, Richardson_num_max, & + wpxp_Ri_exp, a3_coef_min, a_const, bv_efold, z_displace ) call read_parameters_api( -99, "", & C1, C1b, C1c, C2rt, C2thl, C2rtthl, & @@ -1553,8 +1602,8 @@ subroutine clubb_ini_cam(pbuf2d) C_invrs_tau_N2_wp2, C_invrs_tau_N2_xp2, & C_invrs_tau_N2_wpxp, C_invrs_tau_N2_clear_wp3, & C_invrs_tau_wpxp_Ri, C_invrs_tau_wpxp_N2_thresh, & - Cx_min, Cx_max, Richardson_num_min, & - Richardson_num_max, a3_coef_min, & + Cx_min, Cx_max, Richardson_num_min, Richardson_num_max, & + wpxp_Ri_exp, a3_coef_min, a_const, bv_efold, z_displace, & clubb_params ) clubb_params(iC2rtthl) = clubb_C2rtthl @@ -1606,29 +1655,24 @@ subroutine clubb_ini_cam(pbuf2d) clubb_params(iC_invrs_tau_N2_xp2) = clubb_C_invrs_tau_N2_xp2 clubb_params(iC_invrs_tau_N2_wpxp) = clubb_C_invrs_tau_N2_wpxp clubb_params(iC_invrs_tau_N2_clear_wp3) = clubb_C_invrs_tau_N2_clear_wp3 + clubb_params(ibv_efold) = clubb_bv_efold + clubb_params(iwpxp_Ri_exp) = clubb_wpxp_Ri_exp + clubb_params(iz_displace) = clubb_z_displace ! Set up CLUBB core. Note that some of these inputs are overwritten ! when clubb_tend_cam is called. The reason is that heights can change ! at each time step, which is why dummy arrays are read in here for heights ! as they are immediately overwrote. !$OMP PARALLEL - call setup_clubb_core_api & - ( nlev+1, theta0, ts_nudge, & ! In - hydromet_dim, sclr_dim, & ! In - sclr_tol, edsclr_dim, clubb_params, & ! In - l_host_applies_sfc_fluxes, & ! In - saturation_equation, & ! In - l_input_fields, & ! In - clubb_config_flags%iiPDF_type, & ! In - clubb_config_flags%ipdf_call_placement, & ! In - clubb_config_flags%l_predict_upwp_vpwp, & ! In - clubb_config_flags%l_min_xp2_from_corr_wx, & ! In - clubb_config_flags%l_prescribed_avg_deltaz, & ! In - clubb_config_flags%l_damp_wp2_using_em, & ! In - clubb_config_flags%l_stability_correct_tau_zm, & ! In - clubb_config_flags%l_enable_relaxed_clipping, & ! In - clubb_config_flags%l_diag_Lscale_from_tau, & ! In - err_code ) ! Out + call setup_clubb_core_api( & + nlev+1, theta0, ts_nudge, & ! In + hydromet_dim, sclr_dim, & ! In + sclr_tol, edsclr_dim, clubb_params, & ! In + l_host_applies_sfc_fluxes, & ! In + saturation_equation, & ! In + l_input_fields, & ! In + clubb_config_flags, & ! In + err_code ) ! Out if ( err_code == clubb_fatal_error ) then call endrun('clubb_ini_cam: FATAL ERROR CALLING SETUP_CLUBB_CORE') @@ -1750,21 +1794,21 @@ subroutine clubb_ini_cam(pbuf2d) dum2 = 1200._r8 dum3 = 300._r8 - if (l_stats) then - - do i=1, pcols - call stats_init_clubb( .true., dum1, dum2, & - nlev+1, nlev+1, nlev+1, dum3, & - stats_zt(i), stats_zm(i), stats_sfc(i), & - stats_rad_zt(i), stats_rad_zm(i)) - end do + if (stats_metadata%l_stats) then + + call stats_init_clubb( .true., dum1, dum2, & + nlev+1, nlev+1, nlev+1, dum3, & + stats_zt(:), stats_zm(:), stats_sfc(:), & + stats_rad_zt(:), stats_rad_zm(:)) allocate(out_zt(pcols,pverp,stats_zt(1)%num_output_fields)) allocate(out_zm(pcols,pverp,stats_zm(1)%num_output_fields)) allocate(out_sfc(pcols,1,stats_sfc(1)%num_output_fields)) - allocate(out_radzt(pcols,pverp,stats_rad_zt(1)%num_output_fields)) - allocate(out_radzm(pcols,pverp,stats_rad_zm(1)%num_output_fields)) + if ( stats_metadata%l_output_rad_files ) then + allocate(out_radzt(pcols,pverp,stats_rad_zt(1)%num_output_fields)) + allocate(out_radzm(pcols,pverp,stats_rad_zm(1)%num_output_fields)) + end if endif @@ -1959,6 +2003,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & use cam_logfile, only: iulog use tropopause, only: tropopause_findChemTrop use time_manager, only: get_nstep, is_first_restart_step + #ifdef CLUBB_SGS use hb_diff, only: pblintd use scamMOD, only: single_column,scm_clubb_iop_name @@ -1973,10 +2018,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & w_tol_sqd, & rt_tol, & thl_tol, & - l_stats, & - stats_tsamp, & - stats_tout, & - l_output_rad_files, & stats_begin_timestep_api, & hydromet_dim, calculate_thlp2_rad_api, update_xp2_mc_api, & sat_mixrat_liq_api, & @@ -2067,6 +2108,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & real(r8) :: zo(pcols) ! roughness height [m] real(r8) :: dz_g(pcols,pver) ! thickness of layer [m] real(r8) :: relvarmax + real(r8) :: se_upper_a(pcols), se_upper_b(pcols), se_upper_diss(pcols) + real(r8) :: tw_upper_a(pcols), tw_upper_b(pcols), tw_upper_diss(pcols) ! Local CLUBB variables dimensioned as NCOL (only useful columns) to be sent into the clubb run api ! NOTE: THESE VARIABLS SHOULD NOT BE USED IN PBUF OR OUTFLD (HISTORY) SUBROUTINES @@ -2267,6 +2310,10 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & real(kind=time_precision) :: time_elapsed ! time keep track of stats [s] integer :: stats_nsamp, stats_nout ! Stats sampling and output intervals for CLUBB [timestep] + real(r8) :: rtm_integral_vtend(pcols), & + rtm_integral_ltend(pcols) + + real(r8) :: rtm_integral_1, rtm_integral_update, rtm_integral_forcing ! ---------------------------------------------------- ! @@ -2415,7 +2462,6 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & character(len=*), parameter :: subr='clubb_tend_cam' type(grid) :: gr - integer :: begin_height, end_height type(nu_vertical_res_dep) :: nu_vert_res_dep ! Vertical resolution dependent nu values real(r8) :: lmin @@ -2427,7 +2473,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & #ifdef CLUBB_SGS !-----------------------------------------------------------------------------------! - ! MAIN COMPUTATION BEGINS HERE ! ! + ! MAIN COMPUTATION BEGINS HERE ! !-----------------------------------------------------------------------------------! call t_startf("clubb_tend_cam") @@ -2953,11 +2999,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & end do ! Set stats output and increment equal to CLUBB and host dt - stats_tsamp = dtime - stats_tout = hdtime + stats_metadata%stats_tsamp = dtime + stats_metadata%stats_tout = hdtime - stats_nsamp = nint(stats_tsamp/dtime) - stats_nout = nint(stats_tout/dtime) + stats_nsamp = nint(stats_metadata%stats_tsamp/dtime) + stats_nout = nint(stats_metadata%stats_tout/dtime) ! Heights need to be set at each timestep. Therefore, recall ! setup_grid and setup_parameters for this. @@ -2969,12 +3015,11 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & call setup_grid_api( nlev+1, ncol, sfc_elevation, l_implemented, & ! intent(in) grid_type, zi_g(:,2), zi_g(:,1), zi_g(:,nlev+1), & ! intent(in) zi_g, zt_g, & ! intent(in) - gr, begin_height, end_height ) ! intent(out) + gr ) ! intent(out) - call setup_parameters_api( zi_g(:,2), clubb_params, nlev+1, ncol, grid_type, & ! intent(in) - zi_g, zt_g, & ! intent(in) - clubb_config_flags%l_prescribed_avg_deltaz, & ! intent(in) - lmin, nu_vert_res_dep, err_code ) ! intent(out) + call setup_parameters_api( zi_g(:,2), clubb_params, gr, ncol, grid_type, & ! intent(in) + clubb_config_flags%l_prescribed_avg_deltaz, & ! intent(in) + lmin, nu_vert_res_dep, err_code ) ! intent(out) if ( err_code == clubb_fatal_error ) then call endrun(subr//': Fatal error in CLUBB setup_parameters') end if @@ -3260,9 +3305,10 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & do t=1,nadv ! do needed number of "sub" timesteps for each CAM step - ! Increment the statistics then being stats timestep - if (l_stats) then - call stats_begin_timestep_api(t, stats_nsamp, stats_nout) + ! Increment the statistics then begin stats timestep + if (stats_metadata%l_stats) then + call stats_begin_timestep_api( t, stats_nsamp, stats_nout, & + stats_metadata ) endif !####################################################################### @@ -3341,6 +3387,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & grid_dx, grid_dy, & clubb_params, nu_vert_res_dep, lmin, & clubb_config_flags, & + stats_metadata, & stats_zt(:ncol), stats_zm(:ncol), stats_sfc(:ncol), & um_in, vm_in, upwp_in, vpwp_in, up2_in, vp2_in, up3_in, vp3_in, & thlm_in, rtm_in, wprtp_in, wpthlp_in, & @@ -3423,7 +3470,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ! Check to see if stats should be output, here stats are read into ! output arrays to make them conformable to CAM output - if (l_stats) then + if (stats_metadata%l_stats) then do i=1, ncol call stats_end_timestep_clubb(i, stats_zt(i), stats_zm(i), stats_rad_zt(i), stats_rad_zm(i), stats_sfc(i), & out_zt, out_zm, out_radzt, out_radzm, out_sfc) @@ -3707,6 +3754,9 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ! Now compute the tendencies of CLUBB to CAM, note that pverp is the ghost point ! for all variables and therefore is never called in this loop + rtm_integral_vtend(:) = 0._r8 + rtm_integral_ltend(:) = 0._r8 + do k=1, pver do i=1, ncol @@ -3716,6 +3766,9 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ptend_loc%q(i,k,ixcldliq) = (rcm(i,k) - state1%q(i,k,ixcldliq)) / hdtime ! Tendency of liquid water ptend_loc%s(i,k) = (clubb_s(i,k) - state1%s(i,k)) / hdtime ! Tendency of static energy + rtm_integral_ltend(i) = rtm_integral_ltend(i) + ptend_loc%q(i,k,ixcldliq)*state1%pdel(i,k)/gravit + rtm_integral_vtend(i) = rtm_integral_vtend(i) + ptend_loc%q(i,k,ixq)*state1%pdel(i,k)/gravit + end do end do @@ -4299,7 +4352,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & end if ! Output CLUBB history here - if (l_stats) then + if (stats_metadata%l_stats) then do j=1,stats_zt(1)%num_output_fields @@ -4319,7 +4372,7 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & call outfld(trim(sub),out_zm(:,:,j), pcols, lchnk) enddo - if (l_output_rad_files) then + if (stats_metadata%l_output_rad_files) then do j=1,stats_rad_zt(1)%num_output_fields call outfld(trim(stats_rad_zt(1)%file%grid_avg_var(j)%name), out_radzt(:,:,j), pcols, lchnk) enddo @@ -4549,57 +4602,6 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & !----------------------------------------------------------------------- - - use clubb_api_module, only: & - ztscr01, & - ztscr02, & - ztscr03, & - ztscr04, & - ztscr05, & - ztscr06, & - ztscr07, & - ztscr08, & - ztscr09, & - ztscr10, & - ztscr11, & - ztscr12, & - ztscr13, & - ztscr14, & - ztscr15, & - ztscr16, & - ztscr17, & - ztscr18, & - ztscr19, & - ztscr20, & - ztscr21 - - use clubb_api_module, only: & - zmscr01, & - zmscr02, & - zmscr03, & - zmscr04, & - zmscr05, & - zmscr06, & - zmscr07, & - zmscr08, & - zmscr09, & - zmscr10, & - zmscr11, & - zmscr12, & - zmscr13, & - zmscr14, & - zmscr15, & - zmscr16, & - zmscr17, & - l_stats, & - l_output_rad_files, & - stats_tsamp, & - stats_tout, & - l_stats_samp, & - l_stats_last, & - l_netcdf, & - l_grads - use clubb_api_module, only: time_precision, & ! nvarmax_zm, stats_init_zm_api, & ! nvarmax_zt, stats_init_zt_api, & ! @@ -4615,7 +4617,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & implicit none - ! Input Variables + !----------------------- Input Variables ----------------------- logical, intent(in) :: l_stats_in ! Stats on? T/F @@ -4628,16 +4630,17 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & integer, intent(in) :: nnrad_zm ! Grid points in the radiation grid [count] real(kind=time_precision), intent(in) :: delt ! Timestep (dtmain in CLUBB) [s] - - ! Output Variables - type (stats), intent(out) :: stats_zt, & ! stats_zt grid - stats_zm, & ! stats_zm grid - stats_rad_zt, & ! stats_rad_zt grid - stats_rad_zm, & ! stats_rad_zm grid - stats_sfc ! stats_sfc + !----------------------- Output Variables ----------------------- + type (stats), intent(out), dimension(pcols) :: & + stats_zt, & ! stats_zt grid + stats_zm, & ! stats_zm grid + stats_rad_zt, & ! stats_rad_zt grid + stats_rad_zm, & ! stats_rad_zm grid + stats_sfc ! stats_sfc - ! Local Variables + + !----------------------- Local Variables ----------------------- ! Namelist Variables @@ -4656,28 +4659,27 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & clubb_vars_rad_zm, & clubb_vars_sfc - ! Local Variables - - logical :: l_error, & - first_call = .false. + logical :: l_error character(len=200) :: temp1, sub - integer :: i, ntot, read_status + integer :: i, ntot, read_status, j integer :: iunit, ierr + !----------------------- Begin Code ----------------------- + ! Initialize l_error = .false. ! Set stats_variables variables with inputs from calling subroutine - l_stats = l_stats_in - - stats_tsamp = stats_tsamp_in - stats_tout = stats_tout_in + stats_metadata%l_stats = l_stats_in + + stats_metadata%stats_tsamp = stats_tsamp_in + stats_metadata%stats_tout = stats_tout_in - if ( .not. l_stats ) then - l_stats_samp = .false. - l_stats_last = .false. + if ( .not. stats_metadata%l_stats ) then + stats_metadata%l_stats_samp = .false. + stats_metadata%l_stats_last = .false. return end if @@ -4716,296 +4718,214 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & call mpi_bcast(clubb_vars_sfc, var_length*nvarmax_sfc, mpi_character, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(subr//": FATAL: mpi_bcast: clubb_vars_sfc") + ! Hardcode these for use in CAM-CLUBB, don't want either - l_netcdf = .false. - l_grads = .false. + stats_metadata%l_netcdf = .false. + stats_metadata%l_grads = .false. ! Check sampling and output frequencies + do j = 1, pcols + + ! The model time step length, delt (which is dtmain), should multiply + ! evenly into the statistical sampling time step length, stats_tsamp. + if ( abs( stats_metadata%stats_tsamp/delt - floor(stats_metadata%stats_tsamp/delt) ) > 1.e-8_r8 ) then + l_error = .true. ! This will cause the run to stop. + write(fstderr,*) 'Error: stats_tsamp should be an even multiple of ', & + 'delt (which is dtmain). Check the appropriate ', & + 'model.in file.' + write(fstderr,*) 'stats_tsamp = ', stats_metadata%stats_tsamp + write(fstderr,*) 'delt = ', delt + endif - ! The model time step length, delt (which is dtmain), should multiply - ! evenly into the statistical sampling time step length, stats_tsamp. - if ( abs( stats_tsamp/delt - floor(stats_tsamp/delt) ) > 1.e-8_r8 ) then - l_error = .true. ! This will cause the run to stop. - write(fstderr,*) 'Error: stats_tsamp should be an even multiple of ', & - 'delt (which is dtmain). Check the appropriate ', & - 'model.in file.' - write(fstderr,*) 'stats_tsamp = ', stats_tsamp - write(fstderr,*) 'delt = ', delt - endif - - ! Initialize zt (mass points) - - i = 1 - do while ( ichar(clubb_vars_zt(i)(1:1)) /= 0 .and. & - len_trim(clubb_vars_zt(i)) /= 0 .and. & - i <= nvarmax_zt ) - i = i + 1 - enddo - ntot = i - 1 - if ( ntot == nvarmax_zt ) then - write(fstderr,*) "There are more statistical variables listed in ", & - "clubb_vars_zt than allowed for by nvarmax_zt." - write(fstderr,*) "Check the number of variables listed for clubb_vars_zt ", & - "in the stats namelist, or change nvarmax_zt." - write(fstderr,*) "nvarmax_zt = ", nvarmax_zt - call endrun ("stats_init_clubb: number of zt statistical variables exceeds limit") - endif - - stats_zt%num_output_fields = ntot - stats_zt%kk = nnzp - - allocate( stats_zt%z( stats_zt%kk ) ) - - allocate( stats_zt%accum_field_values( 1, 1, stats_zt%kk, stats_zt%num_output_fields ) ) - allocate( stats_zt%accum_num_samples( 1, 1, stats_zt%kk, stats_zt%num_output_fields ) ) - allocate( stats_zt%l_in_update( 1, 1, stats_zt%kk, stats_zt%num_output_fields ) ) - call stats_zero( stats_zt%kk, stats_zt%num_output_fields, stats_zt%accum_field_values, & - stats_zt%accum_num_samples, stats_zt%l_in_update ) - - allocate( stats_zt%file%grid_avg_var( stats_zt%num_output_fields ) ) - allocate( stats_zt%file%z( stats_zt%kk ) ) - - first_call = (.not. allocated(ztscr01)) - - ! Allocate scratch space - if (first_call) allocate( ztscr01(stats_zt%kk) ) - if (first_call) allocate( ztscr02(stats_zt%kk) ) - if (first_call) allocate( ztscr03(stats_zt%kk) ) - if (first_call) allocate( ztscr04(stats_zt%kk) ) - if (first_call) allocate( ztscr05(stats_zt%kk) ) - if (first_call) allocate( ztscr06(stats_zt%kk) ) - if (first_call) allocate( ztscr07(stats_zt%kk) ) - if (first_call) allocate( ztscr08(stats_zt%kk) ) - if (first_call) allocate( ztscr09(stats_zt%kk) ) - if (first_call) allocate( ztscr10(stats_zt%kk) ) - if (first_call) allocate( ztscr11(stats_zt%kk) ) - if (first_call) allocate( ztscr12(stats_zt%kk) ) - if (first_call) allocate( ztscr13(stats_zt%kk) ) - if (first_call) allocate( ztscr14(stats_zt%kk) ) - if (first_call) allocate( ztscr15(stats_zt%kk) ) - if (first_call) allocate( ztscr16(stats_zt%kk) ) - if (first_call) allocate( ztscr17(stats_zt%kk) ) - if (first_call) allocate( ztscr18(stats_zt%kk) ) - if (first_call) allocate( ztscr19(stats_zt%kk) ) - if (first_call) allocate( ztscr20(stats_zt%kk) ) - if (first_call) allocate( ztscr21(stats_zt%kk) ) - - ztscr01 = 0.0_r8 - ztscr02 = 0.0_r8 - ztscr03 = 0.0_r8 - ztscr04 = 0.0_r8 - ztscr05 = 0.0_r8 - ztscr06 = 0.0_r8 - ztscr07 = 0.0_r8 - ztscr08 = 0.0_r8 - ztscr09 = 0.0_r8 - ztscr10 = 0.0_r8 - ztscr11 = 0.0_r8 - ztscr12 = 0.0_r8 - ztscr13 = 0.0_r8 - ztscr14 = 0.0_r8 - ztscr15 = 0.0_r8 - ztscr16 = 0.0_r8 - ztscr17 = 0.0_r8 - ztscr18 = 0.0_r8 - ztscr19 = 0.0_r8 - ztscr20 = 0.0_r8 - ztscr21 = 0.0_r8 - - ! Default initialization for array indices for zt - if (first_call) then - call stats_init_zt_api( clubb_vars_zt, l_error, & - stats_zt ) - end if + ! Initialize zt (mass points) - ! Initialize zm (momentum points) + i = 1 + do while ( ichar(clubb_vars_zt(i)(1:1)) /= 0 .and. & + len_trim(clubb_vars_zt(i)) /= 0 .and. & + i <= nvarmax_zt ) + i = i + 1 + enddo + ntot = i - 1 + if ( ntot == nvarmax_zt ) then + write(fstderr,*) "There are more statistical variables listed in ", & + "clubb_vars_zt than allowed for by nvarmax_zt." + write(fstderr,*) "Check the number of variables listed for clubb_vars_zt ", & + "in the stats namelist, or change nvarmax_zt." + write(fstderr,*) "nvarmax_zt = ", nvarmax_zt + call endrun ("stats_init_clubb: number of zt statistical variables exceeds limit") + endif - i = 1 - do while ( ichar(clubb_vars_zm(i)(1:1)) /= 0 .and. & - len_trim(clubb_vars_zm(i)) /= 0 .and. & - i <= nvarmax_zm ) - i = i + 1 - end do - ntot = i - 1 - if ( ntot == nvarmax_zm ) then - write(fstderr,*) "There are more statistical variables listed in ", & - "clubb_vars_zm than allowed for by nvarmax_zm." - write(fstderr,*) "Check the number of variables listed for clubb_vars_zm ", & - "in the stats namelist, or change nvarmax_zm." - write(fstderr,*) "nvarmax_zm = ", nvarmax_zm - call endrun ("stats_init_clubb: number of zm statistical variables exceeds limit") - endif + stats_zt(j)%num_output_fields = ntot + stats_zt(j)%kk = nnzp - stats_zm%num_output_fields = ntot - stats_zm%kk = nnzp + allocate( stats_zt(j)%z( stats_zt(j)%kk ) ) - allocate( stats_zm%z( stats_zm%kk ) ) + allocate( stats_zt(j)%accum_field_values( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) + allocate( stats_zt(j)%accum_num_samples( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) + allocate( stats_zt(j)%l_in_update( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) + call stats_zero( stats_zt(j)%kk, stats_zt(j)%num_output_fields, stats_zt(j)%accum_field_values, & + stats_zt(j)%accum_num_samples, stats_zt(j)%l_in_update ) - allocate( stats_zm%accum_field_values( 1, 1, stats_zm%kk, stats_zm%num_output_fields ) ) - allocate( stats_zm%accum_num_samples( 1, 1, stats_zm%kk, stats_zm%num_output_fields ) ) - allocate( stats_zm%l_in_update( 1, 1, stats_zm%kk, stats_zm%num_output_fields ) ) - call stats_zero( stats_zm%kk, stats_zm%num_output_fields, stats_zm%accum_field_values, & - stats_zm%accum_num_samples, stats_zm%l_in_update ) + allocate( stats_zt(j)%file%grid_avg_var( stats_zt(j)%num_output_fields ) ) + allocate( stats_zt(j)%file%z( stats_zt(j)%kk ) ) - allocate( stats_zm%file%grid_avg_var( stats_zm%num_output_fields ) ) - allocate( stats_zm%file%z( stats_zm%kk ) ) - - ! Allocate scratch space - - if (first_call) allocate( zmscr01(stats_zm%kk) ) - if (first_call) allocate( zmscr02(stats_zm%kk) ) - if (first_call) allocate( zmscr03(stats_zm%kk) ) - if (first_call) allocate( zmscr04(stats_zm%kk) ) - if (first_call) allocate( zmscr05(stats_zm%kk) ) - if (first_call) allocate( zmscr06(stats_zm%kk) ) - if (first_call) allocate( zmscr07(stats_zm%kk) ) - if (first_call) allocate( zmscr08(stats_zm%kk) ) - if (first_call) allocate( zmscr09(stats_zm%kk) ) - if (first_call) allocate( zmscr10(stats_zm%kk) ) - if (first_call) allocate( zmscr11(stats_zm%kk) ) - if (first_call) allocate( zmscr12(stats_zm%kk) ) - if (first_call) allocate( zmscr13(stats_zm%kk) ) - if (first_call) allocate( zmscr14(stats_zm%kk) ) - if (first_call) allocate( zmscr15(stats_zm%kk) ) - if (first_call) allocate( zmscr16(stats_zm%kk) ) - if (first_call) allocate( zmscr17(stats_zm%kk) ) - - zmscr01 = 0.0_r8 - zmscr02 = 0.0_r8 - zmscr03 = 0.0_r8 - zmscr04 = 0.0_r8 - zmscr05 = 0.0_r8 - zmscr06 = 0.0_r8 - zmscr07 = 0.0_r8 - zmscr08 = 0.0_r8 - zmscr09 = 0.0_r8 - zmscr10 = 0.0_r8 - zmscr11 = 0.0_r8 - zmscr12 = 0.0_r8 - zmscr13 = 0.0_r8 - zmscr14 = 0.0_r8 - zmscr15 = 0.0_r8 - zmscr16 = 0.0_r8 - zmscr17 = 0.0_r8 - - if (first_call) then - call stats_init_zm_api( clubb_vars_zm, l_error, & - stats_zm ) - end if + ! Default initialization for array indices for zt + call stats_init_zt_api( clubb_vars_zt, & + l_error, & + stats_metadata, stats_zt(j) ) - ! Initialize rad_zt (radiation points) + ! Initialize zm (momentum points) - if (l_output_rad_files) then - - i = 1 - do while ( ichar(clubb_vars_rad_zt(i)(1:1)) /= 0 .and. & - len_trim(clubb_vars_rad_zt(i)) /= 0 .and. & - i <= nvarmax_rad_zt ) - i = i + 1 - end do - ntot = i - 1 - if ( ntot == nvarmax_rad_zt ) then - write(fstderr,*) "There are more statistical variables listed in ", & - "clubb_vars_rad_zt than allowed for by nvarmax_rad_zt." - write(fstderr,*) "Check the number of variables listed for clubb_vars_rad_zt ", & - "in the stats namelist, or change nvarmax_rad_zt." - write(fstderr,*) "nvarmax_rad_zt = ", nvarmax_rad_zt - call endrun ("stats_init_clubb: number of rad_zt statistical variables exceeds limit") - endif + i = 1 + do while ( ichar(clubb_vars_zm(i)(1:1)) /= 0 .and. & + len_trim(clubb_vars_zm(i)) /= 0 .and. & + i <= nvarmax_zm ) + i = i + 1 + end do + ntot = i - 1 + if ( ntot == nvarmax_zm ) then + write(fstderr,*) "There are more statistical variables listed in ", & + "clubb_vars_zm than allowed for by nvarmax_zm." + write(fstderr,*) "Check the number of variables listed for clubb_vars_zm ", & + "in the stats namelist, or change nvarmax_zm." + write(fstderr,*) "nvarmax_zm = ", nvarmax_zm + call endrun ("stats_init_clubb: number of zm statistical variables exceeds limit") + endif - stats_rad_zt%num_output_fields = ntot - stats_rad_zt%kk = nnrad_zt + stats_zm(j)%num_output_fields = ntot + stats_zm(j)%kk = nnzp - allocate( stats_rad_zt%z( stats_rad_zt%kk ) ) + allocate( stats_zm(j)%z( stats_zm(j)%kk ) ) - allocate( stats_rad_zt%accum_field_values( 1, 1, stats_rad_zt%kk, stats_rad_zt%num_output_fields ) ) - allocate( stats_rad_zt%accum_num_samples( 1, 1, stats_rad_zt%kk, stats_rad_zt%num_output_fields ) ) - allocate( stats_rad_zt%l_in_update( 1, 1, stats_rad_zt%kk, stats_rad_zt%num_output_fields ) ) + allocate( stats_zm(j)%accum_field_values( 1, 1, stats_zm(j)%kk, stats_zm(j)%num_output_fields ) ) + allocate( stats_zm(j)%accum_num_samples( 1, 1, stats_zm(j)%kk, stats_zm(j)%num_output_fields ) ) + allocate( stats_zm(j)%l_in_update( 1, 1, stats_zm(j)%kk, stats_zm(j)%num_output_fields ) ) + call stats_zero( stats_zm(j)%kk, stats_zm(j)%num_output_fields, stats_zm(j)%accum_field_values, & + stats_zm(j)%accum_num_samples, stats_zm(j)%l_in_update ) - call stats_zero( stats_rad_zt%kk, stats_rad_zt%num_output_fields, stats_rad_zt%accum_field_values, & - stats_rad_zt%accum_num_samples, stats_rad_zt%l_in_update ) + allocate( stats_zm(j)%file%grid_avg_var( stats_zm(j)%num_output_fields ) ) + allocate( stats_zm(j)%file%z( stats_zm(j)%kk ) ) - allocate( stats_rad_zt%file%grid_avg_var( stats_rad_zt%num_output_fields ) ) - allocate( stats_rad_zt%file%z( stats_rad_zt%kk ) ) + call stats_init_zm_api( clubb_vars_zm, & + l_error, & + stats_metadata, stats_zm(j) ) - call stats_init_rad_zt_api( clubb_vars_rad_zt, l_error, & - stats_rad_zt ) + ! Initialize rad_zt (radiation points) - ! Initialize rad_zm (radiation points) - - i = 1 - do while ( ichar(clubb_vars_rad_zm(i)(1:1)) /= 0 .and. & - len_trim(clubb_vars_rad_zm(i)) /= 0 .and. & - i <= nvarmax_rad_zm ) - i = i + 1 - end do - ntot = i - 1 - if ( ntot == nvarmax_rad_zm ) then - write(fstderr,*) "There are more statistical variables listed in ", & - "clubb_vars_rad_zm than allowed for by nvarmax_rad_zm." - write(fstderr,*) "Check the number of variables listed for clubb_vars_rad_zm ", & - "in the stats namelist, or change nvarmax_rad_zm." - write(fstderr,*) "nvarmax_rad_zm = ", nvarmax_rad_zm - call endrun ("stats_init_clubb: number of rad_zm statistical variables exceeds limit") - endif - - stats_rad_zm%num_output_fields = ntot - stats_rad_zm%kk = nnrad_zm - - allocate( stats_rad_zm%z( stats_rad_zm%kk ) ) - - allocate( stats_rad_zm%accum_field_values( 1, 1, stats_rad_zm%kk, stats_rad_zm%num_output_fields ) ) - allocate( stats_rad_zm%accum_num_samples( 1, 1, stats_rad_zm%kk, stats_rad_zm%num_output_fields ) ) - allocate( stats_rad_zm%l_in_update( 1, 1, stats_rad_zm%kk, stats_rad_zm%num_output_fields ) ) - - call stats_zero( stats_rad_zm%kk, stats_rad_zm%num_output_fields, stats_rad_zm%accum_field_values, & - stats_rad_zm%accum_num_samples, stats_rad_zm%l_in_update ) - - allocate( stats_rad_zm%file%grid_avg_var( stats_rad_zm%num_output_fields ) ) - allocate( stats_rad_zm%file%z( stats_rad_zm%kk ) ) + if (stats_metadata%l_output_rad_files) then + + i = 1 + do while ( ichar(clubb_vars_rad_zt(i)(1:1)) /= 0 .and. & + len_trim(clubb_vars_rad_zt(i)) /= 0 .and. & + i <= nvarmax_rad_zt ) + i = i + 1 + end do + ntot = i - 1 + if ( ntot == nvarmax_rad_zt ) then + write(fstderr,*) "There are more statistical variables listed in ", & + "clubb_vars_rad_zt than allowed for by nvarmax_rad_zt." + write(fstderr,*) "Check the number of variables listed for clubb_vars_rad_zt ", & + "in the stats namelist, or change nvarmax_rad_zt." + write(fstderr,*) "nvarmax_rad_zt = ", nvarmax_rad_zt + call endrun ("stats_init_clubb: number of rad_zt statistical variables exceeds limit") + endif + + stats_rad_zt(j)%num_output_fields = ntot + stats_rad_zt(j)%kk = nnrad_zt + + allocate( stats_rad_zt(j)%z( stats_rad_zt(j)%kk ) ) + + allocate( stats_rad_zt(j)%accum_field_values( 1, 1, stats_rad_zt(j)%kk, stats_rad_zt(j)%num_output_fields ) ) + allocate( stats_rad_zt(j)%accum_num_samples( 1, 1, stats_rad_zt(j)%kk, stats_rad_zt(j)%num_output_fields ) ) + allocate( stats_rad_zt(j)%l_in_update( 1, 1, stats_rad_zt(j)%kk, stats_rad_zt(j)%num_output_fields ) ) + + call stats_zero( stats_rad_zt(j)%kk, stats_rad_zt(j)%num_output_fields, stats_rad_zt(j)%accum_field_values, & + stats_rad_zt(j)%accum_num_samples, stats_rad_zt(j)%l_in_update ) + + allocate( stats_rad_zt(j)%file%grid_avg_var( stats_rad_zt(j)%num_output_fields ) ) + allocate( stats_rad_zt(j)%file%z( stats_rad_zt(j)%kk ) ) + + call stats_init_rad_zt_api( clubb_vars_rad_zt, & + l_error, & + stats_metadata, stats_rad_zt(j) ) + + ! Initialize rad_zm (radiation points) - call stats_init_rad_zm_api( clubb_vars_rad_zm, l_error, & - stats_rad_zm ) - end if ! l_output_rad_files + i = 1 + do while ( ichar(clubb_vars_rad_zm(i)(1:1)) /= 0 .and. & + len_trim(clubb_vars_rad_zm(i)) /= 0 .and. & + i <= nvarmax_rad_zm ) + i = i + 1 + end do + ntot = i - 1 + if ( ntot == nvarmax_rad_zm ) then + write(fstderr,*) "There are more statistical variables listed in ", & + "clubb_vars_rad_zm than allowed for by nvarmax_rad_zm." + write(fstderr,*) "Check the number of variables listed for clubb_vars_rad_zm ", & + "in the stats namelist, or change nvarmax_rad_zm." + write(fstderr,*) "nvarmax_rad_zm = ", nvarmax_rad_zm + call endrun ("stats_init_clubb: number of rad_zm statistical variables exceeds limit") + endif + + stats_rad_zm(j)%num_output_fields = ntot + stats_rad_zm(j)%kk = nnrad_zm + + allocate( stats_rad_zm(j)%z( stats_rad_zm(j)%kk ) ) + + allocate( stats_rad_zm(j)%accum_field_values( 1, 1, stats_rad_zm(j)%kk, stats_rad_zm(j)%num_output_fields ) ) + allocate( stats_rad_zm(j)%accum_num_samples( 1, 1, stats_rad_zm(j)%kk, stats_rad_zm(j)%num_output_fields ) ) + allocate( stats_rad_zm(j)%l_in_update( 1, 1, stats_rad_zm(j)%kk, stats_rad_zm(j)%num_output_fields ) ) + + call stats_zero( stats_rad_zm(j)%kk, stats_rad_zm(j)%num_output_fields, stats_rad_zm(j)%accum_field_values, & + stats_rad_zm(j)%accum_num_samples, stats_rad_zm(j)%l_in_update ) + + allocate( stats_rad_zm(j)%file%grid_avg_var( stats_rad_zm(j)%num_output_fields ) ) + allocate( stats_rad_zm(j)%file%z( stats_rad_zm(j)%kk ) ) + + call stats_init_rad_zm_api( clubb_vars_rad_zm, & + l_error, & + stats_metadata, stats_rad_zm(j) ) + end if ! l_output_rad_files - ! Initialize sfc (surface point) + ! Initialize sfc (surface point) - i = 1 - do while ( ichar(clubb_vars_sfc(i)(1:1)) /= 0 .and. & - len_trim(clubb_vars_sfc(i)) /= 0 .and. & - i <= nvarmax_sfc ) - i = i + 1 - end do - ntot = i - 1 - if ( ntot == nvarmax_sfc ) then - write(fstderr,*) "There are more statistical variables listed in ", & - "clubb_vars_sfc than allowed for by nvarmax_sfc." - write(fstderr,*) "Check the number of variables listed for clubb_vars_sfc ", & - "in the stats namelist, or change nvarmax_sfc." - write(fstderr,*) "nvarmax_sfc = ", nvarmax_sfc - call endrun ("stats_init_clubb: number of sfc statistical variables exceeds limit") - endif + i = 1 + do while ( ichar(clubb_vars_sfc(i)(1:1)) /= 0 .and. & + len_trim(clubb_vars_sfc(i)) /= 0 .and. & + i <= nvarmax_sfc ) + i = i + 1 + end do + ntot = i - 1 + if ( ntot == nvarmax_sfc ) then + write(fstderr,*) "There are more statistical variables listed in ", & + "clubb_vars_sfc than allowed for by nvarmax_sfc." + write(fstderr,*) "Check the number of variables listed for clubb_vars_sfc ", & + "in the stats namelist, or change nvarmax_sfc." + write(fstderr,*) "nvarmax_sfc = ", nvarmax_sfc + call endrun ("stats_init_clubb: number of sfc statistical variables exceeds limit") + endif - stats_sfc%num_output_fields = ntot - stats_sfc%kk = 1 + stats_sfc(j)%num_output_fields = ntot + stats_sfc(j)%kk = 1 - allocate( stats_sfc%z( stats_sfc%kk ) ) + allocate( stats_sfc(j)%z( stats_sfc(j)%kk ) ) - allocate( stats_sfc%accum_field_values( 1, 1, stats_sfc%kk, stats_sfc%num_output_fields ) ) - allocate( stats_sfc%accum_num_samples( 1, 1, stats_sfc%kk, stats_sfc%num_output_fields ) ) - allocate( stats_sfc%l_in_update( 1, 1, stats_sfc%kk, stats_sfc%num_output_fields ) ) + allocate( stats_sfc(j)%accum_field_values( 1, 1, stats_sfc(j)%kk, stats_sfc(j)%num_output_fields ) ) + allocate( stats_sfc(j)%accum_num_samples( 1, 1, stats_sfc(j)%kk, stats_sfc(j)%num_output_fields ) ) + allocate( stats_sfc(j)%l_in_update( 1, 1, stats_sfc(j)%kk, stats_sfc(j)%num_output_fields ) ) - call stats_zero( stats_sfc%kk, stats_sfc%num_output_fields, stats_sfc%accum_field_values, & - stats_sfc%accum_num_samples, stats_sfc%l_in_update ) + call stats_zero( stats_sfc(j)%kk, stats_sfc(j)%num_output_fields, stats_sfc(j)%accum_field_values, & + stats_sfc(j)%accum_num_samples, stats_sfc(j)%l_in_update ) - allocate( stats_sfc%file%grid_avg_var( stats_sfc%num_output_fields ) ) - allocate( stats_sfc%file%z( stats_sfc%kk ) ) + allocate( stats_sfc(j)%file%grid_avg_var( stats_sfc(j)%num_output_fields ) ) + allocate( stats_sfc(j)%file%z( stats_sfc(j)%kk ) ) - if (first_call) then - call stats_init_sfc_api( clubb_vars_sfc, l_error, & - stats_sfc ) - end if + call stats_init_sfc_api( clubb_vars_sfc, & + l_error, & + stats_metadata, stats_sfc(j) ) + + end do ! Check for errors @@ -5013,48 +4933,51 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & call endrun ('stats_init: errors found') endif -! Now call add fields - if (first_call) then - - do i = 1, stats_zt%num_output_fields - - temp1 = trim(stats_zt%file%grid_avg_var(i)%name) - sub = temp1 - if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) - - call addfld(trim(sub),(/ 'ilev' /),& - 'A',trim(stats_zt%file%grid_avg_var(i)%units),trim(stats_zt%file%grid_avg_var(i)%description)) - enddo - - do i = 1, stats_zm%num_output_fields + ! Now call add fields - temp1 = trim(stats_zm%file%grid_avg_var(i)%name) - sub = temp1 - if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) - - call addfld(trim(sub),(/ 'ilev' /),& - 'A',trim(stats_zm%file%grid_avg_var(i)%units),trim(stats_zm%file%grid_avg_var(i)%description)) - enddo + do i = 1, stats_zt(1)%num_output_fields + + temp1 = trim(stats_zt(1)%file%grid_avg_var(i)%name) + sub = temp1 + if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) + + call addfld( trim(sub), (/ 'ilev' /), 'A', & + trim(stats_zt(1)%file%grid_avg_var(i)%units), & + trim(stats_zt(1)%file%grid_avg_var(i)%description) ) + enddo + + do i = 1, stats_zm(1)%num_output_fields + + temp1 = trim(stats_zm(1)%file%grid_avg_var(i)%name) + sub = temp1 + if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) + + call addfld( trim(sub), (/ 'ilev' /), 'A', & + trim(stats_zm(1)%file%grid_avg_var(i)%units), & + trim(stats_zm(1)%file%grid_avg_var(i)%description) ) + enddo - if (l_output_rad_files) then + if (stats_metadata%l_output_rad_files) then - do i = 1, stats_rad_zt%num_output_fields - call addfld(trim(stats_rad_zt%file%grid_avg_var(i)%name),(/ 'ilev' /),& - 'A',trim(stats_rad_zt%file%grid_avg_var(i)%units),trim(stats_rad_zt%file%grid_avg_var(i)%description)) - enddo - - do i = 1, stats_rad_zm%num_output_fields - call addfld(trim(stats_rad_zm%file%grid_avg_var(i)%name),(/ 'ilev' /),& - 'A',trim(stats_rad_zm%file%grid_avg_var(i)%units),trim(stats_rad_zm%file%grid_avg_var(i)%description)) - enddo - endif - - do i = 1, stats_sfc%num_output_fields - call addfld(trim(stats_sfc%file%grid_avg_var(i)%name),horiz_only,& - 'A',trim(stats_sfc%file%grid_avg_var(i)%units),trim(stats_sfc%file%grid_avg_var(i)%description)) - enddo - - end if + do i = 1, stats_rad_zt(1)%num_output_fields + call addfld( trim(stats_rad_zt(1)%file%grid_avg_var(i)%name), (/ 'ilev' /), 'A', & + trim(stats_rad_zt(1)%file%grid_avg_var(i)%units), & + trim(stats_rad_zt(1)%file%grid_avg_var(i)%description) ) + enddo + + do i = 1, stats_rad_zm(1)%num_output_fields + call addfld( trim(stats_rad_zm(1)%file%grid_avg_var(i)%name), (/ 'ilev' /), 'A', & + trim(stats_rad_zm(1)%file%grid_avg_var(i)%units), & + trim(stats_rad_zm(1)%file%grid_avg_var(i)%description) ) + enddo + endif + + do i = 1, stats_sfc(1)%num_output_fields + call addfld( trim(stats_sfc(1)%file%grid_avg_var(i)%name), horiz_only, 'A', & + trim(stats_sfc(1)%file%grid_avg_var(i)%units), & + trim(stats_sfc(1)%file%grid_avg_var(i)%description) ) + enddo + return @@ -5081,10 +5004,6 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st use clubb_api_module, only: & fstderr, & ! Constant(s) - l_stats_last, & - stats_tsamp, & - stats_tout, & - l_output_rad_files, & clubb_at_least_debug_level_api ! Procedure(s) use cam_abortutils, only: endrun @@ -5114,7 +5033,7 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st ! Check if it is time to write to file - if ( .not. l_stats_last ) return + if ( .not. stats_metadata%l_stats_last ) return ! Initialize l_error = .false. @@ -5122,7 +5041,7 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st ! Compute averages call stats_avg( stats_zt%kk, stats_zt%num_output_fields, stats_zt%accum_field_values, stats_zt%accum_num_samples ) call stats_avg( stats_zm%kk, stats_zm%num_output_fields, stats_zm%accum_field_values, stats_zm%accum_num_samples ) - if (l_output_rad_files) then + if (stats_metadata%l_output_rad_files) then call stats_avg( stats_rad_zt%kk, stats_rad_zt%num_output_fields, stats_rad_zt%accum_field_values, & stats_rad_zt%accum_num_samples ) call stats_avg( stats_rad_zm%kk, stats_rad_zm%num_output_fields, stats_rad_zm%accum_field_values, & @@ -5147,7 +5066,7 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st enddo enddo - if (l_output_rad_files) then + if (stats_metadata%l_output_rad_files) then do i = 1, stats_rad_zt%num_output_fields do k = 1, stats_rad_zt%kk out_radzt(thecol,pverp-k+1,i) = stats_rad_zt%accum_field_values(1,1,k,i) @@ -5180,7 +5099,7 @@ subroutine stats_end_timestep_clubb(thecol, stats_zt, stats_zm, stats_rad_zt, st stats_zt%accum_num_samples, stats_zt%l_in_update ) call stats_zero( stats_zm%kk, stats_zm%num_output_fields, stats_zm%accum_field_values, & stats_zm%accum_num_samples, stats_zm%l_in_update ) - if (l_output_rad_files) then + if (stats_metadata%l_output_rad_files) then call stats_zero( stats_rad_zt%kk, stats_rad_zt%num_output_fields, stats_rad_zt%accum_field_values, & stats_rad_zt%accum_num_samples, stats_rad_zt%l_in_update ) call stats_zero( stats_rad_zm%kk, stats_rad_zm%num_output_fields, stats_rad_zm%accum_field_values, & From f0f446da1baa55fd8d0e5a1110c58e1a83216a9a Mon Sep 17 00:00:00 2001 From: Katetc Date: Thu, 11 Jan 2024 12:08:51 -0700 Subject: [PATCH 03/17] UWM updates for SILHS --- src/physics/cam/subcol_SILHS.F90 | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/physics/cam/subcol_SILHS.F90 b/src/physics/cam/subcol_SILHS.F90 index e7fe38637a..e941889e50 100644 --- a/src/physics/cam/subcol_SILHS.F90 +++ b/src/physics/cam/subcol_SILHS.F90 @@ -20,6 +20,7 @@ module subcol_SILHS use clubb_intr, only: & clubb_config_flags, & clubb_params, & + stats_metadata, & stats_zt, stats_zm, stats_sfc, & pdf_params_chnk @@ -473,7 +474,7 @@ subroutine subcol_init_SILHS(pbuf2d) corr_file_path_below = trim( subcol_SILHS_corr_file_path )//trim( subcol_SILHS_corr_file_name )//below_file_ext call setup_corr_varnce_array_api( corr_file_path_cloud, corr_file_path_below, & - getnewunit(iunit), & + newunit(iunit), & clubb_config_flags%l_fix_w_chi_eta_correlations ) !------------------------------- @@ -603,8 +604,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) setup_pdf_parameters_api, & - l_stats_samp, & - hydromet_pdf_parameter, & zm2zt_api, setup_grid_heights_api, & @@ -664,7 +663,6 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) real(r8), parameter :: qsmall = 1.0e-18_r8 ! Microphysics cut-off for cloud integer :: i, j, k, ngrdcol, ncol, lchnk, stncol - integer :: begin_height, end_height ! Output from setup_grid call real(r8) :: sfc_elevation(state%ngrdcol) ! Surface elevation real(r8), dimension(state%ngrdcol,pverp-top_lev+1) :: zt_g, zi_g ! Thermo & Momentum grids for clubb @@ -957,7 +955,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) call setup_grid_api( pverp+1-top_lev, ncol, sfc_elevation(1:ncol), l_implemented, & ! intent(in) grid_type, zi_g(1:ncol,2), zi_g(1:ncol,1), zi_g(1:ncol,pverp+1-top_lev), & ! intent(in) zi_g(1:ncol,:), zt_g(1:ncol,:), & ! intent(in) - gr, begin_height, end_height ) + gr ) ! Calculate the distance between grid levels on the host model grid, ! using host model grid indices. @@ -1135,7 +1133,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) Nc_in_cloud, cld_frac_in, khzm, & ! In ice_supersat_frac_in, hydromet, wphydrometp, & ! In corr_array_n_cloud, corr_array_n_below, & ! In - pdf_params_chnk(lchnk), l_stats_samp, & ! In + pdf_params_chnk(lchnk), & ! In clubb_params, & ! In clubb_config_flags%iiPDF_type, & ! In clubb_config_flags%l_use_precip_frac, & ! In @@ -1144,6 +1142,7 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) clubb_config_flags%l_calc_w_corr, & ! In clubb_config_flags%l_const_Nc_in_cloud, & ! In clubb_config_flags%l_fix_w_chi_eta_correlations, & ! In + stats_metadata, & ! In stats_zt, stats_zm, stats_sfc, & ! In hydrometp2, & ! Inout mu_x_1, mu_x_2, & ! Out @@ -1231,7 +1230,8 @@ subroutine subcol_gen_SILHS(state, tend, state_sc, tend_sc, pbuf) clubb_config_flags%l_tke_aniso, & ! In clubb_config_flags%l_standard_term_ta, & ! In vert_decorr_coef, & ! In - stats_lh_zt, stats_lh_sfc, & ! intent(inout) + stats_metadata, & ! In + stats_lh_zt, stats_lh_sfc, & ! InOut X_nl_all_levs, X_mixt_comp_all_levs, & ! Out lh_sample_point_weights) ! Out @@ -4125,12 +4125,12 @@ end subroutine subcol_SILHS_hydromet_conc_tend_lim ! small function to get an unused stream identifier to send to setup_corr_varnce_array_api ! or any other silhs/clubb functions that require a unit number argument ! This comes directly from the Fortran wiki - integer function getnewunit(unit) + integer function newunit(unit) integer, intent(out), optional :: unit integer, parameter :: LUN_MIN=10, LUN_MAX=1000 logical :: opened - integer :: lun, newunit + integer :: lun newunit=-1 do lun=LUN_MIN,LUN_MAX @@ -4141,6 +4141,6 @@ integer function getnewunit(unit) end if end do if (present(unit)) unit=newunit - end function getnewunit + end function newunit end module subcol_SILHS From 8e3ec85cd5bcc49bc5002ca3e9da859fb23b841b Mon Sep 17 00:00:00 2001 From: Katetc Date: Thu, 11 Jan 2024 16:34:56 -0700 Subject: [PATCH 04/17] Point to new CLUBB External --- Externals_CAM.cfg | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Externals_CAM.cfg b/Externals_CAM.cfg index b66e4a2d25..9c87bfaf99 100644 --- a/Externals_CAM.cfg +++ b/Externals_CAM.cfg @@ -25,7 +25,7 @@ local_path = src/physics/clubb protocol = git repo_url = https://github.com/larson-group/clubb_release sparse = ../.clubb_sparse_checkout -tag = clubb_4ncar_20221129_59cb19f_20230330_branchtag +tag = clubb_4ncar_20231115_5406350 required = True [pumas] From e3c100607ead4ddc443f8387200adf1e2f0a838b Mon Sep 17 00:00:00 2001 From: Katetc Date: Fri, 12 Jan 2024 13:37:38 -0700 Subject: [PATCH 05/17] Few more small changes from larson-group --- bld/namelist_files/namelist_defaults_cam.xml | 3 +++ bld/namelist_files/namelist_definition.xml | 2 +- cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam | 4 ++-- cime_config/usermods_dirs/scam_mandatory/shell_commands | 2 +- 4 files changed, 7 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 48903217cc..3c89487fbe 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2178,6 +2178,9 @@ .false. .false. .false. + 0.5 + 25.0 + .false. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index d1c23ae727..16ae7abbd3 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4054,7 +4054,7 @@ This equation calculates an in-cloud Brunt-Vaisala frequency. -Flag to use cloud fraction to adjust the value of the +Flag to use cloud fraction to adjust the value of the turbulent dissipation coefficient, C2. diff --git a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam index d322c3706a..9e374a0e88 100644 --- a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam @@ -46,7 +46,7 @@ fincl1 = 'U:A','PS:A','T:A','V:A','OMEGA:A','Z3:A','PRECT:A', 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'Richardson_num', 'shear_sqd', +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', fincl2 = 'CLDTOT', 'CLDST','CDNUMC','CLDLIQ','CLDICE','FLUT', 'LWCF','SWCF','PRECT' clubb_history = .true. @@ -77,4 +77,4 @@ clubb_vars_zm= 'wp2', 'rtp2', 'thlp2', 'rtpthlp', 'wprtp', 'wpthlp', 'wp4', 'up2 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'Richardson_num', 'shear_sqd' +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' diff --git a/cime_config/usermods_dirs/scam_mandatory/shell_commands b/cime_config/usermods_dirs/scam_mandatory/shell_commands index 5230507d8a..4fa8390aa5 100755 --- a/cime_config/usermods_dirs/scam_mandatory/shell_commands +++ b/cime_config/usermods_dirs/scam_mandatory/shell_commands @@ -10,6 +10,6 @@ # Note that clm cannot use initial conditions with SCAM -so will only use specified phenology # Only change if CLM_FORCE_COLDSTART exists. -if [ `./xmlquery --value CLM_FORCE_COLDSTART |& grep -c 'ERROR'` -eq 0 ]; then +if [ `./xmlquery --value CLM_FORCE_COLDSTART 2>&1 | grep -c 'ERROR'` -eq 0 ]; then ./xmlchange CLM_FORCE_COLDSTART='on' fi From a019b233197289b2288cd74573ead9c3710a6383 Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 24 Jan 2024 13:26:56 -0700 Subject: [PATCH 06/17] Addressing some review comments --- bld/namelist_files/namelist_defaults_cam.xml | 3 -- src/physics/cam/clubb_intr.F90 | 32 +++++++++++++++++++- 2 files changed, 31 insertions(+), 4 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 3c89487fbe..3322e9bb72 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2159,7 +2159,6 @@ 10.0 4.0 0.0 - 5.0 .true. .false. @@ -2178,8 +2177,6 @@ .false. .false. .false. - 0.5 - 25.0 diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index a1aacfab5d..94596a37b2 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -1088,6 +1088,8 @@ subroutine clubb_readnl(nlfile) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_detice_rad") call mpi_bcast(clubb_detphase_lowtemp, 1, mpi_real8, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_detphase_lowtemp") + call mpi_bcast(clubb_iiPDF_type, 1, mpi_integer, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_iiPDF_type") call mpi_bcast(clubb_l_use_C7_Richardson, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_use_C7_Richardson") @@ -1170,7 +1172,35 @@ subroutine clubb_readnl(nlfile) call mpi_bcast(clubb_l_standard_term_ta, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_standard_term_ta") call mpi_bcast(clubb_l_partial_upwind_wp3, 1, mpi_logical, mstrid, mpicom, ierr) - if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_partial_upwind_wp3") + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_partial_upwind_wp3" + call mpi_bcast(clubb_l_C2_cloud_frac, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_C2_cloud_frac") + call mpi_bcast(clubb_l_calc_thlp2_rad, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_calc_thlp2_rad") + call mpi_bcast(clubb_l_calc_w_corr, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_calc_w_corr") + call mpi_bcast(clubb_l_const_Nc_in_cloud, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_const_Nc_in_cloud") + call mpi_bcast(clubb_l_diagnose_correlations, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_diagnose_correlations") + call mpi_bcast(clubb_l_diffuse_rtm_and_thlm, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_diffuse_rtm_and_thlm") + call mpi_bcast(clubb_l_fix_w_chi_eta_correlations, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_fix_w_chi_eta_correlations") + call mpi_bcast(clubb_l_prescribed_avg_deltaz, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_prescribed_avg_deltaz") + call mpi_bcast(clubb_l_rtm_nudge, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_rtm_nudge") + call mpi_bcast(clubb_l_stability_correct_Kh_N2_zm, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_stability_correct_Kh_N2_zm") + call mpi_bcast(clubb_l_tke_aniso, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_tke_aniso") + call mpi_bcast(clubb_l_upwind_xm_ma, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_upwind_xm_ma") + call mpi_bcast(clubb_l_use_precip_frac, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_use_precip_frac") + call mpi_bcast(clubb_l_uv_nudge, 1, mpi_logical, mstrid, mpicom, ierr) + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_uv_nudge") ! Overwrite defaults if they are true if (clubb_history) stats_metadata%l_stats = .true. From 544e33c363741892a77552f11ee250bf330e84a7 Mon Sep 17 00:00:00 2001 From: Katetc Date: Tue, 30 Jan 2024 15:16:27 -0700 Subject: [PATCH 07/17] Addressing more initial review comments --- .../testmods_dirs/cam/silhs/user_nl_cam | 4 +- src/physics/cam/clubb_intr.F90 | 69 +++++++++++++------ 2 files changed, 50 insertions(+), 23 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam index 9e374a0e88..ec4b6a4bfc 100644 --- a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam @@ -46,7 +46,7 @@ fincl1 = 'U:A','PS:A','T:A','V:A','OMEGA:A','Z3:A','PRECT:A', 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', 'Ri_zm' fincl2 = 'CLDTOT', 'CLDST','CDNUMC','CLDLIQ','CLDICE','FLUT', 'LWCF','SWCF','PRECT' clubb_history = .true. @@ -77,4 +77,4 @@ clubb_vars_zm= 'wp2', 'rtp2', 'thlp2', 'rtpthlp', 'wprtp', 'wpthlp', 'wp4', 'up2 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', 'Ri_zm' diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 94596a37b2..9ae5eddbd7 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -1427,7 +1427,7 @@ subroutine clubb_ini_cam(pbuf2d) logical, parameter :: l_input_fields = .false. ! Always false for CAM-CLUBB. logical, parameter :: l_update_pressure = .false. ! Always false for CAM-CLUBB. - integer :: nlev + integer :: nlev, ierr=0 real(r8) :: & C1, C1b, C1c, C2rt, C2thl, C2rtthl, & @@ -1465,7 +1465,8 @@ subroutine clubb_ini_cam(pbuf2d) allocate( & pdf_params_chnk(begchunk:endchunk), & pdf_params_zm_chnk(begchunk:endchunk), & - pdf_implicit_coefs_terms_chnk(begchunk:endchunk) ) + pdf_implicit_coefs_terms_chnk(begchunk:endchunk), stat=ierr ) + if( ierr /= 0 ) call endrun(' clubb_ini_cam: failed to allocate pdf_params') ! ----------------------------------------------------------------- ! ! Determine how many constituents CLUBB will transport. Note that @@ -1831,13 +1832,18 @@ subroutine clubb_ini_cam(pbuf2d) stats_zt(:), stats_zm(:), stats_sfc(:), & stats_rad_zt(:), stats_rad_zm(:)) - allocate(out_zt(pcols,pverp,stats_zt(1)%num_output_fields)) - allocate(out_zm(pcols,pverp,stats_zm(1)%num_output_fields)) - allocate(out_sfc(pcols,1,stats_sfc(1)%num_output_fields)) + allocate(out_zt(pcols,pverp,stats_zt(1)%num_output_fields), stat=ierr) + if( ierr /= 0 ) call endrun( 'clubb_ini_cam: Unable to allocate out_zt' ) + allocate(out_zm(pcols,pverp,stats_zm(1)%num_output_fields), stat=ierr) + if( ierr /= 0 ) call endrun( 'clubb_ini_cam: Unable to allocate out_zm' ) + allocate(out_sfc(pcols,1,stats_sfc(1)%num_output_fields), stat=ierr) + if( ierr /= 0 ) call endrun( 'clubb_ini_cam: Unable to allocate out_sfc' ) if ( stats_metadata%l_output_rad_files ) then - allocate(out_radzt(pcols,pverp,stats_rad_zt(1)%num_output_fields)) - allocate(out_radzm(pcols,pverp,stats_rad_zm(1)%num_output_fields)) + allocate(out_radzt(pcols,pverp,stats_rad_zt(1)%num_output_fields), stat=ierr) + if( ierr /= 0 ) call endrun( 'clubb_ini_cam: Unable to allocate out_radzt' ) + allocate(out_radzm(pcols,pverp,stats_rad_zm(1)%num_output_fields), stat=ierr) + if( ierr /= 0 ) call endrun( 'clubb_ini_cam: Unable to allocate out_radzm' ) end if endif @@ -3796,12 +3802,14 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ptend_loc%q(i,k,ixcldliq) = (rcm(i,k) - state1%q(i,k,ixcldliq)) / hdtime ! Tendency of liquid water ptend_loc%s(i,k) = (clubb_s(i,k) - state1%s(i,k)) / hdtime ! Tendency of static energy - rtm_integral_ltend(i) = rtm_integral_ltend(i) + ptend_loc%q(i,k,ixcldliq)*state1%pdel(i,k)/gravit - rtm_integral_vtend(i) = rtm_integral_vtend(i) + ptend_loc%q(i,k,ixq)*state1%pdel(i,k)/gravit + rtm_integral_ltend(i) = rtm_integral_ltend(i) + ptend_loc%q(i,k,ixcldliq)*state1%pdel(i,k) + rtm_integral_vtend(i) = rtm_integral_vtend(i) + ptend_loc%q(i,k,ixq)*state1%pdel(i,k) end do end do - + + rtm_integral_ltend(i) = rtm_integral_ltend(i)/gravit + rtm_integral_vtend(i) = rtm_integral_vtend(i)/gravit if (clubb_do_adv) then if (macmic_it == cld_macmic_num_steps) then @@ -4761,10 +4769,10 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & if ( abs( stats_metadata%stats_tsamp/delt - floor(stats_metadata%stats_tsamp/delt) ) > 1.e-8_r8 ) then l_error = .true. ! This will cause the run to stop. write(fstderr,*) 'Error: stats_tsamp should be an even multiple of ', & - 'delt (which is dtmain). Check the appropriate ', & - 'model.in file.' + 'the clubb time step (delt below)' write(fstderr,*) 'stats_tsamp = ', stats_metadata%stats_tsamp write(fstderr,*) 'delt = ', delt + call endrun ("stats_init_clubb: CLUBB stats_tsamp must be an even multiple of the timestep") endif ! Initialize zt (mass points) @@ -4777,6 +4785,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & enddo ntot = i - 1 if ( ntot == nvarmax_zt ) then + l_error = .true. write(fstderr,*) "There are more statistical variables listed in ", & "clubb_vars_zt than allowed for by nvarmax_zt." write(fstderr,*) "Check the number of variables listed for clubb_vars_zt ", & @@ -4788,16 +4797,22 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & stats_zt(j)%num_output_fields = ntot stats_zt(j)%kk = nnzp - allocate( stats_zt(j)%z( stats_zt(j)%kk ) ) + allocate( stats_zt(j)%z( stats_zt(j)%kk ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%z") - allocate( stats_zt(j)%accum_field_values( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) - allocate( stats_zt(j)%accum_num_samples( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) - allocate( stats_zt(j)%l_in_update( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ) ) + allocate( stats_zt(j)%accum_field_values( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%accum_field_values") + allocate( stats_zt(j)%accum_num_samples( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%accum_num_samples") + allocate( stats_zt(j)%l_in_update( 1, 1, stats_zt(j)%kk, stats_zt(j)%num_output_fields ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%l_in_update") call stats_zero( stats_zt(j)%kk, stats_zt(j)%num_output_fields, stats_zt(j)%accum_field_values, & stats_zt(j)%accum_num_samples, stats_zt(j)%l_in_update ) - allocate( stats_zt(j)%file%grid_avg_var( stats_zt(j)%num_output_fields ) ) - allocate( stats_zt(j)%file%z( stats_zt(j)%kk ) ) + allocate( stats_zt(j)%file%grid_avg_var( stats_zt(j)%num_output_fields ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%file%grid_avg_var") + allocate( stats_zt(j)%file%z( stats_zt(j)%kk ), stat=ierr ) + if( ierr /= 0 ) call endrun("stats_init_clubb: Failed to allocate stats_zt%file%z") ! Default initialization for array indices for zt call stats_init_zt_api( clubb_vars_zt, & @@ -4814,6 +4829,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & end do ntot = i - 1 if ( ntot == nvarmax_zm ) then + l_error = .true. ! This will cause the run to stop. write(fstderr,*) "There are more statistical variables listed in ", & "clubb_vars_zm than allowed for by nvarmax_zm." write(fstderr,*) "Check the number of variables listed for clubb_vars_zm ", & @@ -4889,6 +4905,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & end do ntot = i - 1 if ( ntot == nvarmax_rad_zm ) then + l_error = .true. ! This will cause the run to stop. write(fstderr,*) "There are more statistical variables listed in ", & "clubb_vars_rad_zm than allowed for by nvarmax_rad_zm." write(fstderr,*) "Check the number of variables listed for clubb_vars_rad_zm ", & @@ -4928,6 +4945,7 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & end do ntot = i - 1 if ( ntot == nvarmax_sfc ) then + l_error = .true. ! This will cause the run to stop. write(fstderr,*) "There are more statistical variables listed in ", & "clubb_vars_sfc than allowed for by nvarmax_sfc." write(fstderr,*) "Check the number of variables listed for clubb_vars_sfc ", & @@ -4990,20 +5008,29 @@ subroutine stats_init_clubb( l_stats_in, stats_tsamp_in, stats_tout_in, & if (stats_metadata%l_output_rad_files) then do i = 1, stats_rad_zt(1)%num_output_fields - call addfld( trim(stats_rad_zt(1)%file%grid_avg_var(i)%name), (/ 'ilev' /), 'A', & + temp1 = trim(stats_rad_zt(1)%file%grid_avg_var(i)%name) + sub = temp1 + if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) + call addfld( trim(sub), (/ 'ilev' /), 'A', & trim(stats_rad_zt(1)%file%grid_avg_var(i)%units), & trim(stats_rad_zt(1)%file%grid_avg_var(i)%description) ) enddo do i = 1, stats_rad_zm(1)%num_output_fields - call addfld( trim(stats_rad_zm(1)%file%grid_avg_var(i)%name), (/ 'ilev' /), 'A', & + temp1 = trim(stats_rad_zm(1)%file%grid_avg_var(i)%name) + sub = temp1 + if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) + call addfld( trim(sub), (/ 'ilev' /), 'A', & trim(stats_rad_zm(1)%file%grid_avg_var(i)%units), & trim(stats_rad_zm(1)%file%grid_avg_var(i)%description) ) enddo endif do i = 1, stats_sfc(1)%num_output_fields - call addfld( trim(stats_sfc(1)%file%grid_avg_var(i)%name), horiz_only, 'A', & + temp1 = trim(stats_sfc(1)%file%grid_avg_var(i)%name) + sub = temp1 + if (len(temp1) > max_fieldname_len) sub = temp1(1:max_fieldname_len) + call addfld( trim(sub), horiz_only, 'A', & trim(stats_sfc(1)%file%grid_avg_var(i)%units), & trim(stats_sfc(1)%file%grid_avg_var(i)%description) ) enddo From 42a6316ad3c776e9951175cae91752ceef7a68df Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 31 Jan 2024 13:30:29 -0700 Subject: [PATCH 08/17] Fixed some oopses --- src/physics/cam/clubb_intr.F90 | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 9ae5eddbd7..bdd3a26ce4 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -1172,7 +1172,7 @@ subroutine clubb_readnl(nlfile) call mpi_bcast(clubb_l_standard_term_ta, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_standard_term_ta") call mpi_bcast(clubb_l_partial_upwind_wp3, 1, mpi_logical, mstrid, mpicom, ierr) - if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_partial_upwind_wp3" + if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_partial_upwind_wp3") call mpi_bcast(clubb_l_C2_cloud_frac, 1, mpi_logical, mstrid, mpicom, ierr) if (ierr /= 0) call endrun(sub//": FATAL: mpi_bcast: clubb_l_C2_cloud_frac") call mpi_bcast(clubb_l_calc_thlp2_rad, 1, mpi_logical, mstrid, mpicom, ierr) @@ -3805,12 +3805,12 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & rtm_integral_ltend(i) = rtm_integral_ltend(i) + ptend_loc%q(i,k,ixcldliq)*state1%pdel(i,k) rtm_integral_vtend(i) = rtm_integral_vtend(i) + ptend_loc%q(i,k,ixq)*state1%pdel(i,k) - end do - end do + end do + end do - rtm_integral_ltend(i) = rtm_integral_ltend(i)/gravit - rtm_integral_vtend(i) = rtm_integral_vtend(i)/gravit - + rtm_integral_ltend(:) = rtm_integral_ltend(:)/gravit + rtm_integral_vtend(:) = rtm_integral_vtend(:)/gravit + if (clubb_do_adv) then if (macmic_it == cld_macmic_num_steps) then From 643c32790dbe9a74f2dc47a95f20a6000fa476f0 Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 6 Mar 2024 16:19:45 -0700 Subject: [PATCH 09/17] Convert CLUBB error locations from rad to degrees --- src/physics/cam/clubb_intr.F90 | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index bdd3a26ce4..6bc701ed4f 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 + use physconst, only: cpair, gravit, rga, latvap, latice, zvir, rh2o, karman, pi use air_composition, only: rairv, cpairv use cam_history_support, only: max_fieldname_len @@ -2496,6 +2496,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & intrinsic :: max character(len=*), parameter :: subr='clubb_tend_cam' + real(r8), parameter :: rad2deg=180.0_r8/pi + real(r8) :: tmp_lon1, tmp_lonN type(grid) :: gr @@ -3451,8 +3453,13 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & ! one value only for the entire chunk if ( err_code == clubb_fatal_error ) then write(fstderr,*) "Fatal error in CLUBB: at timestep ", get_nstep() - write(fstderr,*) "LAT Range: ", state1%lat(1), " -- ", state1%lat(ncol) - write(fstderr,*) "LON: Range:", state1%lon(1), " -- ", state1%lon(ncol) + write(fstderr,*) "LAT Range: ", state1%lat(1)*rad2deg, & + " -- ", state1%lat(ncol)*rad2deg + tmp_lon1 = state1%lon(1)*rad2deg + tmp_lon1 = state1%lon(ncol)*rad2deg + if(tmp_lon1.gt.180.0_r8) then tmp_lon1=tmp_lon1-360.0_r8 + if(tmp_lonN.gt.180.0_r8) then tmp_lonN=tmp_lonN-360.0_r8 + write(fstderr,*) "LON: Range:", tmp_lon1, " -- ", tmp_lonN call endrun(subr//': Fatal error in CLUBB library') end if From 918ae1d89261128618529fafda82cd12e3f3eaa9 Mon Sep 17 00:00:00 2001 From: Katetc Date: Wed, 6 Mar 2024 16:20:34 -0700 Subject: [PATCH 10/17] Update hist list for subcolumns and add clubb_diags test output to mg3 test defs --- .../cam/outfrq9s_mg3/user_nl_cam | 79 +++++++++++++++++++ .../testmods_dirs/cam/silhs/user_nl_cam | 4 +- 2 files changed, 81 insertions(+), 2 deletions(-) diff --git a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam index 8482082dce..e0d415074d 100644 --- a/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam @@ -2,3 +2,82 @@ mfilt=1,1,1,1,1,1 ndens=1,1,1,1,1,1 nhtfrq=9,9,9,9,9,9 inithist='ENDOFRUN' +clubb_history = .true. +clubb_rad_history = .false. +fincl1 = 'Q', 'RHW', 'QRS', 'QRL', 'HR', 'FDL', 'SILHS_CLUBB_PRECIP_FRAC', 'SILHS_CLUBB_ICE_SS_FRAC', +'thlm', 'thvm', 'rtm', 'rcm', 'rvm', 'um', 'vm', 'um_ref','vm_ref','ug', 'vg', 'cloud_frac', 'cloud_cover', +'rcm_in_layer', 'rcm_in_cloud', 'p_in_Pa', 'exner', 'rho_ds_zt', 'thv_ds_zt', 'Lscale', 'Lscale_pert_1', +'Lscale_pert_2', 'T_in_K', 'rel_humidity', 'wp3', 'wpthlp2', 'wp2thlp', 'wprtp2', 'wp2rtp', 'Lscale_up', +'Lscale_down', 'tau_zt', 'Kh_zt', 'wp2thvp', 'wp2rcp', 'wprtpthlp', 'sigma_sqd_w_zt', 'rho', 'radht', +'radht_LW', 'radht_SW', 'Ncm', 'Nc_in_cloud', 'Nc_activated', 'snowslope', 'sed_rcm', 'rsat', 'rsati', +'diam', 'mass_ice_cryst', 'rcm_icedfs', 'u_T_cm', 'rtm_bt', 'rtm_ma', 'rtm_ta', 'rtm_mfl', 'thlm_tacl', +'thlm_cl', 'thlm_forcing', 'thlm_sdmp','thlm_mc', 'thlm_old', 'thlm_without_ta', 'thlm_mfl_min', +'thlm_mfl_max', 'thlm_enter_mfl', 'thlm_exit_mfl', 'rtm_old', 'rtm_without_ta', 'rtm_mfl_min', 'rtm_mfl_max', +'rtm_enter_mfl', 'rtm_exit_mfl', 'um_bt', 'um_ma', 'um_gf', 'um_cf', 'um_ta', 'um_f', 'um_sdmp', 'um_ndg', +'vm_bt', 'vm_ma', 'vm_gf', 'vm_cf', 'vm_ta', 'vm_f', 'vm_sdmp', 'vm_ndg', 'wp3_bt', 'wp3_ma', 'wp3_ta', +'wp3_tp', 'wp3_ac', 'wp3_bp1', 'wp3_pr_turb', 'wp3_pr_dfsn', 'wp3_pr1', 'wp3_pr2', 'wp3_dp1', 'wp3_cl', +'mixt_frac', 'w_1', 'w_2', 'varnce_w_1', 'varnce_w_2', 'thl_1', 'thl_2', 'varnce_thl_1', 'varnce_thl_2', +'rt_1', 'rt_2', 'varnce_rt_1', 'varnce_rt_2', 'rc_1', 'rc_2', 'rsatl_1', 'rsatl_2', 'cloud_frac_1', +'cloud_frac_2', 'a3_coef_zt', 'wp3_on_wp2_zt', 'chi_1', 'chi_2', 'stdev_chi_1', 'stdev_chi_2', +'stdev_eta_1', 'stdev_eta_2', 'covar_chi_eta_1', 'covar_chi_eta_2', 'corr_chi_eta_1', 'corr_chi_eta_2', +'corr_rt_thl_1', 'crt_1', 'crt_2', 'cthl_1', 'cthl_2', 'precip_frac', 'precip_frac_1', 'precip_frac_2', +'Ncnm', 'wp2_zt', 'thlp2_zt', 'wpthlp_zt', 'wprtp_zt', 'rtp2_zt', 'rtpthlp_zt', 'up2_zt', 'vp2_zt', +'upwp_zt', 'vpwp_zt', 'C11_Skw_fnc', 'wp2', 'rtp2', 'thlp2', 'rtpthlp', 'wprtp', 'wpthlp', 'wp4', 'up2', +'vp2', 'wpthvp', 'rtpthvp', 'thlpthvp', 'tau_zm', 'Kh_zm', 'wprcp', 'wm_zm', 'thlprcp', 'rtprcp', 'rcp2', +'upwp', 'vpwp', 'rho_zm', 'sigma_sqd_w', 'Skw_velocity', 'gamma_Skw_fnc', 'C6rt_Skw_fnc', 'C6thl_Skw_fnc', +'C7_Skw_fnc', 'C1_Skw_fnc', 'a3_coef', 'wp3_on_wp2', 'rcm_zm', 'rtm_zm', 'thlm_zm', 'cloud_frac_zm', +'rho_ds_zm', 'thv_ds_zm', 'em', 'mean_w_up', 'mean_w_down', 'shear', 'wp3_zm', 'Frad', 'Frad_LW', 'Frad_SW', +'Frad_LW_up', 'Frad_SW_up', 'Frad_LW_down', 'Frad_SW_down', 'Fprec', 'Fcsed', 'wp2_bt', 'wp2_ma', 'wp2_ta', +'wp2_ac', 'wp2_bp', 'wp2_pr1', 'wp2_pr2', 'wp2_pr3', 'wp2_dp1', 'wp2_dp2', 'wp2_cl', 'wp2_pd', 'wp2_sf', +'vp2_bt', 'vp2_ma', 'vp2_ta', 'vp2_tp', 'vp2_dp1', 'vp2_dp2', 'vp2_pr1', 'vp2_pr2', 'vp2_cl', 'vp2_pd', +'vp2_sf', 'up2_bt', 'up2_ma', 'up2_ta', 'up2_tp', 'up2_dp1', 'up2_dp2', 'up2_pr1', 'up2_pr2', 'up2_cl', +'up2_pd', 'up2_sf', 'wprtp_bt', 'wprtp_ma', 'wprtp_ta', 'wprtp_tp', 'wprtp_ac', 'wprtp_bp', 'wprtp_pr1', +'wprtp_pr2', 'wprtp_pr3', 'wprtp_dp1', 'wprtp_mfl', 'wprtp_cl', 'wprtp_sicl', 'wprtp_pd', 'wprtp_forcing', +'wprtp_mc', 'wpthlp_bt', 'wpthlp_ma', 'wpthlp_ta', 'wpthlp_tp', 'wpthlp_ac', 'wpthlp_bp', 'wpthlp_pr1', +'wpthlp_pr2', 'wpthlp_pr3', 'wpthlp_dp1', 'wpthlp_mfl', 'wpthlp_cl', 'wpthlp_sicl', 'wpthlp_forcing', +'wpthlp_mc', 'rtp2_bt', 'rtp2_ma', 'rtp2_ta', 'rtp2_tp', 'rtp2_dp1', 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', +'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', +'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', +'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', +'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', +'wpthlp_mfl_min', 'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' + +clubb_vars_zt ='thlm', 'thvm', 'rtm', 'rcm', 'rvm', 'um', 'vm', 'um_ref','vm_ref','ug', 'vg', 'cloud_frac', +'cloud_cover', 'rcm_in_layer', 'rcm_in_cloud', 'p_in_Pa', 'exner', 'rho_ds_zt', 'thv_ds_zt', 'Lscale', +'Lscale_pert_1', 'Lscale_pert_2', 'T_in_K', 'rel_humidity', 'wp3', 'wpthlp2', 'wp2thlp', 'wprtp2', 'wp2rtp', +'Lscale_up', 'Lscale_down', 'tau_zt', 'Kh_zt', 'wp2thvp', 'wp2rcp', 'wprtpthlp', 'sigma_sqd_w_zt', 'rho', +'radht', 'radht_LW', 'radht_SW', 'Ncm', 'Nc_in_cloud', 'Nc_activated', 'snowslope', 'sed_rcm', 'rsat', +'rsati', 'diam', 'mass_ice_cryst', 'rcm_icedfs', 'u_T_cm', 'rtm_bt', 'rtm_ma', 'rtm_ta', 'rtm_mfl', +'rtm_tacl', 'rtm_cl', 'rtm_forcing', 'rtm_sdmp','rtm_mc', 'rtm_pd', 'rvm_mc', 'rcm_mc', 'rcm_sd_mg_morr', +'thlm_bt', 'thlm_ma', 'thlm_ta', 'thlm_mfl', 'thlm_tacl', 'thlm_cl', 'thlm_forcing', 'thlm_sdmp','thlm_mc', +'thlm_old', 'thlm_without_ta', 'thlm_mfl_min', 'thlm_mfl_max', 'thlm_enter_mfl', 'thlm_exit_mfl', +'rtm_old', 'rtm_without_ta', 'rtm_mfl_min', 'rtm_mfl_max', 'rtm_enter_mfl', 'rtm_exit_mfl', 'um_bt', +'um_ma', 'um_gf', 'um_cf', 'um_ta', 'um_f', 'um_sdmp', 'um_ndg', 'vm_bt', 'vm_ma', 'vm_gf', 'vm_cf', +'vm_ta', 'vm_f', 'vm_sdmp', 'vm_ndg', 'wp3_bt', 'wp3_ma', 'wp3_ta', 'wp3_tp', 'wp3_ac', 'wp3_bp1', +'wp3_pr_turb', 'wp3_pr_dfsn', 'wp3_pr1', 'wp3_pr2', 'wp3_dp1', 'wp3_cl', 'mixt_frac', 'w_1', 'w_2', +'varnce_w_1', 'varnce_w_2', 'thl_1', 'thl_2', 'varnce_thl_1', 'varnce_thl_2', 'rt_1', +'rt_2', 'varnce_rt_1', 'varnce_rt_2', 'rc_1', 'rc_2', 'rsatl_1', 'rsatl_2', 'cloud_frac_1', 'cloud_frac_2', +'a3_coef_zt', 'wp3_on_wp2_zt', 'chi_1', 'chi_2', 'stdev_chi_1', 'stdev_chi_2', 'stdev_eta_1', 'stdev_eta_2', +'covar_chi_eta_1', 'covar_chi_eta_2', 'corr_chi_eta_1', 'corr_chi_eta_2', 'corr_rt_thl_1', 'crt_1', +'crt_2', 'cthl_1', 'cthl_2', 'precip_frac', 'precip_frac_1', 'precip_frac_2', 'Ncnm', 'wp2_zt', 'thlp2_zt', +'wpthlp_zt', 'wprtp_zt', 'rtp2_zt', 'rtpthlp_zt', 'up2_zt', 'vp2_zt', 'upwp_zt', 'vpwp_zt', 'C11_Skw_fnc' + +clubb_vars_zm= 'wp2', 'rtp2', 'thlp2', 'rtpthlp', 'wprtp', 'wpthlp', 'wp4', 'up2', 'vp2', 'wpthvp', +'rtpthvp', 'thlpthvp', 'tau_zm', 'Kh_zm', 'wprcp', 'wm_zm', 'thlprcp', 'rtprcp', 'rcp2', 'upwp', 'vpwp', +'rho_zm', 'sigma_sqd_w', 'Skw_velocity', 'gamma_Skw_fnc', 'C6rt_Skw_fnc', 'C6thl_Skw_fnc', 'C7_Skw_fnc', +'C1_Skw_fnc', 'a3_coef', 'wp3_on_wp2', 'rcm_zm', 'rtm_zm', 'thlm_zm', 'cloud_frac_zm', 'rho_ds_zm', +'thv_ds_zm', 'em', 'mean_w_up', 'mean_w_down', 'shear', 'wp3_zm', 'Frad', 'Frad_LW', 'Frad_SW', +'Frad_LW_up', 'Frad_SW_up', 'Frad_LW_down', 'Frad_SW_down', 'Fprec', 'Fcsed', 'wp2_bt', 'wp2_ma', 'wp2_ta', +'wp2_ac', 'wp2_bp', 'wp2_pr1', 'wp2_pr2', 'wp2_pr3', 'wp2_dp1', 'wp2_dp2', 'wp2_cl', 'wp2_pd', 'wp2_sf', +'vp2_bt', 'vp2_ma', 'vp2_ta', 'vp2_tp', 'vp2_dp1', 'vp2_dp2', 'vp2_pr1', 'vp2_pr2', 'vp2_cl', 'vp2_pd', 'vp2_sf', 'up2_bt', 'up2_ma', 'up2_ta', 'up2_tp', 'up2_dp1', 'up2_dp2', 'up2_pr1', 'up2_pr2', 'up2_cl', 'up2_pd', +'up2_sf', 'wprtp_bt', 'wprtp_ma', 'wprtp_ta', 'wprtp_tp', 'wprtp_ac', 'wprtp_bp', 'wprtp_pr1', 'wprtp_pr2', +'wprtp_pr3', 'wprtp_dp1', 'wprtp_mfl', 'wprtp_cl', 'wprtp_sicl', 'wprtp_pd', 'wprtp_forcing', 'wprtp_mc', +'wpthlp_bt', 'wpthlp_ma', 'wpthlp_ta', 'wpthlp_tp', 'wpthlp_ac', 'wpthlp_bp', 'wpthlp_pr1', 'wpthlp_pr2', +'wpthlp_pr3', 'wpthlp_dp1', 'wpthlp_mfl', 'wpthlp_cl', 'wpthlp_sicl', 'wpthlp_forcing', 'wpthlp_mc', +'rtp2_bt', 'rtp2_ma', 'rtp2_ta', 'rtp2_tp', 'rtp2_dp1', 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', +'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', +'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', +'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', +'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' + diff --git a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam index ec4b6a4bfc..13ceac46c1 100644 --- a/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam +++ b/cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam @@ -46,7 +46,7 @@ fincl1 = 'U:A','PS:A','T:A','V:A','OMEGA:A','Z3:A','PRECT:A', 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', 'Ri_zm' +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' fincl2 = 'CLDTOT', 'CLDST','CDNUMC','CLDLIQ','CLDICE','FLUT', 'LWCF','SWCF','PRECT' clubb_history = .true. @@ -77,4 +77,4 @@ clubb_vars_zm= 'wp2', 'rtp2', 'thlp2', 'rtpthlp', 'wprtp', 'wpthlp', 'wp4', 'up2 'rtp2_dp2', 'rtp2_cl', 'rtp2_pd', 'rtp2_sf', 'rtp2_forcing', 'rtp2_mc', 'thlp2_bt', 'thlp2_ma', 'thlp2_ta', 'thlp2_tp', 'thlp2_dp1', 'thlp2_dp2', 'thlp2_cl', 'thlp2_pd', 'thlp2_sf', 'thlp2_forcing', 'thlp2_mc', 'rtpthlp_bt', 'rtpthlp_ma', 'rtpthlp_ta', 'rtpthlp_tp1', 'rtpthlp_tp2', 'rtpthlp_dp1', 'rtpthlp_dp2', 'rtpthlp_cl', 'rtpthlp_sf', 'rtpthlp_forcing', 'rtpthlp_mc', 'wpthlp_enter_mfl', 'wpthlp_exit_mfl', 'wprtp_enter_mfl', 'wprtp_exit_mfl', 'wpthlp_mfl_min', -'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd', 'Ri_zm' +'wpthlp_mfl_max', 'wprtp_mfl_min', 'wprtp_mfl_max', 'shear_sqd' From e1f6bf07d02d4e0150051ca736d343f20e96a83c Mon Sep 17 00:00:00 2001 From: Katetc Date: Thu, 7 Mar 2024 17:17:50 -0700 Subject: [PATCH 11/17] Addressing review comments --- bld/namelist_files/namelist_defaults_cam.xml | 17 ++++++++++-- bld/namelist_files/namelist_definition.xml | 27 ++++++++++---------- 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/bld/namelist_files/namelist_defaults_cam.xml b/bld/namelist_files/namelist_defaults_cam.xml index 3322e9bb72..d10f5196cc 100644 --- a/bld/namelist_files/namelist_defaults_cam.xml +++ b/bld/namelist_files/namelist_defaults_cam.xml @@ -2082,12 +2082,19 @@ 0.04 0.1 .false. + .false. + .true. + .false. .true. + .false. .false. .false. + .false. + .false. .false. .false. .false. + .true. .false. .false. .false. @@ -2104,16 +2111,22 @@ .false. .false. .true. + .false. .false. + .false. .false. .false. .true. - .true. - .true. + .false. + .true. + .true. + .true. + .true. .true. .false. .false. .true. + .true. .false. .false. .false. diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 16ae7abbd3..50d811ce68 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4022,11 +4022,12 @@ each Gaussian. -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. + group="clubb_params_nl" valid_values="1,2,3,4,5,6,7" > +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. +iiPDF_ADG1 = 1 (ADG1 PDF), iiPDF_ADG2 = 2 (ADG2 PDF), iiPDF_3D_Luhar = 3 (3D Luhar PDF), +iiPDF_new = 4 (new PDF), iiPDF_TSDADG = 5 (TSDADG PDF), iiPDF_LY93 = 6 (Lewellen and Yoh (1993)), +iiPDF_new_hybrid = 7 (new hybrid PDF) -For rtm nudging +Turn on (true) and off (false) rtm nudging. -Divides Kh_N2_zm by a stability factor +Whether or not we want CLUBB to apply a stability correction Kh_N2_zm. -For anisotropic turbulent kinetic energy, i.e. -TKE = 1/2 (u'^2 + v'^2 + w'^2) +Use anisotropic turbulent kinetic energy in the CLUBB higher order closure, i.e. +calculate TKE = 1/2 (u'^2 + v'^2 + w'^2). This improves the simulation of complex +turbulence but at a greater cost than running without. -This flag determines whether we want to use an upwind -differencing approximation rather than a centered -differencing for turbulent or mean advection terms. It +This flag determines whether we want to use an upwind differencing approximation +rather than a centered differencing for turbulent or mean advection terms. It affects rtm, thlm, sclrm, um and vm. @@ -4310,7 +4311,7 @@ is used. -For wind speed nudging. +Turn on (true) or off (false) uv wind speed nudging. Date: Tue, 26 Mar 2024 15:53:23 -0600 Subject: [PATCH 12/17] Small bug fix --- src/physics/cam/clubb_intr.F90 | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 6bc701ed4f..13d5fff1df 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -3457,8 +3457,8 @@ subroutine clubb_tend_cam( state, ptend_all, pbuf, hdtime, & " -- ", state1%lat(ncol)*rad2deg tmp_lon1 = state1%lon(1)*rad2deg tmp_lon1 = state1%lon(ncol)*rad2deg - if(tmp_lon1.gt.180.0_r8) then tmp_lon1=tmp_lon1-360.0_r8 - if(tmp_lonN.gt.180.0_r8) then tmp_lonN=tmp_lonN-360.0_r8 + if(tmp_lon1.gt.180.0_r8) tmp_lon1=tmp_lon1-360.0_r8 + if(tmp_lonN.gt.180.0_r8) tmp_lonN=tmp_lonN-360.0_r8 write(fstderr,*) "LON: Range:", tmp_lon1, " -- ", tmp_lonN call endrun(subr//': Fatal error in CLUBB library') end if From ad1c08ed02e508b6664b30f80efc2b42e47d8e2f Mon Sep 17 00:00:00 2001 From: Katetc Date: Thu, 28 Mar 2024 13:15:17 -0600 Subject: [PATCH 13/17] CLUBB diagnostics test update plus addressing Adams review --- bld/namelist_files/namelist_definition.xml | 3 ++- .../testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/bld/namelist_files/namelist_definition.xml b/bld/namelist_files/namelist_definition.xml index 50d811ce68..c9a825ec1a 100644 --- a/bld/namelist_files/namelist_definition.xml +++ b/bld/namelist_files/namelist_definition.xml @@ -4109,7 +4109,8 @@ Diagnose correlations instead of using fixed ones -Diffuses rtm and thlm +Implicit diffusion on moisture and temperature, implemented within CLUBB's +matrix equations for wprtp/rtm and wpthlp/thlm. Date: Fri, 29 Mar 2024 17:24:54 -0600 Subject: [PATCH 14/17] Remove threadprivate calls for stats (not needed) --- src/physics/cam/clubb_intr.F90 | 3 --- 1 file changed, 3 deletions(-) diff --git a/src/physics/cam/clubb_intr.F90 b/src/physics/cam/clubb_intr.F90 index 5d3c095a46..c5bdcd71ce 100644 --- a/src/physics/cam/clubb_intr.F90 +++ b/src/physics/cam/clubb_intr.F90 @@ -48,12 +48,9 @@ module clubb_intr stats_rad_zm(pcols), & ! stats_rad_zm grid stats_sfc(pcols) ! stats_sfc -!$omp threadprivate(stats_zt, stats_zm, stats_rad_zt, stats_rad_zm, stats_sfc) - type (stats_metadata_type) :: & stats_metadata -!$omp threadprivate(stats_metadata) #endif From 7ac0af54aa6964d06a1d03b2d33410265127ddcc Mon Sep 17 00:00:00 2001 From: Katetc Date: Fri, 29 Mar 2024 17:28:28 -0600 Subject: [PATCH 15/17] Update testlist to include a threaded FV test --- cime_config/testdefs/testlist_cam.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 7cd5767648..036faf0075 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -262,7 +262,7 @@ - + From 1f0c3103f798f331df957df2039e40645203b4ef Mon Sep 17 00:00:00 2001 From: katetc Date: Thu, 11 Apr 2024 15:28:13 -0600 Subject: [PATCH 16/17] New threaded test hitting wallclock limit in aux_cam suite. Increased limit --- cime_config/testdefs/testlist_cam.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cime_config/testdefs/testlist_cam.xml b/cime_config/testdefs/testlist_cam.xml index 036faf0075..4889a720fc 100644 --- a/cime_config/testdefs/testlist_cam.xml +++ b/cime_config/testdefs/testlist_cam.xml @@ -269,7 +269,7 @@ - + From d2662b4313d423504fd0b23f95ad1a97cf80f1ae Mon Sep 17 00:00:00 2001 From: katetc Date: Fri, 12 Apr 2024 14:52:15 -0600 Subject: [PATCH 17/17] Update ChangeLog --- doc/ChangeLog | 158 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 158 insertions(+) diff --git a/doc/ChangeLog b/doc/ChangeLog index 604f195122..4165695363 100644 --- a/doc/ChangeLog +++ b/doc/ChangeLog @@ -1,3 +1,161 @@ +=============================================================== + +Tag name: cam6_3_155 +Originator(s): katec,vlarson,bstephens82,huebleruwm,zarzycki,JulioTBacmeister +Date: April 11, 2024 +One-line Summary: Update CLUBB and SILHS to new UWM external +Github PR URL: https://github.com/ESCOMP/CAM/pull/960 + +Purpose of changes (include the issue number and title text for each relevant GitHub issue): + - Update to new CLUBB external with some taus code modifications https://github.com/ESCOMP/CAM/issues/956 + - Convert CLUBB lat/lon crash remport from radians to degrees https://github.com/ESCOMP/CAM/issues/971 + - Parameter changes related to optimizing CLUBB's taus code for CESM3 https://github.com/ESCOMP/CAM/issues/953 + +Describe any changes made to build system: + - Modify a test to include threading ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s + - Add CLUBB stats output to an ERP or regular aux_cam test via outfrq9s_mg3 test mods + +Describe any changes made to the namelist: + - Add new fields clubb_bv_efold, clubb_wpxp_Ri_exp, clubb_z_displace to default list + - Add default values and namelist definition entries for many CLUBB namelist fields that were previously missing. + +List any changes to the defaults for the boundary datasets: None + +Describe any substantial timing or memory changes: None + +Code reviewed by: cacraig, adamrher, nusbaume, bstephens + +List all files eliminated: None + +List all files added and what they do: None + +List all existing files that have been modified, and describe the changes: +M Externals_CAM.cfg + - Point to new tag for CLUBB and SILHS externals + +M bld/build-namelist +M bld/namelist_files/namelist_defaults_cam.xml +M bld/namelist_files/namelist_definition.xml + - New namelist fields for CLUBB plus improved documentation and specified defaults for some older fields + +M cime_config/testdefs/testlist_cam.xml + - Change one test to be multithreaded + +M cime_config/testdefs/testmods_dirs/cam/outfrq9s_mg3/user_nl_cam + - Add CLUBB stats history to tests using these mods + +M cime_config/testdefs/testmods_dirs/cam/silhs/user_nl_cam + - Update CLUBB stats history to remove Richardson_num which is no longer output + +M cime_config/usermods_dirs/scam_mandatory/shell_commands + - Update shell redirects + +M src/physics/cam/clubb_intr.F90 +M src/physics/cam/subcol_SILHS.F90 + - Updates to support the new CLUBB and SILHS externals + +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. + +Some tests have namelist changes due to changed stream_datafiles name in ice_in + +derecho/intel/aux_cam: + + ERP_Ln9.C96_C96_mg17.F2000climo.derecho_intel.cam-outfrq9s_mg3 (Overall: PEND) details: + ERP_Ln9.f09_f09_mg17.FCSD_HCO.derecho_intel.cam-outfrq9s (Overall: FAIL) details: + - pre-existing failures + + SMS_Ld1.f09_f09_mg17.FCHIST_GC.derecho_intel.cam-outfrq1d (Overall: FAIL) details: + - Current failure, but should be fixed when cime external is next updated + + SMS_Ld5.f09_f09_mg17.PC6.derecho_intel.cam-cam6_port_f09 (Overall: NLFAIL) details: + - New namelist fields for cam6 but CLUBB not used in Port compset + + ERC_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq3s_cosp (Overall: DIFF) details: + ERC_D_Ln9_P144x1.ne16pg3_ne16pg3_mg17.QPC6HIST.derecho_intel.cam-outfrq3s_ttrac_usecase (Overall: DIFF) details: + ERP_D_Ln9.f19_f19_mg17.QPC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.F2000dev.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_D_Ln9.ne30pg3_ne30pg3_mg17.FLTHIST.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + ERP_D_Ln9_P64x2.f09_f09_mg17.QSC6.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ld3.f09_f09_mg17.FWHIST.derecho_intel.cam-reduced_hist1d (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2000dev.derecho_intel.cam-outfrq9s_mg3 (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.F2010climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f09_f09_mg17.FHIST_BDRD.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.f19_f19_mg17.FWsc1850.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30_ne30_mg17.FCnudged.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + ERP_Ln9_P24x3.f45_f45_mg37.QPWmaC6.derecho_intel.cam-outfrq9s_mee_fluxes (Overall: DIFF) details: + ERS_Ld3.f10_f10_mg37.F1850.derecho_intel.cam-outfrq1d_14dec_ghg_cam_dev (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_P288x1.mpasa120_mpasa120.F2000climo.derecho_intel.cam-outfrq9s_mpasa120 (Overall: DIFF) details: + ERS_Ln9_P36x1.mpasa480_mpasa480.F2000climo.derecho_intel.cam-outfrq9s_mpasa480 (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.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.FXHIST.derecho_intel.cam-outfrq9s_amie (Overall: DIFF) details: + SMS_D_Ln9.f19_f19_mg17.QPC2000climo.derecho_intel.cam-outfrq3s_usecase (Overall: DIFF) details: + SMS_D_Ln9.ne16_ne16_mg17.FX2000.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.ne30pg3_ne30pg3_mg17.FMTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne0ARCTICne30x4_ne0ARCTICne30x4_mt12.FHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne0CONUSne30x8_ne0CONUSne30x8_mt12.FCHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9_P1280x1.ne30pg3_ne30pg3_mg17.FCLTHIST.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_D_Ln9.T42_T42.FSCAM.derecho_intel.cam-outfrq9s (Overall: DIFF) details: + SMS_Ld1.f09_f09_mg17.FW2000climo.derecho_intel.cam-outfrq1d (Overall: DIFF) details: + SMS_Ld1.f19_f19.F2000dev.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_Lm13.f10_f10_mg37.F2000climo.derecho_intel.cam-outfrq1m (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.F2000climo.derecho_intel.cam-silhs (Overall: DIFF) details: + SMS_Ln9.f19_f19_mg17.FHIST.derecho_intel.cam-outfrq9s_nochem (Overall: DIFF) details: + SMS_Ln9.ne30pg3_ne30pg3_mg17.FW2000climo.derecho_intel.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + - All tests using CLUBB will see small answer changes + +izumi/nag/aux_cam: + DAE.f45_f45_mg37.FHS94.izumi_nag.cam-dae (Overall: FAIL) details: + - pre-existing failure + + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_am (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_cospsathist (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERC_D_Ln9.f10_f10_mg37.QPWmaC6.izumi_nag.cam-outfrq3s (Overall: DIFF) details: + ERI_D_Ln18.f19_f19_mg17.QPC6.izumi_nag.cam-ghgrmp_e8 (Overall: DIFF) details: + ERP_Ln9.ne5pg3_ne5pg3_mg37.QPC6.izumi_nag.cam-outfrq9s_clubbmf (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.QPC6.izumi_nag.cam-outfrq3s_ba (Overall: DIFF) details: + SMS_P48x1_D_Ln3.f09_f09_mg17.QPC6HIST.izumi_nag.cam-outfrq3s_co2cycle_usecase (Overall: DIFF) details: + - All tests using CLUBB will see small answer changes + +izumi/gnu/aux_cam: + SMS_Ld5.f09_f09_mg17.PC6.izumi_gnu.cam-cam6_port_f09_rrtmgp (Overall: NLFAIL) details: + - New namelist fields for cam6 but CLUBB not used in Port compset + + ERP_D_Ln9.ne3pg3_ne3pg3_mg37.QPC6.izumi_gnu.cam-outfrq9s_rrtmgp (Overall: DIFF) details: + SMS_D_Ln9.f10_f10_mg37.2000_CAM%DEV%GHGMAM4_CLM50%SP_CICE%PRES_DOCN%DOM_MOSART_SGLC_SWAV_SESP.izumi_gnu.cam-outfrq9s (Overall: DIFF) details: + - All tests using CLUBB will see small answer changes + +CAM tag used for the baseline comparison tests if different than previous +tag: previous tag - cam6_3_154 + +Summarize any changes to answers, i.e., +- what code configurations: All configurations that use CLUBB will see answer changes (cam6 and cam_dev) +- what platforms/compilers: All platforms and compilers +- nature of change (roundoff; larger than roundoff but same climate; new +climate): Larger than roundoff but very similar climate (not verified by ECT) + +If this tag changes climate describe the run(s) done to evaluate the new +climate in enough detail that it(they) could be reproduced: +- Compare cam6_3_154 to development branch in a 1 year F2000dev f09_f09_mg17 case +- Diagnostics here: https://webext.cgd.ucar.edu/F2000climo/newCLUBBtesting/larson_tag_20231115.katemerge.011124-1252.F2000dev.f09_f09_mg17_1_2_vs_larson_tag_control.cam6_3_145.011124-1252.F2000dev.f09_f09_mg17_1_2/ + ===============================================================