rdb_ocean_surface_stress Module


Uses

  • module~~rdb_ocean_surface_stress~~UsesGraph module~rdb_ocean_surface_stress rdb_ocean_surface_stress iso_fortran_env iso_fortran_env module~rdb_ocean_surface_stress->iso_fortran_env module~rdb_constants rdb_constants module~rdb_ocean_surface_stress->module~rdb_constants module~rdb_grid rdb_grid module~rdb_ocean_surface_stress->module~rdb_grid module~rdb_mem_report rdb_mem_report module~rdb_ocean_surface_stress->module~rdb_mem_report module~rdb_multilayer_state rdb_multilayer_state module~rdb_ocean_surface_stress->module~rdb_multilayer_state module~rdb_scratch_3d rdb_scratch_3d module~rdb_ocean_surface_stress->module~rdb_scratch_3d pic_types pic_types module~rdb_constants->pic_types module~rdb_grid->module~rdb_constants module~rdb_mem_report->iso_fortran_env module~rdb_mem_report->module~rdb_constants pic_logger pic_logger module~rdb_mem_report->pic_logger pic_strings pic_strings module~rdb_mem_report->pic_strings module~rdb_multilayer_state->iso_fortran_env module~rdb_multilayer_state->module~rdb_constants module~rdb_multilayer_state->module~rdb_grid module~rdb_multilayer_state->module~rdb_mem_report module~rdb_efp rdb_efp module~rdb_multilayer_state->module~rdb_efp module~rdb_error_ring rdb_error_ring module~rdb_multilayer_state->module~rdb_error_ring module~rdb_tracer rdb_tracer module~rdb_multilayer_state->module~rdb_tracer module~rdb_multilayer_state->pic_logger module~rdb_scratch_3d->iso_fortran_env module~rdb_scratch_3d->module~rdb_constants module~rdb_scratch_3d->module~rdb_mem_report module~rdb_efp->iso_fortran_env ieee_arithmetic ieee_arithmetic module~rdb_efp->ieee_arithmetic module~rdb_error_ring->pic_logger module~rdb_tracer->iso_fortran_env module~rdb_tracer->module~rdb_constants module~rdb_tracer->module~rdb_grid module~rdb_tracer->module~rdb_mem_report

