PPM quasi-fourth-order edge value at interface k+1/2 (MOM6 ppm_edge;
Colella & Woodward 1984 eq. 1.6).
| Type | Intent | Optional | Attributes | Name | ||
|---|---|---|---|---|---|---|
| real(kind=wp), | intent(in) | :: | hkm1 |
widths of cells k-1..k+2 |
||
| real(kind=wp), | intent(in) | :: | hk |
widths of cells k-1..k+2 |
||
| real(kind=wp), | intent(in) | :: | hkp1 |
widths of cells k-1..k+2 |
||
| real(kind=wp), | intent(in) | :: | hkp2 |
widths of cells k-1..k+2 |
||
| real(kind=wp), | intent(in) | :: | ak |
cell averages k, k+1 |
||
| real(kind=wp), | intent(in) | :: | akp1 |
cell averages k, k+1 |
||
| real(kind=wp), | intent(in) | :: | pk |
PLM slopes k, k+1 |
||
| real(kind=wp), | intent(in) | :: | pkp1 |
PLM slopes k, k+1 |
||
| real(kind=wp), | intent(in) | :: | h_neglect |
negligible thickness floor |
| Type | Visibility | Attributes | Name | Initial | |||
|---|---|---|---|---|---|---|---|
| real(kind=wp), | private | :: | f1 | ||||
| real(kind=wp), | private | :: | f2 | ||||
| real(kind=wp), | private | :: | f3 | ||||
| real(kind=wp), | private | :: | f4 | ||||
| real(kind=wp), | private | :: | r_2hk_hkp1 | ||||
| real(kind=wp), | private | :: | r_hk_2hkp1 | ||||
| real(kind=wp), | private | :: | r_hk_hkp1 |
pure function redi_ppm_edge(hkm1, hk, hkp1, hkp2, ak, akp1, pk, pkp1, h_neglect) result(e) !$acc routine seq real(wp), intent(in) :: hkm1, hk, hkp1, hkp2 !! widths of cells k-1..k+2 real(wp), intent(in) :: ak, akp1 !! cell averages k, k+1 real(wp), intent(in) :: pk, pkp1 !! PLM slopes k, k+1 real(wp), intent(in) :: h_neglect !! negligible thickness floor real(wp) :: e real(wp) :: r_hk_hkp1, r_2hk_hkp1, r_hk_2hkp1 real(wp) :: f1, f2, f3, f4 r_hk_hkp1 = hk + hkp1 if (r_hk_hkp1 <= 0.0_wp) then e = 0.5_wp*(ak + akp1) return end if r_hk_hkp1 = 1.0_wp/r_hk_hkp1 if (hk < hkp1) then e = ak + (hk*r_hk_hkp1)*(akp1 - ak) else e = akp1 + (hkp1*r_hk_hkp1)*(ak - akp1) end if r_2hk_hkp1 = 1.0_wp/((2.0_wp*hk + hkp1) + h_neglect) r_hk_2hkp1 = 1.0_wp/((hk + 2.0_wp*hkp1) + h_neglect) f1 = 1.0_wp/((hk + hkp1) + (hkm1 + hkp2)) f2 = 2.0_wp*(hkp1*hk)*r_hk_hkp1* & ((hkm1 + hk)*r_2hk_hkp1 - (hkp2 + hkp1)*r_hk_2hkp1) f3 = hk*(hkm1 + hk)*r_2hk_hkp1 f4 = hkp1*(hkp1 + hkp2)*r_hk_2hkp1 e = e + f1*(f2*(akp1 - ak) - (f3*pkp1 - f4*pk)) end function redi_ppm_edge