vcoord_t Derived Type

type, public :: vcoord_t


Components

Type Visibility Attributes Name Initial
real(kind=wp), public :: blend_width = 50.0_wp

Width of the blending zone (m)

integer, public :: coord_type = VCOORD_SIGMA

Vertical coordinate type (VCOORD_SIGMA, VCOORD_ZSIGMA, etc.)

real(kind=wp), public :: depth_transition = 100.0_wp

Depth (m) where sigma-to-z blending begins

real(kind=wp), public, allocatable :: dsig_target(:)

(nz) Target sigma-like layer fractions, sum = 1.0

integer, public :: nz = 0

Number of vertical layers

integer, public :: remap_method = REMAP_PPM

Remap reconstruction order (REMAP_PCM/PLM/PPM/PPM_H4/PQM). Default PPM. PQM falls back to PPM for nz < 5 (see remap_column_pqm).

real(kind=wp), public, allocatable :: z_ref(:)

(nz+1) Reference interface depths for z-levels (m, positive down). Only allocated for coord types that use z-levels.

real(kind=wp), public :: zstar_h_min = 1.0e-4_wp

Vanishing-layer floor (m). Layers that would land below the local bed get clipped to this thickness rather than going to zero. Deliberately BELOW H_VANISHED (1.5e-4): these are inert filler layers that downstream h-dividing kernels are MEANT to skip, so the floor is anti-zero armour, not a positivity floor. See vcoord_h_min_role for the other contract the same knob carries on the density (RHO/HYCOM) families.

real(kind=wp), public :: zstar_h_surf_target = 0.0_wp

Target physical thickness of the surface layer (m). 0 => auto: uniform per-column (falls back to lite behaviour per column). Set > 0 to anchor the surface layer at a fixed thickness regardless of total depth H.

integer, public :: zstar_n_surf = 0

Number of “fine” near-surface layers using stretching. 0 => auto (use max(1, nz/3))

integer, public :: zstar_stretching = 1

Surface-concentration stretching: 1=log, 0=uniform


Type-Bound Procedures

procedure, public, non_overridable :: cleanup => vcoord_cleanup

  • private subroutine vcoord_cleanup(self)

    Deallocate all arrays. Safe to call on uninitialised instances.

    Arguments

    Type IntentOptional Attributes Name
    class(vcoord_t), intent(inout) :: self

procedure, public, non_overridable :: enter_data => vcoord_enter_data

  • private subroutine vcoord_enter_data(self)

    Map read-only coordinate arrays to GPU.

    Arguments

    Type IntentOptional Attributes Name
    class(vcoord_t), intent(inout) :: self

procedure, public, non_overridable :: exit_data => vcoord_exit_data

  • private subroutine vcoord_exit_data(self)

    Unmap coordinate arrays from GPU.

    Arguments

    Type IntentOptional Attributes Name
    class(vcoord_t), intent(inout) :: self

procedure, public, non_overridable :: init => vcoord_init

  • private subroutine vcoord_init(self, nz, coord_type, remap_method)

    Initialise a vertical coordinate definition. Allocates + populates dsig_target for the given type. Unknown types: error stop.

    Arguments

    Type IntentOptional Attributes Name
    class(vcoord_t), intent(inout) :: self
    integer, intent(in) :: nz

    Number of vertical layers

    integer, intent(in) :: coord_type

    Coordinate type constant (VCOORD_SIGMA, etc.)

    integer, intent(in) :: remap_method

    Remapping method constant (REMAP_PLM, etc.)

procedure, public, non_overridable :: needs_remap => vcoord_needs_remap

  • private pure function vcoord_needs_remap(self) result(needs_remap)

    Returns .true. if this coordinate type requires conservative vertical remapping after the barotropic step. Pure sigma does not — layers are simply rescaled by dsig(k) * H.

    Arguments

    Type IntentOptional Attributes Name
    class(vcoord_t), intent(in) :: self

    Return Value logical

Source Code

   type :: vcoord_t
      integer :: coord_type = VCOORD_SIGMA
         !! Vertical coordinate type (VCOORD_SIGMA, VCOORD_ZSIGMA, etc.)
      integer :: remap_method = REMAP_PPM
         !! Remap reconstruction order (REMAP_PCM/PLM/PPM/PPM_H4/PQM). Default PPM.
         !! PQM falls back to PPM for nz < 5 (see `remap_column_pqm`).
      integer :: nz = 0
         !! Number of vertical layers

      real(wp), allocatable :: dsig_target(:)
         !! (nz) Target sigma-like layer fractions, sum = 1.0

      real(wp), allocatable :: z_ref(:)
         !! (nz+1) Reference interface depths for z-levels (m, positive down).
         !! Only allocated for coord types that use z-levels.

      ! z-sigma hybrid parameters
      real(wp) :: depth_transition = 100.0_wp
         !! Depth (m) where sigma-to-z blending begins
      real(wp) :: blend_width = 50.0_wp
         !! Width of the blending zone (m)

      ! Full MOM6 z* parameters (VCOORD_ZSTAR_FULL)
      real(wp) :: zstar_h_surf_target = 0.0_wp
         !! Target physical thickness of the surface layer (m).
         !! 0 => auto: uniform per-column (falls back to lite behaviour
         !! per column).  Set > 0 to anchor the surface layer at a
         !! fixed thickness regardless of total depth H.
      real(wp) :: zstar_h_min = 1.0e-4_wp
         !! Vanishing-layer floor (m).  Layers that would land below the
         !! local bed get clipped to this thickness rather than going to zero.
         !! Deliberately BELOW `H_VANISHED` (1.5e-4): these are inert filler
         !! layers that downstream h-dividing kernels are MEANT to skip, so
         !! the floor is anti-zero armour, not a positivity floor.  See
         !! `vcoord_h_min_role` for the other contract the same knob carries
         !! on the density (RHO/HYCOM) families.
      integer :: zstar_stretching = 1
         !! Surface-concentration stretching: 1=log, 0=uniform
      integer :: zstar_n_surf = 0
         !! Number of "fine" near-surface layers using stretching.
         !! 0 => auto (use max(1, nz/3))
   contains
      procedure, non_overridable :: init => vcoord_init
      procedure, non_overridable :: needs_remap => vcoord_needs_remap
      procedure, non_overridable :: enter_data => vcoord_enter_data
      procedure, non_overridable :: exit_data => vcoord_exit_data
      procedure, non_overridable :: cleanup => vcoord_cleanup
   end type vcoord_t