register_ocean_hvisc Subroutine

private subroutine register_ocean_hvisc(cfg, schema)

&ocean_hvisc_nml: lateral-viscosity closure + coefficients. lateral_closure enum mirrors parse_lateral_closure in rdb_ocean_lateral_mix.

Arguments

Type IntentOptional Attributes Name
type(config_t), intent(in), target :: cfg
type(nml_schema_t), intent(inout) :: schema

Calls

proc~~register_ocean_hvisc~~CallsGraph proc~register_ocean_hvisc register_ocean_hvisc proc~group_add nml_group_t%group_add proc~register_ocean_hvisc->proc~group_add proc~nml_enum nml_enum proc~register_ocean_hvisc->proc~nml_enum proc~nml_int nml_int proc~register_ocean_hvisc->proc~nml_int proc~nml_logical nml_logical proc~register_ocean_hvisc->proc~nml_logical proc~nml_real nml_real proc~register_ocean_hvisc->proc~nml_real proc~nml_real_array nml_real_array proc~register_ocean_hvisc->proc~nml_real_array proc~schema_add_group nml_schema_t%schema_add_group proc~register_ocean_hvisc->proc~schema_add_group error error proc~group_add->error proc~lower lower proc~group_add->proc~lower proc~schema_add_group->error proc~schema_add_group->proc~lower proc~move_group move_group proc~schema_add_group->proc~move_group

Called by

proc~~register_ocean_hvisc~~CalledByGraph proc~register_ocean_hvisc register_ocean_hvisc proc~build_rdb_schema build_rdb_schema proc~build_rdb_schema->proc~register_ocean_hvisc proc~read_config_from_string_impl read_config_from_string_impl proc~read_config_from_string_impl->proc~build_rdb_schema proc~read_config_impl read_config_impl proc~read_config_impl->proc~build_rdb_schema proc~read_config read_config proc~read_config->proc~read_config_impl proc~read_config_from_string read_config_from_string proc~read_config_from_string->proc~read_config_from_string_impl proc~build_pending_handle build_pending_handle proc~build_pending_handle->proc~read_config_from_string proc~rdb_ocean_create_from_string rdb_ocean_create_from_string proc~rdb_ocean_create_from_string->proc~build_pending_handle proc~rdb_ocean_create_pending rdb_ocean_create_pending proc~rdb_ocean_create_pending->proc~build_pending_handle

Variables

Type Visibility Attributes Name Initial
type(nml_group_t), private :: g
real(kind=wp), private, pointer :: pa(:)
integer, private, pointer :: pi
logical, private, pointer :: pl
real(kind=wp), private, pointer :: pr
character(len=:), private, pointer :: ps

