One Arakawa-Hsu pair coefficient (q1 + q2 + q3)/12 with each PV
re-evaluated at a corner thickness of at least h_ref/2:
q → q·h_X/(h_ref/2) where h_X < h_ref/2, q unchanged
otherwise (so an inactive floor returns the unfloored sum bit for
bit). h_ref is the larger thickness of the pair’s u- and v-face.
The bound is the one sadourny_energy satisfies by construction:
there each corner PV multiplies only transports through faces whose
two cells both sit inside that corner’s 4-cell mean, so
h_corner >= h_face/2 (equal areas) and q·vh <= 2·|f+ζ|·|v|·dx.
The HK stencil also pairs a corner with a transport whose far cell
lies OUTSIDE it, and there h_face/h_corner is unbounded. Because
h_ref belongs to the PAIR, the u-tendency’s coefficient on vh_V
and the v-tendency’s on uh_U stay equal (energy antisymmetry).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q1 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | h1 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | q2 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | h2 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | q3 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | h3 |
The three corner PVs and the corner thicknesses they carry. |
||
| real(kind=wp), | intent(in) | :: | h_ref |
|
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private, | parameter | :: | C1_12 | = | 1.0_wp/12.0_wp | |
| real(kind=wp), | private | :: | hh | ||||
| real(kind=wp), | private | :: | p1 | ||||
| real(kind=wp), | private | :: | p2 | ||||
| real(kind=wp), | private | :: | p3 |
pure function hk_pair_coef(q1, h1, q2, h2, q3, h3, h_ref) result(coef) !$acc routine seq !! One Arakawa-Hsu pair coefficient `(q1 + q2 + q3)/12` with each PV !! re-evaluated at a corner thickness of at least `h_ref/2`: !! `q → q·h_X/(h_ref/2)` where `h_X < h_ref/2`, `q` unchanged !! otherwise (so an inactive floor returns the unfloored sum bit for !! bit). `h_ref` is the larger thickness of the pair's u- and v-face. !! !! The bound is the one `sadourny_energy` satisfies by construction: !! there each corner PV multiplies only transports through faces whose !! two cells both sit inside that corner's 4-cell mean, so !! `h_corner >= h_face/2` (equal areas) and `q·vh <= 2·|f+ζ|·|v|·dx`. !! The HK stencil also pairs a corner with a transport whose far cell !! lies OUTSIDE it, and there `h_face/h_corner` is unbounded. Because !! `h_ref` belongs to the PAIR, the u-tendency's coefficient on `vh_V` !! and the v-tendency's on `uh_U` stay equal (energy antisymmetry). real(wp), intent(in) :: q1, h1, q2, h2, q3, h3 !! The three corner PVs and the corner thicknesses they carry. real(wp), intent(in) :: h_ref !! `max(h_U, h_V)` of the pair's two faces (m). real(wp) :: coef real(wp), parameter :: C1_12 = 1.0_wp/12.0_wp real(wp) :: hh, p1, p2, p3 hh = 0.5_wp*h_ref p1 = q1 p2 = q2 p3 = q3 if (h1 < hh) p1 = q1*(h1/hh) if (h2 < hh) p2 = q2*(h2/hh) if (h3 < hh) p3 = q3*(h3/hh) coef = (p1 + p2 + p3)*C1_12 end function hk_pair_coef