11 subroutine advect_pv_ad (qnew,q,q_traj,q_north,q_south, &
12 & u,u_traj,v,v_traj, &
13 & nx,ny,deltax,deltay,dt)
18 real(kind=kind_real),
intent(inout) :: qnew(nx,ny,2)
19 real(kind=kind_real),
intent(inout) :: q(nx,ny,2)
20 real(kind=kind_real),
intent(in) :: q_traj(nx,ny,2)
21 real(kind=kind_real),
intent(in) :: q_north(nx,2)
22 real(kind=kind_real),
intent(in) :: q_south(nx,2)
23 real(kind=kind_real),
intent(out) :: u(nx,ny,2)
24 real(kind=kind_real),
intent(in) :: u_traj(nx,ny,2)
25 real(kind=kind_real),
intent(out) :: v(nx,ny,2)
26 real(kind=kind_real),
intent(in) :: v_traj(nx,ny,2)
27 integer,
intent(in) :: nx
28 integer,
intent(in) :: ny
29 real(kind=kind_real),
intent(in) :: deltax
30 real(kind=kind_real),
intent(in) :: deltay
31 real(kind=kind_real),
intent(in) :: dt
33 integer :: ii,jj,kk,ixm1,ix,ixp1,ixp2,jym1,jy,jyp1,jyp2
34 real(kind=kind_real) :: ax_traj,ay_traj,qjm1_traj,qj_traj,qjp1_traj,qjp2_traj
35 real(kind=kind_real) :: ax,ay,qjm1,qj,qjp1,qjp2
36 real(kind_real),
parameter :: one=1.0_kind_real
37 real(kind_real),
parameter :: two=2.0_kind_real
38 real(kind_real),
parameter :: half=0.5_kind_real
39 real(kind_real),
parameter :: sixth=1.0_kind_real/6.0_kind_real
46 q(ii,jj,kk) = 0.0_kind_real
59 ax_traj =
real(ii,kind_real) - u_traj(ii,jj,kk)*dt/deltax
61 ax_traj = ax_traj-
real(ix,kind_real)
62 ixm1 = 1 + modulo(ix-2,nx)
63 ixp1 = 1 + modulo(ix ,nx)
64 ixp2 = 1 + modulo(ix+1,nx)
65 ix = 1 + modulo(ix-1,nx)
67 ay_traj =
real(jj,kind_real) - v_traj(ii,jj,kk)*dt/deltay
69 ay_traj = ay_traj-
real(jy,kind_real)
76 & ax_traj *(ax_traj-one)*(ax_traj-two) &
77 & *q_south(ixm1,kk)*(-sixth) + &
78 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
79 & *q_south(ix, kk)*half + &
80 & (ax_traj+one)* ax_traj *(ax_traj-two) &
81 & *q_south(ixp1,kk)*(-half) + &
82 & (ax_traj+one) * ax_traj *(ax_traj-one) &
83 & *q_south(ixp2,kk)*(sixth)
84 else if (jym1 > ny)
then 86 & ax_traj *(ax_traj-one)*(ax_traj-two) &
87 & *q_north(ixm1,kk)*(-sixth) + &
88 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
89 & *q_north(ix, kk)*half + &
90 & (ax_traj+one)* ax_traj *(ax_traj-two) &
91 & *q_north(ixp1,kk)*(-half) + &
92 & (ax_traj+one)* ax_traj *(ax_traj-one) &
93 & *q_north(ixp2,kk)*(sixth)
96 & ax_traj *(ax_traj-one)*(ax_traj-two) &
97 & *q_traj(ixm1,jym1,kk)*(-sixth) + &
98 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
99 & *q_traj(ix, jym1,kk)*half + &
100 & (ax_traj+one)* ax_traj *(ax_traj-two) &
101 & *q_traj(ixp1,jym1,kk)*(-half) + &
102 & (ax_traj+one)* ax_traj *(ax_traj-one) &
103 & *q_traj(ixp2,jym1,kk)*(sixth)
108 & ax_traj *(ax_traj-one)*(ax_traj-two) &
109 & *q_south(ixm1,kk)*(-sixth) + &
110 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
111 & *q_south(ix ,kk)*half + &
112 & (ax_traj+one)* ax_traj *(ax_traj-two) &
113 & *q_south(ixp1,kk)*(-half) + &
114 & (ax_traj+one)* ax_traj *(ax_traj-one) &
115 & *q_south(ixp2,kk)*(sixth)
116 else if (jy > ny)
then 118 & ax_traj *(ax_traj-one)*(ax_traj-two) &
119 & *q_north(ixm1,kk)*(-sixth) + &
120 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
121 & *q_north(ix ,kk)*half + &
122 & (ax_traj+one)* ax_traj *(ax_traj-two) &
123 & *q_north(ixp1,kk)*(-half) + &
124 & (ax_traj+one)* ax_traj *(ax_traj-one) &
125 & *q_north(ixp2,kk)*(sixth)
128 & ax_traj *(ax_traj-one)*(ax_traj-two) &
129 & *q_traj(ixm1,jy,kk)*(-sixth) + &
130 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
131 & *q_traj(ix ,jy,kk)*half + &
132 & (ax_traj+one)* ax_traj *(ax_traj-two) &
133 & *q_traj(ixp1,jy,kk)*(-half) + &
134 & (ax_traj+one)* ax_traj *(ax_traj-one) &
135 & *q_traj(ixp2,jy,kk)*(sixth)
140 & ax_traj *(ax_traj-one)*(ax_traj-two) &
141 & *q_south(ixm1,kk)*(-sixth) + &
142 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
143 & *q_south(ix ,kk)*half + &
144 & (ax_traj+one)* ax_traj *(ax_traj-two) &
145 & *q_south(ixp1,kk)*(-half) + &
146 & (ax_traj+one)* ax_traj *(ax_traj-one) &
147 & *q_south(ixp2,kk)*(sixth)
148 else if (jyp1 > ny)
then 150 & ax_traj *(ax_traj-one)*(ax_traj-two) &
151 & *q_north(ixm1,kk)*(-sixth) + &
152 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
153 & *q_north(ix ,kk)*half + &
154 & (ax_traj+one)* ax_traj *(ax_traj-two) &
155 & *q_north(ixp1,kk)*(-half) + &
156 & (ax_traj+one)* ax_traj *(ax_traj-one) &
157 & *q_north(ixp2,kk)*(sixth)
160 & ax_traj *(ax_traj-one)*(ax_traj-two) &
161 & *q_traj(ixm1,jyp1,kk)*(-sixth) + &
162 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
163 & *q_traj(ix ,jyp1,kk)*half + &
164 & (ax_traj+one)* ax_traj *(ax_traj-two) &
165 & *q_traj(ixp1,jyp1,kk)*(-half) + &
166 & (ax_traj+one)* ax_traj *(ax_traj-one) &
167 & *q_traj(ixp2,jyp1,kk)*(sixth)
172 & ax_traj *(ax_traj-one)*(ax_traj-two) &
173 & *q_south(ixm1,kk)*(-sixth) + &
174 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
175 & *q_south(ix ,kk)*half + &
176 & (ax_traj+one)* ax_traj *(ax_traj-two) &
177 & *q_south(ixp1,kk)*(-half) + &
178 & (ax_traj+one)* ax_traj *(ax_traj-one) &
179 & *q_south(ixp2,kk)*(sixth)
180 else if (jyp2 > ny)
then 182 & ax_traj *(ax_traj-one)*(ax_traj-two) &
183 & *q_north(ixm1,kk)*(-sixth) + &
184 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
185 & *q_north(ix ,kk)*half + &
186 & (ax_traj+one)* ax_traj *(ax_traj-two) &
187 & *q_north(ixp1,kk)*(-half) + &
188 & (ax_traj+one)* ax_traj *(ax_traj-one) &
189 & *q_north(ixp2,kk)*(sixth)
192 & ax_traj *(ax_traj-one)*(ax_traj-two) &
193 & *q_traj(ixm1,jyp2,kk)*(-sixth) + &
194 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two) &
195 & *q_traj(ix ,jyp2,kk)*half + &
196 & (ax_traj+one)* ax_traj *(ax_traj-two) &
197 & *q_traj(ixp1,jyp2,kk)*(-half) + &
198 & (ax_traj+one)* ax_traj *(ax_traj-one) &
199 &*q_traj(ixp2,jyp2,kk)*(sixth)
215 & (ay_traj-one)*(ay_traj-two)*(-sixth)*qjm1_traj + &
216 & ay_traj * (ay_traj-two)*(-sixth)*qjm1_traj + &
217 & ay_traj *(ay_traj-one)* (-sixth)*qjm1_traj + &
218 & (ay_traj-one)*(ay_traj-two)*half *qj_traj + &
219 & (ay_traj+one)* (ay_traj-two)*half *qj_traj + &
220 & (ay_traj+one)*(ay_traj-one)* half *qj_traj + &
221 & ay_traj *(ay_traj-two)*(-half) *qjp1_traj + &
222 & (ay_traj+one)* (ay_traj-two)*(-half) *qjp1_traj + &
223 & (ay_traj+one)* ay_traj * (-half) *qjp1_traj + &
224 & ay_traj *(ay_traj-one)*(sixth) *qjp2_traj + &
225 & (ay_traj+one)* (ay_traj-one)*(sixth) *qjp2_traj + &
226 & (ay_traj+one)* ay_traj * (sixth) *qjp2_traj ) &
229 qjm1 = ( ay_traj *(ay_traj-one)*(ay_traj-two)*(-sixth) ) &
232 qj = ( (ay_traj+one)*(ay_traj-one)*(ay_traj-two)*half ) &
235 qjp1 = ( (ay_traj+one)* ay_traj *(ay_traj-two)*(-half) ) &
238 qjp2 = ( (ay_traj+one)* ay_traj *(ay_traj-one)*(sixth) ) &
241 qnew(ii,jj,kk) = 0.0_kind_real
247 & (ax_traj-one)*(ax_traj-two) &
248 & *q_south(ixm1,kk)*(-sixth) + &
249 & ax_traj * (ax_traj-two) &
250 & *q_south(ixm1,kk)*(-sixth) + &
251 & ax_traj *(ax_traj-one) &
252 & *q_south(ixm1,kk)*(-sixth) + &
253 & (ax_traj-one)*(ax_traj-two) &
254 & *q_south(ix ,kk)*half + &
255 & (ax_traj+one)* (ax_traj-two) &
256 & *q_south(ix ,kk)*half + &
257 & (ax_traj+one)*(ax_traj-one) &
258 & *q_south(ix ,kk)*half + &
259 & ax_traj *(ax_traj-two) &
260 & *q_south(ixp1,kk)*(-half) + &
261 & (ax_traj+one)* (ax_traj-two) &
262 & *q_south(ixp1,kk)*(-half) + &
263 & (ax_traj+one)* ax_traj &
264 & *q_south(ixp1,kk)*(-half) + &
265 & ax_traj *(ax_traj-one) &
266 & *q_south(ixp2,kk)*(sixth) + &
267 & (ax_traj+one)* (ax_traj-one) &
268 & *q_south(ixp2,kk)*(sixth) + &
269 & (ax_traj+one)* ax_traj &
270 & *q_south(ixp2,kk)*(sixth) &
274 else if (jyp2 > ny)
then 276 & (ax_traj-one)*(ax_traj-two) &
277 & *q_north(ixm1,kk)*(-sixth) + &
278 & ax_traj * (ax_traj-two) &
279 & *q_north(ixm1,kk)*(-sixth) + &
280 & ax_traj *(ax_traj-one) &
281 & *q_north(ixm1,kk)*(-sixth) + &
282 & (ax_traj-one)*(ax_traj-two) &
283 & *q_north(ix ,kk)*half + &
284 & (ax_traj+one)* (ax_traj-two) &
285 & *q_north(ix ,kk)*half + &
286 & (ax_traj+one)*(ax_traj-one) &
287 & *q_north(ix ,kk)*half + &
288 & ax_traj *(ax_traj-two) &
289 & *q_north(ixp1,kk)*(-half) + &
290 & (ax_traj+one)* (ax_traj-two) &
291 & *q_north(ixp1,kk)*(-half) + &
292 & (ax_traj+one)* ax_traj &
293 & *q_north(ixp1,kk)*(-half) + &
294 & ax_traj *(ax_traj-one) &
295 & *q_north(ixp2,kk)*(sixth) + &
296 & (ax_traj+one)* (ax_traj-one) &
297 & *q_north(ixp2,kk)*(sixth) + &
298 & (ax_traj+one)* ax_traj &
299 & *q_north(ixp2,kk)*(sixth) &
305 & (ax_traj-one)*(ax_traj-two) &
306 & *q_traj(ixm1,jyp2,kk)*(-sixth) + &
307 & ax_traj * (ax_traj-two) &
308 & *q_traj(ixm1,jyp2,kk)*(-sixth) + &
309 & ax_traj *(ax_traj-one) &
310 & *q_traj(ixm1,jyp2,kk)*(-sixth) + &
311 & (ax_traj-one)*(ax_traj-two) &
312 & *q_traj(ix ,jyp2,kk)*half + &
313 & (ax_traj+one)* (ax_traj-two) &
314 & *q_traj(ix ,jyp2,kk)*half + &
315 & (ax_traj+one)*(ax_traj-one) &
316 & *q_traj(ix ,jyp2,kk)*half + &
317 & ax_traj *(ax_traj-two) &
318 & *q_traj(ixp1,jyp2,kk)*(-half) + &
319 & (ax_traj+one)* (ax_traj-two) &
320 & *q_traj(ixp1,jyp2,kk)*(-half) + &
321 & (ax_traj+one)* ax_traj &
322 & *q_traj(ixp1,jyp2,kk)*(-half) + &
323 & ax_traj *(ax_traj-one) &
324 &*q_traj(ixp2,jyp2,kk)*(sixth) + &
325 & (ax_traj+one)* (ax_traj-one) &
326 &*q_traj(ixp2,jyp2,kk)*(sixth) + &
327 & (ax_traj+one)* ax_traj &
328 &*q_traj(ixp2,jyp2,kk)*(sixth) &
331 q(ixm1,jyp2,kk) = q(ixm1,jyp2,kk) + ( &
332 & ax_traj *(ax_traj-one)*(ax_traj-two)*(-sixth) &
335 q(ix ,jyp2,kk) = q(ix ,jyp2,kk) + ( &
336 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two)*half &
339 q(ixp1,jyp2,kk) = q(ixp1,jyp2,kk) + ( &
340 & (ax_traj+one)* ax_traj *(ax_traj-two)*(-half) &
343 q(ixp2,jyp2,kk) = q(ixp2,jyp2,kk) + ( &
344 & (ax_traj+one)* ax_traj *(ax_traj-one)*(sixth) &
352 & (ax_traj-one)*(ax_traj-two) &
353 & *q_south(ixm1,kk)*(-sixth) + &
354 & ax_traj * (ax_traj-two) &
355 & *q_south(ixm1,kk)*(-sixth) + &
356 & ax_traj *(ax_traj-one) &
357 & *q_south(ixm1,kk)*(-sixth) + &
358 & (ax_traj-one)*(ax_traj-two) &
359 & *q_south(ix ,kk)*half + &
360 & (ax_traj+one)* (ax_traj-two) &
361 & *q_south(ix ,kk)*half + &
362 & (ax_traj+one)*(ax_traj-one) &
363 & *q_south(ix ,kk)*half + &
364 & ax_traj *(ax_traj-two) &
365 & *q_south(ixp1,kk)*(-half) + &
366 & (ax_traj+one)* (ax_traj-two) &
367 & *q_south(ixp1,kk)*(-half) + &
368 & (ax_traj+one)* ax_traj &
369 & *q_south(ixp1,kk)*(-half) + &
370 & ax_traj *(ax_traj-one) &
371 & *q_south(ixp2,kk)*(sixth) + &
372 & (ax_traj+one)* (ax_traj-one) &
373 & *q_south(ixp2,kk)*(sixth) + &
374 & (ax_traj+one)* ax_traj &
375 & *q_south(ixp2,kk)*(sixth) &
379 else if (jyp1 > ny)
then 381 & (ax_traj-one)*(ax_traj-two) &
382 & *q_north(ixm1,kk)*(-sixth) + &
383 & ax_traj * (ax_traj-two) &
384 & *q_north(ixm1,kk)*(-sixth) + &
385 & ax_traj *(ax_traj-one) &
386 & *q_north(ixm1,kk)*(-sixth) + &
387 & (ax_traj-one)*(ax_traj-two) &
388 & *q_north(ix ,kk)*half + &
389 & (ax_traj+one)* (ax_traj-two) &
390 & *q_north(ix ,kk)*half + &
391 & (ax_traj+one)*(ax_traj-one) &
392 & *q_north(ix ,kk)*half + &
393 & ax_traj *(ax_traj-two) &
394 & *q_north(ixp1,kk)*(-half) + &
395 & (ax_traj+one)* (ax_traj-two) &
396 & *q_north(ixp1,kk)*(-half) + &
397 & (ax_traj+one)* ax_traj &
398 & *q_north(ixp1,kk)*(-half) + &
399 & ax_traj *(ax_traj-one) &
400 & *q_north(ixp2,kk)*(sixth) + &
401 & (ax_traj+one)* (ax_traj-one) &
402 & *q_north(ixp2,kk)*(sixth) + &
403 & (ax_traj+one)* ax_traj &
404 & *q_north(ixp2,kk)*(sixth) &
410 & (ax_traj-one)*(ax_traj-two) &
411 & *q_traj(ixm1,jyp1,kk)*(-sixth) + &
412 & ax_traj * (ax_traj-two) &
413 & *q_traj(ixm1,jyp1,kk)*(-sixth) + &
414 & ax_traj *(ax_traj-one) &
415 & *q_traj(ixm1,jyp1,kk)*(-sixth) + &
416 & (ax_traj-one)*(ax_traj-two) &
417 & *q_traj(ix ,jyp1,kk)*half + &
418 & (ax_traj+one)* (ax_traj-two) &
419 & *q_traj(ix ,jyp1,kk)*half + &
420 & (ax_traj+one)*(ax_traj-one) &
421 & *q_traj(ix ,jyp1,kk)*half + &
422 & ax_traj *(ax_traj-two) &
423 & *q_traj(ixp1,jyp1,kk)*(-half) + &
424 & (ax_traj+one)* (ax_traj-two) &
425 & *q_traj(ixp1,jyp1,kk)*(-half) + &
426 & (ax_traj+one)* ax_traj &
427 & *q_traj(ixp1,jyp1,kk)*(-half) + &
428 & ax_traj *(ax_traj-one) &
429 & *q_traj(ixp2,jyp1,kk)*(sixth) + &
430 & (ax_traj+one)* (ax_traj-one) &
431 & *q_traj(ixp2,jyp1,kk)*(sixth) + &
432 & (ax_traj+one)* ax_traj &
433 & *q_traj(ixp2,jyp1,kk)*(sixth) &
436 q(ixm1,jyp1,kk) = q(ixm1,jyp1,kk) + ( &
437 & ax_traj *(ax_traj-one)*(ax_traj-two)*(-sixth) &
441 q(ix ,jyp1,kk) = q(ix ,jyp1,kk) + ( &
442 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two)*half &
446 q(ixp1,jyp1,kk) = q(ixp1,jyp1,kk) + ( &
447 & (ax_traj+one)* ax_traj *(ax_traj-two)*(-half) &
450 q(ixp2,jyp1,kk) = q(ixp2,jyp1,kk) + ( &
451 & (ax_traj+one)* ax_traj *(ax_traj-one)*(sixth) &
457 & (ax_traj-one)*(ax_traj-two) &
458 & *q_south(ixm1,kk)*(-sixth) + &
459 & ax_traj * (ax_traj-two) &
460 & *q_south(ixm1,kk)*(-sixth) + &
461 & ax_traj *(ax_traj-one) &
462 & *q_south(ixm1,kk)*(-sixth) + &
463 & (ax_traj-one)*(ax_traj-two) &
464 & *q_south(ix ,kk)*half + &
465 & (ax_traj+one)* (ax_traj-two) &
466 & *q_south(ix ,kk)*half + &
467 & (ax_traj+one)*(ax_traj-one) &
468 & *q_south(ix ,kk)*half + &
469 & ax_traj *(ax_traj-two) &
470 & *q_south(ixp1,kk)*(-half) + &
471 & (ax_traj+one)* (ax_traj-two) &
472 & *q_south(ixp1,kk)*(-half) + &
473 & (ax_traj+one)* ax_traj &
474 & *q_south(ixp1,kk)*(-half) + &
475 & ax_traj *(ax_traj-one) &
476 & *q_south(ixp2,kk)*(sixth) + &
477 & (ax_traj+one)* (ax_traj-one) &
478 & *q_south(ixp2,kk)*(sixth) + &
479 & (ax_traj+one)* ax_traj &
480 & *q_south(ixp2,kk)*(sixth) &
484 else if (jy > ny)
then 486 & (ax_traj-one)*(ax_traj-two) &
487 & *q_north(ixm1,kk)*(-sixth) + &
488 & ax_traj * (ax_traj-two) &
489 & *q_north(ixm1,kk)*(-sixth) + &
490 & ax_traj *(ax_traj-one) &
491 & *q_north(ixm1,kk)*(-sixth) + &
492 & (ax_traj-one)*(ax_traj-two) &
493 & *q_north(ix ,kk)*half + &
494 & (ax_traj+one)* (ax_traj-two) &
495 & *q_north(ix ,kk)*half + &
496 & (ax_traj+one)*(ax_traj-one) &
497 & *q_north(ix ,kk)*half + &
498 & ax_traj *(ax_traj-two) &
499 & *q_north(ixp1,kk)*(-half) + &
500 & (ax_traj+one)* (ax_traj-two) &
501 & *q_north(ixp1,kk)*(-half) + &
502 & (ax_traj+one)* ax_traj &
503 & *q_north(ixp1,kk)*(-half) + &
504 & ax_traj *(ax_traj-one) &
505 & *q_north(ixp2,kk)*(sixth) + &
506 & (ax_traj+one)* (ax_traj-one) &
507 & *q_north(ixp2,kk)*(sixth) + &
508 & (ax_traj+one)* ax_traj &
509 & *q_north(ixp2,kk)*(sixth) &
515 & (ax_traj-one)*(ax_traj-two) &
516 & *q_traj(ixm1,jy,kk)*(-sixth) + &
517 & ax_traj * (ax_traj-two) &
518 & *q_traj(ixm1,jy,kk)*(-sixth) + &
519 & ax_traj *(ax_traj-one) &
520 & *q_traj(ixm1,jy,kk)*(-sixth) + &
521 & (ax_traj-one)*(ax_traj-two) &
522 & *q_traj(ix ,jy,kk)*half + &
523 & (ax_traj+one)* (ax_traj-two) &
524 & *q_traj(ix ,jy,kk)*half + &
525 & (ax_traj+one)*(ax_traj-one) &
526 & *q_traj(ix ,jy,kk)*half + &
527 & ax_traj *(ax_traj-two) &
528 & *q_traj(ixp1,jy,kk)*(-half) + &
529 & (ax_traj+one)* (ax_traj-two) &
530 & *q_traj(ixp1,jy,kk)*(-half) + &
531 & (ax_traj+one)* ax_traj &
532 & *q_traj(ixp1,jy,kk)*(-half) + &
533 & ax_traj *(ax_traj-one) &
534 & *q_traj(ixp2,jy,kk)*(sixth) + &
535 & (ax_traj+one)* (ax_traj-one) &
536 & *q_traj(ixp2,jy,kk)*(sixth) + &
537 & (ax_traj+one)* ax_traj &
538 & *q_traj(ixp2,jy,kk)*(sixth) &
541 q(ixm1,jy,kk) = q(ixm1,jy,kk) + ( &
542 & ax_traj *(ax_traj-one)*(ax_traj-two)*(-sixth) &
545 q(ix ,jy,kk) = q(ix ,jy,kk) + ( &
546 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two)*half &
549 q(ixp1,jy,kk) = q(ixp1,jy,kk) + ( &
550 & (ax_traj+one)* ax_traj *(ax_traj-two)*(-half) &
553 q(ixp2,jy,kk) = q(ixp2,jy,kk) + ( &
554 & (ax_traj+one)* ax_traj *(ax_traj-one)*(sixth) &
562 & (ax_traj-one)*(ax_traj-two) &
563 & *q_south(ixm1,kk)*(-sixth) + &
564 & ax_traj * (ax_traj-two) &
565 & *q_south(ixm1,kk)*(-sixth) + &
566 & ax_traj *(ax_traj-one) &
567 & *q_south(ixm1,kk)*(-sixth) + &
568 & (ax_traj-one)*(ax_traj-two) &
569 & *q_south(ix, kk)*half + &
570 & (ax_traj+one)* (ax_traj-two) &
571 & *q_south(ix, kk)*half + &
572 & (ax_traj+one)*(ax_traj-one) &
573 & *q_south(ix, kk)*half + &
574 & ax_traj *(ax_traj-two) &
575 & *q_south(ixp1,kk)*(-half) + &
576 & (ax_traj+one)* (ax_traj-two) &
577 & *q_south(ixp1,kk)*(-half) + &
578 & (ax_traj+one)* ax_traj &
579 & *q_south(ixp1,kk)*(-half) + &
580 & ax_traj *(ax_traj-one) &
581 & *q_south(ixp2,kk)*(sixth) + &
582 & (ax_traj+one) * (ax_traj-one) &
583 & *q_south(ixp2,kk)*(sixth) + &
584 & (ax_traj+one) * ax_traj &
585 & *q_south(ixp2,kk)*(sixth) &
589 else if (jym1 > ny)
then 591 & (ax_traj-one)*(ax_traj-two) &
592 & *q_north(ixm1,kk)*(-sixth) + &
593 & ax_traj * (ax_traj-two) &
594 & *q_north(ixm1,kk)*(-sixth) + &
595 & ax_traj *(ax_traj-one) &
596 & *q_north(ixm1,kk)*(-sixth) + &
597 & (ax_traj-one)*(ax_traj-two) &
598 & *q_north(ix, kk)*half + &
599 & (ax_traj+one)* (ax_traj-two) &
600 & *q_north(ix, kk)*half + &
601 & (ax_traj+one)*(ax_traj-one) &
602 & *q_north(ix, kk)*half + &
603 & ax_traj *(ax_traj-two) &
604 & *q_north(ixp1,kk)*(-half) + &
605 & (ax_traj+one)* (ax_traj-two) &
606 & *q_north(ixp1,kk)*(-half) + &
607 & (ax_traj+one)* ax_traj &
608 & *q_north(ixp1,kk)*(-half) + &
609 & ax_traj *(ax_traj-one) &
610 & *q_north(ixp2,kk)*(sixth) + &
611 & (ax_traj+one)* (ax_traj-one) &
612 & *q_north(ixp2,kk)*(sixth) + &
613 & (ax_traj+one)* ax_traj &
614 & *q_north(ixp2,kk)*(sixth) &
620 & (ax_traj-one)*(ax_traj-two) &
621 & *q_traj(ixm1,jym1,kk)*(-sixth) + &
622 & ax_traj * (ax_traj-two) &
623 & *q_traj(ixm1,jym1,kk)*(-sixth) + &
624 & ax_traj *(ax_traj-one) &
625 & *q_traj(ixm1,jym1,kk)*(-sixth) + &
626 & (ax_traj-one)*(ax_traj-two) &
627 & *q_traj(ix, jym1,kk)*half + &
628 & (ax_traj+one)* (ax_traj-two) &
629 & *q_traj(ix, jym1,kk)*half + &
630 & (ax_traj+one)*(ax_traj-one) &
631 & *q_traj(ix, jym1,kk)*half + &
632 & ax_traj *(ax_traj-two) &
633 & *q_traj(ixp1,jym1,kk)*(-half) + &
634 & (ax_traj+one)* (ax_traj-two) &
635 & *q_traj(ixp1,jym1,kk)*(-half) + &
636 & (ax_traj+one)* ax_traj &
637 & *q_traj(ixp1,jym1,kk)*(-half) + &
638 & ax_traj *(ax_traj-one) &
639 & *q_traj(ixp2,jym1,kk)*(sixth) + &
640 & (ax_traj+one)* (ax_traj-one) &
641 & *q_traj(ixp2,jym1,kk)*(sixth) + &
642 & (ax_traj+one)* ax_traj &
643 & *q_traj(ixp2,jym1,kk)*(sixth) &
646 q(ixm1,jym1,kk) = q(ixm1,jym1,kk) + ( &
647 & ax_traj *(ax_traj-one)*(ax_traj-two)*(-sixth) &
650 q(ix, jym1,kk) = q(ix, jym1,kk) + ( &
651 & (ax_traj+one)*(ax_traj-one)*(ax_traj-two)*half &
654 q(ixp1,jym1,kk) = q(ixp1,jym1,kk) + ( &
655 & (ax_traj+one)* ax_traj *(ax_traj-two)*(-half) &
658 q(ixp2,jym1,kk) = q(ixp2,jym1,kk) + ( &
659 & (ax_traj+one)* ax_traj *(ax_traj-one)*(sixth) &
667 v(ii,jj,kk) = ay * (-dt/deltay)
670 u(ii,jj,kk) = ax * (-dt/deltax)
subroutine advect_pv_ad(qnew, q, q_traj, q_north, q_south, u, u_traj, v, v_traj, nx, ny, deltax, deltay, dt)
Advect potential vorticity - Adjoint.