Initialize the CVMix KPP module and set up diagnostics Returns True if KPP is to be used, False otherwise.
187 type(param_file_type),
intent(in) :: paramFile
188 type(ocean_grid_type),
intent(in) :: G
189 type(verticalGrid_type),
intent(in) :: GV
190 type(unit_scale_type),
intent(in) :: US
191 type(diag_ctrl),
target,
intent(in) :: diag
192 type(time_type),
intent(in) :: Time
193 type(KPP_CS),
pointer :: CS
194 logical,
optional,
intent(out) :: passive
195 type(wave_parameters_CS),
optional,
pointer :: Waves
198 # include "version_variable.h" 199 character(len=40) :: mdl =
'MOM_CVMix_KPP' 200 character(len=20) :: string
201 logical :: CS_IS_ONE=.false.
202 logical :: lnoDGat1=.false.
204 if (
associated(cs))
call mom_error(fatal,
'MOM_CVMix_KPP, KPP_init: '// &
205 'Control structure has already been initialized')
208 call get_param(paramfile, mdl,
"USE_KPP", kpp_init, default=.false., do_not_log=.true.)
209 call log_version(paramfile, mdl, version,
'This is the MOM wrapper to CVMix:KPP\n' // &
210 'See http://cvmix.github.io/', all_default=.not.kpp_init)
211 call get_param(paramfile, mdl,
"USE_KPP", kpp_init, &
212 "If true, turns on the [CVMix] KPP scheme of Large et al., 1994, "// &
213 "to calculate diffusivities and non-local transport in the OBL.", &
216 if (.not. kpp_init)
return 219 call openparameterblock(paramfile,
'KPP')
220 call get_param(paramfile, mdl,
'PASSIVE', cs%passiveMode, &
221 'If True, puts KPP into a passive-diagnostic mode.', &
225 if (
present(passive)) passive=cs%passiveMode
227 call get_param(paramfile, mdl,
'APPLY_NONLOCAL_TRANSPORT', cs%applyNonLocalTrans, &
228 'If True, applies the non-local transport to heat and scalars. '// &
229 'If False, calculates the non-local transport and tendencies but '//&
230 'purely for diagnostic purposes.', &
231 default=.not. cs%passiveMode)
232 call get_param(paramfile, mdl,
'N_SMOOTH', cs%n_smooth, &
233 'The number of times the 1-1-4-1-1 Laplacian filter is applied on '// &
236 if (cs%n_smooth > g%domain%nihalo)
then 237 call mom_error(fatal,
'KPP smoothing number (N_SMOOTH) cannot be greater than NIHALO.')
238 elseif (cs%n_smooth > g%domain%njhalo)
then 239 call mom_error(fatal,
'KPP smoothing number (N_SMOOTH) cannot be greater than NJHALO.')
241 if (cs%n_smooth > 0)
then 242 call get_param(paramfile, mdl,
'DEEPEN_ONLY_VIA_SMOOTHING', cs%deepen_only, &
243 'If true, apply OBLdepth smoothing at a cell only if the OBLdepth '// &
244 'gets deeper via smoothing.', &
246 id_clock_kpp_smoothing = cpu_clock_id(
'(Ocean KPP BLD smoothing)', grain=clock_routine)
248 call get_param(paramfile, mdl,
'RI_CRIT', cs%Ri_crit, &
249 'Critical bulk Richardson number used to define depth of the '// &
250 'surface Ocean Boundary Layer (OBL).', &
251 units=
'nondim', default=0.3)
252 call get_param(paramfile, mdl,
'VON_KARMAN', cs%vonKarman, &
253 'von Karman constant.', &
254 units=
'nondim', default=0.40)
255 call get_param(paramfile, mdl,
'ENHANCE_DIFFUSION', cs%enhance_diffusion, &
256 'If True, adds enhanced diffusion at the based of the boundary layer.', &
258 call get_param(paramfile, mdl,
'INTERP_TYPE', cs%interpType, &
259 'Type of interpolation to determine the OBL depth.\n'// &
260 'Allowed types are: linear, quadratic, cubic.', &
262 call get_param(paramfile, mdl,
'INTERP_TYPE2', cs%interpType2, &
263 'Type of interpolation to compute diff and visc at OBL_depth.\n'// &
264 'Allowed types are: linear, quadratic, cubic or LMD94.', &
266 call get_param(paramfile, mdl,
'COMPUTE_EKMAN', cs%computeEkman, &
267 'If True, limit OBL depth to be no deeper than Ekman depth.', &
269 call get_param(paramfile, mdl,
'COMPUTE_MONIN_OBUKHOV', cs%computeMoninObukhov, &
270 'If True, limit the OBL depth to be no deeper than '// &
271 'Monin-Obukhov depth.', &
273 call get_param(paramfile, mdl,
'CS', cs%cs, &
274 'Parameter for computing velocity scale function.', &
275 units=
'nondim', default=98.96)
276 call get_param(paramfile, mdl,
'CS2', cs%cs2, &
277 'Parameter for computing non-local term.', &
278 units=
'nondim', default=6.32739901508)
279 call get_param(paramfile, mdl,
'DEEP_OBL_OFFSET', cs%deepOBLoffset, &
280 'If non-zero, the distance above the bottom to which the OBL is clipped '// &
281 'if it would otherwise reach the bottom. The smaller of this and 0.1D is used.', &
282 units=
'm',default=0.)
283 call get_param(paramfile, mdl,
'FIXED_OBLDEPTH', cs%fixedOBLdepth, &
284 'If True, fix the OBL depth to FIXED_OBLDEPTH_VALUE '// &
285 'rather than using the OBL depth from CVMix. '// &
286 'This option is just for testing purposes.', &
288 call get_param(paramfile, mdl,
'FIXED_OBLDEPTH_VALUE', cs%fixedOBLdepth_value, &
289 'Value for the fixed OBL depth when fixedOBLdepth==True. '// &
290 'This parameter is for just for testing purposes. '// &
291 'It will over-ride the OBLdepth computed from CVMix.', &
292 units=
'm',default=30.0)
293 call get_param(paramfile, mdl,
'SURF_LAYER_EXTENT', cs%surf_layer_ext, &
294 'Fraction of OBL depth considered in the surface layer.', &
295 units=
'nondim',default=0.10)
296 call get_param(paramfile, mdl,
'MINIMUM_OBL_DEPTH', cs%minOBLdepth, &
297 'If non-zero, a minimum depth to use for KPP OBL depth. Independent of '// &
298 'this parameter, the OBL depth is always at least as deep as the first layer.', &
299 units=
'm',default=0.)
300 call get_param(paramfile, mdl,
'MINIMUM_VT2', cs%minVtsqr, &
301 'Min of the unresolved velocity Vt2 used in Rib CVMix calculation.\n'// &
302 'Scaling: MINIMUM_VT2 = const1*d*N*ws, with d=1m, N=1e-5/s, ws=1e-6 m/s.', &
303 units=
'm2/s2',default=1e-10)
306 call get_param(paramfile, mdl,
'CORRECT_SURFACE_LAYER_AVERAGE', cs%correctSurfLayerAvg, &
307 'If true, applies a correction step to the averaging of surface layer '// &
308 'properties. This option is obsolete.', default=.false.)
309 if (cs%correctSurfLayerAvg) &
310 call mom_error(fatal,
'Correct surface layer average disabled in code. To recover \n'// &
311 ' feature will require code intervention.')
312 call get_param(paramfile, mdl,
'FIRST_GUESS_SURFACE_LAYER_DEPTH', cs%surfLayerDepth, &
313 'The first guess at the depth of the surface layer used for averaging '// &
314 'the surface layer properties. If =0, the top model level properties '// &
315 'will be used for the surface layer. If CORRECT_SURFACE_LAYER_AVERAGE=True, a '// &
316 'subsequent correction is applied. This parameter is obsolete', units=
'm', default=0.)
319 call get_param(paramfile, mdl,
'NLT_SHAPE', string, &
320 'MOM6 method to set nonlocal transport profile. '// &
321 'Over-rides the result from CVMix. Allowed values are: \n'// &
322 '\t CVMix - Uses the profiles from CVMix specified by MATCH_TECHNIQUE\n'//&
323 '\t LINEAR - A linear profile, 1-sigma\n'// &
324 '\t PARABOLIC - A parablic profile, (1-sigma)^2\n'// &
325 '\t CUBIC - A cubic profile, (1-sigma)^2(1+2*sigma)\n'// &
326 '\t CUBIC_LMD - The original KPP profile', &
328 select case ( trim(string) )
329 case (
"CVMix") ; cs%NLT_shape = nlt_shape_cvmix
330 case (
"LINEAR") ; cs%NLT_shape = nlt_shape_linear
331 case (
"PARABOLIC") ; cs%NLT_shape = nlt_shape_parabolic
332 case (
"CUBIC") ; cs%NLT_shape = nlt_shape_cubic
333 case (
"CUBIC_LMD") ; cs%NLT_shape = nlt_shape_cubic_lmd
334 case default ;
call mom_error(fatal,
"KPP_init: "// &
335 "Unrecognized NLT_SHAPE option"//trim(string))
337 call get_param(paramfile, mdl,
'MATCH_TECHNIQUE', cs%MatchTechnique, &
338 'CVMix method to set profile function for diffusivity and NLT, '// &
339 'as well as matching across OBL base. Allowed values are: \n'// &
340 '\t SimpleShapes = sigma*(1-sigma)^2 for both diffusivity and NLT\n'// &
341 '\t MatchGradient = sigma*(1-sigma)^2 for NLT; diffusivity profile from matching\n'//&
342 '\t MatchBoth = match gradient for both diffusivity and NLT\n'// &
343 '\t ParabolicNonLocal = sigma*(1-sigma)^2 for diffusivity; (1-sigma)^2 for NLT', &
344 default=
'SimpleShapes')
345 if (cs%MatchTechnique ==
'ParabolicNonLocal')
then 350 if (cs%MatchTechnique ==
'ParabolicNonLocal' .or. cs%MatchTechnique ==
'SimpleShapes')
then 356 if (cs%MatchTechnique ==
'MatchBoth' .and. (cs%interpType2 ==
'cubic' .or. &
357 cs%interpType2 ==
'quadratic'))
then 358 call mom_error(fatal,
"If MATCH_TECHNIQUE=MatchBoth, INTERP_TYPE2 must be set to \n"//&
359 "linear or LMD94 (recommended) to avoid negative viscosity and diffusivity.\n"//&
360 "Please select one of these valid options." )
363 call get_param(paramfile, mdl,
'KPP_ZERO_DIFFUSIVITY', cs%KPPzeroDiffusivity, &
364 'If True, zeroes the KPP diffusivity and viscosity; for testing purpose.',&
366 call get_param(paramfile, mdl,
'KPP_IS_ADDITIVE', cs%KPPisAdditive, &
367 'If true, adds KPP diffusivity to diffusivity from other schemes.\n'//&
368 'If false, KPP is the only diffusivity wherever KPP is non-zero.', &
370 call get_param(paramfile, mdl,
'KPP_SHORTWAVE_METHOD',string, &
371 'Determines contribution of shortwave radiation to KPP surface '// &
372 'buoyancy flux. Options include:\n'// &
373 ' ALL_SW: use total shortwave radiation\n'// &
374 ' MXL_SW: use shortwave radiation absorbed by mixing layer\n'// &
375 ' LV1_SW: use shortwave radiation absorbed by top model layer', &
377 select case ( trim(string) )
378 case (
"ALL_SW") ; cs%SW_METHOD = sw_method_all_sw
379 case (
"MXL_SW") ; cs%SW_METHOD = sw_method_mxl_sw
380 case (
"LV1_SW") ; cs%SW_METHOD = sw_method_lv1_sw
381 case default ;
call mom_error(fatal,
"KPP_init: "// &
382 "Unrecognized KPP_SHORTWAVE_METHOD option"//trim(string))
384 call get_param(paramfile, mdl,
'CVMix_ZERO_H_WORK_AROUND', cs%min_thickness, &
385 'A minimum thickness used to avoid division by small numbers in the vicinity '// &
386 'of vanished layers. This is independent of MIN_THICKNESS used in other parts of MOM.', &
387 units=
'm', default=0.)
391 call get_param(paramfile, mdl,
"USE_KPP_LT_K", cs%LT_K_Enhancement, &
392 'Flag for Langmuir turbulence enhancement of turbulent'//&
393 'mixing coefficient.', units=
"", default=.false.)
394 call get_param(paramfile, mdl,
"STOKES_MIXING", cs%STOKES_MIXING, &
395 'Flag for Langmuir turbulence enhancement of turbulent'//&
396 'mixing coefficient.', units=
"", default=.false.)
397 if (cs%LT_K_Enhancement)
then 398 call get_param(paramfile, mdl,
'KPP_LT_K_SHAPE', string, &
399 'Vertical dependence of LT enhancement of mixing. '// &
400 'Valid options are: \n'// &
401 '\t CONSTANT = Constant value for full OBL\n'// &
402 '\t SCALED = Varies based on normalized shape function.', &
404 select case ( trim(string))
405 case (
"CONSTANT") ; cs%LT_K_SHAPE = lt_k_constant
406 case (
"SCALED") ; cs%LT_K_SHAPE = lt_k_scaled
407 case default ;
call mom_error(fatal,
"KPP_init: "//&
408 "Unrecognized KPP_LT_K_SHAPE option: "//trim(string))
410 call get_param(paramfile, mdl,
"KPP_LT_K_METHOD", string , &
411 'Method to enhance mixing coefficient in KPP. '// &
412 'Valid options are: \n'// &
413 '\t CONSTANT = Constant value (KPP_K_ENH_FAC) \n'// &
414 '\t VR12 = Function of Langmuir number based on VR12\n'// &
415 '\t RW16 = Function of Langmuir number based on RW16', &
417 select case ( trim(string))
418 case (
"CONSTANT") ; cs%LT_K_METHOD = lt_k_mode_constant
419 case (
"VR12") ; cs%LT_K_METHOD = lt_k_mode_vr12
420 case (
"RW16") ; cs%LT_K_METHOD = lt_k_mode_rw16
421 case default ;
call mom_error(fatal,
"KPP_init: "//&
422 "Unrecognized KPP_LT_K_METHOD option: "//trim(string))
424 if (cs%LT_K_METHOD==lt_k_mode_constant)
then 425 call get_param(paramfile, mdl,
"KPP_K_ENH_FAC",cs%KPP_K_ENH_FAC , &
426 'Constant value to enhance mixing coefficient in KPP.', &
431 call get_param(paramfile, mdl,
"USE_KPP_LT_VT2", cs%LT_Vt2_Enhancement, &
432 'Flag for Langmuir turbulence enhancement of Vt2'//&
433 'in Bulk Richardson Number.', units=
"", default=.false.)
434 if (cs%LT_Vt2_Enhancement)
then 435 call get_param(paramfile, mdl,
"KPP_LT_VT2_METHOD",string , &
436 'Method to enhance Vt2 in KPP. '// &
437 'Valid options are: \n'// &
438 '\t CONSTANT = Constant value (KPP_VT2_ENH_FAC) \n'// &
439 '\t VR12 = Function of Langmuir number based on VR12\n'// &
440 '\t RW16 = Function of Langmuir number based on RW16\n'// &
441 '\t LF17 = Function of Langmuir number based on LF17', &
443 select case ( trim(string))
444 case (
"CONSTANT") ; cs%LT_VT2_METHOD = lt_vt2_mode_constant
445 case (
"VR12") ; cs%LT_VT2_METHOD = lt_vt2_mode_vr12
446 case (
"RW16") ; cs%LT_VT2_METHOD = lt_vt2_mode_rw16
447 case (
"LF17") ; cs%LT_VT2_METHOD = lt_vt2_mode_lf17
448 case default ;
call mom_error(fatal,
"KPP_init: "//&
449 "Unrecognized KPP_LT_VT2_METHOD option: "//trim(string))
451 if (cs%LT_VT2_METHOD==lt_vt2_mode_constant)
then 452 call get_param(paramfile, mdl,
"KPP_VT2_ENH_FAC",cs%KPP_VT2_ENH_FAC , &
453 'Constant value to enhance VT2 in KPP.', &
458 call closeparameterblock(paramfile)
459 call get_param(paramfile, mdl,
'DEBUG', cs%debug, default=.false., do_not_log=.true.)
461 call cvmix_init_kpp( ri_crit=cs%Ri_crit, &
462 minobldepth=cs%minOBLdepth, &
463 minvtsqr=cs%minVtsqr, &
464 vonkarman=cs%vonKarman, &
465 surf_layer_ext=cs%surf_layer_ext, &
466 interp_type=cs%interpType, &
467 interp_type2=cs%interpType2, &
468 lekman=cs%computeEkman, &
469 lmonob=cs%computeMoninObukhov, &
470 matchtechnique=cs%MatchTechnique, &
471 lenhanced_diff=cs%enhance_diffusion,&
472 lnonzero_surf_nonlocal=cs_is_one ,&
474 cvmix_kpp_params_user=cs%KPP_params )
478 cs%id_OBLdepth = register_diag_field(
'ocean_model',
'KPP_OBLdepth', diag%axesT1, time, &
479 'Thickness of the surface Ocean Boundary Layer calculated by [CVMix] KPP',
'meter', &
480 cmor_field_name=
'oml', cmor_long_name=
'ocean_mixed_layer_thickness_defined_by_mixing_scheme', &
481 cmor_units=
'm', cmor_standard_name=
'Ocean Mixed Layer Thickness Defined by Mixing Scheme')
485 if (cs%n_smooth > 0)
then 486 cs%id_OBLdepth_original = register_diag_field(
'ocean_model',
'KPP_OBLdepth_original', diag%axesT1, time, &
487 'Thickness of the surface Ocean Boundary Layer without smoothing calculated by [CVMix] KPP',
'meter', &
488 cmor_field_name=
'oml', cmor_long_name=
'ocean_mixed_layer_thickness_defined_by_mixing_scheme', &
489 cmor_units=
'm', cmor_standard_name=
'Ocean Mixed Layer Thickness Defined by Mixing Scheme')
491 cs%id_BulkDrho = register_diag_field(
'ocean_model',
'KPP_BulkDrho', diag%axesTL, time, &
492 'Bulk difference in density used in Bulk Richardson number, as used by [CVMix] KPP', &
493 'kg/m3', conversion=us%R_to_kg_m3)
494 cs%id_BulkUz2 = register_diag_field(
'ocean_model',
'KPP_BulkUz2', diag%axesTL, time, &
495 'Square of bulk difference in resolved velocity used in Bulk Richardson number via [CVMix] KPP',
'm2/s2')
496 cs%id_BulkRi = register_diag_field(
'ocean_model',
'KPP_BulkRi', diag%axesTL, time, &
497 'Bulk Richardson number used to find the OBL depth used by [CVMix] KPP',
'nondim')
498 cs%id_Sigma = register_diag_field(
'ocean_model',
'KPP_sigma', diag%axesTi, time, &
499 'Sigma coordinate used by [CVMix] KPP',
'nondim')
500 cs%id_Ws = register_diag_field(
'ocean_model',
'KPP_Ws', diag%axesTL, time, &
501 'Turbulent vertical velocity scale for scalars used by [CVMix] KPP',
'm/s')
502 cs%id_N = register_diag_field(
'ocean_model',
'KPP_N', diag%axesTi, time, &
503 '(Adjusted) Brunt-Vaisala frequency used by [CVMix] KPP',
'1/s')
504 cs%id_N2 = register_diag_field(
'ocean_model',
'KPP_N2', diag%axesTi, time, &
505 'Square of Brunt-Vaisala frequency used by [CVMix] KPP',
'1/s2')
506 cs%id_Vt2 = register_diag_field(
'ocean_model',
'KPP_Vt2', diag%axesTL, time, &
507 'Unresolved shear turbulence used by [CVMix] KPP',
'm2/s2')
508 cs%id_uStar = register_diag_field(
'ocean_model',
'KPP_uStar', diag%axesT1, time, &
509 'Friction velocity, u*, as used by [CVMix] KPP',
'm/s', conversion=us%Z_to_m*us%s_to_T)
510 cs%id_buoyFlux = register_diag_field(
'ocean_model',
'KPP_buoyFlux', diag%axesTi, time, &
511 'Surface (and penetrating) buoyancy flux, as used by [CVMix] KPP',
'm2/s3', conversion=us%L_to_m**2*us%s_to_T**3)
512 cs%id_QminusSW = register_diag_field(
'ocean_model',
'KPP_QminusSW', diag%axesT1, time, &
513 'Net temperature flux ignoring short-wave, as used by [CVMix] KPP',
'K m/s')
514 cs%id_netS = register_diag_field(
'ocean_model',
'KPP_netSalt', diag%axesT1, time, &
515 'Effective net surface salt flux, as used by [CVMix] KPP',
'ppt m/s')
516 cs%id_Kt_KPP = register_diag_field(
'ocean_model',
'KPP_Kheat', diag%axesTi, time, &
517 'Heat diffusivity due to KPP, as calculated by [CVMix] KPP',
'm2/s')
518 cs%id_Kd_in = register_diag_field(
'ocean_model',
'KPP_Kd_in', diag%axesTi, time, &
519 'Diffusivity passed to KPP',
'm2/s', conversion=us%Z2_T_to_m2_s)
520 cs%id_Ks_KPP = register_diag_field(
'ocean_model',
'KPP_Ksalt', diag%axesTi, time, &
521 'Salt diffusivity due to KPP, as calculated by [CVMix] KPP',
'm2/s')
522 cs%id_Kv_KPP = register_diag_field(
'ocean_model',
'KPP_Kv', diag%axesTi, time, &
523 'Vertical viscosity due to KPP, as calculated by [CVMix] KPP',
'm2/s')
524 cs%id_NLTt = register_diag_field(
'ocean_model',
'KPP_NLtransport_heat', diag%axesTi, time, &
525 'Non-local transport (Cs*G(sigma)) for heat, as calculated by [CVMix] KPP',
'nondim')
526 cs%id_NLTs = register_diag_field(
'ocean_model',
'KPP_NLtransport_salt', diag%axesTi, time, &
527 'Non-local tranpsort (Cs*G(sigma)) for scalars, as calculated by [CVMix] KPP',
'nondim')
528 cs%id_NLT_dTdt = register_diag_field(
'ocean_model',
'KPP_NLT_dTdt', diag%axesTL, time, &
529 'Temperature tendency due to non-local transport of heat, as calculated by [CVMix] KPP',
'K/s')
530 cs%id_NLT_dSdt = register_diag_field(
'ocean_model',
'KPP_NLT_dSdt', diag%axesTL, time, &
531 'Salinity tendency due to non-local transport of salt, as calculated by [CVMix] KPP',
'ppt/s')
532 cs%id_NLT_temp_budget = register_diag_field(
'ocean_model',
'KPP_NLT_temp_budget', diag%axesTL, time, &
533 'Heat content change due to non-local transport, as calculated by [CVMix] KPP',
'W/m^2')
534 cs%id_NLT_saln_budget = register_diag_field(
'ocean_model',
'KPP_NLT_saln_budget', diag%axesTL, time, &
535 'Salt content change due to non-local transport, as calculated by [CVMix] KPP',
'kg/(sec*m^2)')
536 cs%id_Tsurf = register_diag_field(
'ocean_model',
'KPP_Tsurf', diag%axesT1, time, &
537 'Temperature of surface layer (10% of OBL depth) as passed to [CVMix] KPP',
'C')
538 cs%id_Ssurf = register_diag_field(
'ocean_model',
'KPP_Ssurf', diag%axesT1, time, &
539 'Salinity of surface layer (10% of OBL depth) as passed to [CVMix] KPP',
'ppt')
540 cs%id_Usurf = register_diag_field(
'ocean_model',
'KPP_Usurf', diag%axesCu1, time, &
541 'i-component flow of surface layer (10% of OBL depth) as passed to [CVMix] KPP',
'm/s')
542 cs%id_Vsurf = register_diag_field(
'ocean_model',
'KPP_Vsurf', diag%axesCv1, time, &
543 'j-component flow of surface layer (10% of OBL depth) as passed to [CVMix] KPP',
'm/s')
544 cs%id_EnhK = register_diag_field(
'ocean_model',
'EnhK', diag%axesTI, time, &
545 'Langmuir number enhancement to K as used by [CVMix] KPP',
'nondim')
546 cs%id_EnhVt2 = register_diag_field(
'ocean_model',
'EnhVt2', diag%axesTL, time, &
547 'Langmuir number enhancement to Vt2 as used by [CVMix] KPP',
'nondim')
548 cs%id_La_SL = register_diag_field(
'ocean_model',
'KPP_La_SL', diag%axesT1, time, &
549 'Surface-layer Langmuir number computed in [CVMix] KPP',
'nondim')
551 allocate( cs%N( szi_(g), szj_(g), szk_(g)+1 ) )
553 allocate( cs%OBLdepth( szi_(g), szj_(g) ) )
554 cs%OBLdepth(:,:) = 0.
555 allocate( cs%kOBL( szi_(g), szj_(g) ) )
557 allocate( cs%La_SL( szi_(g), szj_(g) ) )
559 allocate( cs%Vt2( szi_(g), szj_(g), szk_(g) ) )
561 if (cs%id_OBLdepth_original > 0)
allocate( cs%OBLdepth_original( szi_(g), szj_(g) ) )
563 allocate( cs%OBLdepthprev( szi_(g), szj_(g) ) ) ; cs%OBLdepthprev(:,:) = 0.0
564 if (cs%id_BulkDrho > 0)
allocate( cs%dRho( szi_(g), szj_(g), szk_(g) ) )
565 if (cs%id_BulkDrho > 0) cs%dRho(:,:,:) = 0.
566 if (cs%id_BulkUz2 > 0)
allocate( cs%Uz2( szi_(g), szj_(g), szk_(g) ) )
567 if (cs%id_BulkUz2 > 0) cs%Uz2(:,:,:) = 0.
568 if (cs%id_BulkRi > 0)
allocate( cs%BulkRi( szi_(g), szj_(g), szk_(g) ) )
569 if (cs%id_BulkRi > 0) cs%BulkRi(:,:,:) = 0.
570 if (cs%id_Sigma > 0)
allocate( cs%sigma( szi_(g), szj_(g), szk_(g)+1 ) )
571 if (cs%id_Sigma > 0) cs%sigma(:,:,:) = 0.
572 if (cs%id_Ws > 0)
allocate( cs%Ws( szi_(g), szj_(g), szk_(g) ) )
573 if (cs%id_Ws > 0) cs%Ws(:,:,:) = 0.
574 if (cs%id_N2 > 0)
allocate( cs%N2( szi_(g), szj_(g), szk_(g)+1 ) )
575 if (cs%id_N2 > 0) cs%N2(:,:,:) = 0.
576 if (cs%id_Kt_KPP > 0)
allocate( cs%Kt_KPP( szi_(g), szj_(g), szk_(g)+1 ) )
577 if (cs%id_Kt_KPP > 0) cs%Kt_KPP(:,:,:) = 0.
578 if (cs%id_Ks_KPP > 0)
allocate( cs%Ks_KPP( szi_(g), szj_(g), szk_(g)+1 ) )
579 if (cs%id_Ks_KPP > 0) cs%Ks_KPP(:,:,:) = 0.
580 if (cs%id_Kv_KPP > 0)
allocate( cs%Kv_KPP( szi_(g), szj_(g), szk_(g)+1 ) )
581 if (cs%id_Kv_KPP > 0) cs%Kv_KPP(:,:,:) = 0.
582 if (cs%id_Tsurf > 0)
allocate( cs%Tsurf( szi_(g), szj_(g)) )
583 if (cs%id_Tsurf > 0) cs%Tsurf(:,:) = 0.
584 if (cs%id_Ssurf > 0)
allocate( cs%Ssurf( szi_(g), szj_(g)) )
585 if (cs%id_Ssurf > 0) cs%Ssurf(:,:) = 0.
586 if (cs%id_Usurf > 0)
allocate( cs%Usurf( szib_(g), szj_(g)) )
587 if (cs%id_Usurf > 0) cs%Usurf(:,:) = 0.
588 if (cs%id_Vsurf > 0)
allocate( cs%Vsurf( szi_(g), szjb_(g)) )
589 if (cs%id_Vsurf > 0) cs%Vsurf(:,:) = 0.
590 if (cs%id_EnhVt2 > 0)
allocate( cs%EnhVt2( szi_(g), szj_(g), szk_(g)) )
591 if (cs%id_EnhVt2 > 0) cs%EnhVt2(:,:,:) = 0.
592 if (cs%id_EnhK > 0)
allocate( cs%EnhK( szi_(g), szj_(g), szk_(g)+1 ) )
593 if (cs%id_EnhK > 0) cs%EnhK(:,:,:) = 0.
595 id_clock_kpp_calc = cpu_clock_id(
'Ocean KPP calculate)', grain=clock_module)
596 id_clock_kpp_compute_bld = cpu_clock_id(
'(Ocean KPP comp BLD)', grain=clock_routine)