Van Leer monotonized centred slope for cell i. Returns 0 at local extrema (sign change between left and right differences) and the slope-limited centred derivative otherwise. Standard PPM convention; see Colella-Woodward 1984.
Consumer: rdb_ice_transport (sea-ice PR 4b), same role as here
(SIS2 Lin-94 slope + limit, SIS_continuity.F90:1464-1468).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | h_im1 | |||
| real(kind=wp), | intent(in) | :: | h_i | |||
| real(kind=wp), | intent(in) | :: | h_ip1 | |||
| real(kind=wp), | intent(out) | :: | dh |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | dh_centered | ||||
| real(kind=wp), | private | :: | dh_left | ||||
| real(kind=wp), | private | :: | dh_right |
pure subroutine ppm_limited_slope(h_im1, h_i, h_ip1, dh) !$acc routine seq !! Van Leer monotonized centred slope for cell i. Returns 0 !! at local extrema (sign change between left and right !! differences) and the slope-limited centred derivative !! otherwise. Standard PPM convention; see Colella-Woodward !! 1984. !! !! Consumer: `rdb_ice_transport` (sea-ice PR 4b), same role as here !! (SIS2 Lin-94 slope + limit, `SIS_continuity.F90:1464-1468`). real(wp), intent(in) :: h_im1, h_i, h_ip1 real(wp), intent(out) :: dh real(wp) :: dh_centered, dh_left, dh_right dh_left = h_i - h_im1 dh_right = h_ip1 - h_i dh_centered = 0.5_wp*(dh_left + dh_right) if (dh_left*dh_right > 0.0_wp) then dh = sign(min(abs(dh_centered), & 2.0_wp*abs(dh_left), & 2.0_wp*abs(dh_right)), & dh_centered) else dh = 0.0_wp end if end subroutine ppm_limited_slope