1 c icf computes
the coefficient location given an index offset
m1,
m2,
m3, equation
e, and component
c
2 c icf corresponds to
the M123CE macro found in many C++ files dealing with coefficient gridFunctions
5 & (
off(1)+
m1)+hwidth+width*((
off(2)+
m2)+hwidth+width3
6 & *((
off(3)+
m3)+hwidth)) +
7 & isten_size*((occ+c)+ncmp*(
oce+
e))
11 c
double precision rxr
12 rxr(i1,i2,i3,
d,c)=(
rx(i1+1,i2,i3,d,c)-
rx(i1-1,i2,i3,d,c))*
dri2(1) ! (d_c)_r
13 c
double precision rxs
14 rxs(i1,i2,i3,d,c)=(
rx(i1,i2+1,i3,d,c)-
rx(i1,i2-1,i3,d,c))*
dri2(2) ! (d_c)_s
15 c
double precision
rxt
16 rxt(i1,i2,i3,d,c)=(
rx(i1,i2,i3-1,d,c)-
rx(i1,i2,i3+1,d,c))*
dri2(3) ! (d_c)_t
19 c XXX only 2
D implemented
21 ! basically you
get d_{ce}
22 rxx(
i1,
i2,
i3,
d,c,
e) =
rx(
i1,
i2,
i3,1,
e)*
rxr(
i1,
i2,
i3,
d,c)+ ! r_e * ( d_c )_r +
24 c
double precision rxy
25 rxy(
i1,
i2,
i3,
d,c) =
rx(
i1,
i2,
i3,1,2)*
rxr(
i1,
i2,
i3,
d,c)+ ! r_y * ( d_c )_r +
31 &
rx(i1,i2,i3,1,c)*
rx(i1,i2,i3,2,c)) *
rx(i1-1,i2-1,i3,d,c) + !-1,-1
32 & (
rx(i1,i2,i3,2,c)*
rx(i1,i2,i3,2,c)*
dri(2)*
dri(2) -
33 &
rxx(i1,i2,i3,2,c,c)*
dri2(2) ) *
rx(i1,i2-1,i3,d,c) - ! 0,-1
35 &
rx(i1,i2,i3,1,c)*
rx(i1,i2,i3,2,c)) *
rx(i1+1,i2-1,i3,d,c) + !+1,-1
36 & (
rx(i1,i2,i3,1,c)*
rx(i1,i2,i3,1,c)*
dri(1)*
dri(1) -
37 &
rxx(i1,i2,i3,1,c,c)*
dri2(1) ) *
rx(i1-1,i2,i3,d,c)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+
68 &
rx(i1,i2,i3,2,
m1)*( -alpha*
u(i1,i2+2,i3,c)+
69 & (.5d0+3d0*alpha)*
u(i1,i2+1,i3,c) -
70 & 3d0*alpha*
u(i1,i2,i3,c) +
71 & (alpha-.5d0)*
u(i1,i2-1,i3,c))*
dri(2)
74 &
rx(i1,i2,i3,1,
m1)*( -alpha*log(abs(
u(i1+2,i2,i3,c)))+
75 & (.5d0+3d0*alpha)*log(abs(
u(i1+1,i2,i3,c))) -
76 & 3d0*alpha*log(abs(
u(i1,i2,i3,c))) +
77 & (alpha-.5d0)*log(abs(
u(i1-1,i2,i3,c))))*
dri(1)+
78 &
rx(i1,i2,i3,2,
m1)*( -alpha*log(abs(
u(i1,i2+2,i3,c)))+
79 & (.5d0+3d0*alpha)*log(abs(
u(i1,i2+1,i3,c))) -
80 & 3d0*alpha*log(abs(
u(i1,i2,i3,c))) +
81 & (alpha-.5d0)*log(abs(
u(i1,i2-1,i3,c))))*
dri(2)
85 & (.5d0)*log(abs(
u(i1+1,i2,i3,c))) -
86 & (.5d0)*log(abs(
u(i1-1,i2,i3,c))))*
dri(1)+
88 & (.5d0)*log(abs(
u(i1,i2+1,i3,c))) -
89 & (.5d0)*log(abs(
u(i1,i2-1,i3,c))))*
dri(2)
93 &
rx(i1,i2,i3,1,
m1)*( +alpha*
u(i1-2,i2,i3,c) -
94 & (.5d0+3d0*alpha)*
u(i1-1,i2,i3,c) +
95 & 3d0*alpha*
u(i1,i2,i3,c) -
96 & (alpha-.5d0)*
u(i1+1,i2,i3,c))*
dri(1) +
97 &
rx(i1,i2,i3,2,
m1)*( +alpha*
u(i1,i2-2,i3,c)-
98 & (.5d0+3d0*alpha)*
u(i1,i2-1,i3,c) +
99 & 3d0*alpha*
u(i1,i2,i3,c) -
100 & (alpha-.5d0)*
u(i1,i2+1,i3,c))*
dri(2)
102 logux4p(i1,i2,i3,c,
m1) =
103 &
rx(i1,i2,i3,1,
m1)*( +alpha*log(abs(
u(i1-2,i2,i3,c))) -
104 & (.5d0+3d0*alpha)*log(abs(
u(i1-1,i2,i3,c))) +
105 & 3d0*alpha*log(abs(
u(i1,i2,i3,c))) -
106 & (alpha-.5d0)*log(abs(
u(i1+1,i2,i3,c))))*
dri(1)+
107 &
rx(i1,i2,i3,2,
m1)*( +alpha*log(abs(
u(i1,i2-2,i3,c)))-
108 & (.5d0+3d0*alpha)*log(abs(
u(i1,i2-1,i3,c))) +
109 & 3d0*alpha*log(abs(
u(i1,i2,i3,c))) -
110 & (alpha-.5d0)*log(abs(
u(i1,i2+1,i3,c))))*
dri(2)
112 c
uxx approximates
a second (possibly mixed)
derivative of component c
113 c
double precision
uxx
116 &
rx(i1,i2,i3,1,
m2)*
rx(i1,i2,i3,2,m1)) *
u(i1-1,i2-1,i3,c) + !-1,-1
118 &
rxx(i1,i2,i3,2,m1,
m2)*
dri2(2) ) *
u(i1,i2-1,i3,c) - ! 0,-1
120 &
rx(i1,i2,i3,1,
m2)*
rx(i1,i2,i3,2,m1)) *
u(i1+1,i2-1,i3,c) + !+1,-1
122 &
rxx(i1,i2,i3,1,m1,
m2)*
dri2(1) ) *
u(i1-1,i2,i3,c) - !-1, 0
123 & 2d0 * (
rx(i1,i2,i3,1,m1)*
rx(i1,i2,i3,1,
m2)*
dri(1)*
dri(1) +
125 & *
u(i1,i2,i3,c) + ! 0, 0
127 &
rxx(i1,i2,i3,1,m1,
m2)*
dri2(1) ) *
u(i1+1,i2,i3,c) - !+1, 0
129 &
rx(i1,i2,i3,1,
m2)*
rx(i1,i2,i3,2,m1)) *
u(i1-1,i2+1,i3,c) + !-1,+1
131 &
rxx(i1,i2,i3,2,m1,
m2)*
dri2(2) ) *
u(i1,i2+1,i3,c) + ! 0,+1
133 &
rx(i1,i2,i3,1,
m2)*
rx(i1,i2,i3,2,m1)) *
u(i1+1,i2+1,i3,c) !+1,+1
137 & alpha*xyz(i1-2,i2,i3,2)-
138 & 3d0*alpha*xyz(i1-1,i2,i3,2)+
139 & 3d0*alpha*xyz(i1,i2,i3,2)-
140 & alpha*xyz(i1+1,i2,i3,2)) +
141 &
rx(i1,i2,i3,2,2)*
dri(2)*(
142 & alpha*xyz(i1,i2-2,i3,2)-
143 & 3d0*alpha*xyz(i1,i2-1,i3,2)+
144 & 3d0*alpha*xyz(i1,i2,i3,2)-
145 & alpha*xyz(i1,i2+1,i3,2))
147 c END OF STATEMENT FUNCTIONS