Used by

  • module~~rdb_ocean_surface_stress~~UsedByGraph module~rdb_ocean_surface_stress rdb_ocean_surface_stress module~rdb_barotropic_coupling rdb_barotropic_coupling module~rdb_barotropic_coupling->module~rdb_ocean_surface_stress module~rdb_ice_ocean_coupler rdb_ice_ocean_coupler module~rdb_ice_ocean_coupler->module~rdb_ocean_surface_stress module~rdb_ocean_halo_state rdb_ocean_halo_state module~rdb_ice_ocean_coupler->module~rdb_ocean_halo_state module~rdb_ocean_bt_budget_probe rdb_ocean_bt_budget_probe module~rdb_ocean_bt_budget_probe->module~rdb_ocean_surface_stress module~rdb_ocean_data_forcing rdb_ocean_data_forcing module~rdb_ocean_data_forcing->module~rdb_ocean_surface_stress module~rdb_ocean_data_forcing->module~rdb_ocean_halo_state module~rdb_ocean_dyn rdb_ocean_dyn module~rdb_ocean_dyn->module~rdb_ocean_surface_stress module~rdb_ocean_dyn->module~rdb_barotropic_coupling module~rdb_ocean_dyn->module~rdb_ocean_bt_budget_probe module~rdb_ocean_epbl rdb_ocean_epbl module~rdb_ocean_dyn->module~rdb_ocean_epbl module~rdb_ocean_ghost_poison rdb_ocean_ghost_poison module~rdb_ocean_dyn->module~rdb_ocean_ghost_poison module~rdb_ocean_dyn->module~rdb_ocean_halo_state module~rdb_ocean_mle rdb_ocean_mle module~rdb_ocean_dyn->module~rdb_ocean_mle module~rdb_ocean_vmix rdb_ocean_vmix module~rdb_ocean_dyn->module~rdb_ocean_vmix module~rdb_continuity rdb_continuity module~rdb_ocean_dyn->module~rdb_continuity module~rdb_ocean_engine rdb_ocean_engine module~rdb_ocean_engine->module~rdb_ocean_surface_stress module~rdb_ocean_engine->module~rdb_ice_ocean_coupler module~rdb_ocean_engine->module~rdb_ocean_data_forcing module~rdb_ocean_engine->module~rdb_ocean_dyn module~rdb_ocean_engine->module~rdb_ocean_halo_state module~rdb_ocean_setup rdb_ocean_setup module~rdb_ocean_engine->module~rdb_ocean_setup module~rdb_ocean_state rdb_ocean_state module~rdb_ocean_engine->module~rdb_ocean_state module~rdb_ice_transport rdb_ice_transport module~rdb_ocean_engine->module~rdb_ice_transport module~rdb_ocean_diag_derived rdb_ocean_diag_derived module~rdb_ocean_engine->module~rdb_ocean_diag_derived module~rdb_ocean_diag_fills rdb_ocean_diag_fills module~rdb_ocean_engine->module~rdb_ocean_diag_fills module~rdb_ocean_epbl->module~rdb_ocean_surface_stress module~rdb_ocean_ghost_poison->module~rdb_ocean_surface_stress module~rdb_ocean_halo_state->module~rdb_ocean_surface_stress module~rdb_ocean_mle->module~rdb_ocean_surface_stress module~rdb_ocean_mle->module~rdb_ocean_epbl module~rdb_ocean_setup->module~rdb_ocean_surface_stress module~rdb_ocean_setup->module~rdb_ocean_dyn module~rdb_ocean_setup->module~rdb_ocean_epbl module~rdb_ocean_setup->module~rdb_ocean_halo_state module~rdb_ocean_setup->module~rdb_ocean_state module~rdb_ocean_setup->module~rdb_ocean_vmix module~rdb_ocean_state->module~rdb_ocean_surface_stress module~rdb_ocean_state->module~rdb_ocean_data_forcing module~rdb_ocean_state->module~rdb_ocean_dyn module~rdb_ocean_state->module~rdb_ocean_epbl module~rdb_ocean_state->module~rdb_ocean_mle module~rdb_ocean_state->module~rdb_ocean_vmix module~rdb_ocean_state->module~rdb_continuity module~rdb_ocean_vmix->module~rdb_ocean_surface_stress module~rdb_continuity->module~rdb_ocean_mle module~rdb_driver rdb_driver module~rdb_driver->module~rdb_ocean_dyn module~rdb_driver->module~rdb_ocean_engine module~rdb_driver->module~rdb_ocean_state module~rdb_handle rdb_handle module~rdb_handle->module~rdb_ocean_engine module~rdb_handle->module~rdb_ocean_state module~rdb_ice_transport->module~rdb_ocean_halo_state module~rdb_ice_transport->module~rdb_continuity module~rdb_ocean_api rdb_ocean_api module~rdb_ocean_api->module~rdb_ocean_dyn module~rdb_ocean_api->module~rdb_ocean_engine module~rdb_ocean_api->module~rdb_handle module~rdb_ocean_api->module~rdb_ocean_diag_derived module~rdb_ocean_api->module~rdb_ocean_diag_fills module~rdb_ocean_diag_derived->module~rdb_ocean_state module~rdb_ocean_diag_derived->module~rdb_ocean_diag_fills module~rdb_ocean_diag_fills->module~rdb_ocean_state proc~validate_config validate_config proc~validate_config->module~rdb_ocean_vmix

Derived Types

type, public ::  ocean_surface_stress_t

Components

Type Visibility Attributes Name Initial
logical, public :: direct_stress = .false.

