Build one column’s TOP-DOWN layer-average tracer Tlay, PPM
interface edges Tint, and per-layer limited PPM left/right edges
aLe/aRe from the bottom-up native (h, hTr) column (fixed-size
NZ_STACK_MAX copies), restricted to the face’s open window
kb..kt (1..nz off the z-level closed-face path) — indexed in
the WINDOW top-down frame, 1..nk, nk = kt-kb+1. Tlay = the I1′
column read (rdb_vl_column_conc, see redi_build_column).
Mirrors MOM6 interface_scalar + ppm_left_right_edge_values.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| integer, | intent(in) | :: | kb |
Native (bottom-up) open window, |
||
| integer, | intent(in) | :: | kt |
Native (bottom-up) open window, |
||
| real(kind=wp), | intent(in) | :: | h_col(NZ_STACK_MAX) | |||
| real(kind=wp), | intent(in) | :: | htr_col(NZ_STACK_MAX) | |||
| real(kind=wp), | intent(out) | :: | Tlay(NZ_STACK_MAX) | |||
| real(kind=wp), | intent(out) | :: | Tint(NZ_STACK_MAX+1) | |||
| real(kind=wp), | intent(out) | :: | aLe(NZ_STACK_MAX) | |||
| real(kind=wp), | intent(out) | :: | aRe(NZ_STACK_MAX) |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | alk | ||||
| real(kind=wp), | private | :: | ark | ||||
| real(kind=wp), | private | :: | cc(NZ_STACK_MAX) | ||||
| real(kind=wp), | private | :: | htd(NZ_STACK_MAX) | ||||
| integer, | private | :: | k | ||||
| integer, | private | :: | kf | ||||
| integer, | private | :: | nk | ||||
| real(kind=wp), | private | :: | tedge(NZ_STACK_MAX+1) | ||||
| real(kind=wp), | private | :: | tlk |
pure subroutine redi_tracer_column(kb, kt, h_col, htr_col, Tlay, Tint, aLe, aRe) !$acc routine seq !! Build one column's TOP-DOWN layer-average tracer `Tlay`, PPM !! interface edges `Tint`, and per-layer limited PPM left/right edges !! `aLe/aRe` from the bottom-up native (h, hTr) column (fixed-size !! NZ_STACK_MAX copies), restricted to the face's open window !! `kb..kt` (`1..nz` off the z-level closed-face path) — indexed in !! the WINDOW top-down frame, `1..nk`, `nk = kt-kb+1`. Tlay = the I1′ !! column read (`rdb_vl_column_conc`, see `redi_build_column`). !! Mirrors MOM6 interface_scalar + ppm_left_right_edge_values. integer, intent(in) :: kb, kt !! Native (bottom-up) open window, `1 <= kb <= kt`. real(wp), intent(in) :: h_col(NZ_STACK_MAX), htr_col(NZ_STACK_MAX) real(wp), intent(out) :: Tlay(NZ_STACK_MAX), Tint(NZ_STACK_MAX + 1) real(wp), intent(out) :: aLe(NZ_STACK_MAX), aRe(NZ_STACK_MAX) real(wp) :: htd(NZ_STACK_MAX), tedge(NZ_STACK_MAX + 1), cc(NZ_STACK_MAX) real(wp) :: alk, ark, tlk integer :: k, kf, nk nk = kt - kb + 1 call rdb_vl_column_conc(kt, h_col, htr_col, cc) do k = kb, kt kf = kt + 1 - k htd(kf) = h_col(k) Tlay(kf) = cc(k) end do call redi_interface_scalar(nk, htd, Tlay, tedge) do k = 1, nk + 1 Tint(k) = tedge(k) end do do k = 1, nk alk = Tint(k) ark = Tint(k + 1) tlk = Tlay(k) if (redi_signum1(ark - tlk)*redi_signum1(tlk - alk) <= 0.0_wp) then alk = tlk ark = tlk else if (sign(3.0_wp, ark - alk)*((tlk - alk) + (tlk - ark)) > abs(ark - alk)) then alk = tlk + 2.0_wp*(tlk - ark) else if (sign(3.0_wp, ark - alk)*((tlk - alk) + (tlk - ark)) < -abs(ark - alk)) then ark = tlk + 2.0_wp*(tlk - alk) end if aLe(k) = alk aRe(k) = ark end do end subroutine redi_tracer_column