1 |
jmc |
1.1 |
C $Header: $ |
2 |
|
|
C $Name: $ |
3 |
|
|
|
4 |
|
|
# include "GAD_OPTIONS.h" |
5 |
|
|
|
6 |
|
|
SUBROUTINE GAD_PPM_P3E_Y(bi,bj,kk,ix, |
7 |
|
|
& mask,fbar,edge,myThid) |
8 |
|
|
C |================================================================| |
9 |
|
|
C | PPM_P3E_Y: approximate edge values with degree-3 polynomials. | |
10 |
|
|
C | Fixed grid-spacing variant in Y. | |
11 |
|
|
C |================================================================| |
12 |
|
|
|
13 |
|
|
implicit none |
14 |
|
|
|
15 |
|
|
C =============================================== global variables |
16 |
|
|
# include "SIZE.h" |
17 |
|
|
# include "GRID.h" |
18 |
|
|
# include "GAD.h" |
19 |
|
|
|
20 |
|
|
C ====================================================== arguments |
21 |
|
|
integer bi,bj,kk,ix |
22 |
|
|
_RL mask(1-OLy:sNy+OLy) |
23 |
|
|
_RL fbar(1-OLy:sNy+OLy) |
24 |
|
|
_RL edge(1-OLy:sNy+OLy) |
25 |
|
|
integer myThid |
26 |
|
|
|
27 |
|
|
C ====================================================== variables |
28 |
|
|
integer iy |
29 |
|
|
_RL mloc(-2:+1) |
30 |
|
|
_RL floc(-2:+1) |
31 |
|
|
_RL ftmp |
32 |
|
|
|
33 |
|
|
C ==================== reconstruct 3rd--order accurate edge values |
34 |
|
|
do iy = 1-OLy+2, sNy+OLy-1 |
35 |
|
|
|
36 |
|
|
C ================ mask local stencil: expand from centre outwards |
37 |
|
|
mloc(-1) = mask(iy-1) |
38 |
|
|
mloc(+0) = mask(iy+0) |
39 |
|
|
|
40 |
|
|
floc(-1) = fbar(iy+0) |
41 |
|
|
& + mloc(-1)*(fbar(iy-1)-fbar(iy+0)) |
42 |
|
|
floc(+0) = fbar(iy-1) |
43 |
|
|
& + mloc(+0)*(fbar(iy+0)-fbar(iy-1)) |
44 |
|
|
|
45 |
|
|
mloc(-2) = mask(iy-2) * mloc(-1) |
46 |
|
|
|
47 |
|
|
ftmp = 2. _d 0 * floc(-1) - floc(+0) |
48 |
|
|
floc(-2) = ftmp |
49 |
|
|
& + mloc(-2)*(fbar(iy-2)-ftmp) |
50 |
|
|
|
51 |
|
|
mloc(+1) = mask(iy+1) * mloc(+0) |
52 |
|
|
|
53 |
|
|
ftmp = 2. _d 0 * floc(+0) - floc(-1) |
54 |
|
|
floc(+1) = ftmp |
55 |
|
|
& + mloc(+1)*(fbar(iy+1)-ftmp) |
56 |
|
|
|
57 |
|
|
C ================ centred, 5th-order interpolation for edge value |
58 |
|
|
edge(iy) = |
59 |
|
|
& -(1. _d 0 / 12. _d 0)*(floc(-2)+floc(+1)) |
60 |
|
|
& +(7. _d 0 / 12. _d 0)*(floc(-1)+floc(+0)) |
61 |
|
|
|
62 |
|
|
end do |
63 |
|
|
|
64 |
|
|
return |
65 |
|
|
|
66 |
|
|
c end subroutine GAD_PPM_P3E_Y |
67 |
|
|
end |