Source Code

   subroutine register_ocean_hvisc(cfg, schema)
      !! `&ocean_hvisc_nml`: lateral-viscosity closure + coefficients.
      !! `lateral_closure` enum mirrors `parse_lateral_closure` in
      !! rdb_ocean_lateral_mix.
      type(config_t), target, intent(in) :: cfg
      type(nml_schema_t), intent(inout) :: schema
      type(nml_group_t) :: g
      real(wp), pointer :: pr
      real(wp), pointer :: pa(:)
      integer, pointer :: pi
      logical, pointer :: pl
      character(len=:), pointer :: ps

      g%name = "ocean_hvisc"
      g%doc = "Lateral-viscosity closure + coefficients."
      ps => cfg%ocean%hvisc%lateral_closure
      call g%add(nml_enum("lateral_closure", ps, "Lateral-mixing closure tag", &
                          allowed=[character(len=12) :: "none", "leith", "smagorinsky", &
                                   "smag", "biharmonic", "leith_biharm"]))
      pr => cfg%ocean%hvisc%c_smag
      call g%add(nml_real("c_smag", pr, "Smagorinsky coefficient"))
      pr => cfg%ocean%hvisc%c_leith
      call g%add(nml_real("c_leith", pr, "Leith coefficient"))
      pr => cfg%ocean%hvisc%kh_vel_scale
      call g%add(nml_real("kh_vel_scale", pr, "Velocity scale for the resolution viscosity floor", &
                          units="m/s"))
      pr => cfg%ocean%hvisc%ah_bg
      call g%add(nml_real("ah_bg", pr, "Background harmonic viscosity (<0 = derive)", units="m^2/s"))
      pr => cfg%ocean%hvisc%ah_max
      call g%add(nml_real("ah_max", pr, "Cap on per-face harmonic viscosity", units="m^2/s"))
      pl => cfg%ocean%hvisc%smag_ah
      call g%add(nml_logical("smag_ah", pl, "Flow-aware biharmonic viscosity (MOM6 SMAGORINSKY_AH)"))
      pr => cfg%ocean%hvisc%smag_bi_const
      call g%add(nml_real("smag_bi_const", pr, "Biharmonic Smagorinsky constant (MOM6 SMAG_BI_CONST)"))
      pr => cfg%ocean%hvisc%c_leith_bi
      call g%add(nml_real("c_leith_bi", pr, "Biharmonic Leith constant (MOM6 LEITH_BI_CONST)"))
      pr => cfg%ocean%hvisc%nu_4_bg
      call g%add(nml_real("nu_4_bg", pr, "Background biharmonic viscosity floor", units="m^4/s"))
      pr => cfg%ocean%hvisc%nu_4_max
      call g%add(nml_real("nu_4_max", pr, "Cap on per-face biharmonic viscosity", units="m^4/s"))
      pr => cfg%ocean%hvisc%nu_h
      call g%add(nml_real("nu_h", pr, "Constant horizontal eddy viscosity", units="m^2/s"))
      pr => cfg%ocean%hvisc%nu_4
      call g%add(nml_real("nu_4", pr, "Constant biharmonic eddy viscosity", units="m^4/s"))
      pl => cfg%ocean%hvisc%no_slip
      call g%add(nml_logical("no_slip", pl, &
                             "Coastal lateral BC: .false.=free-slip (×wet_q), .true.=no-slip (×(2-wet_q))"))
      pl => cfg%ocean%hvisc%stress_tensor
      call g%add(nml_logical("stress_tensor", pl, &
                             "MOM6 thickness-weighted stress-div operator + per-cell CFL + coast-mask"))
      pr => cfg%ocean%hvisc%bound_coef
      call g%add(nml_real("bound_coef", pr, "Per-cell viscosity-CFL safety coefficient (MOM6 HORVISC_BOUND_COEF)"))
      pl => cfg%ocean%hvisc%bound_kh
      call g%add(nml_logical("bound_kh", pl, &
                             "Per-face harmonic viscosity CFL clamp on the velocity-Laplacian paths (MOM6 BOUND_KH)"))
      pl => cfg%ocean%hvisc%resoln_scaled_visc
      call g%add(nml_logical("resoln_scaled_visc", pl, &
                  "Scale dynamic LAPLACIAN viscosity (Leith/Smag_KH A_h, not biharmonic) by VarMix Res_fn (MOM6 RESOLN_SCALED_KH)"))
      pr => cfg%ocean%hvisc%kh_vel_scale_live
      call g%add(nml_real("kh_vel_scale_live", pr, &
                          "Live velocity-scale viscosity Kh=U*dx*|u| (0=off; distinct from kh_vel_scale floor)", &
                          units="m/s"))
      pr => cfg%ocean%hvisc%kh_aniso
      call g%add(nml_real("kh_aniso", pr, &
                          "Anisotropic Laplacian viscosity magnitude (MOM6 KH_ANISO; stress_tensor path only)", &
                          units="m^2/s"))
      pi => cfg%ocean%hvisc%aniso_mode
      call g%add(nml_int("aniso_mode", pi, &
                         "Anisotropy direction mode (0=grid-relative aniso_dir; MOM6 ANISOTROPIC_MODE)", min=0))
      pa => cfg%ocean%hvisc%aniso_dir
      call g%add(nml_real_array("aniso_dir", pa, &
                                "Anisotropy direction (n1,n2) in grid i,j components (MOM6 ANISO_GRID_DIR)"))
      call schema%add_group(g)
   end subroutine register_ocean_hvisc