ocean_tides_t Derived Type

type, public :: ocean_tides_t


Inherited by

type~~ocean_tides_t~~InheritedByGraph type~ocean_tides_t ocean_tides_t type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_tides_t tides 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 :: amp_c(:)

(nconst) equilibrium amplitudes A (m).

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

(nconst) per-step scratch Alovefcos(omeganow+V+u).

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

(nconst) per-step scratch Alovef*sin(…).

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

Scalar SAL factor beta (~0.085-0.12; C2).

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

(nx,ny,3) cos-part spatial structure per species slice.

logical, public :: enable = .false.

Master switch (default off => bit-identical).

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

(nx,ny) equilibrium tide elevation (m) at cell centres.

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

(nx,ny) combined seam field eta_eq + eta_sal — the surface elevation the barotropic PGF drives -g grad(eta - .) against.

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

(nx,ny) scalar-SAL elevation (m); beta_sal*eta (C2).

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

(nconst) nodal amplitude factor (fixed at nodal_ref_date).

logical, public :: is_init = .false.

True between init and destroy (tracks GPU attachment too).

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

(nconst) Love-number factors.

integer, public :: nconst = 0

Number of active harmonic constituents.

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

(nconst) angular frequencies (rad/s).

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

(nconst) equilibrium argument V_c at ref_date (rad).

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

(nx,ny,3) sin-part spatial structure per species slice.

integer, public, allocatable :: species_c(:)

(nconst) structure-slice index 1/2/3 (diurnal/semidi/long-per).

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

Seconds from ref_date to the model’s t=0 (v1: 0).

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

(nconst) nodal phase (rad).

logical, public :: use_sal = .false.

Apply scalar self-attraction & loading (C2).


Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_tides_bytes

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

    Counted allocatable footprint of the tides 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_tides_t), intent(in) :: this

    Return Value integer(kind=int64)

procedure, public, non_overridable :: destroy => ocean_tides_destroy

procedure, public, non_overridable :: enter_data => ocean_tides_enter_data

  • private subroutine ocean_tides_enter_data(this)

    Attach the device-resident tide arrays. Only when enabled. select-type -> non-poly _impl (AMD libomptarget class-box rule).

    Arguments

    Type IntentOptional Attributes Name
    class(ocean_tides_t), intent(inout) :: this

procedure, public, non_overridable :: exit_data => ocean_tides_exit_data

procedure, public, non_overridable :: init => ocean_tides_init

  • private subroutine ocean_tides_init(this, grid)

    Minimal init — the real allocation + astronomy fill happens in tides_configure_astronomy / tides_build_struct once the namelist + metrics are available (host, before enter_data).

    Arguments

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

Source Code

   type :: ocean_tides_t
      logical :: is_init = .false.
         !! True between `init` and `destroy` (tracks GPU attachment too).

      ! ---- Master switches ----
      logical :: enable = .false.
         !! Master switch (default off => bit-identical).
      logical :: use_sal = .false.
         !! Apply scalar self-attraction & loading (C2).

      ! ---- Active constituent catalog (nconst <= TIDES_CATALOG_SIZE) ----
      integer :: nconst = 0
         !! Number of active harmonic constituents.
      integer, allocatable :: species_c(:)
         !! (nconst) structure-slice index 1/2/3 (diurnal/semidi/long-per).
      real(wp), allocatable :: omega_c(:)
         !! (nconst) angular frequencies (rad/s).
      real(wp), allocatable :: amp_c(:)
         !! (nconst) equilibrium amplitudes A (m).
      real(wp), allocatable :: love_c(:)
         !! (nconst) Love-number factors.
      real(wp), allocatable :: phase0(:)
         !! (nconst) equilibrium argument V_c at ref_date (rad).
      real(wp), allocatable :: f_nodal(:)
         !! (nconst) nodal amplitude factor (fixed at nodal_ref_date).
      real(wp), allocatable :: u_nodal(:)
         !! (nconst) nodal phase (rad).
      real(wp), allocatable :: amp_cos(:)
         !! (nconst) per-step scratch A*love*f*cos(omega*now+V+u).
      real(wp), allocatable :: amp_sin(:)
         !! (nconst) per-step scratch A*love*f*sin(...).

      ! ---- Spatial structure (built ONCE at init) ----
      real(wp), allocatable :: cos_struct(:, :, :)
         !! (nx,ny,3) cos-part spatial structure per species slice.
      real(wp), allocatable :: sin_struct(:, :, :)
         !! (nx,ny,3) sin-part spatial structure per species slice.

      ! ---- 2D forcing fields (filled once per OUTER step) ----
      real(wp), allocatable :: eta_eq(:, :)
         !! (nx,ny) equilibrium tide elevation (m) at cell centres.
      real(wp), allocatable :: eta_sal(:, :)
         !! (nx,ny) scalar-SAL elevation (m); `beta_sal*eta` (C2).
      real(wp), allocatable :: eta_forcing(:, :)
         !! (nx,ny) combined seam field `eta_eq + eta_sal` — the surface
         !! elevation the barotropic PGF drives `-g grad(eta - .)` against.
      real(wp) :: beta_sal = 0.0_wp
         !! Scalar SAL factor beta (~0.085-0.12; C2).

      ! ---- Time tracker ----
      real(wp) :: t_epoch = 0.0_wp
         !! Seconds from ref_date to the model's t=0 (v1: 0).
   contains
      procedure, non_overridable :: init => ocean_tides_init
      procedure, non_overridable :: destroy => ocean_tides_destroy
      procedure, non_overridable :: enter_data => ocean_tides_enter_data
      procedure, non_overridable :: exit_data => ocean_tides_exit_data
      procedure, non_overridable :: bytes => ocean_tides_bytes
   end type ocean_tides_t