Surface-relative hydrostatic pressure at the interface K straddled
by layer ka (above, surface-side) and ka-1 (below): the
interface sits at the BOTTOM of layer ka, so the water column
above it is layers ka..nz (bottom-up, k=nz the surface).
p = g·ρ₀·Σ_{k’=ka}^{nz} h(k’) — the sum INCLUDES ka (the layer
directly above the interface); omitting it shorts the pressure by
one layer (~5e5 Pa) and biases pressure-dependent EOS derivatives.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | nx | |||
| integer, | intent(in) | :: | ny | |||
| integer, | intent(in) | :: | nz | |||
| real(kind=wp), | intent(in) | :: | h_layer(nx,ny,nz) | |||
| integer, | intent(in) | :: | ic | |||
| integer, | intent(in) | :: | jc | |||
| integer, | intent(in) | :: | ka | |||
| real(kind=wp), | intent(in) | :: | rho0 |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| integer, | private | :: | kk |
pure function pressure_above_x(nx, ny, nz, h_layer, ic, jc, ka, rho0) result(p) !! Surface-relative hydrostatic pressure at the interface K straddled !! by layer `ka` (above, surface-side) and `ka-1` (below): the !! interface sits at the BOTTOM of layer `ka`, so the water column !! above it is layers `ka..nz` (bottom-up, k=nz the surface). !! p = g·ρ₀·Σ_{k'=ka}^{nz} h(k') — the sum INCLUDES `ka` (the layer !! directly above the interface); omitting it shorts the pressure by !! one layer (~5e5 Pa) and biases pressure-dependent EOS derivatives. !$acc routine seq integer, intent(in) :: nx, ny, nz, ic, jc, ka real(wp), intent(in) :: h_layer(nx, ny, nz) real(wp), intent(in) :: rho0 real(wp) :: p integer :: kk p = 0.0_wp do kk = nz, ka, -1 p = p + GRAVITY*rho0*h_layer(ic, jc, kk) end do end function pressure_above_x