MOM6 DIRECT_STRESS analogue. When .true. the wind stress is distributed across the top hmix_stress metres rather than concentrated in the surface-most layer. Mirrors HYCOM’s approach: stress acts on a surface slab of fixed thickness, with each layer in that slab getting a proportional share. Has no effect when the top layer is already thinner than hmix_stress (bit-identical to the bed-only branch in that limit).

type(scratch_3d_buffer_t), public :: du_stress

Surface stress tendency at east faces, shape (nx+1, ny, nz). Only k=nz carries a non-zero value; k

type(scratch_3d_buffer_t), public :: dv_stress

Surface stress tendency at north faces, shape (nx, ny+1, nz).

real(kind=wp), public :: h_min = 1.0e-3_wp

Floor on the surface-layer thickness in the 1/h_top division — keeps the kernel finite when the top layer pinches out (rare; e.g., wave breaking under ZSTAR_FULL).

logical, public :: has_stress_mag = .false.

True once ocean_surface_stress_set_derived has filled stress_mag at least once. Informational — no kernel gates on it (stress_mag is always allocated and zero-safe).

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

Thickness (m) of the surface slab over which the stress is spread when direct_stress = .true.. MOM6 production default 20 m. Zero (default) keeps the surface-layer-only behaviour even if direct_stress is flipped on.

logical, public :: is_init = .false.

True between init and destroy.

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

Boussinesq reference density (kg/m^3) used in the tau / (rho_0 * h) acceleration (top-layer and DIRECT_STRESS distributed forms alike).

Read more…
real(kind=wp), public, allocatable :: stress_mag(:,:)

Cell-centred wind-stress magnitude |tau| (Pa, sqrt(tau_x_cell^2 + tau_y_cell^2)), shape (nx_total, ny_total). Always allocated (PR-12 §7.4: a pure τ property, unlike a shared ustar which would need a coherent rho0 — deferred). Refreshed in step by every writer of the tau pair: the set_wind_stress_* setters and ocean_surface_stress_set_derived at configure, the data-forcing reader’s seam refresh per bracket, and the sea-ice stress coupler’s on-device blend every outer step (all via ocean_surface_stress_refresh_mag). KPP (rdb_ocean_vmix) and EPBL (rdb_ocean_epbl) both read it instead of re-deriving tau_mag inline (bit-identical dedup — same three lines, same FP op order, just computed once) — which is why a tau write that skips the refresh silently freezes BOTH schemes’ u_* at the last refreshed stress.

Read more…
real(kind=wp), public, allocatable :: stress_shelf(:,:)

Cell-centred magnitude of the stress an ICE-SHELF BASE exerts on the ocean (N/m^2, >= 0), shape (nx_total, ny_total), valid including ghosts. Always allocated, mapped and counted; exactly zero without a cavity, and exactly zero on every cell with cover_frac = 0.

Read more…
real(kind=wp), public, allocatable :: tau_x(:,:)

Zonal wind stress (N/m^2) on east faces, shape (nx+1, ny). Fill via set_wind_stress_const for spatially-uniform wind, or assign the array directly for spatially-varying input. Default zero.

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

Meridional wind stress (N/m^2) on north faces, shape (nx, ny+1).

Type-Bound Procedures

procedure, public, non_overridable :: bytes => ocean_surface_stress_bytes
procedure, public, non_overridable :: destroy => ocean_surfstress_destroy
procedure, public, non_overridable :: enter_data => ocean_surfstress_enter_data
procedure, public, non_overridable :: exit_data => ocean_surfstress_exit_data
procedure, public, non_overridable :: init => ocean_surfstress_init
procedure, public, non_overridable :: set_wind_stress_2gyre => ocean_surfstress_set_2gyre
procedure, public, non_overridable :: set_wind_stress_const => ocean_surfstress_set_const
procedure, public, non_overridable :: set_wind_stress_neverworld2 => ocean_surfstress_set_neverworld2

Functions

private pure function ocean_surface_stress_bytes(this) result(nbytes)

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

Return Value integer(kind=int64)


Subroutines

public pure subroutine ocean_surface_stress_apply_cover(ss, cover_frac)

