ocean_wave_speed_t Derived Type

type, public :: ocean_wave_speed_t


Inherited by

type~~ocean_wave_speed_t~~InheritedByGraph type~ocean_wave_speed_t ocean_wave_speed_t type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_wave_speed_t wavespeed type~ocean_engine_t ocean_engine_t type~ocean_engine_t->type~ocean_state_t state type~ocean_handle_t ocean_handle_t type~ocean_handle_t->type~ocean_state_t state type~ocean_handle_t->type~ocean_engine_t engine

Components

Type Visibility Attributes Name Initial
real(kind=wp), public, allocatable :: beta_centre(:,:)

|grad f| at cell centres (1/(m*s)); static, filled at configure by build_static from the same Coriolis field (the meke_length_scales centred-difference idiom). Feeds the equatorial branch of wavespeed_rd — replaces the old namelist-scalar beta.

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

First-baroclinic gravity-wave speed (m/s).

logical, public :: enable = .false.

Master switch. Default off — bit-identity preserved.

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

|f| at cell centres (1/s); filled by build_static from metrics_fill_coriolis (planetary or beta-plane, per &ocean_grid_nml coriolis_scheme).

logical, public :: is_init = .false.

True between init and destroy.

real(kind=wp), public :: mono_n2_depth = -1.0_wp

depth. < 0 = off.

integer, public :: n_wavespeed = 1

diagnostic). Default every step (cheap when default-off).

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

First-mode Rossby deformation radius (m).

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

Rd / dx (nondim) — the B2 resolution ratio. dx here is metrics%dxT (metres), NOT grid%dx (degrees on spherical/supergrid/tripolar).

real(kind=wp), public :: rho0 = 1035.0_wp

Boussinesq reference density (kg/m^3) for gprime.

logical, public :: use_ebt = .false.

DEFERRED: pressure-Neumann / equivalent-barotropic variant.


Type-Bound Procedures

procedure, public :: build_static => ocean_wave_speed_build_static

  • private subroutine ocean_wave_speed_build_static(this, grid, metrics, f_centre)

    Copy a pre-filled cell-centre Coriolis magnitude |f| (1/s) onto the slot (mirror of ocean_meke_set_f_centre — the caller builds f_centre via fill_coriolis_centre / metrics_fill_coriolis, which handles beta-plane AND planetary/spherical), and fill the static beta_centre = |grad f| field with the SAME centred-difference stencil meke_length_scales uses (edge rows/columns left at 0 -> the extratropical Rd = cg1/|f| branch there).

    Read more…

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_wave_speed_t), intent(inout) :: this
    type(hgrid_t), intent(in) :: grid
    type(ocean_metrics_t), intent(in) :: metrics
    real(kind=wp), intent(in) :: f_centre(grid%nx_total,grid%ny_total)

procedure, public, non_overridable :: bytes => ocean_wave_speed_bytes

  • private pure function ocean_wave_speed_bytes(this) result(nbytes)

    Counted allocatable footprint of the wave speed slot (0 when unallocated). One arr_bytes term per array — add a term here when a new allocatable joins the type.

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_wave_speed_t), intent(in) :: this

    Return Value integer(kind=int64)

procedure, public :: destroy => ocean_wave_speed_destroy

procedure, public :: enter_data => ocean_wave_speed_enter_data

procedure, public :: exit_data => ocean_wave_speed_exit_data

procedure, public :: init => ocean_wave_speed_init

  • private subroutine ocean_wave_speed_init(this, grid)

    Allocate the persistent (nx, ny) fields. Always allocates (configure runs after init, so enable is not known yet); the off-state footprint is four 2D arrays.

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_wave_speed_t), intent(inout) :: this
    type(hgrid_t), intent(in) :: grid

Source Code

   type :: ocean_wave_speed_t
      logical :: is_init = .false.
         !! True between `init` and `destroy`.

      ! ---- Scheme selection + master switch ----
      logical :: enable = .false.
         !! Master switch.  Default off — bit-identity preserved.
      real(wp) :: mono_n2_depth = -1.0_wp
         !! DEFERRED: limit N^2 from increasing with depth below this
         !! depth.  `< 0` = off.
      logical :: use_ebt = .false.
         !! DEFERRED: pressure-Neumann / equivalent-barotropic variant.
      integer :: n_wavespeed = 1
         !! Cadence: recompute every `n_wavespeed` steps (slow
         !! diagnostic).  Default every step (cheap when default-off).

      ! ---- Environment (copied from the EOS slot at configure) ----
      real(wp) :: rho0 = 1035.0_wp
         !! Boussinesq reference density (kg/m^3) for `gprime`.

      ! ---- Persistent fields ----
      real(wp), allocatable :: f_centre(:, :)
         !! |f| at cell centres (1/s); filled by `build_static` from
         !! `metrics_fill_coriolis` (planetary or beta-plane, per
         !! `&ocean_grid_nml coriolis_scheme`).
      real(wp), allocatable :: beta_centre(:, :)
         !! |grad f| at cell centres (1/(m*s)); static, filled at
         !! configure by `build_static` from the same Coriolis field
         !! (the `meke_length_scales` centred-difference idiom).  Feeds
         !! the equatorial branch of `wavespeed_rd` — replaces the old
         !! namelist-scalar `beta`.
      real(wp), allocatable :: cg1(:, :)
         !! First-baroclinic gravity-wave speed (m/s).
      real(wp), allocatable :: rd(:, :)
         !! First-mode Rossby deformation radius (m).
      real(wp), allocatable :: rd_over_dx(:, :)
         !! Rd / dx (nondim) — the B2 resolution ratio.  `dx` here is
         !! `metrics%dxT` (metres), NOT `grid%dx` (degrees on
         !! spherical/supergrid/tripolar).
   contains
      procedure :: init => ocean_wave_speed_init
      procedure :: destroy => ocean_wave_speed_destroy
      procedure :: enter_data => ocean_wave_speed_enter_data
      procedure :: exit_data => ocean_wave_speed_exit_data
      procedure :: build_static => ocean_wave_speed_build_static
      procedure, non_overridable :: bytes => ocean_wave_speed_bytes
   end type ocean_wave_speed_t