The five sub-point (T, S, p) triples of the in-layer Boole rule,
top (n = 1) to bottom (n = 5), for the per-EOS twins – the same
points boole_dpa_intz_layer writes out in place.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | rho0 |
Boussinesq reference density used in the pressure estimate. |
||
| real(kind=wp), | intent(in) | :: | e_top |
Surface-relative height of the SHALLOWER interface. |
||
| real(kind=wp), | intent(in) | :: | dz |
Layer thickness (m), dz >= 0. |
||
| real(kind=wp), | intent(in) | :: | t_t |
Temperature: top edge, bottom edge, layer mean. |
||
| real(kind=wp), | intent(in) | :: | t_b |
Temperature: top edge, bottom edge, layer mean. |
||
| real(kind=wp), | intent(in) | :: | t_mean |
Temperature: top edge, bottom edge, layer mean. |
||
| real(kind=wp), | intent(in) | :: | s_t |
Salinity: top edge, bottom edge, layer mean. |
||
| real(kind=wp), | intent(in) | :: | s_b |
Salinity: top edge, bottom edge, layer mean. |
||
| real(kind=wp), | intent(in) | :: | s_mean |
Salinity: top edge, bottom edge, layer mean. |
||
| logical, | intent(in) | :: | parabolic |
.true. -> add the PPM curvature (s6/t6) term. |
||
| real(kind=wp), | intent(out) | :: | t5(N_BOOLE) |
Sub-point temperature, salinity and Boussinesq pressure (Pa). |
||
| real(kind=wp), | intent(out) | :: | s5(N_BOOLE) |
Sub-point temperature, salinity and Boussinesq pressure (Pa). |
||
| real(kind=wp), | intent(out) | :: | p5(N_BOOLE) |
Sub-point temperature, salinity and Boussinesq pressure (Pa). |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | gxrho | ||||
| integer, | private | :: | n | ||||
| real(kind=wp), | private | :: | s6 | ||||
| real(kind=wp), | private | :: | t6 | ||||
| real(kind=wp), | private | :: | wt_b | ||||
| real(kind=wp), | private | :: | wt_t | ||||
| real(kind=wp), | private | :: | z5 |
pure subroutine boole_layer_points(rho0, e_top, dz, t_t, t_b, t_mean, & s_t, s_b, s_mean, parabolic, t5, s5, p5) !$acc routine seq !! The five sub-point (T, S, p) triples of the in-layer Boole rule, !! top (n = 1) to bottom (n = 5), for the per-EOS twins -- the same !! points `boole_dpa_intz_layer` writes out in place. real(wp), intent(in) :: rho0 !! Boussinesq reference density used in the pressure estimate. real(wp), intent(in) :: e_top !! Surface-relative height of the SHALLOWER interface. real(wp), intent(in) :: dz !! Layer thickness (m), dz >= 0. real(wp), intent(in) :: t_t, t_b, t_mean !! Temperature: top edge, bottom edge, layer mean. real(wp), intent(in) :: s_t, s_b, s_mean !! Salinity: top edge, bottom edge, layer mean. logical, intent(in) :: parabolic !! .true. -> add the PPM curvature (s6/t6) term. real(wp), intent(out) :: t5(N_BOOLE), s5(N_BOOLE), p5(N_BOOLE) !! Sub-point temperature, salinity and Boussinesq pressure (Pa). real(wp) :: gxrho, wt_t, wt_b, t6, s6, z5 integer :: n gxrho = GRAVITY*rho0 ! PPM curvature (zero for PLM). t6 = 0.0_wp s6 = 0.0_wp if (parabolic) then t6 = 3.0_wp*(2.0_wp*t_mean - (t_t + t_b)) s6 = 3.0_wp*(2.0_wp*s_mean - (s_t + s_b)) end if !GCC$ unroll 5 do n = 1, N_BOOLE wt_t = 0.25_wp*real(N_BOOLE - n, wp) ! 1, .75, .5, .25, 0 wt_b = 1.0_wp - wt_t ! Linear blend + parabolic correction. At wt_t in [0,1] the ! parabola through (_t at wt_t=1, _b at wt_t=0, mean) is ! q(wt_t) = wt_t*q_t + wt_b*q_b + q6*wt_t*wt_b. t5(n) = wt_t*t_t + wt_b*t_b + t6*wt_t*wt_b s5(n) = wt_t*s_t + wt_b*s_b + s6*wt_t*wt_b z5 = e_top - 0.25_wp*real(n - 1, wp)*dz ! marches DOWN from top p5(n) = -gxrho*z5 end do end subroutine boole_layer_points