ocean_hdiff_tracer_t Derived Type

type, public :: ocean_hdiff_tracer_t


Inherits

type~~ocean_hdiff_tracer_t~~InheritsGraph type~ocean_hdiff_tracer_t ocean_hdiff_tracer_t type~scratch_3d_buffer_t scratch_3d_buffer_t type~ocean_hdiff_tracer_t->type~scratch_3d_buffer_t T_centre, F_x_face, F_y_face

Inherited by

type~~ocean_hdiff_tracer_t~~InheritedByGraph type~ocean_hdiff_tracer_t ocean_hdiff_tracer_t type~ocean_state_t ocean_state_t type~ocean_state_t->type~ocean_hdiff_tracer_t hdiff_tracer 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
type(scratch_3d_buffer_t), public :: F_x_face

East-face tracer flux kappa * h_face * dT/dx. Shape (nx+1, ny, nz_ml).

type(scratch_3d_buffer_t), public :: F_y_face

North-face counterpart. Shape (nx, ny+1, nz_ml).

type(scratch_3d_buffer_t), public :: T_centre

T = hTr/h at cell centres. Shape (nx, ny, nz_ml). Filled per tracer at the start of each impl call; reused across the F_x / F_y face passes so the divergence step reads a consistent snapshot.

logical, public :: is_init = .false.

True between init and destroy.

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

Constant horizontal tracer diffusivity (m^2/s). Zero is a no-op — the kernel short-circuits without touching hTr. Stability bound (explicit forward-Euler): kappa_h * dt * (1/dx^2 + 1/dy^2) <= 0.5


Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_hdiff_tracer_bytes

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

    Counted allocatable footprint of the horizontal tracer diffusion slot (0 when unallocated).

    Arguments

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

    Return Value integer(kind=int64)

procedure, public, non_overridable :: destroy => ocean_hdiff_tracer_destroy

procedure, public, non_overridable :: enter_data => ocean_hdiff_tracer_enter_data

procedure, public, non_overridable :: exit_data => ocean_hdiff_tracer_exit_data

procedure, public, non_overridable :: init => ocean_hdiff_tracer_init

Source Code

   type :: ocean_hdiff_tracer_t
      logical :: is_init = .false.
         !! True between `init` and `destroy`.
      real(wp) :: kappa_h = 0.0_wp
         !! Constant horizontal tracer diffusivity (m^2/s).  Zero
         !! is a no-op — the kernel short-circuits without
         !! touching hTr.  Stability bound (explicit forward-Euler):
         !!   kappa_h * dt * (1/dx^2 + 1/dy^2) <= 0.5

      type(scratch_3d_buffer_t) :: T_centre
         !! `T = hTr/h` at cell centres.  Shape (nx, ny, nz_ml).
         !! Filled per tracer at the start of each impl call;
         !! reused across the F_x / F_y face passes so the
         !! divergence step reads a consistent snapshot.
      type(scratch_3d_buffer_t) :: F_x_face
         !! East-face tracer flux `kappa * h_face * dT/dx`.
         !! Shape (nx+1, ny, nz_ml).
      type(scratch_3d_buffer_t) :: F_y_face
         !! North-face counterpart.  Shape (nx, ny+1, nz_ml).
   contains
      procedure, non_overridable :: init => ocean_hdiff_tracer_init
      procedure, non_overridable :: destroy => ocean_hdiff_tracer_destroy
      procedure, non_overridable :: enter_data => ocean_hdiff_tracer_enter_data
      procedure, non_overridable :: exit_data => ocean_hdiff_tracer_exit_data
      procedure, non_overridable :: bytes => ocean_hdiff_tracer_bytes
   end type ocean_hdiff_tracer_t