Kernel state for the per-tracer horizontal-diffusion sweep.
Sits alongside rdb_ocean_horizontal_viscosity (which does
the momentum half of horizontal mixing); this module is the
tracer-side counterpart. Same compute-then-apply pattern,
same scratch-buffer two-pass design for race-free
do concurrent parallelism.
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| type(scratch_3d_buffer_t), | public | :: | F_x_face |
East-face tracer flux |
|||
| 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 |
|
|||
| logical, | public | :: | is_init | = | .false. |
True between |
|
| 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 |
| procedure, public, non_overridable :: bytes => ocean_hdiff_tracer_bytes | |
| 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 |
Counted allocatable footprint of the horizontal tracer diffusion slot (0 when unallocated).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_hdiff_tracer_t), | intent(in) | :: | this |
Iterate the tracer registry and apply constant-kappa_h
horizontal Laplacian diffusion to every tracer whose
do_horizontal_diffusion flag is set. Outer-shim:
forwards each tracer’s hTr to the flat-impl below.
Reuses the same scratch buffers across all tracers in one
call.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(hgrid_t), | intent(in) | :: | grid | |||
| type(ocean_metrics_t), | intent(in) | :: | metrics | |||
| type(ocean_hdiff_tracer_t), | intent(inout) | :: | this | |||
| type(multilayer_state_t), | intent(inout) | :: | ms | |||
| real(kind=wp), | intent(in) | :: | dt | |||
| logical, | intent(in), | optional | :: | active | ||
| type(ocean_bc_state_t), | intent(in), | optional | :: | bc |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_hdiff_tracer_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_hdiff_tracer_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_hdiff_tracer_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_hdiff_tracer_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| type(ocean_hdiff_tracer_t), | intent(inout) | :: | this |
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| class(ocean_hdiff_tracer_t), | intent(inout) | :: | this | |||
| type(hgrid_t), | intent(in) | :: | grid | |||
| integer, | intent(in), | optional | :: | nz_ml |
Four-pass flat-impl horizontal-Laplacian tracer diffusion in conservative curvilinear form (design ยง2, mirrors continuity):
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| integer, | intent(in) | :: | nghost | |||
| integer, | intent(in) | :: | nx_phys | |||
| integer, | intent(in) | :: | ny_phys | |||
| real(kind=wp), | intent(in) | :: | dt | |||
| real(kind=wp), | intent(in) | :: | kappa | |||
| real(kind=wp), | intent(in) | :: | dy_cu(nx+1,ny) | |||
| real(kind=wp), | intent(in) | :: | dx_cv(nx,ny+1) | |||
| real(kind=wp), | intent(in) | :: | idxCu(nx+1,ny) | |||
| real(kind=wp), | intent(in) | :: | idyCv(nx,ny+1) | |||
| real(kind=wp), | intent(in) | :: | iareaT(nx,ny) | |||
| real(kind=wp), | intent(in) | :: | h(nx,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | hTr(nx,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | T_centre(nx,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | F_x_face(nx+1,ny,nz) | |||
| real(kind=wp), | intent(inout) | :: | F_y_face(nx,ny+1,nz) | |||
| logical, | intent(in) | :: | wall_w | |||
| logical, | intent(in) | :: | wall_e | |||
| logical, | intent(in) | :: | wall_s | |||
| logical, | intent(in) | :: | wall_n | |||
| real(kind=wp), | intent(in), | optional | :: | open_u(nx+1,ny,nz) |
Per-layer 0/1 u-face open mask
( |
|
| real(kind=wp), | intent(in), | optional | :: | open_v(nx,ny+1,nz) |
v-face twin. Present iff |
|
| real(kind=wp), | intent(inout), | optional | :: | budget(nx,ny,nz) |