Zero the wind-stress pair on every C-grid face that touches an ice-covered cell, then refresh stress_mag from the masked pair. The two halves are ONE call on purpose: a masked tau with a stale stress_mag would leave KPP/EPBL mixing on a wind that no longer reaches the water.

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(inout) :: ss
real(kind=wp), intent(in) :: cover_frac(:,:)

Ice-cover fraction at cell centres (metrics%cover_frac, v1 binary 0/1), shape (nx_total, ny_total).

public subroutine ocean_surface_stress_apply_tendencies(this, ms, dt, no_wait)

Outer-shim — flattens the derived-type derefs before the do concurrent body sees them. Explicit-shape dimensions derived from ms and passed to the impl as scalar args. no_wait (optional, default .false.): forwarded to the impl — when .true. the apply DC loops run on OpenACC queue 1 without a trailing sync, so the batched velocity-apply chain in run_stage_split !$acc wait(1)s ONCE. Default ⇒ blocking. Not pure because of the async/wait directives.

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(in) :: this
type(multilayer_state_t), intent(inout) :: ms
real(kind=wp), intent(in) :: dt
logical, intent(in), optional :: no_wait

public subroutine ocean_surface_stress_compute_tendencies(grid, this, ms)

Fill du_stress / dv_stress with the surface stress acceleration tau / (rho_0 * h_top) at k = nz. Outer-shim: hoist the derived-type derefs (this%tau_x, this%du_stress%data, ms%h_layer, ms%wet_mask) to the host, dispatch to flat-impl.

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid
type(ocean_surface_stress_t), intent(inout) :: this
type(multilayer_state_t), intent(in) :: ms

public pure subroutine ocean_surface_stress_refresh_mag(ss)

Recompute stress_mag from the CURRENT tau_x/tau_y, shape taken from the already-allocated arrays (no grid needed — this is the grid-free twin of ocean_surface_stress_set_derived, for callers that hold the slot but not the grid).

Read more…

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(inout) :: ss

public subroutine ocean_surface_stress_set_derived(grid, ss, cover_frac)

Fill stress_mag from the current tau_x/tau_y — the MOM6 set_derived_forcing_fields analogue (PR-12), and the public entry point configure_ocean_forcing calls after the wind_config dispatch. Host-side (the wind field is configure-static in v1, so one fill at configure suffices — a future time-varying wind reader re-calls this after each read). Not pure: writes into ss. Call BEFORE enter_data, or follow with !$acc update device(ss%stress_mag) if already mapped. In practice this is a defensive re-fill only: every set_wind_stress_* setter already refreshes stress_mag in step (ocean_surfstress_refresh_stress_mag) so stress_mag is never stale relative to tau_x/tau_y regardless of call site (production driver OR a unit test that never reaches configure_ocean_forcing).

Arguments

Type IntentOptional Attributes Name
type(hgrid_t), intent(in) :: grid

Kept in the public signature (PR-12 plan §5.2) though shape is now taken from tau_x/tau_y directly — see ocean_surfstress_refresh_stress_mag.

type(ocean_surface_stress_t), intent(inout) :: ss
real(kind=wp), intent(in), optional :: cover_frac(:,:)

Ice-shelf cover fraction at cell centres (metrics%cover_frac). Present ⇒ the tau pair is masked on every face touching a covered cell BEFORE stress_mag is rebuilt (ocean_surface_stress_apply_cover). Absent ⇒ the original refresh-only path, byte-identical.

public pure subroutine ocean_surface_stress_set_shelf_from_ustar(stress_shelf, ustar, rho0, nx, ny)

Publish the ice-base stress from a FRICTION VELOCITY: stress_shelf = rho_0 * u_*^2.

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: stress_shelf(nx,ny)

ocean_surface_stress_t%stress_shelf (N/m^2), overwritten.

real(kind=wp), intent(in) :: ustar(nx,ny)

ocean_cavity_flux_t%ustar (m/s).

real(kind=wp), intent(in) :: rho0

