Initialized the CVMix convection mixing routine.
57 type(time_type),
intent(in) :: time
58 type(ocean_grid_type),
intent(in) :: g
59 type(verticalgrid_type),
intent(in) :: gv
60 type(unit_scale_type),
intent(in) :: us
61 type(param_file_type),
intent(in) :: param_file
62 type(diag_ctrl),
target,
intent(inout) :: diag
63 type(cvmix_conv_cs),
pointer :: cs
69 #include "version_variable.h" 71 if (
associated(cs))
then 72 call mom_error(warning,
"CVMix_conv_init called with an associated "// &
79 call get_param(param_file, mdl,
"USE_CVMix_CONVECTION", cvmix_conv_init, default=.false., do_not_log=.true.)
80 call log_version(param_file, mdl, version, &
81 "Parameterization of enhanced mixing due to convection via CVMix", &
82 all_default=.not.cvmix_conv_init)
83 call get_param(param_file, mdl,
"USE_CVMix_CONVECTION", cvmix_conv_init, &
84 "If true, turns on the enhanced mixing due to convection "//&
85 "via CVMix. This scheme increases diapycnal diffs./viscs. "//&
86 "at statically unstable interfaces. Relevant parameters are "//&
87 "contained in the CVMix_CONVECTION% parameter block.", &
90 if (.not. cvmix_conv_init)
return 92 call get_param(param_file, mdl,
"ENERGETICS_SFC_PBL", useepbl, default=.false., &
98 call mom_error(warning,
'MOM_CVMix_conv_init: '// &
99 'CVMix convection may not be properly applied when ENERGETICS_SFC_PBL = True'//&
100 'as convective mixing might occur in the boundary layer.')
103 call get_param(param_file, mdl,
'DEBUG', cs%debug, default=.false., do_not_log=.true.)
105 call get_param(param_file, mdl,
'MIN_THICKNESS', cs%min_thickness, default=0.001, do_not_log=.true.)
107 call openparameterblock(param_file,
'CVMix_CONVECTION')
109 call get_param(param_file, mdl,
"PRANDTL_CONV", prandtl_conv, &
110 "The turbulent Prandtl number applied to convective "//&
111 "instabilities (i.e., used to convert KD_CONV into KV_CONV)", &
112 units=
"nondim", default=1.0)
114 call get_param(param_file, mdl,
'KD_CONV', cs%kd_conv_const, &
115 "Diffusivity used in convective regime. Corresponding viscosity "//&
116 "(KV_CONV) will be set to KD_CONV * PRANDTL_TURB.", &
117 units=
'm2/s', default=1.00)
119 call get_param(param_file, mdl,
'BV_SQR_CONV', cs%bv_sqr_conv, &
120 "Threshold for squared buoyancy frequency needed to trigger "//&
121 "Brunt-Vaisala parameterization.", &
122 units=
'1/s^2', default=0.0)
124 call closeparameterblock(param_file)
127 cs%kv_conv_const = cs%kd_conv_const * prandtl_conv
130 allocate(cs%N2(szi_(g), szj_(g), szk_(g)+1)); cs%N2(:,:,:) = 0.
131 allocate(cs%kd_conv(szi_(g), szj_(g), szk_(g)+1)); cs%kd_conv(:,:,:) = 0.
132 allocate(cs%kv_conv(szi_(g), szj_(g), szk_(g)+1)); cs%kv_conv(:,:,:) = 0.
136 cs%id_N2 = register_diag_field(
'ocean_model',
'N2_conv', diag%axesTi, time, &
137 'Square of Brunt-Vaisala frequency used by MOM_CVMix_conv module',
'1/s2')
138 cs%id_kd_conv = register_diag_field(
'ocean_model',
'kd_conv', diag%axesTi, time, &
139 'Additional diffusivity added by MOM_CVMix_conv module',
'm2/s', conversion=us%Z2_T_to_m2_s)
140 cs%id_kv_conv = register_diag_field(
'ocean_model',
'kv_conv', diag%axesTi, time, &
141 'Additional viscosity added by MOM_CVMix_conv module',
'm2/s', conversion=us%Z2_T_to_m2_s)
143 call cvmix_init_conv(convect_diff=cs%kd_conv_const, &
144 convect_visc=cs%kv_conv_const, &
145 lbruntvaisala=.true., &
146 bvsqr_convect=cs%bv_sqr_conv)