Interface height at a velocity point from the two adjacent
cell-centre interface heights. MOM6’s PORBAR_ETA_INTERP
options. POROUS_ETA_MAX (the higher, i.e. shallower,
interface) is the default and the LEAST blocking: the open width
w is monotone increasing in the interface height, so the rule
that returns the larger height leaves the most of the face open.
POROUS_ETA_MIN is the most blocking.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | z_a |
Interface height in the first adjacent cell (m, positive up). |
||
| real(kind=wp), | intent(in) | :: | z_b |
Interface height in the second adjacent cell (m, positive up). |
||
| integer, | intent(in) | :: | interp |
One of the |
pure function porous_eta_face(z_a, z_b, interp) result(eta) !! Interface height at a velocity point from the two adjacent !! cell-centre interface heights. MOM6's `PORBAR_ETA_INTERP` !! options. `POROUS_ETA_MAX` (the higher, i.e. shallower, !! interface) is the default and the LEAST blocking: the open width !! `w` is monotone increasing in the interface height, so the rule !! that returns the larger height leaves the most of the face open. !! `POROUS_ETA_MIN` is the most blocking. real(wp), intent(in) :: z_a !! Interface height in the first adjacent cell (m, positive up). real(wp), intent(in) :: z_b !! Interface height in the second adjacent cell (m, positive up). integer, intent(in) :: interp !! One of the `POROUS_ETA_*` enum values. real(wp) :: eta select case (interp) case (POROUS_ETA_MAX) eta = max(z_a, z_b) case (POROUS_ETA_MIN) eta = min(z_a, z_b) case (POROUS_ETA_ARITH) eta = 0.5_wp*(z_a + z_b) case (POROUS_ETA_HARM) ! Only meaningful when both interfaces are on the SAME side of ! the datum (the ocean case, both negative). A straddling pair ! can drive the denominator through zero, where the H_DIV_EPS ! armour prevents the division but not a large result. eta = 2.0_wp*(z_a*z_b)/(z_a + z_b + H_DIV_EPS) case default ! UNREACHABLE. MOM6 issues a FATAL here; this is a `pure` ! device-side function and cannot, so the fail-loud lives at the ! host boundary instead: `parse_porous_eta_interp` returns -1 for ! any unrecognised string and `configure_ocean_porous` ! `error stop`s on it, so no other value can reach this kernel. ! Falling back to MAX keeps the function total. eta = max(z_a, z_b) end select end function porous_eta_face