The PPM edge limiter of one interior layer: clip both interface estimates into the monotone bounds of the three adjacent means, flatten a local extremum to PCM, and apply the Colella & Woodward (1984) parabola limiter.
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | q_m1 |
Layer means of layers k-1, k, k+1. |
||
| real(kind=wp), | intent(in) | :: | q_c |
Layer means of layers k-1, k, k+1. |
||
| real(kind=wp), | intent(in) | :: | q_p1 |
Layer means of layers k-1, k, k+1. |
||
| real(kind=wp), | intent(in) | :: | ql_raw |
Interface estimates at the layer’s deeper / shallower interface. |
||
| real(kind=wp), | intent(in) | :: | qr_raw |
Interface estimates at the layer’s deeper / shallower interface. |
||
| real(kind=wp), | intent(out) | :: | q_t |
Limited top (shallower) / bottom (deeper) edge values. |
||
| real(kind=wp), | intent(out) | :: | q_b |
Limited top (shallower) / bottom (deeper) edge values. |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | dq | ||||
| real(kind=wp), | private | :: | dq_l | ||||
| real(kind=wp), | private | :: | dq_r | ||||
| real(kind=wp), | private | :: | q6 | ||||
| real(kind=wp), | private | :: | q_hi | ||||
| real(kind=wp), | private | :: | q_lo | ||||
| real(kind=wp), | private | :: | ql | ||||
| real(kind=wp), | private | :: | qr |
pure subroutine ppm_limit_edges(q_m1, q_c, q_p1, ql_raw, qr_raw, q_t, q_b) !$acc routine seq !! The PPM edge limiter of one interior layer: clip both interface !! estimates into the monotone bounds of the three adjacent means, !! flatten a local extremum to PCM, and apply the Colella & Woodward !! (1984) parabola limiter. real(wp), intent(in) :: q_m1, q_c, q_p1 !! Layer means of layers k-1, k, k+1. real(wp), intent(in) :: ql_raw, qr_raw !! Interface estimates at the layer's deeper / shallower interface. real(wp), intent(out) :: q_t, q_b !! Limited top (shallower) / bottom (deeper) edge values. real(wp) :: q_lo, q_hi, ql, qr, dq, dq_l, dq_r, q6 q_lo = min(q_m1, q_c, q_p1) q_hi = max(q_m1, q_c, q_p1) ql = max(q_lo, min(q_hi, ql_raw)) qr = max(q_lo, min(q_hi, qr_raw)) dq = qr - ql dq_l = q_c - ql dq_r = qr - q_c if (dq_l*dq_r <= 0.0_wp) then ! Local extremum -> flatten to PCM. ql = q_c qr = q_c else q6 = 6.0_wp*q_c - 3.0_wp*(ql + qr) if (abs(q6) > abs(dq)) then if (q6*dq > 0.0_wp) then ql = 3.0_wp*q_c - 2.0_wp*qr else qr = 3.0_wp*q_c - 2.0_wp*ql end if end if end if q_b = ql ! deeper edge q_t = qr ! shallower edge end subroutine ppm_limit_edges