ocean_p_surf_t Derived Type

type, public :: ocean_p_surf_t


Inherited by

type~~ocean_p_surf_t~~InheritedByGraph type~ocean_p_surf_t ocean_p_surf_t type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_p_surf_t p_surf 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
logical, public :: enable = .false.

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

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

(nx,ny) inverse-barometer elevation -p_surf/(rho0 g_bt), metres.

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

(nx,ny) combined seam field eta_ib [+ eta_tide] — the surface elevation the barotropic PGF drives -g grad(eta - .) against.

logical, public :: in_eos = .false.

Also hand the assembled p_surf to the equation of state’s IN-SITU pressure arguments as the top-of-column pressure (&ocean_psurf_nml in_eos). Read by the outer-step driver, which refreshes multilayer_state_t%p_top from sf%p_surf when BOTH this and enable are set; p_top is otherwise the zero array it is allocated as, and every EOS evaluation is bit-identical. It does NOT touch the potential density ms%rho_layer (uniform eos%p_ref by design). This slot does NOT own p_top — the multilayer state does, because that is what the in-situ consumers already carry.

logical, public :: is_init = .false.

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

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

Boussinesq reference density (kg/m^3). Assigned from ocean_state%eos%rho0 at configure — the single ρ₀ of record.


Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_p_surf_bytes

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

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

    Return Value integer(kind=int64)

procedure, public, non_overridable :: destroy => ocean_p_surf_destroy

procedure, public, non_overridable :: enter_data => ocean_p_surf_enter_data

  • private subroutine ocean_p_surf_enter_data(this)

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

    Arguments

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

procedure, public, non_overridable :: exit_data => ocean_p_surf_exit_data

procedure, public, non_overridable :: init => ocean_p_surf_init

  • private subroutine ocean_p_surf_init(this, grid)

    Minimal init — the real allocation happens in p_surf_configure once the namelist is available (host, before enter_data).

    Arguments

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

Source Code

   type :: ocean_p_surf_t
      logical :: is_init = .false.
         !! True between `init` and `destroy` (tracks GPU attachment too).
      logical :: enable = .false.
         !! Master switch (default off => bit-identical).
      logical :: in_eos = .false.
         !! Also hand the assembled `p_surf` to the equation of state's
         !! IN-SITU pressure arguments as the top-of-column pressure
         !! (`&ocean_psurf_nml in_eos`).  Read by the outer-step driver,
         !! which refreshes `multilayer_state_t%p_top` from `sf%p_surf`
         !! when BOTH this and `enable` are set; `p_top` is otherwise the
         !! zero array it is allocated as, and every EOS evaluation is
         !! bit-identical.  It does NOT touch the potential density
         !! `ms%rho_layer` (uniform `eos%p_ref` by design).  This slot does
         !! NOT own `p_top` — the multilayer state does, because that is
         !! what the in-situ consumers already carry.
      real(wp) :: rho0 = 1035.0_wp
         !! Boussinesq reference density (kg/m^3).  Assigned from
         !! `ocean_state%eos%rho0` at configure — the single ρ₀ of record.
      real(wp), allocatable :: eta_ib(:, :)
         !! (nx,ny) inverse-barometer elevation `-p_surf/(rho0 g_bt)`, metres.
      real(wp), allocatable :: eta_seam(:, :)
         !! (nx,ny) combined seam field `eta_ib [+ eta_tide]` — the surface
         !! elevation the barotropic PGF drives `-g grad(eta - .)` against.
   contains
      procedure, non_overridable :: init => ocean_p_surf_init
      procedure, non_overridable :: destroy => ocean_p_surf_destroy
      procedure, non_overridable :: enter_data => ocean_p_surf_enter_data
      procedure, non_overridable :: exit_data => ocean_p_surf_exit_data
      procedure, non_overridable :: bytes => ocean_p_surf_bytes
   end type ocean_p_surf_t