163 Real h_xi, h_eta, h_zeta;
169 Real px_hi = (
x(i+1,j,k) -
x(i,j,k)) * dxinv;
172 Real pz_hi_md_hi = Real(0.5) * (
x(i+1,j ,k+1) +
x(i ,j ,k+1)
173 -
x(i+1,j ,k ) -
x(i ,j ,k ) );
174 h_xi = Real(0.25) * ( zp(i+1,j ,k+1) - zp(i-1,j ,k+1)
175 +zp(i+1,j+1,k+1) - zp(i-1,j+1,k+1) ) * dxinv;
176 h_zeta = Real(0.25) * ( zp(i+1,j ,k+2) - zp(i+1,j ,k )
177 +zp(i+1,j+1,k+2) - zp(i+1,j+1,k ) );
178 pz_hi_md_hi *= h_xi / h_zeta;
181 Real pz_hi_md_lo = Real(0.5) * (
x(i+1,j ,k ) +
x(i ,j ,k )
182 -
x(i+1,j ,k-1) -
x(i ,j ,k-1) );
183 h_xi = Real(0.25) * ( zp(i+1,j ,k ) - zp(i-1,j ,k )
184 +zp(i+1,j+1,k ) - zp(i-1,j+1,k ) ) * dxinv;
185 h_zeta = Real(0.25) * ( zp(i+1,j ,k+1) - zp(i+1,j ,k-1)
186 +zp(i+1,j+1,k+1) - zp(i+1,j+1,k-1) );
187 pz_hi_md_lo *= h_xi / h_zeta;
190 px_hi -= Real(0.5) * ( pz_hi_md_hi + pz_hi_md_lo );
195 Real px_lo = (
x(i,j,k) -
x(i-1,j,k)) * dxinv;
198 Real pz_lo_md_hi = Real(0.5) * (
x(i,j,k+1) +
x(i-1,j,k+1)
199 -
x(i,j,k ) -
x(i-1,j,k ) );
200 h_xi = Real(0.25) * ( zp(i,j ,k+1) - zp(i-2,j ,k+1)
201 +zp(i,j+1,k+1) - zp(i-2,j+1,k+1) ) * dxinv;
202 h_zeta = Real(0.25) * ( zp(i,j ,k+2) - zp(i ,j ,k )
203 +zp(i,j+1,k+2) - zp(i ,j+1,k ) );
204 pz_lo_md_hi *= h_xi / h_zeta;
207 Real pz_lo_md_lo = Real(0.5) * (
x(i,j,k ) +
x(i-1,j,k )
208 -
x(i,j,k-1) -
x(i-1,j,k-1) );
209 h_xi = Real(0.25) * ( zp(i,j ,k ) - zp(i-2,j ,k )
210 +zp(i,j+1,k ) - zp(i-2,j+1,k ) ) * dxinv;
211 h_zeta = Real(0.25) * ( zp(i,j ,k+1) - zp(i ,j ,k-1)
212 +zp(i,j+1,k+1) - zp(i ,j+1,k-1) );
213 pz_lo_md_lo *= h_xi / h_zeta;
216 px_lo -= Real(0.5) * ( pz_lo_md_hi + pz_lo_md_lo );
222 Real py_hi = (
x(i,j+1,k) -
x(i,j,k)) * dyinv;
225 Real pz_md_hi_hi = Real(0.5) * (
x(i,j+1,k+1) +
x(i,j,k+1)
226 -
x(i,j+1,k ) -
x(i,j,k ) );
227 h_eta = Real(0.25) * ( zp(i ,j+1,k+1) - zp(i ,j-1,k+1)
228 +zp(i+1,j+1,k+1) - zp(i+1,j-1,k+1) ) * dyinv;
229 h_zeta = Real(0.25) * ( zp(i ,j+1,k+2) - zp(i ,j+1,k )
230 +zp(i+1,j+1,k+2) - zp(i+1,j+1,k ) );
231 pz_md_hi_hi *= h_eta/ h_zeta;
234 Real pz_md_hi_lo = Real(0.5) * (
x(i,j+1,k ) +
x(i,j,k )
235 -
x(i,j+1,k-1) -
x(i,j,k-1) );
236 h_eta = Real(0.25) * ( zp(i ,j+1,k ) - zp(i ,j-1,k)
237 +zp(i+1,j+1,k ) - zp(i+1,j-1,k) ) * dyinv;
238 h_zeta = Real(0.25) * ( zp(i ,j+1,k+1) - zp(i ,j+1,k-1)
239 +zp(i+1,j+1,k+1) - zp(i+1,j+1,k-1) );
240 pz_md_hi_lo *= h_eta/ h_zeta;
243 py_hi -= Real(0.5) * ( pz_md_hi_hi + pz_md_hi_lo );
249 Real py_lo = (
x(i,j,k) -
x(i,j-1,k)) * dyinv;
252 Real pz_md_lo_hi = Real(0.5) * (
x(i ,j,k+1) +
x(i ,j-1,k+1)
253 -
x(i ,j,k ) -
x(i ,j-1,k ) );
254 h_eta = Real(0.25) * ( zp(i ,j,k+1) - zp(i ,j-2,k+1)
255 +zp(i+1,j,k+1) - zp(i+1,j-2,k+1) ) * dyinv;
256 h_zeta = Real(0.25) * ( zp(i ,j,k+2) - zp(i ,j ,k )
257 +zp(i+1,j,k+2) - zp(i+1,j ,k ) );
258 pz_md_lo_hi *= h_eta/ h_zeta;
261 Real pz_md_lo_lo = Real(0.5) * (
x(i ,j,k ) +
x(i ,j-1,k )
262 -
x(i ,j,k-1) -
x(i ,j-1,k-1) );
263 h_eta = Real(0.25) * ( zp(i ,j,k ) - zp(i ,j-2,k )
264 +zp(i+1,j,k ) - zp(i+1,j-2,k ) ) * dyinv;
265 h_zeta = Real(0.25) * ( zp(i ,j,k+1) - zp(i ,j ,k-1)
266 +zp(i+1,j,k+1) - zp(i+1,j ,k-1) );
267 pz_md_lo_lo *= h_eta/ h_zeta;
270 py_lo -= Real(0.5) * ( pz_md_lo_hi + pz_md_lo_lo );
276 Real pz_hi =
x(i,j,k+1) -
x(i,j,k );
277 Real hzeta_inv_on_zhi = 8.0 / ( (zp(i,j,k+2) + zp(i+1,j,k+2) + zp(i,j+1,k+2) + zp(i+1,j+1,k+2))
278 -(zp(i,j,k ) + zp(i+1,j,k ) + zp(i,j+1,k ) + zp(i+1,j+1,k )) );
279 pz_hi *= hzeta_inv_on_zhi;
282 Real px_hi_md_hi = Real(0.5) * (
x(i+1,j,k+1) -
x(i ,j ,k+1)
283 +
x(i+1,j,k ) -
x(i ,j ,k )) * dxinv;
284 Real px_lo_md_hi = Real(0.5) * (
x(i ,j,k+1) -
x(i-1,j ,k+1)
285 +
x(i ,j,k ) -
x(i-1,j ,k )) * dxinv;
286 Real py_md_hi_hi = Real(0.5) * (
x(i,j+1,k+1) -
x(i ,j ,k+1)
287 +
x(i,j+1,k ) -
x(i ,j ,k )) * dyinv;
288 Real py_md_lo_hi = Real(0.5) * (
x(i,j ,k+1) -
x(i ,j-1,k+1)
289 +
x(i,j ,k ) -
x(i ,j-1,k )) * dyinv;
292 Real h_xi_on_zhi = 0.5 * ( zp(i+1,j+1,k+1) + zp(i+1,j,k+1) - zp(i,j+1,k+1) - zp(i,j,k+1) ) * dxinv;
293 Real h_eta_on_zhi = 0.5 * ( zp(i+1,j+1,k+1) + zp(i,j+1,k+1) - zp(i+1,j,k+1) - zp(i,j,k+1) ) * dyinv;
297 pz_hi -= 0.5 * h_xi_on_zhi * ( (px_hi_md_hi + px_lo_md_hi) - (pz_hi_md_hi + pz_lo_md_hi) );
298 pz_hi -= 0.5 * h_eta_on_zhi * ( (py_md_hi_hi + py_md_lo_hi) - (pz_md_hi_hi + pz_md_lo_hi) );
304 Real pz_lo =
x(i,j,k ) -
x(i,j,k-1);
305 Real hzeta_inv_on_zlo = 8.0 / ( (zp(i,j,k+1) + zp(i+1,j,k+1) + zp(i,j+1,k+1) + zp(i+1,j+1,k+1))
306 -(zp(i,j,k-1) + zp(i+1,j,k-1) + zp(i,j+1,k-1) + zp(i+1,j+1,k-1)) );
307 pz_lo *= hzeta_inv_on_zlo;
310 Real px_hi_md_lo = Real(0.5) * (
x(i+1,j ,k ) -
x(i ,j ,k )
311 +
x(i+1,j ,k-1) -
x(i ,j ,k-1)) * dxinv;
312 Real px_lo_md_lo = Real(0.5) * (
x(i ,j ,k ) -
x(i-1,j ,k )
313 +
x(i ,j ,k-1) -
x(i-1,j ,k-1)) * dxinv;
314 Real py_md_hi_lo = Real(0.5) * (
x(i ,j+1,k ) -
x(i ,j ,k )
315 +
x(i ,j+1,k-1) -
x(i ,j ,k-1)) * dyinv;
316 Real py_md_lo_lo = Real(0.5) * (
x(i ,j ,k ) -
x(i ,j-1,k )
317 +
x(i ,j ,k-1) -
x(i ,j-1,k-1)) * dyinv;
320 Real h_xi_on_zlo = 0.5 * (zp(i+1,j+1,k) + zp(i+1,j,k) - zp(i,j+1,k) - zp(i,j,k)) * dxinv;
321 Real h_eta_on_zlo = 0.5 * (zp(i+1,j+1,k) + zp(i,j+1,k) - zp(i+1,j,k) - zp(i,j,k)) * dyinv;
325 pz_lo -= 0.5 * h_xi_on_zlo * ( (px_hi_md_lo + px_lo_md_lo) - (pz_hi_md_lo + pz_lo_md_lo) );
326 pz_lo -= 0.5 * h_eta_on_zlo * ( (py_md_hi_lo + py_md_lo_lo) - (pz_md_hi_lo + pz_md_lo_lo) );
346 Real invdJ = 4.0 / ( zp(i,j,k+1) + zp(i+1,j,k+1) + zp(i,j+1,k+1) + zp(i+1,j+1,k+1)
347 -zp(i,j,k ) - zp(i+1,j,k ) - zp(i,j+1,k ) - zp(i+1,j+1,k ) );
349 Real ax_lo = .5 * (zp(i ,j,k+1) + zp(i ,j+1,k+1) - zp(i ,j,k) - zp(i ,j+1,k));
350 Real ax_hi = .5 * (zp(i+1,j,k+1) + zp(i+1,j+1,k+1) - zp(i+1,j,k) - zp(i+1,j+1,k));
351 Real ay_lo = .5 * (zp(i,j ,k+1) + zp(i+1,j ,k+1) - zp(i,j ,k) - zp(i+1,j ,k));
352 Real ay_hi = .5 * (zp(i,j+1,k+1) + zp(i+1,j+1,k+1) - zp(i,j+1,k) - zp(i+1,j+1,k));
354 y(i,j,k) = ( (ax_hi*px_hi - ax_lo*px_lo) * dxinv
355 +(ay_hi*py_hi - ay_lo*py_lo) * dyinv
356 +( pz_hi - pz_lo) ) * invdJ;