Reference density (kg/m^3) – the single rho0 of record, by value from ocean_surface_stress_t%rho0.

integer, intent(in) :: nx

Extents of BOTH arrays. The caller gates on the melt slot’s enable, which is exactly when ustar is full size, so an (1,1) placeholder can never reach these dummies.

integer, intent(in) :: ny

Extents of BOTH arrays. The caller gates on the melt slot’s enable, which is exactly when ustar is full size, so an (1,1) placeholder can never reach these dummies.

private pure subroutine ocean_surfstress_cover_impl(tau_x, tau_y, cover_frac, nx, ny)

Flat do concurrent kernel behind ocean_surface_stress_apply_cover — explicit-shape dummies, integer dims first (decl-order, ifx

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: tau_x(nx+1,ny)
real(kind=wp), intent(inout) :: tau_y(nx,ny+1)
real(kind=wp), intent(in) :: cover_frac(nx,ny)
integer, intent(in) :: nx
integer, intent(in) :: ny

private pure subroutine ocean_surfstress_derived_impl(tau_x, tau_y, stress_mag, nx, ny)

stress_mag(i,j) = |tau| at cell centres — literal copy of the three lines this dedups from rdb_ocean_vmix.F90 (KPP, :575-577/:641-643, pre-PR-12) and rdb_ocean_epbl.F90 (:974-976, pre-PR-12): SAME face-average op order, so the substitution at each call site is bit-identical (PR-12 §7.5). Explicit-shape dummies, integer dims first (decl-order).

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: tau_x(nx+1,ny)
real(kind=wp), intent(in) :: tau_y(nx,ny+1)
real(kind=wp), intent(inout) :: stress_mag(nx,ny)
integer, intent(in) :: nx
integer, intent(in) :: ny

private subroutine ocean_surfstress_destroy(this)

Arguments

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

private subroutine ocean_surfstress_enter_data(this)

Type-bound wrapper — delegates to the non-polymorphic impl so the device-attach map base is the heap object, not a polymorphic stack box (AMD libomptarget cross-slot-overlap fix). Slot-header presence comes from the orchestrator’s root copyin(state); only the leaf arrays + scratch are attached here.

Arguments

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

private subroutine ocean_surfstress_enter_data_impl(this)

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(inout) :: this

private subroutine ocean_surfstress_exit_data(this)

Arguments

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

private subroutine ocean_surfstress_exit_data_impl(this)

Arguments

Type IntentOptional Attributes Name
type(ocean_surface_stress_t), intent(inout) :: this

private subroutine ocean_surfstress_init(this, grid, nz_ml)

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_stress_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
integer, intent(in), optional :: nz_ml

private subroutine ocean_surfstress_refresh_stress_mag(this)

Type-bound-facing shim behind every set_wind_stress_* setter: strips the polymorphic box (same reason as enter_data) and delegates to ocean_surface_stress_refresh_mag. Keeping this call inside each setter — rather than requiring a separate explicit call — is what keeps stress_mag correct for every existing caller, including unit tests that build ocean_surface_stress_t directly and never reach configure_ocean_forcing.

Arguments

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

private subroutine ocean_surfstress_set_2gyre(this, grid, taux_mag, j_offset, ny_global)

Fill tau_x with the MOM6 2gyre profile, tau_x(i,j) = taux_mag · (1 − cos(2π · (y − y_south) / y_len)), and zero tau_y. In Cartesian terms (y − y_south) / y_len is the normalised position from the south wall of the physical domain (0 at south, 1 at north), so the formula reduces to taux_mag · (1 − cos(2π · ((j_phys − 0.5) / ny_phys))) with j_phys = j − nghost. Physical-interior rows only; ghost rows stay at zero so wall faces see no spurious stress. Host only — call enter_data afterwards (or !$acc update device if already mapped).

Read more…

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_stress_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: taux_mag
integer, intent(in), optional :: j_offset
integer, intent(in), optional :: ny_global

private subroutine ocean_surfstress_set_const(this, tau_x_val, tau_y_val)

Fill tau_x / tau_y uniformly with the given scalar values. Convenience helper for the spatially-constant wind case (the Tier-1 default and most unit tests). Host only — call enter_data afterwards (or !$acc update device if already mapped) to sync to GPU. Refreshes stress_mag in step (PR-12) so every existing caller — production and unit test alike — gets a consistent stress_mag with no separate call required.

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_stress_t), intent(inout) :: this
real(kind=wp), intent(in) :: tau_x_val
real(kind=wp), intent(in) :: tau_y_val

