LCOV - code coverage report
Current view: | top level - physics/clubb/src/CLUBB_core - model_flags.F90 (source / functions) |  |  | Hit | Total | Coverage
Test: | coverage.info |  | Lines: | 186 | 187 | 99.5 %
Date: | 2024-12-17 22:39:59 |  | Functions: | 3 | 4 | 75.0 %

              Line data    Source code
           1             : !-----------------------------------------------------------------------
           2             : ! $Id$
           3             : !===============================================================================
           4             : module model_flags
           5             :
           6             : ! Description:
           7             : !   Various model options that can be toggled off and on as desired.
           8             :
           9             : ! References:
          10             : !   None
          11             : !-------------------------------------------------------------------------------
          12             :
          13             :   implicit none
          14             :
          15             :   public :: clubb_config_flags_type, set_default_clubb_config_flags, &
          16             :             initialize_clubb_config_flags_type, print_clubb_config_flags
          17             :
          18             :   private ! Default Scope
          19             :
          20             :   ! Options for the two component normal (double Gaussian) PDF type to use for
          21             :   ! the w, rt, and theta-l (or w, chi, and eta) portion of CLUBB's multivariate,
          22             :   ! two-component PDF.
          23             :   integer, parameter, public :: &
          24             :     iiPDF_ADG1 = 1,       & ! ADG1 PDF
          25             :     iiPDF_ADG2 = 2,       & ! ADG2 PDF
          26             :     iiPDF_3D_Luhar = 3,   & ! 3D Luhar PDF
          27             :     iiPDF_new = 4,        & ! new PDF
          28             :     iiPDF_TSDADG = 5,     & ! new TSDADG PDF
          29             :     iiPDF_LY93 = 6,       & ! Lewellen and Yoh (1993)
          30             :     iiPDF_new_hybrid = 7    ! new hybrid PDF
          31             :
          32             :   ! Options for the placement of the call to CLUBB's PDF.
          33             :   integer, parameter, public :: &
          34             :     ipdf_pre_advance_fields   = 1,   & ! Call before advancing predictive fields
          35             :     ipdf_post_advance_fields  = 2,   & ! Call after advancing predictive fields
          36             :     ipdf_pre_post_advance_fields = 3   ! Call both before and after advancing
          37             :                                        ! predictive fields
          38             :
          39             :   integer, parameter, public :: &
          40             :     lapack          = 1,  & ! Use lapack library for matrix solves
          41             :     penta_lu        = 2,  & ! Use penta_lu solver for 5 banded matrices
          42             :     tridiag_lu      = 2,  & ! Use tridiag_lu solver for 3 banded matrices
          43             :     penta_bicgstab  = 3     ! Use bicgstab to solve 5 banded matrices
          44             :
          45             :   logical, parameter, public ::  &
          46             :     l_pos_def            = .false., & ! Flux limiting positive definite scheme on rtm
          47             :     l_hole_fill          = .true.,  & ! Hole filling pos def scheme on wp2,up2,rtp2,etc
          48             :     l_clip_turb_adv      = .false.    ! Corrects thlm/rtm when w'th_l'/w'r_t' is clipped
          49             :
          50             :   logical, parameter, public :: &
          51             : #ifdef BYTESWAP_IO
          52             :     l_byteswap_io = .true.,   & ! Don't use the native byte ordering in GrADS output
          53             : #else
          54             :     l_byteswap_io = .false.,  & ! Use the native byte ordering in GrADS output
          55             : #endif
          56             :     l_gamma_Skw   = .true.      ! Use a Skw dependent gamma parameter
          57             :
          58             :   logical, parameter, public :: &
          59             :     l_use_boussinesq = .false.  ! Flag to use the Boussinesq form of the
          60             :                                 ! predictive equations.  The predictive
          61             :                                 ! equations are anelastic by default.
          62             :
          63             :   logical, parameter, public :: &
          64             :     ! Flag to use explicit turbulent advection in the wp3 predictive equation.
          65             :     l_explicit_turbulent_adv_wp3 = .false.,  &
          66             :     ! Flag to use explicit turbulent advection in the wpxp predictive equation.
          67             :     l_explicit_turbulent_adv_wpxp = .false., &
          68             :     ! Flag to use explicit turbulent advection in the xp2 and xpyp predictive
          69             :     ! equations.
          70             :     l_explicit_turbulent_adv_xpyp = .false.
          71             :
          72             :   ! Flag to advance xp3 using a simplified version of the d(xp3)/dt predictive
          73             :   ! equation or calculate it using a steady-state approximation.  When the flag
          74             :   ! is turned off, the Larson and Golaz (2005) ansatz to calculate xp3 after
          75             :   ! calculating Skx using the ansatz.
          76             :   logical, parameter, public :: &
          77             :     l_advance_xp3 = .false.
          78             :
          79             :   logical, parameter, public :: &
          80             :     l_morr_xp2_mc = .false. ! Flag to include the effects of rain evaporation
          81             :                             ! on rtp2 and thlp2.  The moister (rt_1 or rt_2)
          82             :                             ! and colder (thl_1 or thl_2) will be fed into
          83             :                             ! the morrison microphys, and rain evaporation will
          84             :                             ! be allowed to increase variances
          85             :
          86             :   logical, parameter, public :: &
          87             :     l_evaporate_cold_rcm = .false. ! Flag to evaporate cloud water at temperatures
          88             :                                    ! colder than -37C.  This is to be used for
          89             :                                    ! Morrison microphysics, to prevent excess ice
          90             :
          91             :   logical, parameter, public :: &
          92             :     l_cubic_interp = .false.      ! Flag to convert grid points with cubic monotonic
          93             :                                   ! spline interpolation as opposed to linear interpolation.
          94             :
          95             :   logical, parameter, public :: &
          96             :     l_upwind_Kh_dp_term = .false.
          97             :
          98             :   ! These are the integer constants that represent the various saturation
          99             :   ! formulas. To add a new formula, add an additional constant here,
         100             :   ! add the logic to check the strings for the new formula in clubb_core and
         101             :   ! this module, and add logic in saturation to call the proper function--
         102             :   ! the control logic will be based on these named constants.
         103             :
         104             :   integer, parameter, public :: &
         105             :     saturation_bolton = 1, & ! Constant for Bolton approximations of saturation
         106             :     saturation_gfdl   = 2, & ! Constant for the GFDL approximation of saturation
         107             :     saturation_flatau = 3, & ! Constant for Flatau approximations of saturation
         108             :     saturation_lookup = 4    ! Use a lookup table for mixing length
         109             :                              ! saturation vapor pressure calculations
         110             :
         111             :   !-----------------------------------------------------------------------------
         112             :   ! Options that can be changed at runtime
         113             :   ! The default values are chosen below and overwritten if desired by the user
         114             :   !-----------------------------------------------------------------------------
         115             :
         116             :   ! Use a quintic polynomial in mono_cubic_interp
         117             :   logical, parameter, public :: &
         118             :     l_quintic_poly_interp = .false.
         119             :
         120             :   logical, parameter, public :: &
         121             :     l_silhs_rad = .false.    ! Resolve radiation over subcolumns using SILHS
         122             :
         123             :   ! Previously used within 'ifdef GFDL'
         124             :   logical, parameter, public :: &
         125             :      I_sat_sphum = .false.       ! h1g, 2010-06-15
         126             :
         127             :   ! Derived type to hold all configurable CLUBB flags
         128             :   type clubb_config_flags_type
         129             :     ! Note that all flags in this data type might also be modified in
         130             :     ! corresponding .in files which would supercede the default values!
         131             :
         132             :     integer :: &
         133             :       iiPDF_type,           & ! Selected option for the two-component normal
         134             :                               ! (double Gaussian) PDF type to use for the w, rt,
         135             :                               ! and theta-l (or w, chi, and eta) portion of
         136             :                               ! CLUBB's multivariate, two-component PDF.
         137             :       ipdf_call_placement,  & ! Selected option for the placement of the call to
         138             :                               ! CLUBB's PDF.
         139             :       penta_solve_method,   & ! Option to set the penta-diagonal matrix solving method
         140             :       tridiag_solve_method, & ! Option to set the tri-diagonal matrix solving method
         141             :       saturation_formula      ! Integer that stores the saturation formula to be used
         142             :
         143             :     logical :: &
         144             :       l_use_precip_frac,            & ! Flag to use precipitation fraction in KK microphysics. The
         145             :                                       ! precipitation fraction is automatically set to 1 when this
         146             :                                       ! flag is turned off.
         147             :       l_predict_upwp_vpwp,          & ! Flag to predict <u'w'> and <v'w'> along with <u> and <v>
         148             :                                       ! alongside the advancement of <rt>, <w'rt'>, <thl>,
         149             :                                       ! <wpthlp>, <sclr>, and <w'sclr'> in subroutine
         150             :                                       ! advance_xm_wpxp.  Otherwise, <u'w'> and <v'w'> are still
         151             :                                       ! approximated by eddy diffusivity when <u> and <v> are
         152             :                                       ! advanced in subroutine advance_windm_edsclrm.
         153             :       l_min_wp2_from_corr_wx,       & ! Flag to base the threshold minimum value of wp2 on keeping
         154             :                                       ! the overall correlation of w and x (w and rt, as well as w
         155             :                                       ! and theta-l) within the limits of -max_mag_correlation_flux
         156             :                                       ! to max_mag_correlation_flux.
         157             :       l_min_xp2_from_corr_wx,       & ! Flag to base the threshold minimum value of xp2 (rtp2 and
         158             :                                       ! thlp2) on keeping the overall correlation of w and x within
         159             :                                       ! the limits of -max_mag_correlation_flux to
         160             :                                       ! max_mag_correlation_flux.
         161             :       l_C2_cloud_frac,              & ! Flag to use cloud fraction to adjust the value of the
         162             :                                       ! turbulent dissipation coefficient, C2.
         163             :       l_diffuse_rtm_and_thlm,       & ! Diffuses rtm and thlm
         164             :       l_stability_correct_Kh_N2_zm, & ! Divides Kh_N2_zm by a stability factor
         165             :       l_calc_thlp2_rad,             & ! Include the contribution of radiation to thlp2
         166             :       l_upwind_xpyp_ta,             & ! This flag determines whether we want to use an upwind
         167             :                                       ! differencing approximation rather than a centered
         168             :                                       ! differencing for turbulent or mean advection terms. It
         169             :                                       ! affects rtp2, thlp2, up2, vp2, sclrp2, rtpthlp, sclrprtp, &
         170             :                                       ! sclrpthlp.
         171             :       l_upwind_xm_ma,               & ! This flag determines whether we want to use an upwind
         172             :                                       ! differencing approximation rather than a centered
         173             :                                       ! differencing for turbulent or mean advection terms. It
         174             :                                       ! affects rtm, thlm, sclrm, um and vm.
         175             :       l_uv_nudge,                   & ! For wind speed nudging.
         176             :       l_rtm_nudge,                  & ! For rtm nudging
         177             :       l_tke_aniso,                  & ! For anisotropic turbulent kinetic energy, i.e.
         178             :                                       ! TKE = 1/2 (u'^2 + v'^2 + w'^2)
         179             :       l_vert_avg_closure,           & ! Use 2 calls to pdf_closure and the trapezoidal rule to
         180             :                                       ! compute the varibles that are output from high order
         181             :                                       ! closure
         182             :       l_trapezoidal_rule_zt,        & ! If true, the trapezoidal rule is called for the
         183             :                                       ! thermodynamic-level variables output from pdf_closure.
         184             :       l_trapezoidal_rule_zm,        & ! If true, the trapezoidal rule is called for three
         185             :                                       ! momentum-level variables - wpthvp, thlpthvp, and rtpthvp -
         186             :                                       ! output from pdf_closure.
         187             :       l_call_pdf_closure_twice,     & ! This logical flag determines whether or not to call
         188             :                                       ! subroutine pdf_closure twice.  If true, pdf_closure is
         189             :                                       ! called first on thermodynamic levels and then on momentum
         190             :                                       ! levels so that each variable is computed on its native
         191             :                                       ! level.  If false, pdf_closure is only called on
         192             :                                       ! thermodynamic levels, and variables which belong on
         193             :                                       ! momentum levels are interpolated.
         194             :       l_standard_term_ta,           & ! Use the standard discretization for the turbulent advection
         195             :                                       ! terms.  Setting to .false. means that a_1 and a_3 are
         196             :                                       ! pulled outside of the derivative in
         197             :                                       ! advance_wp2_wp3_module.F90 and in
         198             :                                       ! advance_xp2_xpyp_module.F90.
         199             :       l_partial_upwind_wp3,         & ! Flag to use an "upwind" discretization rather
         200             :                                       ! than a centered discretization for the portion
         201             :                                       ! of the wp3 turbulent advection term for ADG1
         202             :                                       ! that is linearized in terms of wp3<t+1>.
         203             :                                       ! (Requires ADG1 PDF and l_standard_term_ta).
         204             :       l_godunov_upwind_wpxp_ta,     & ! This flag determines whether we want to use an upwind
         205             :                                       ! differencing approximation rather than a centered
         206             :                                       ! differencing for turbulent advection terms.
         207             :                                       ! It affects  wpxp only.
         208             :       l_godunov_upwind_xpyp_ta,     & ! This flag determines whether we want to use an upwind
         209             :                                       ! differencing approximation rather than a centered
         210             :                                       ! differencing for turbulent advection terms. It affects
         211             :                                       ! xpyp only.
         212             :       l_use_cloud_cover,            & ! Use cloud_cover and rcm_in_layer to help boost cloud_frac
         213             :                                       ! and rcm to help increase cloudiness at coarser grid
         214             :                                       ! resolutions.
         215             :       l_diagnose_correlations,      & ! Diagnose correlations instead of using fixed ones
         216             :       l_calc_w_corr,                & ! Calculate the correlations between w and the hydrometeors
         217             :       l_const_Nc_in_cloud,          & ! Use a constant cloud droplet conc. within cloud (K&K)
         218             :       l_fix_w_chi_eta_correlations, & ! Use a fixed correlation for s and t Mellor(chi/eta)
         219             :       l_stability_correct_tau_zm,   & ! Use tau_N2_zm instead of tau_zm in wpxp_pr1 stability
         220             :                                       ! correction
         221             :       l_damp_wp2_using_em,          & ! In wp2 equation, use a dissipation formula of
         222             :                                       ! -(2/3)*em/tau_zm, as in Bougeault (1981)
         223             :       l_do_expldiff_rtm_thlm,       & ! Diffuse rtm and thlm explicitly
         224             :       l_Lscale_plume_centered,      & ! Alternate that uses the PDF to compute the perturbed values
         225             :       l_diag_Lscale_from_tau,       & ! First diagnose dissipation time tau, and then diagnose the
         226             :                                       ! mixing length scale as Lscale = tau * tke
         227             :       l_use_C7_Richardson,          & ! Parameterize C7 based on Richardson number
         228             :       l_use_C11_Richardson,         & ! Parameterize C11 and C16 based on Richardson number
         229             :       l_use_shear_Richardson,       & ! Use shear in the calculation of Richardson number
         230             :       l_brunt_vaisala_freq_moist,   & ! Use a different formula for the Brunt-Vaisala frequency in
         231             :                                       ! saturated atmospheres (from Durran and Klemp, 1982)
         232             :       l_use_thvm_in_bv_freq,        & ! Use thvm in the calculation of Brunt-Vaisala frequency
         233             :       l_rcm_supersat_adj,           & ! Add excess supersaturated vapor to cloud water
         234             :       l_damp_wp3_Skw_squared,       & ! Set damping on wp3 to use Skw^2 rather than Skw^4
         235             :       l_prescribed_avg_deltaz,      & ! used in adj_low_res_nu. If .true., avg_deltaz = deltaz
         236             :       l_lmm_stepping,               & ! Apply Linear Multistep Method (LMM) Stepping
         237             :       l_e3sm_config,                & ! Run model with E3SM settings
         238             :       l_vary_convect_depth,         & ! Flag used to calculate convective velocity using
         239             :                                       ! a variable estimate of layer depth based on the depth
         240             :                                       ! over which wpthlp is positive near the ground when true
         241             :                                       ! More information can be found by
         242             :                                       ! Looking at issue #905 on the clubb repo
         243             :       l_use_tke_in_wp3_pr_turb_term, &! Use TKE formulation for wp3 pr_turb term
         244             :       l_use_tke_in_wp2_wp3_K_dfsn,  & ! Use TKE in eddy diffusion for wp2 and wp3
         245             :       l_use_wp3_lim_with_smth_Heaviside, & ! Flag to activate mods on wp3 limiters for conv test
         246             :       l_smooth_Heaviside_tau_wpxp,  & ! Use smoothed Heaviside 'Peskin' function
         247             :                                       ! in the calculation of H_invrs_tau_wpxp_N2
         248             :                                       ! in src/CLUBB_core/mixing_length.F90
         249             :       l_modify_limiters_for_cnvg_test, & ! Flag to activate mods on limiters for conv test
         250             :       l_enable_relaxed_clipping,    & ! Flag to relax clipping on wpxp in
         251             :                                       ! xm_wpxp_clipping_and_stats
         252             :       l_linearize_pbl_winds,        & ! Code to linearize PBL winds
         253             :       l_mono_flux_lim_thlm,         & ! Flag to turn on monotonic flux limiter for thlm
         254             :       l_mono_flux_lim_rtm,          & ! Flag to turn on monotonic flux limiter for rtm
         255             :       l_mono_flux_lim_um,           & ! Flag to turn on monotonic flux limiter for um
         256             :       l_mono_flux_lim_vm,           & ! Flag to turn on monotonic flux limiter for vm
         257             :       l_mono_flux_lim_spikefix,     & ! Flag to implement monotonic flux limiter code that
         258             :                                       ! eliminates spurious drying tendencies at model top
         259             :       l_host_applies_sfc_fluxes       ! Use to determine whether a host model has already applied the surface flux,
         260             :                                       ! to avoid double counting.
         261             :
         262             :   end type clubb_config_flags_type
         263             :
         264             :   contains
         265             :
         266             : !===============================================================================
         267        1536 :   subroutine set_default_clubb_config_flags( iiPDF_type, &
         268             :                                              ipdf_call_placement, &
         269             :                                              penta_solve_method, &
         270             :                                              tridiag_solve_method, &
         271             :                                              saturation_formula, &
         272             :                                              l_use_precip_frac, &
         273             :                                              l_predict_upwp_vpwp, &
         274             :                                              l_min_wp2_from_corr_wx, &
         275             :                                              l_min_xp2_from_corr_wx, &
         276             :                                              l_C2_cloud_frac, &
         277             :                                              l_diffuse_rtm_and_thlm, &
         278             :                                              l_stability_correct_Kh_N2_zm, &
         279             :                                              l_calc_thlp2_rad, &
         280             :                                              l_upwind_xpyp_ta, &
         281             :                                              l_upwind_xm_ma, &
         282             :                                              l_uv_nudge, &
         283             :                                              l_rtm_nudge, &
         284             :                                              l_tke_aniso, &
         285             :                                              l_vert_avg_closure, &
         286             :                                              l_trapezoidal_rule_zt, &
         287             :                                              l_trapezoidal_rule_zm, &
         288             :                                              l_call_pdf_closure_twice, &
         289             :                                              l_standard_term_ta, &
         290             :                                              l_partial_upwind_wp3, &
         291             :                                              l_godunov_upwind_wpxp_ta, &
         292             :                                              l_godunov_upwind_xpyp_ta, &
         293             :                                              l_use_cloud_cover, &
         294             :                                              l_diagnose_correlations, &
         295             :                                              l_calc_w_corr, &
         296             :                                              l_const_Nc_in_cloud, &
         297             :                                              l_fix_w_chi_eta_correlations, &
         298             :                                              l_stability_correct_tau_zm, &
         299             :                                              l_damp_wp2_using_em, &
         300             :                                              l_do_expldiff_rtm_thlm, &
         301             :                                              l_Lscale_plume_centered, &
         302             :                                              l_diag_Lscale_from_tau, &
         303             :                                              l_use_C7_Richardson, &
         304             :                                              l_use_C11_Richardson, &
         305             :                                              l_use_shear_Richardson, &
         306             :                                              l_brunt_vaisala_freq_moist, &
         307             :                                              l_use_thvm_in_bv_freq, &
         308             :                                              l_rcm_supersat_adj, &
         309             :                                              l_damp_wp3_Skw_squared, &
         310             :                                              l_prescribed_avg_deltaz, &
         311             :                                              l_lmm_stepping, &
         312             :                                              l_e3sm_config, &
         313             :                                              l_vary_convect_depth, &
         314             :                                              l_use_tke_in_wp3_pr_turb_term, &
         315             :                                              l_use_tke_in_wp2_wp3_K_dfsn, &
         316             :                                              l_use_wp3_lim_with_smth_Heaviside, &
         317             :                                              l_smooth_Heaviside_tau_wpxp, &
         318             :                                              l_modify_limiters_for_cnvg_test, &
         319             :                                              l_enable_relaxed_clipping, &
         320             :                                              l_linearize_pbl_winds, &
         321             :                                              l_mono_flux_lim_thlm, &
         322             :                                              l_mono_flux_lim_rtm, &
         323             :                                              l_mono_flux_lim_um, &
         324             :                                              l_mono_flux_lim_vm, &
         325             :                                              l_mono_flux_lim_spikefix, &
         326             :                                              l_host_applies_sfc_fluxes )
         327             :
         328             : ! Description:
         329             : !   Sets all CLUBB flags to a default setting.
         330             :
         331             : ! References:
         332             : !   None
         333             : !-------------------------------------------------------------------------------
         334             :
         335             :     implicit none
         336             :
         337             :     ! Output variables
         338             :     integer, intent(out) :: &
         339             :       iiPDF_type,           & ! Selected option for the two-component normal
         340             :                               ! (double Gaussian) PDF type to use for the w, rt,
         341             :                               ! and theta-l (or w, chi, and eta) portion of
         342             :                               ! CLUBB's multivariate, two-component PDF.
         343             :       ipdf_call_placement,  & ! Selected option for the placement of the call to
         344             :                               ! CLUBB's PDF.
         345             :       penta_solve_method,   & ! Option to set the penta-diagonal matrix solving method
         346             :       tridiag_solve_method, & ! Option to set the tri-diagonal matrix solving method
         347             :       saturation_formula      ! Integer that stores the saturation formula to be used
         348             :
         349             :     logical, intent(out) :: &
         350             :       l_use_precip_frac,            & ! Flag to use precipitation fraction in KK microphysics. The
         351             :                                       ! precipitation fraction is automatically set to 1 when this
         352             :                                       ! flag is turned off.
         353             :       l_predict_upwp_vpwp,          & ! Flag to predict <u'w'> and <v'w'> along with <u> and <v>
         354             :                                       ! alongside the advancement of <rt>, <w'rt'>, <thl>,
         355             :                                       ! <wpthlp>, <sclr>, and <w'sclr'> in subroutine
         356             :                                       ! advance_xm_wpxp.  Otherwise, <u'w'> and <v'w'> are still
         357             :                                       ! approximated by eddy diffusivity when <u> and <v> are
         358             :                                       ! advanced in subroutine advance_windm_edsclrm.
         359             :       l_min_wp2_from_corr_wx,       & ! Flag to base the threshold minimum value of wp2 on keeping
         360             :                                       ! the overall correlation of w and x (w and rt, as well as w
         361             :                                       ! and theta-l) within the limits of -max_mag_correlation_flux
         362             :                                       ! to max_mag_correlation_flux.
         363             :       l_min_xp2_from_corr_wx,       & ! Flag to base the threshold minimum value of xp2 (rtp2 and
         364             :                                       ! thlp2) on keeping the overall correlation of w and x within
         365             :                                       ! the limits of -max_mag_correlation_flux to
         366             :                                       ! max_mag_correlation_flux.
         367             :       l_C2_cloud_frac,              & ! Flag to use cloud fraction to adjust the value of the
         368             :                                       ! turbulent dissipation coefficient, C2.
         369             :       l_diffuse_rtm_and_thlm,       & ! Diffuses rtm and thlm
         370             :       l_stability_correct_Kh_N2_zm, & ! Divides Kh_N2_zm by a stability factor
         371             :       l_calc_thlp2_rad,             & ! Include the contribution of radiation to thlp2
         372             :       l_upwind_xpyp_ta,             & ! This flag determines whether we want to use an upwind
         373             :                                       ! differencing approximation rather than a centered
         374             :                                       ! differencing for turbulent or mean advection terms. It
         375             :                                       ! affects rtp2, thlp2, up2, vp2, sclrp2, rtpthlp, sclrprtp, &
         376             :                                       ! sclrpthlp.
         377             :       l_upwind_xm_ma,               & ! This flag determines whether we want to use an upwind
         378             :                                       ! differencing approximation rather than a centered
         379             :                                       ! differencing for turbulent or mean advection terms. It
         380             :                                       ! affects rtm, thlm, sclrm, um and vm.
         381             :       l_uv_nudge,                   & ! For wind speed nudging.
         382             :       l_rtm_nudge,                  & ! For rtm nudging
         383             :       l_tke_aniso,                  & ! For anisotropic turbulent kinetic energy, i.e.
         384             :                                       ! TKE = 1/2 (u'^2 + v'^2 + w'^2)
         385             :       l_vert_avg_closure,           & ! Use 2 calls to pdf_closure and the trapezoidal rule to
         386             :                                       ! compute the varibles that are output from high order
         387             :                                       ! closure
         388             :       l_trapezoidal_rule_zt,        & ! If true, the trapezoidal rule is called for the
         389             :                                       ! thermodynamic-level variables output from pdf_closure.
         390             :       l_trapezoidal_rule_zm,        & ! If true, the trapezoidal rule is called for three
         391             :                                       ! momentum-level variables - wpthvp, thlpthvp, and rtpthvp -
         392             :                                       ! output from pdf_closure.
         393             :       l_call_pdf_closure_twice,     & ! This logical flag determines whether or not to call
         394             :                                       ! subroutine pdf_closure twice.  If true, pdf_closure is
         395             :                                       ! called first on thermodynamic levels and then on momentum
         396             :                                       ! levels so that each variable is computed on its native
         397             :                                       ! level.  If false, pdf_closure is only called on
         398             :                                       ! thermodynamic levels, and variables which belong on
         399             :                                       ! momentum levels are interpolated.
         400             :       l_standard_term_ta,           & ! Use the standard discretization for the turbulent advection
         401             :                                       ! terms.  Setting to .false. means that a_1 and a_3 are
         402             :                                       ! pulled outside of the derivative in
         403             :                                       ! advance_wp2_wp3_module.F90 and in
         404             :                                       ! advance_xp2_xpyp_module.F90.
         405             :       l_partial_upwind_wp3,         & ! Flag to use an "upwind" discretization rather
         406             :                                       ! than a centered discretization for the portion
         407             :                                       ! of the wp3 turbulent advection term for ADG1
         408             :                                       ! that is linearized in terms of wp3<t+1>.
         409             :                                       ! (Requires ADG1 PDF and l_standard_term_ta).
         410             :       l_godunov_upwind_wpxp_ta,     & ! This flag determines whether we want to use an upwind
         411             :                                       ! differencing approximation rather than a centered
         412             :                                       ! differencing for turbulent advection terms.
         413             :                                       ! It affects  wpxp only.
         414             :       l_godunov_upwind_xpyp_ta,     & ! This flag determines whether we want to use an upwind
         415             :                                       ! differencing approximation rather than a centered
         416             :                                       ! differencing for turbulent advection terms. It affects
         417             :                                       ! xpyp only.
         418             :       l_use_cloud_cover,            & ! Use cloud_cover and rcm_in_layer to help boost cloud_frac
         419             :                                       ! and rcm to help increase cloudiness at coarser grid
         420             :                                       ! resolutions.
         421             :       l_diagnose_correlations,      & ! Diagnose correlations instead of using fixed ones
         422             :       l_calc_w_corr,                & ! Calculate the correlations between w and the hydrometeors
         423             :       l_const_Nc_in_cloud,          & ! Use a constant cloud droplet conc. within cloud (K&K)
         424             :       l_fix_w_chi_eta_correlations, & ! Use a fixed correlation for s and t Mellor(chi/eta)
         425             :       l_stability_correct_tau_zm,   & ! Use tau_N2_zm instead of tau_zm in wpxp_pr1 stability
         426             :                                       ! correction
         427             :       l_damp_wp2_using_em,          & ! In wp2 equation, use a dissipation formula of
         428             :                                       ! -(2/3)*em/tau_zm, as in Bougeault (1981)
         429             :       l_do_expldiff_rtm_thlm,       & ! Diffuse rtm and thlm explicitly
         430             :       l_Lscale_plume_centered,      & ! Alternate that uses the PDF to compute the perturbed values
         431             :       l_diag_Lscale_from_tau,       & ! First diagnose dissipation time tau, and then diagnose the
         432             :                                       ! mixing length scale as Lscale = tau * tke
         433             :       l_use_C7_Richardson,          & ! Parameterize C7 based on Richardson number
         434             :       l_use_C11_Richardson,         & ! Parameterize C11 and C16 based on Richardson number
         435             :       l_use_shear_Richardson,       & ! Use shear in the calculation of Richardson number
         436             :       l_brunt_vaisala_freq_moist,   & ! Use a different formula for the Brunt-Vaisala frequency in
         437             :                                       ! saturated atmospheres (from Durran and Klemp, 1982)
         438             :       l_use_thvm_in_bv_freq,        & ! Use thvm in the calculation of Brunt-Vaisala frequency
         439             :       l_rcm_supersat_adj,           & ! Add excess supersaturated vapor to cloud water
         440             :       l_damp_wp3_Skw_squared,       & ! Set damping on wp3 to use Skw^2 rather than Skw^4
         441             :       l_prescribed_avg_deltaz,      & ! used in adj_low_res_nu. If .true., avg_deltaz = deltaz
         442             :       l_lmm_stepping,               & ! Apply Linear Multistep Method (LMM) Stepping
         443             :       l_e3sm_config,                & ! Run model with E3SM settings
         444             :       l_vary_convect_depth,         & ! Flag used to calculate convective velocity using
         445             :                                       ! a variable estimate of layer depth based on the depth
         446             :                                       ! over which wpthlp is positive near the ground when true
         447             :                                       ! More information can be found by
         448             :                                       ! Looking at issue #905 on the clubb repo
         449             :       l_use_tke_in_wp3_pr_turb_term,& ! Use TKE formulation for wp3 pr_turb term
         450             :       l_use_tke_in_wp2_wp3_K_dfsn,  & ! Use TKE in eddy diffusion for wp2 and wp3
         451             :       l_use_wp3_lim_with_smth_Heaviside, & ! Flag to activate mods on wp3 limiters for conv test
         452             :       l_smooth_Heaviside_tau_wpxp,  & ! Use smoothed Heaviside 'Peskin' function
         453             :                                       ! in the calculation of H_invrs_tau_wpxp_N2
         454             :                                       ! in src/CLUBB_core/mixing_length.F90
         455             :       l_modify_limiters_for_cnvg_test, & ! Flag to activate mods on limiters for conv test
         456             :       l_enable_relaxed_clipping,    & ! Flag to relax clipping on wpxp in
         457             :                                       ! xm_wpxp_clipping_and_stats
         458             :       l_linearize_pbl_winds,        & ! Code to linearize PBL winds
         459             :       l_mono_flux_lim_thlm,         & ! Flag to turn on monotonic flux limiter for thlm
         460             :       l_mono_flux_lim_rtm,          & ! Flag to turn on monotonic flux limiter for rtm
         461             :       l_mono_flux_lim_um,           & ! Flag to turn on monotonic flux limiter for um
         462             :       l_mono_flux_lim_vm,           & ! Flag to turn on monotonic flux limiter for vm
         463             :       l_mono_flux_lim_spikefix,     & ! Flag to implement monotonic flux limiter code that
         464             :                                       ! eliminates spurious drying tendencies at model top
         465             :       l_host_applies_sfc_fluxes       ! Use to determine whether a host model has already applied the surface flux,
         466             :                                       ! to avoid double counting.
         467             :
         468             : !-----------------------------------------------------------------------
         469             :     ! Begin code
         470             :     ! WARNING: THE DEFAULT VALUES OF THE FLAGS BELOW MAY BE OVERWRITTEN
         471             :     !    BY NAMELIST VALUES FROM, E.G., configurable_clubb_flags_nl!!!
         472             :
         473        1536 :     iiPDF_type = iiPDF_ADG1
         474        1536 :     ipdf_call_placement = ipdf_post_advance_fields
         475        1536 :     penta_solve_method = lapack
         476        1536 :     tridiag_solve_method = lapack
         477        1536 :     saturation_formula = saturation_flatau
         478        1536 :     l_use_precip_frac = .true.
         479        1536 :     l_predict_upwp_vpwp = .true.
         480        1536 :     l_min_wp2_from_corr_wx = .true.
         481        1536 :     l_min_xp2_from_corr_wx = .true.
         482        1536 :     l_C2_cloud_frac = .false.
         483        1536 :     l_diffuse_rtm_and_thlm = .false.
         484        1536 :     l_stability_correct_Kh_N2_zm = .false.
         485        1536 :     l_calc_thlp2_rad = .true.
         486        1536 :     l_upwind_xpyp_ta = .true.
         487        1536 :     l_upwind_xm_ma = .true.
         488        1536 :     l_uv_nudge = .false.
         489        1536 :     l_rtm_nudge = .false.
         490        1536 :     l_tke_aniso = .true.
         491        1536 :     l_vert_avg_closure  = .false.
         492        1536 :     l_trapezoidal_rule_zt = .false.
         493        1536 :     l_trapezoidal_rule_zm = .false.
         494        1536 :     l_call_pdf_closure_twice = .false.
         495        1536 :     l_standard_term_ta = .false.
         496        1536 :     l_partial_upwind_wp3 = .false.
         497        1536 :     l_godunov_upwind_wpxp_ta = .false.
         498        1536 :     l_godunov_upwind_xpyp_ta = .false.
         499        1536 :     l_use_cloud_cover = .false.
         500        1536 :     l_diagnose_correlations = .false.
         501        1536 :     l_calc_w_corr = .false.
         502        1536 :     l_const_Nc_in_cloud = .false.
         503        1536 :     l_fix_w_chi_eta_correlations = .true.
         504        1536 :     l_stability_correct_tau_zm = .false.
         505        1536 :     l_damp_wp2_using_em = .true.
         506        1536 :     l_do_expldiff_rtm_thlm = .false.
         507        1536 :     l_Lscale_plume_centered = .false.
         508        1536 :     l_diag_Lscale_from_tau = .true.
         509        1536 :     l_use_C7_Richardson = .true.
         510        1536 :     l_use_C11_Richardson = .false.
         511        1536 :     l_use_shear_Richardson = .false.
         512        1536 :     l_brunt_vaisala_freq_moist = .false.
         513        1536 :     l_use_thvm_in_bv_freq = .false.
         514        1536 :     l_rcm_supersat_adj = .true.
         515        1536 :     l_damp_wp3_Skw_squared = .true.
         516             : #ifdef GFDL
         517             :     l_prescribed_avg_deltaz = .true.
         518             : #else
         519        1536 :     l_prescribed_avg_deltaz = .false.
         520             : #endif
         521        1536 :     l_lmm_stepping = .false.
         522        1536 :     l_e3sm_config = .false.
         523        1536 :     l_vary_convect_depth = .false.
         524        1536 :     l_use_tke_in_wp3_pr_turb_term = .true.
         525        1536 :     l_use_tke_in_wp2_wp3_K_dfsn = .false.
         526        1536 :     l_use_wp3_lim_with_smth_Heaviside = .false.
         527        1536 :     l_smooth_Heaviside_tau_wpxp = .false.
         528        1536 :     l_modify_limiters_for_cnvg_test = .false.
         529        1536 :     l_enable_relaxed_clipping = .false.
         530        1536 :     l_linearize_pbl_winds = .false.
         531        1536 :     l_mono_flux_lim_thlm = .true.
         532        1536 :     l_mono_flux_lim_rtm = .true.
         533        1536 :     l_mono_flux_lim_um = .true.
         534        1536 :     l_mono_flux_lim_vm = .true.
         535        1536 :     l_mono_flux_lim_spikefix = .true.
         536        1536 :     l_host_applies_sfc_fluxes = .false.
         537             :
         538        1536 :     return
         539             :   end subroutine set_default_clubb_config_flags
         540             :
         541             : !===============================================================================
         542        1536 :   subroutine initialize_clubb_config_flags_type( iiPDF_type,          &
         543             :                                                  ipdf_call_placement, &
         544             :                                                  penta_solve_method, &
         545             :                                                  tridiag_solve_method, &
         546             :                                                  saturation_formula, &
         547             :                                                  l_use_precip_frac, &
         548             :                                                  l_predict_upwp_vpwp, &
         549             :                                                  l_min_wp2_from_corr_wx, &
         550             :                                                  l_min_xp2_from_corr_wx, &
         551             :                                                  l_C2_cloud_frac, &
         552             :                                                  l_diffuse_rtm_and_thlm, &
         553             :                                                  l_stability_correct_Kh_N2_zm, &
         554             :                                                  l_calc_thlp2_rad, &
         555             :                                                  l_upwind_xpyp_ta, &
         556             :                                                  l_upwind_xm_ma, &
         557             :                                                  l_uv_nudge, &
         558             :                                                  l_rtm_nudge, &
         559             :                                                  l_tke_aniso, &
         560             :                                                  l_vert_avg_closure, &
         561             :                                                  l_trapezoidal_rule_zt, &
         562             :                                                  l_trapezoidal_rule_zm, &
         563             :                                                  l_call_pdf_closure_twice, &
         564             :                                                  l_standard_term_ta, &
         565             :                                                  l_partial_upwind_wp3, &
         566             :                                                  l_godunov_upwind_wpxp_ta, &
         567             :                                                  l_godunov_upwind_xpyp_ta, &
         568             :                                                  l_use_cloud_cover, &
         569             :                                                  l_diagnose_correlations, &
         570             :                                                  l_calc_w_corr, &
         571             :                                                  l_const_Nc_in_cloud, &
         572             :                                                  l_fix_w_chi_eta_correlations, &
         573             :                                                  l_stability_correct_tau_zm, &
         574             :                                                  l_damp_wp2_using_em, &
         575             :                                                  l_do_expldiff_rtm_thlm, &
         576             :                                                  l_Lscale_plume_centered, &
         577             :                                                  l_diag_Lscale_from_tau, &
         578             :                                                  l_use_C7_Richardson, &
         579             :                                                  l_use_C11_Richardson, &
         580             :                                                  l_use_shear_Richardson, &
         581             :                                                  l_brunt_vaisala_freq_moist, &
         582             :                                                  l_use_thvm_in_bv_freq, &
         583             :                                                  l_rcm_supersat_adj, &
         584             :                                                  l_damp_wp3_Skw_squared, &
         585             :                                                  l_prescribed_avg_deltaz, &
         586             :                                                  l_lmm_stepping, &
         587             :                                                  l_e3sm_config, &
         588             :                                                  l_vary_convect_depth, &
         589             :                                                  l_use_tke_in_wp3_pr_turb_term, &
         590             :                                                  l_use_tke_in_wp2_wp3_K_dfsn, &
         591             :                                                  l_use_wp3_lim_with_smth_Heaviside, &
         592             :                                                  l_smooth_Heaviside_tau_wpxp, &
         593             :                                                  l_modify_limiters_for_cnvg_test, &
         594             :                                                  l_enable_relaxed_clipping, &
         595             :                                                  l_linearize_pbl_winds, &
         596             :                                                  l_mono_flux_lim_thlm, &
         597             :                                                  l_mono_flux_lim_rtm, &
         598             :                                                  l_mono_flux_lim_um, &
         599             :                                                  l_mono_flux_lim_vm, &
         600             :                                                  l_mono_flux_lim_spikefix, &
         601             :                                                  l_host_applies_sfc_fluxes, &
         602             :                                                  clubb_config_flags )
         603             :
         604             : ! Description:
         605             : !   Initialize the clubb_config_flags_type.
         606             :
         607             : ! References:
         608             : !   None
         609             : !-------------------------------------------------------------------------------
         610             :
         611             :     implicit none
         612             :
         613             :     ! Input variables
         614             :     integer, intent(in) :: &
         615             :       iiPDF_type,           & ! Selected option for the two-component normal
         616             :                               ! (double Gaussian) PDF type to use for the w, rt,
         617             :                               ! and theta-l (or w, chi, and eta) portion of
         618             :                               ! CLUBB's multivariate, two-component PDF.
         619             :       ipdf_call_placement,  & ! Selected option for the placement of the call to
         620             :                               ! CLUBB's PDF.
         621             :       penta_solve_method,   & ! Option to set the penta-diagonal matrix solving method
         622             :       tridiag_solve_method, & ! Option to set the tri-diagonal matrix solving method
         623             :       saturation_formula      ! Integer that stores the saturation formula to be used
         624             :
         625             :     logical, intent(in) :: &
         626             :       l_use_precip_frac,            & ! Flag to use precipitation fraction in KK microphysics. The
         627             :                                       ! precipitation fraction is automatically set to 1 when this
         628             :                                       ! flag is turned off.
         629             :       l_predict_upwp_vpwp,          & ! Flag to predict <u'w'> and <v'w'> along with <u> and <v>
         630             :                                       ! alongside the advancement of <rt>, <w'rt'>, <thl>,
         631             :                                       ! <wpthlp>, <sclr>, and <w'sclr'> in subroutine
         632             :                                       ! advance_xm_wpxp.  Otherwise, <u'w'> and <v'w'> are still
         633             :                                       ! approximated by eddy diffusivity when <u> and <v> are
         634             :                                       ! advanced in subroutine advance_windm_edsclrm.
         635             :       l_min_wp2_from_corr_wx,       & ! Flag to base the threshold minimum value of wp2 on keeping
         636             :                                       ! the overall correlation of w and x (w and rt, as well as w
         637             :                                       ! and theta-l) within the limits of -max_mag_correlation_flux
         638             :                                       ! to max_mag_correlation_flux.
         639             :       l_min_xp2_from_corr_wx,       & ! Flag to base the threshold minimum value of xp2 (rtp2 and
         640             :                                       ! thlp2) on keeping the overall correlation of w and x within
         641             :                                       ! the limits of -max_mag_correlation_flux to
         642             :                                       ! max_mag_correlation_flux.
         643             :       l_C2_cloud_frac,              & ! Flag to use cloud fraction to adjust the value of the
         644             :                                       ! turbulent dissipation coefficient, C2.
         645             :       l_diffuse_rtm_and_thlm,       & ! Diffuses rtm and thlm
         646             :       l_stability_correct_Kh_N2_zm, & ! Divides Kh_N2_zm by a stability factor
         647             :       l_calc_thlp2_rad,             & ! Include the contribution of radiation to thlp2
         648             :       l_upwind_xpyp_ta,             & ! This flag determines whether we want to use an upwind
         649             :                                       ! differencing approximation rather than a centered
         650             :                                       ! differencing for turbulent or mean advection terms. It
         651             :                                       ! affects rtp2, thlp2, up2, vp2, sclrp2, rtpthlp, sclrprtp, &
         652             :                                       ! sclrpthlp.
         653             :       l_upwind_xm_ma,               & ! This flag determines whether we want to use an upwind
         654             :                                       ! differencing approximation rather than a centered
         655             :                                       ! differencing for turbulent or mean advection terms. It
         656             :                                       ! affects rtm, thlm, sclrm, um and vm.
         657             :       l_uv_nudge,                   & ! For wind speed nudging.
         658             :       l_rtm_nudge,                  & ! For rtm nudging
         659             :       l_tke_aniso,                  & ! For anisotropic turbulent kinetic energy, i.e.
         660             :                                       ! TKE = 1/2 (u'^2 + v'^2 + w'^2)
         661             :       l_vert_avg_closure,           & ! Use 2 calls to pdf_closure and the trapezoidal rule to
         662             :                                       ! compute the varibles that are output from high order
         663             :                                       ! closure
         664             :       l_trapezoidal_rule_zt,        & ! If true, the trapezoidal rule is called for the
         665             :                                       ! thermodynamic-level variables output from pdf_closure.
         666             :       l_trapezoidal_rule_zm,        & ! If true, the trapezoidal rule is called for three
         667             :                                       ! momentum-level variables - wpthvp, thlpthvp, and rtpthvp -
         668             :                                       ! output from pdf_closure.
         669             :       l_call_pdf_closure_twice,     & ! This logical flag determines whether or not to call
         670             :                                       ! subroutine pdf_closure twice.  If true, pdf_closure is
         671             :                                       ! called first on thermodynamic levels and then on momentum
         672             :                                       ! levels so that each variable is computed on its native
         673             :                                       ! level.  If false, pdf_closure is only called on
         674             :                                       ! thermodynamic levels, and variables which belong on
         675             :                                       ! momentum levels are interpolated.
         676             :       l_standard_term_ta,           & ! Use the standard discretization for the turbulent advection
         677             :                                       ! terms.  Setting to .false. means that a_1 and a_3 are
         678             :                                       ! pulled outside of the derivative in
         679             :                                       ! advance_wp2_wp3_module.F90 and in
         680             :                                       ! advance_xp2_xpyp_module.F90.
         681             :       l_partial_upwind_wp3,         & ! Flag to use an "upwind" discretization rather
         682             :                                       ! than a centered discretization for the portion
         683             :                                       ! of the wp3 turbulent advection term for ADG1
         684             :                                       ! that is linearized in terms of wp3<t+1>.
         685             :                                       ! (Requires ADG1 PDF and l_standard_term_ta).
         686             :       l_godunov_upwind_wpxp_ta,     & ! This flag determines whether we want to use an upwind
         687             :                                       ! differencing approximation rather than a centered
         688             :                                       ! differencing for turbulent advection terms.
         689             :                                       ! It affects  wpxp only.
         690             :       l_godunov_upwind_xpyp_ta,     & ! This flag determines whether we want to use an upwind
         691             :                                       ! differencing approximation rather than a centered
         692             :                                       ! differencing for turbulent advection terms. It affects
         693             :                                       ! xpyp only.
         694             :       l_use_cloud_cover,            & ! Use cloud_cover and rcm_in_layer to help boost cloud_frac
         695             :                                       ! and rcm to help increase cloudiness at coarser grid
         696             :                                       ! resolutions.
         697             :       l_diagnose_correlations,      & ! Diagnose correlations instead of using fixed ones
         698             :       l_calc_w_corr,                & ! Calculate the correlations between w and the hydrometeors
         699             :       l_const_Nc_in_cloud,          & ! Use a constant cloud droplet conc. within cloud (K&K)
         700             :       l_fix_w_chi_eta_correlations, & ! Use a fixed correlation for s and t Mellor(chi/eta)
         701             :       l_stability_correct_tau_zm,   & ! Use tau_N2_zm instead of tau_zm in wpxp_pr1 stability
         702             :                                       ! correction
         703             :       l_damp_wp2_using_em,          & ! In wp2 equation, use a dissipation formula of
         704             :                                       ! -(2/3)*em/tau_zm, as in Bougeault (1981)
         705             :       l_do_expldiff_rtm_thlm,       & ! Diffuse rtm and thlm explicitly
         706             :       l_Lscale_plume_centered,      & ! Alternate that uses the PDF to compute the perturbed values
         707             :       l_diag_Lscale_from_tau,       & ! First diagnose dissipation time tau, and then diagnose the
         708             :                                       ! mixing length scale as Lscale = tau * tke
         709             :       l_use_C7_Richardson,          & ! Parameterize C7 based on Richardson number
         710             :       l_use_C11_Richardson,         & ! Parameterize C11 and C16 based on Richardson number
         711             :       l_use_shear_Richardson,       & ! Use shear in the calculation of Richardson number
         712             :       l_brunt_vaisala_freq_moist,   & ! Use a different formula for the Brunt-Vaisala frequency in
         713             :                                       ! saturated atmospheres (from Durran and Klemp, 1982)
         714             :       l_use_thvm_in_bv_freq,        & ! Use thvm in the calculation of Brunt-Vaisala frequency
         715             :       l_rcm_supersat_adj,           & ! Add excess supersaturated vapor to cloud water
         716             :       l_damp_wp3_Skw_squared,       & ! Set damping on wp3 to use Skw^2 rather than Skw^4
         717             :       l_prescribed_avg_deltaz,      & ! used in adj_low_res_nu. If .true., avg_deltaz = deltaz
         718             :       l_lmm_stepping,               & ! Apply Linear Multistep Method (LMM) Stepping
         719             :       l_e3sm_config,                & ! Run model with E3SM settings
         720             :       l_vary_convect_depth,         & ! Flag used to calculate convective velocity using
         721             :                                       ! a variable estimate of layer depth based on the depth
         722             :                                       ! over which wpthlp is positive near the ground when true
         723             :                                       ! More information can be found by
         724             :                                       ! Looking at issue #905 on the clubb repo
         725             :       l_use_tke_in_wp3_pr_turb_term,& ! Use TKE formulation for wp3 pr_turb term
         726             :       l_use_tke_in_wp2_wp3_K_dfsn,  & ! Use TKE in eddy diffusion for wp2 and wp3
         727             :       l_use_wp3_lim_with_smth_Heaviside, & ! Flag to activate mods on wp3 limiters for conv test
         728             :       l_smooth_Heaviside_tau_wpxp,  & ! Use smoothed Heaviside 'Peskin' function
         729             :                                       ! in the calculation of H_invrs_tau_wpxp_N2
         730             :                                       ! in src/CLUBB_core/mixing_length.F90
         731             :       l_modify_limiters_for_cnvg_test, & ! Flag to activate mods on limiters for conv test
         732             :       l_enable_relaxed_clipping,    & ! Flag to relax clipping on wpxp in
         733             :                                       ! xm_wpxp_clipping_and_stats
         734             :       l_linearize_pbl_winds,        & ! Code to linearize PBL winds
         735             :       l_mono_flux_lim_thlm,         & ! Flag to turn on monotonic flux limiter for thlm
         736             :       l_mono_flux_lim_rtm,          & ! Flag to turn on monotonic flux limiter for rtm
         737             :       l_mono_flux_lim_um,           & ! Flag to turn on monotonic flux limiter for um
         738             :       l_mono_flux_lim_vm,           & ! Flag to turn on monotonic flux limiter for vm
         739             :       l_mono_flux_lim_spikefix,     & ! Flag to implement monotonic flux limiter code that
         740             :                                       ! eliminates spurious drying tendencies at model top
         741             :       l_host_applies_sfc_fluxes       ! Use to determine whether a host model has already applied the surface flux,
         742             :                                       ! to avoid double counting.
         743             :
         744             :     ! Output variables
         745             :     type(clubb_config_flags_type), intent(out) :: &
         746             :       clubb_config_flags            ! Derived type holding all configurable CLUBB flags
         747             :
         748             : !-----------------------------------------------------------------------
         749             :     ! Begin code
         750             :
         751        1536 :     clubb_config_flags%iiPDF_type = iiPDF_type
         752        1536 :     clubb_config_flags%ipdf_call_placement = ipdf_call_placement
         753        1536 :     clubb_config_flags%penta_solve_method = penta_solve_method
         754        1536 :     clubb_config_flags%tridiag_solve_method = tridiag_solve_method
         755        1536 :     clubb_config_flags%saturation_formula = saturation_formula
         756        1536 :     clubb_config_flags%l_use_precip_frac = l_use_precip_frac
         757        1536 :     clubb_config_flags%l_predict_upwp_vpwp = l_predict_upwp_vpwp
         758        1536 :     clubb_config_flags%l_min_wp2_from_corr_wx = l_min_wp2_from_corr_wx
         759        1536 :     clubb_config_flags%l_min_xp2_from_corr_wx = l_min_xp2_from_corr_wx
         760        1536 :     clubb_config_flags%l_C2_cloud_frac = l_C2_cloud_frac
         761        1536 :     clubb_config_flags%l_diffuse_rtm_and_thlm = l_diffuse_rtm_and_thlm
         762        1536 :     clubb_config_flags%l_stability_correct_Kh_N2_zm = l_stability_correct_Kh_N2_zm
         763        1536 :     clubb_config_flags%l_calc_thlp2_rad = l_calc_thlp2_rad
         764        1536 :     clubb_config_flags%l_upwind_xpyp_ta = l_upwind_xpyp_ta
         765        1536 :     clubb_config_flags%l_upwind_xm_ma = l_upwind_xm_ma
         766        1536 :     clubb_config_flags%l_uv_nudge = l_uv_nudge
         767        1536 :     clubb_config_flags%l_rtm_nudge = l_rtm_nudge
         768        1536 :     clubb_config_flags%l_tke_aniso = l_tke_aniso
         769        1536 :     clubb_config_flags%l_vert_avg_closure  = l_vert_avg_closure
         770        1536 :     clubb_config_flags%l_trapezoidal_rule_zt = l_trapezoidal_rule_zt
         771        1536 :     clubb_config_flags%l_trapezoidal_rule_zm = l_trapezoidal_rule_zm
         772        1536 :     clubb_config_flags%l_call_pdf_closure_twice = l_call_pdf_closure_twice
         773        1536 :     clubb_config_flags%l_standard_term_ta = l_standard_term_ta
         774        1536 :     clubb_config_flags%l_partial_upwind_wp3 = l_partial_upwind_wp3
         775        1536 :     clubb_config_flags%l_godunov_upwind_wpxp_ta = l_godunov_upwind_wpxp_ta
         776        1536 :     clubb_config_flags%l_godunov_upwind_xpyp_ta = l_godunov_upwind_xpyp_ta
         777        1536 :     clubb_config_flags%l_use_cloud_cover = l_use_cloud_cover
         778        1536 :     clubb_config_flags%l_diagnose_correlations = l_diagnose_correlations
         779        1536 :     clubb_config_flags%l_calc_w_corr = l_calc_w_corr
         780        1536 :     clubb_config_flags%l_const_Nc_in_cloud = l_const_Nc_in_cloud
         781        1536 :     clubb_config_flags%l_fix_w_chi_eta_correlations = l_fix_w_chi_eta_correlations
         782        1536 :     clubb_config_flags%l_stability_correct_tau_zm = l_stability_correct_tau_zm
         783        1536 :     clubb_config_flags%l_damp_wp2_using_em = l_damp_wp2_using_em
         784        1536 :     clubb_config_flags%l_do_expldiff_rtm_thlm = l_do_expldiff_rtm_thlm
         785        1536 :     clubb_config_flags%l_Lscale_plume_centered = l_Lscale_plume_centered
         786        1536 :     clubb_config_flags%l_diag_Lscale_from_tau = l_diag_Lscale_from_tau
         787        1536 :     clubb_config_flags%l_use_C7_Richardson = l_use_C7_Richardson
         788        1536 :     clubb_config_flags%l_use_C11_Richardson = l_use_C11_Richardson
         789        1536 :     clubb_config_flags%l_use_shear_Richardson = l_use_shear_Richardson
         790        1536 :     clubb_config_flags%l_brunt_vaisala_freq_moist = l_brunt_vaisala_freq_moist
         791        1536 :     clubb_config_flags%l_use_thvm_in_bv_freq = l_use_thvm_in_bv_freq
         792        1536 :     clubb_config_flags%l_rcm_supersat_adj = l_rcm_supersat_adj
         793        1536 :     clubb_config_flags%l_damp_wp3_Skw_squared = l_damp_wp3_Skw_squared
         794        1536 :     clubb_config_flags%l_prescribed_avg_deltaz = l_prescribed_avg_deltaz
         795        1536 :     clubb_config_flags%l_lmm_stepping = l_lmm_stepping
         796        1536 :     clubb_config_flags%l_e3sm_config = l_e3sm_config
         797        1536 :     clubb_config_flags%l_vary_convect_depth = l_vary_convect_depth
         798        1536 :     clubb_config_flags%l_use_tke_in_wp3_pr_turb_term = l_use_tke_in_wp3_pr_turb_term
         799        1536 :     clubb_config_flags%l_use_tke_in_wp2_wp3_K_dfsn = l_use_tke_in_wp2_wp3_K_dfsn
         800        1536 :     clubb_config_flags%l_use_wp3_lim_with_smth_Heaviside = l_use_wp3_lim_with_smth_Heaviside
         801        1536 :     clubb_config_flags%l_smooth_Heaviside_tau_wpxp = l_smooth_Heaviside_tau_wpxp
         802        1536 :     clubb_config_flags%l_modify_limiters_for_cnvg_test = l_modify_limiters_for_cnvg_test
         803        1536 :     clubb_config_flags%l_enable_relaxed_clipping = l_enable_relaxed_clipping
         804        1536 :     clubb_config_flags%l_linearize_pbl_winds = l_linearize_pbl_winds
         805        1536 :     clubb_config_flags%l_mono_flux_lim_thlm = l_mono_flux_lim_thlm
         806        1536 :     clubb_config_flags%l_mono_flux_lim_rtm = l_mono_flux_lim_rtm
         807        1536 :     clubb_config_flags%l_mono_flux_lim_um = l_mono_flux_lim_um
         808        1536 :     clubb_config_flags%l_mono_flux_lim_vm = l_mono_flux_lim_vm
         809        1536 :     clubb_config_flags%l_mono_flux_lim_spikefix = l_mono_flux_lim_spikefix
         810        1536 :     clubb_config_flags%l_host_applies_sfc_fluxes = l_host_applies_sfc_fluxes
         811             :
         812             :
         813        1536 :     return
         814             :   end subroutine initialize_clubb_config_flags_type
         815             :
         816             : !===============================================================================
         817           2 :   subroutine print_clubb_config_flags( iunit, clubb_config_flags )
         818             :
         819             : ! Description:
         820             : !   Prints the clubb_config_flags.
         821             :
         822             : ! References:
         823             : !   None
         824             : !-------------------------------------------------------------------------------
         825             :
         826             :     implicit none
         827             :
         828             :     ! Input variables
         829             :     integer, intent(in) :: &
         830             :       iunit ! The file to write to
         831             :
         832             :     type(clubb_config_flags_type), intent(in) :: &
         833             :       clubb_config_flags ! Derived type holding all configurable CLUBB flags
         834             :
         835             : !-----------------------------------------------------------------------
         836             :     ! Begin code
         837             :
         838           2 :     write(iunit,*) "iiPDF_type = ", clubb_config_flags%iiPDF_type
         839           2 :     write(iunit,*) "ipdf_call_placement = ", clubb_config_flags%ipdf_call_placement
         840           2 :     write(iunit,*) "penta_solve_method = ", clubb_config_flags%penta_solve_method
         841           2 :     write(iunit,*) "tridiag_solve_method = ", clubb_config_flags%tridiag_solve_method
         842           2 :     write(iunit,*) "l_use_precip_frac = ", clubb_config_flags%l_use_precip_frac
         843           2 :     write(iunit,*) "l_predict_upwp_vpwp = ", clubb_config_flags%l_predict_upwp_vpwp
         844           2 :     write(iunit,*) "l_min_wp2_from_corr_wx = ", clubb_config_flags%l_min_wp2_from_corr_wx
         845           2 :     write(iunit,*) "l_min_xp2_from_corr_wx = ", clubb_config_flags%l_min_xp2_from_corr_wx
         846           2 :     write(iunit,*) "l_C2_cloud_frac = ", clubb_config_flags%l_C2_cloud_frac
         847           2 :     write(iunit,*) "l_diffuse_rtm_and_thlm = ", clubb_config_flags%l_diffuse_rtm_and_thlm
         848           2 :     write(iunit,*) "l_stability_correct_Kh_N2_zm = ", &
         849           4 :                    clubb_config_flags%l_stability_correct_Kh_N2_zm
         850           2 :     write(iunit,*) "l_calc_thlp2_rad = ", clubb_config_flags%l_calc_thlp2_rad
         851           2 :     write(iunit,*) "l_upwind_xpyp_ta = ", clubb_config_flags%l_upwind_xpyp_ta
         852           2 :     write(iunit,*) "l_upwind_xm_ma = ", clubb_config_flags%l_upwind_xm_ma
         853           2 :     write(iunit,*) "l_uv_nudge = ", clubb_config_flags%l_uv_nudge
         854           2 :     write(iunit,*) "l_rtm_nudge = ", clubb_config_flags%l_rtm_nudge
         855           2 :     write(iunit,*) "l_tke_aniso = ", clubb_config_flags%l_tke_aniso
         856           2 :     write(iunit,*) "l_vert_avg_closure = ", clubb_config_flags%l_vert_avg_closure
         857           2 :     write(iunit,*) "l_trapezoidal_rule_zt = ", clubb_config_flags%l_trapezoidal_rule_zt
         858           2 :     write(iunit,*) "l_trapezoidal_rule_zm = ", clubb_config_flags%l_trapezoidal_rule_zm
         859           2 :     write(iunit,*) "l_call_pdf_closure_twice = ", clubb_config_flags%l_call_pdf_closure_twice
         860           2 :     write(iunit,*) "l_standard_term_ta = ", clubb_config_flags%l_standard_term_ta
         861           2 :     write(iunit,*) "l_partial_upwind_wp3 = ", clubb_config_flags%l_partial_upwind_wp3
         862           2 :     write(iunit,*) "l_godunov_upwind_wpxp_ta = ", clubb_config_flags%l_godunov_upwind_wpxp_ta
         863           2 :     write(iunit,*) "l_godunov_upwind_xpyp_ta = ", clubb_config_flags%l_godunov_upwind_xpyp_ta
         864           2 :     write(iunit,*) "l_use_cloud_cover = ", clubb_config_flags%l_use_cloud_cover
         865           2 :     write(iunit,*) "l_diagnose_correlations = ", clubb_config_flags%l_diagnose_correlations
         866           2 :     write(iunit,*) "l_calc_w_corr = ", clubb_config_flags%l_calc_w_corr
         867           2 :     write(iunit,*) "l_const_Nc_in_cloud = ", clubb_config_flags%l_const_Nc_in_cloud
         868           2 :     write(iunit,*) "l_fix_w_chi_eta_correlations = ", clubb_config_flags%l_fix_w_chi_eta_correlations
         869           2 :     write(iunit,*) "l_stability_correct_tau_zm = ", clubb_config_flags%l_stability_correct_tau_zm
         870           2 :     write(iunit,*) "l_damp_wp2_using_em = ", clubb_config_flags%l_damp_wp2_using_em
         871           2 :     write(iunit,*) "l_do_expldiff_rtm_thlm = ", clubb_config_flags%l_do_expldiff_rtm_thlm
         872           2 :     write(iunit,*) "l_Lscale_plume_centered = ", clubb_config_flags%l_Lscale_plume_centered
         873           2 :     write(iunit,*) "l_diag_Lscale_from_tau = ", clubb_config_flags%l_diag_Lscale_from_tau
         874           2 :     write(iunit,*) "l_use_C7_Richardson = ", clubb_config_flags%l_use_C7_Richardson
         875           2 :     write(iunit,*) "l_use_C11_Richardson = ", clubb_config_flags%l_use_C11_Richardson
         876           2 :     write(iunit,*) "l_use_shear_Richardson = ", clubb_config_flags%l_use_shear_Richardson
         877           2 :     write(iunit,*) "l_brunt_vaisala_freq_moist = ", clubb_config_flags%l_brunt_vaisala_freq_moist
         878           2 :     write(iunit,*) "l_use_thvm_in_bv_freq = ", clubb_config_flags%l_use_thvm_in_bv_freq
         879           2 :     write(iunit,*) "l_rcm_supersat_adj = ", clubb_config_flags%l_rcm_supersat_adj
         880           2 :     write(iunit,*) "l_damp_wp3_Skw_squared = ", clubb_config_flags%l_damp_wp3_Skw_squared
         881           2 :     write(iunit,*) "l_prescribed_avg_deltaz = ", clubb_config_flags%l_prescribed_avg_deltaz
         882           2 :     write(iunit,*) "l_lmm_stepping = ", clubb_config_flags%l_lmm_stepping
         883           2 :     write(iunit,*) "l_e3sm_config = ", clubb_config_flags%l_e3sm_config
         884           2 :     write(iunit,*) "l_vary_convect_depth = ", clubb_config_flags%l_vary_convect_depth
         885           2 :     write(iunit,*) "l_use_tke_in_wp3_pr_turb_term = ", clubb_config_flags%l_use_tke_in_wp3_pr_turb_term
         886           2 :     write(iunit,*) "l_use_tke_in_wp2_wp3_K_dfsn = ", clubb_config_flags%l_use_tke_in_wp2_wp3_K_dfsn
         887           2 :     write(iunit,*) "l_use_wp3_lim_with_smth_Heaviside = ", clubb_config_flags%l_use_wp3_lim_with_smth_Heaviside
         888           2 :     write(iunit,*) "l_smooth_Heaviside_tau_wpxp = ", clubb_config_flags%l_smooth_Heaviside_tau_wpxp
         889           2 :     write(iunit,*) "l_modify_limiters_for_cnvg_test = ", clubb_config_flags%l_modify_limiters_for_cnvg_test
         890           2 :     write(iunit,*) "l_enable_relaxed_clipping = ", clubb_config_flags%l_enable_relaxed_clipping
         891           2 :     write(iunit,*) "l_linearize_pbl_winds = ", clubb_config_flags%l_linearize_pbl_winds
         892           2 :     write(iunit,*) "l_mono_flux_lim_thlm = ",clubb_config_flags%l_mono_flux_lim_thlm
         893           2 :     write(iunit,*) "l_mono_flux_lim_rtm = ",clubb_config_flags%l_mono_flux_lim_rtm
         894           2 :     write(iunit,*) "l_mono_flux_lim_um = ",clubb_config_flags%l_mono_flux_lim_vm
         895           2 :     write(iunit,*) "l_mono_flux_lim_vm = ",clubb_config_flags%l_mono_flux_lim_um
         896           2 :     write(iunit,*) "l_mono_flux_lim_spikefix = ",clubb_config_flags%l_mono_flux_lim_spikefix
         897           2 :     write(iunit,*) "l_host_applies_sfc_fluxes = ",clubb_config_flags%l_host_applies_sfc_fluxes
         898             :
         899           2 :     return
         900             :   end subroutine print_clubb_config_flags
         901             :
         902           0 : end module model_flags

Generated by: LCOV version 1.14