private subroutine ocean_surfstress_set_neverworld2(this, grid, taux_mag, j_offset, ny_global)

Fill tau_x with the Neverworld2 zonal wind-stress profile (Marques et al. 2022, GMD; MOM6-inspired) and zero tau_y. τ_x is a 3-band piecewise function of the normalized meridional position y = (j_phys − 0.5)/ny_phys ∈ [0,1] (which equals MOM6’s (lat − south)/len_lat on a uniform grid), scaled by the peak stress taux_mag (Pa), with off = 0.02:

Read more…

Arguments

Type IntentOptional Attributes Name
class(ocean_surface_stress_t), intent(inout) :: this
type(hgrid_t), intent(in) :: grid
real(kind=wp), intent(in) :: taux_mag
integer, intent(in), optional :: j_offset
integer, intent(in), optional :: ny_global

private subroutine surfstress_apply_impl(u_face, v_face, du_stress, dv_stress, dt, nx, ny, nz, lwait)

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(inout) :: u_face(nx+1,ny,nz)
real(kind=wp), intent(inout) :: v_face(nx,ny+1,nz)
real(kind=wp), intent(in) :: du_stress(nx+1,ny,nz)
real(kind=wp), intent(in) :: dv_stress(nx,ny+1,nz)
real(kind=wp), intent(in) :: dt
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz
logical, intent(in) :: lwait

.false. ⇒ leave the apply on queue 1 without syncing (batched).

private pure subroutine surfstress_compute_impl(h_layer, wet_mask, tau_x, tau_y, du_stress, dv_stress, rho0, h_min, nx, ny, nz)

Flat-array surface-stress kernel. Explicit-shape dummies so NVHPC stdpar can compile the device kernel against static bounds.

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: wet_mask(nx,ny)
real(kind=wp), intent(in) :: tau_x(nx+1,ny)
real(kind=wp), intent(in) :: tau_y(nx,ny+1)
real(kind=wp), intent(inout) :: du_stress(nx+1,ny,nz)
real(kind=wp), intent(inout) :: dv_stress(nx,ny+1,nz)
real(kind=wp), intent(in) :: rho0
real(kind=wp), intent(in) :: h_min
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz

private pure subroutine surfstress_distributed_impl(h_layer, wet_mask, tau_x, tau_y, du_stress, dv_stress, rho0, h_min, hmix_stress, nx, ny, nz)

DIRECT_STRESS branch — distribute the wind stress across the top hmix_stress metres of the column. For each face, walk layers from k = nz (surface) down to k = 1, accumulating thickness; the surface boundary layer (SBL) is the set of layers whose top sits within hmix_stress of the free surface. The acceleration per layer is:

Read more…

Arguments

Type IntentOptional Attributes Name
real(kind=wp), intent(in) :: h_layer(nx,ny,nz)
real(kind=wp), intent(in) :: wet_mask(nx,ny)
real(kind=wp), intent(in) :: tau_x(nx+1,ny)
real(kind=wp), intent(in) :: tau_y(nx,ny+1)
real(kind=wp), intent(inout) :: du_stress(nx+1,ny,nz)
real(kind=wp), intent(inout) :: dv_stress(nx,ny+1,nz)
real(kind=wp), intent(in) :: rho0
real(kind=wp), intent(in) :: h_min
real(kind=wp), intent(in) :: hmix_stress
integer, intent(in) :: nx
integer, intent(in) :: ny
integer, intent(in) :: nz