52 & mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, npz&
53 & , nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, &
54 & nord_tr_pert, trdm_pert, split_damp_tr, dpa)
57 INTEGER,
INTENT(IN) :: npx
58 INTEGER,
INTENT(IN) :: npy
59 INTEGER,
INTENT(IN) :: npz
61 INTEGER,
INTENT(IN) :: nq
62 INTEGER,
INTENT(IN) :: hord, nord_tr
63 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
64 LOGICAL,
INTENT(IN) :: split_damp_tr
65 INTEGER,
INTENT(IN) :: q_split
66 INTEGER,
INTENT(IN) :: id_divg
67 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
68 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
70 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
71 REAL,
INTENT(INOUT) :: q_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
73 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
74 REAL,
INTENT(INOUT) :: dp1_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
76 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
77 REAL,
INTENT(INOUT) :: mfx_tl(bd%is:bd%ie+1, bd%js:bd%je, npz)
79 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
80 REAL,
INTENT(INOUT) :: mfy_tl(bd%is:bd%ie, bd%js:bd%je+1, npz)
82 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
83 REAL,
INTENT(INOUT) :: cx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
85 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
86 REAL,
INTENT(INOUT) :: cy_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
88 REAL,
OPTIONAL,
INTENT(OUT) :: dpa(bd%is:bd%ie, bd%js:bd%je)
90 TYPE(
domain2d),
INTENT(INOUT) :: domain
93 REAL :: qn2(bd%isd:bd%ied, bd%jsd:bd%jed, nq)
94 REAL :: qn2_tl(bd%isd:bd%ied, bd%jsd:bd%jed, nq)
95 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
96 REAL :: dp2_tl(bd%is:bd%ie, bd%js:bd%je)
97 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
98 REAL :: fx_tl(bd%is:bd%ie+1, bd%js:bd%je)
99 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
100 REAL :: fy_tl(bd%is:bd%ie, bd%js:bd%je+1)
101 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
102 REAL :: ra_x_tl(bd%is:bd%ie, bd%jsd:bd%jed)
103 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
104 REAL :: ra_y_tl(bd%isd:bd%ied, bd%js:bd%je)
105 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
106 REAL :: xfx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
107 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
108 REAL :: yfx_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
112 INTEGER :: i, j, k, it, iq
113 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
114 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
115 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
116 INTEGER :: is, ie, js, je
117 INTEGER :: isd, ied, jsd, jed
137 area => gridstruct%area
138 rarea => gridstruct%rarea
139 sin_sg => gridstruct%sin_sg
140 dxa => gridstruct%dxa
141 dya => gridstruct%dya
151 IF (cx(i, j, k) .GT. 0.)
THEN 152 xfx_tl(i, j, k) = dxa(i-1, j)*dy(i, j)*sin_sg(i-1, j, 3)*&
154 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
157 xfx_tl(i, j, k) = dxa(i, j)*dy(i, j)*sin_sg(i, j, 1)*cx_tl(i&
159 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
166 IF (cy(i, j, k) .GT. 0.)
THEN 167 yfx_tl(i, j, k) = dya(i, j-1)*dx(i, j)*sin_sg(i, j-1, 4)*&
169 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
172 yfx_tl(i, j, k) = dya(i, j)*dx(i, j)*sin_sg(i, j, 2)*cy_tl(i&
174 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
180 IF (k .LT. npz/6)
THEN 183 IF (cx(i, j, k) .GE. 0.)
THEN 188 IF (cy(i, j, k) .GE. 0.)
THEN 193 IF (cmax(k) .LT. y1)
THEN 199 ELSE IF (cmax(k) .LT. z1)
THEN 209 IF (cx(i, j, k) .GE. 0.)
THEN 214 IF (cy(i, j, k) .GE. 0.)
THEN 224 y2 = max1 + 1. - sin_sg(i, j, 5)
225 IF (cmax(k) .LT. y2)
THEN 235 CALL mp_reduce_max(cmax, npz)
240 nsplt = int(1. + cmax(k))
241 IF (nsplt .GT. 1)
THEN 242 frac = 1./
REAL(nsplt)
245 cx_tl(i, j, k) = frac*cx_tl(i, j, k)
246 cx(i, j, k) = cx(i, j, k)*frac
247 xfx_tl(i, j, k) = frac*xfx_tl(i, j, k)
248 xfx(i, j, k) = xfx(i, j, k)*frac
253 mfx_tl(i, j, k) = frac*mfx_tl(i, j, k)
254 mfx(i, j, k) = mfx(i, j, k)*frac
259 cy_tl(i, j, k) = frac*cy_tl(i, j, k)
260 cy(i, j, k) = cy(i, j, k)*frac
261 yfx_tl(i, j, k) = frac*yfx_tl(i, j, k)
262 yfx(i, j, k) = yfx(i, j, k)*frac
267 mfy_tl(i, j, k) = frac*mfy_tl(i, j, k)
268 mfy(i, j, k) = mfy(i, j, k)*frac
275 CALL complete_group_halo_update(q_pack, domain)
289 ra_x_tl(i, j) = xfx_tl(i, j, k) - xfx_tl(i+1, j, k)
290 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
292 IF (j .GE. js .AND. j .LE. je)
THEN 294 ra_y_tl(i, j) = yfx_tl(i, j, k) - yfx_tl(i, j+1, k)
295 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
299 nsplt = int(1. + cmax(k))
304 dp2_tl(i, j) = dp1_tl(i, j, k) + rarea(i, j)*(mfx_tl(i, j, k&
305 & )-mfx_tl(i+1, j, k)+mfy_tl(i, j, k)-mfy_tl(i, j+1, k))
306 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(mfy&
307 & (i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
314 IF (nsplt .NE. 1)
THEN 318 qn2_tl(i, j, iq) = q_tl(i, j, k, iq)
319 qn2(i, j, iq) = q(i, j, k, iq)
323 IF (hord .EQ. hord_pert)
THEN 324 CALL fv_tp_2d_tlm(qn2(isd:ied, jsd:jed, iq), qn2_tl(isd&
325 & :ied, jsd:jed, iq), cx(is:ie+1, jsd:jed, k)&
326 & , cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, &
327 & js:je+1, k), cy_tl(isd:ied, js:je+1, k), &
328 & npx, npy, hord, fx, fx_tl, fy, fy_tl, xfx(&
329 & is:ie+1, jsd:jed, k), xfx_tl(is:ie+1, jsd:&
330 & jed, k), yfx(isd:ied, js:je+1, k), yfx_tl(&
331 & isd:ied, js:je+1, k), gridstruct, bd, ra_x&
332 & , ra_x_tl, ra_y, ra_y_tl, mfx=mfx(is:ie+1, &
333 & js:je, k), mfx_tl=mfx_tl(is:ie+1, js:je, k)&
334 & , mfy=mfy(is:ie, js:je+1, k), mfy_tl=mfy_tl&
335 & (is:ie, js:je+1, k))
337 CALL fv_tp_2d_tlm(qn2(isd:ied, jsd:jed, iq), qn2_tl(isd:&
338 & ied, jsd:jed, iq), cx(is:ie+1, jsd:jed, k), &
339 & cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, js:je+&
340 & 1, k), cy_tl(isd:ied, js:je+1, k), npx, npy, &
341 & hord_pert, fx, fx_tl, fy, fy_tl, xfx(is:ie+1, &
342 & jsd:jed, k), xfx_tl(is:ie+1, jsd:jed, k), yfx(&
343 & isd:ied, js:je+1, k), yfx_tl(isd:ied, js:je+1&
344 & , k), gridstruct, bd, ra_x, ra_x_tl, ra_y, &
345 & ra_y_tl, mfx=mfx(is:ie+1, js:je, k), mfx_tl=&
346 & mfx_tl(is:ie+1, js:je, k), mfy=mfy(is:ie, js:&
347 & je+1, k), mfy_tl=mfy_tl(is:ie, js:je+1, k))
348 call fv_tp_2d(qn2(isd:ied,jsd:jed,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
349 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
350 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
352 IF (it .LT. nsplt)
THEN 356 qn2_tl(i, j, iq) = ((qn2_tl(i, j, iq)*dp1(i, j, k)+qn2&
357 & (i, j, iq)*dp1_tl(i, j, k)+rarea(i, j)*(fx_tl(i, j)-&
358 & fx_tl(i+1, j)+fy_tl(i, j)-fy_tl(i, j+1)))*dp2(i, j)-&
359 & (qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)-fx(i+1, j)+(fy&
360 & (i, j)-fy(i, j+1)))*rarea(i, j))*dp2_tl(i, j))/dp2(i&
362 qn2(i, j, iq) = (qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)-&
363 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i&
370 q_tl(i, j, k, iq) = ((qn2_tl(i, j, iq)*dp1(i, j, k)+&
371 & qn2(i, j, iq)*dp1_tl(i, j, k)+rarea(i, j)*(fx_tl(i, &
372 & j)-fx_tl(i+1, j)+fy_tl(i, j)-fy_tl(i, j+1)))*dp2(i, &
373 & j)-(qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)-fx(i+1, j)+&
374 & (fy(i, j)-fy(i, j+1)))*rarea(i, j))*dp2_tl(i, j))/&
376 q(i, j, k, iq) = (qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)&
377 & -fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(&
383 IF (hord .EQ. hord_pert)
THEN 384 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:&
385 & ied, jsd:jed, k, iq), cx(is:ie+1, jsd:jed, &
386 & k), cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied&
387 & , js:je+1, k), cy_tl(isd:ied, js:je+1, k), &
388 & npx, npy, hord, fx, fx_tl, fy, fy_tl, xfx(&
389 & is:ie+1, jsd:jed, k), xfx_tl(is:ie+1, jsd:&
390 & jed, k), yfx(isd:ied, js:je+1, k), yfx_tl(&
391 & isd:ied, js:je+1, k), gridstruct, bd, ra_x&
392 & , ra_x_tl, ra_y, ra_y_tl, mfx=mfx(is:ie+1, &
393 & js:je, k), mfx_tl=mfx_tl(is:ie+1, js:je, k)&
394 & , mfy=mfy(is:ie, js:je+1, k), mfy_tl=mfy_tl&
395 & (is:ie, js:je+1, k))
397 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:ied&
398 & , jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k), &
399 & cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, js:je+&
400 & 1, k), cy_tl(isd:ied, js:je+1, k), npx, npy, &
401 & hord_pert, fx, fx_tl, fy, fy_tl, xfx(is:ie+1, &
402 & jsd:jed, k), xfx_tl(is:ie+1, jsd:jed, k), yfx(&
403 & isd:ied, js:je+1, k), yfx_tl(isd:ied, js:je+1&
404 & , k), gridstruct, bd, ra_x, ra_x_tl, ra_y, &
405 & ra_y_tl, mfx=mfx(is:ie+1, js:je, k), mfx_tl=&
406 & mfx_tl(is:ie+1, js:je, k), mfy=mfy(is:ie, js:&
407 & je+1, k), mfy_tl=mfy_tl(is:ie, js:je+1, k))
408 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
409 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
410 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
414 q_tl(i, j, k, iq) = ((q_tl(i, j, k, iq)*dp1(i, j, k)+q(i&
415 & , j, k, iq)*dp1_tl(i, j, k)+rarea(i, j)*(fx_tl(i, j)-&
416 & fx_tl(i+1, j)+fy_tl(i, j)-fy_tl(i, j+1)))*dp2(i, j)-(q&
417 & (i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-fx(i+1, j)+(fy(i&
418 & , j)-fy(i, j+1)))*rarea(i, j))*dp2_tl(i, j))/dp2(i, j)&
420 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-&
421 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, &
428 IF (it .LT. nsplt)
THEN 432 dp1_tl(i, j, k) = dp2_tl(i, j)
433 dp1(i, j, k) = dp2(i, j)
446 IF (
PRESENT(dpa)) dpa = dp2
451 SUBROUTINE tracer_2d_1l(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, &
452 & domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, &
453 & nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, &
457 INTEGER,
INTENT(IN) :: npx
458 INTEGER,
INTENT(IN) :: npy
459 INTEGER,
INTENT(IN) :: npz
461 INTEGER,
INTENT(IN) :: nq
462 INTEGER,
INTENT(IN) :: hord, nord_tr
463 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
464 LOGICAL,
INTENT(IN) :: split_damp_tr
465 INTEGER,
INTENT(IN) :: q_split
466 INTEGER,
INTENT(IN) :: id_divg
467 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
468 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
470 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
472 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
474 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
476 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
478 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
480 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
482 REAL,
OPTIONAL,
INTENT(OUT) :: dpa(bd%is:bd%ie, bd%js:bd%je)
484 TYPE(
domain2d),
INTENT(INOUT) :: domain
487 REAL :: qn2(bd%isd:bd%ied, bd%jsd:bd%jed, nq)
488 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
489 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
490 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
491 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
492 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
493 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
494 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
498 INTEGER :: i, j, k, it, iq
499 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
500 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
501 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
502 INTEGER :: is, ie, js, je
503 INTEGER :: isd, ied, jsd, jed
523 area => gridstruct%area
524 rarea => gridstruct%rarea
525 sin_sg => gridstruct%sin_sg
526 dxa => gridstruct%dxa
527 dya => gridstruct%dya
535 IF (cx(i, j, k) .GT. 0.)
THEN 536 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
539 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
546 IF (cy(i, j, k) .GT. 0.)
THEN 547 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
550 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
556 IF (k .LT. npz/6)
THEN 559 IF (cx(i, j, k) .GE. 0.)
THEN 564 IF (cy(i, j, k) .GE. 0.)
THEN 569 IF (cmax(k) .LT. y1)
THEN 575 ELSE IF (cmax(k) .LT. z1)
THEN 585 IF (cx(i, j, k) .GE. 0.)
THEN 590 IF (cy(i, j, k) .GE. 0.)
THEN 600 y2 = max1 + 1. - sin_sg(i, j, 5)
601 IF (cmax(k) .LT. y2)
THEN 611 CALL mp_reduce_max(cmax, npz)
616 nsplt = int(1. + cmax(k))
617 IF (nsplt .GT. 1)
THEN 618 frac = 1./
REAL(nsplt)
621 cx(i, j, k) = cx(i, j, k)*frac
622 xfx(i, j, k) = xfx(i, j, k)*frac
627 mfx(i, j, k) = mfx(i, j, k)*frac
632 cy(i, j, k) = cy(i, j, k)*frac
633 yfx(i, j, k) = yfx(i, j, k)*frac
638 mfy(i, j, k) = mfy(i, j, k)*frac
645 CALL complete_group_halo_update(q_pack, domain)
653 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
655 IF (j .GE. js .AND. j .LE. je)
THEN 657 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
661 nsplt = int(1. + cmax(k))
666 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(mfy&
667 & (i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
674 IF (nsplt .NE. 1)
THEN 678 qn2(i, j, iq) = q(i, j, k, iq)
682 IF (hord .EQ. hord_pert)
THEN 683 CALL fv_tp_2d(qn2(isd:ied, jsd:jed, iq), cx(is:ie+1, &
684 & jsd:jed, k), cy(isd:ied, js:je+1, k), npx, npy&
685 & , hord, fx, fy, xfx(is:ie+1, jsd:jed, k), yfx(&
686 & isd:ied, js:je+1, k), gridstruct, bd, ra_x, &
687 & ra_y, mfx=mfx(is:ie+1, js:je, k), mfy=mfy(is:ie&
690 call fv_tp_2d(qn2(isd:ied,jsd:jed,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
691 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
692 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
694 IF (it .LT. nsplt)
THEN 698 qn2(i, j, iq) = (qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)-&
699 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i&
706 q(i, j, k, iq) = (qn2(i, j, iq)*dp1(i, j, k)+(fx(i, j)&
707 & -fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(&
713 IF (hord .EQ. hord_pert)
THEN 714 CALL fv_tp_2d(q(isd:ied, jsd:jed, k, iq), cx(is:ie+1, &
715 & jsd:jed, k), cy(isd:ied, js:je+1, k), npx, npy&
716 & , hord, fx, fy, xfx(is:ie+1, jsd:jed, k), yfx(&
717 & isd:ied, js:je+1, k), gridstruct, bd, ra_x, &
718 & ra_y, mfx=mfx(is:ie+1, js:je, k), mfy=mfy(is:ie&
721 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
722 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
723 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
727 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-&
728 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, &
735 IF (it .LT. nsplt)
THEN 739 dp1(i, j, k) = dp2(i, j)
752 IF (
PRESENT(dpa)) dpa = dp2
757 SUBROUTINE tracer_2d_tlm(q, q_tl, dp1, dp1_tl, mfx, mfx_tl, mfy, &
758 & mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, npz&
759 & , nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, &
760 & nord_tr_pert, trdm_pert, split_damp_tr, dpa)
763 INTEGER,
INTENT(IN) :: npx
764 INTEGER,
INTENT(IN) :: npy
765 INTEGER,
INTENT(IN) :: npz
767 INTEGER,
INTENT(IN) :: nq
768 INTEGER,
INTENT(IN) :: hord, nord_tr
769 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
770 LOGICAL,
INTENT(IN) :: split_damp_tr
771 INTEGER,
INTENT(IN) :: q_split
772 INTEGER,
INTENT(IN) :: id_divg
773 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
774 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
776 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
777 REAL,
INTENT(INOUT) :: q_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
779 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
780 REAL,
INTENT(INOUT) :: dp1_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
782 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
783 REAL,
INTENT(INOUT) :: mfx_tl(bd%is:bd%ie+1, bd%js:bd%je, npz)
785 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
786 REAL,
INTENT(INOUT) :: mfy_tl(bd%is:bd%ie, bd%js:bd%je+1, npz)
788 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
789 REAL,
INTENT(INOUT) :: cx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
791 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
792 REAL,
INTENT(INOUT) :: cy_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
794 REAL,
OPTIONAL,
INTENT(OUT) :: dpa(bd%is:bd%ie, bd%js:bd%je, npz)
796 TYPE(
domain2d),
INTENT(INOUT) :: domain
798 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
799 REAL :: dp2_tl(bd%is:bd%ie, bd%js:bd%je)
800 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
801 REAL :: fx_tl(bd%is:bd%ie+1, bd%js:bd%je)
802 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
803 REAL :: fy_tl(bd%is:bd%ie, bd%js:bd%je+1)
804 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
805 REAL :: ra_x_tl(bd%is:bd%ie, bd%jsd:bd%jed)
806 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
807 REAL :: ra_y_tl(bd%isd:bd%ied, bd%js:bd%je)
808 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
809 REAL :: xfx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
810 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
811 REAL :: yfx_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
815 INTEGER :: ksplt(npz)
817 INTEGER :: i, j, k, it, iq
818 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
819 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
820 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
821 INTEGER :: is, ie, js, je
822 INTEGER :: isd, ied, jsd, jed
842 area => gridstruct%area
843 rarea => gridstruct%rarea
844 sin_sg => gridstruct%sin_sg
845 dxa => gridstruct%dxa
846 dya => gridstruct%dya
856 IF (cx(i, j, k) .GT. 0.)
THEN 857 xfx_tl(i, j, k) = dxa(i-1, j)*dy(i, j)*sin_sg(i-1, j, 3)*&
859 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
862 xfx_tl(i, j, k) = dxa(i, j)*dy(i, j)*sin_sg(i, j, 1)*cx_tl(i&
864 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
871 IF (cy(i, j, k) .GT. 0.)
THEN 872 yfx_tl(i, j, k) = dya(i, j-1)*dx(i, j)*sin_sg(i, j-1, 4)*&
874 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
877 yfx_tl(i, j, k) = dya(i, j)*dx(i, j)*sin_sg(i, j, 2)*cy_tl(i&
879 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
884 IF (q_split .EQ. 0)
THEN 886 IF (k .LT. npz/6)
THEN 889 IF (cx(i, j, k) .GE. 0.)
THEN 894 IF (cy(i, j, k) .GE. 0.)
THEN 899 IF (cmax(k) .LT. y1)
THEN 905 ELSE IF (cmax(k) .LT. z1)
THEN 915 IF (cx(i, j, k) .GE. 0.)
THEN 920 IF (cy(i, j, k) .GE. 0.)
THEN 930 y2 = max1 + 1. - sin_sg(i, j, 5)
931 IF (cmax(k) .LT. y2)
THEN 944 IF (q_split .EQ. 0)
THEN 945 CALL mp_reduce_max(cmax, npz)
951 IF (cmax(k) .LT. c_global)
THEN 958 nsplt = int(1. + c_global)
959 IF (is_master() .AND. nsplt .GT. 4)
WRITE(*, *)
'Tracer_2d_split='&
965 IF (nsplt .NE. 1)
THEN 969 ksplt(k) = int(1. + cmax(k))
970 frac = 1./
REAL(ksplt(k))
973 cx_tl(i, j, k) = frac*cx_tl(i, j, k)
974 cx(i, j, k) = cx(i, j, k)*frac
975 xfx_tl(i, j, k) = frac*xfx_tl(i, j, k)
976 xfx(i, j, k) = xfx(i, j, k)*frac
981 mfx_tl(i, j, k) = frac*mfx_tl(i, j, k)
982 mfx(i, j, k) = mfx(i, j, k)*frac
987 cy_tl(i, j, k) = frac*cy_tl(i, j, k)
988 cy(i, j, k) = cy(i, j, k)*frac
989 yfx_tl(i, j, k) = frac*yfx_tl(i, j, k)
990 yfx(i, j, k) = yfx(i, j, k)*frac
995 mfy_tl(i, j, k) = frac*mfy_tl(i, j, k)
996 mfy(i, j, k) = mfy(i, j, k)*frac
1015 CALL complete_group_halo_update(q_pack, domain)
1023 IF (it .LE. ksplt(k))
THEN 1026 dp2_tl(i, j) = dp1_tl(i, j, k) + rarea(i, j)*(mfx_tl(i, j&
1027 & , k)-mfx_tl(i+1, j, k)+mfy_tl(i, j, k)-mfy_tl(i, j+1, k)&
1029 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(&
1030 & mfy(i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
1035 ra_x_tl(i, j) = xfx_tl(i, j, k) - xfx_tl(i+1, j, k)
1036 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
1041 ra_y_tl(i, j) = yfx_tl(i, j, k) - yfx_tl(i, j+1, k)
1042 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
1046 IF (it .EQ. 1 .AND. trdm .GT. 1.e-4)
THEN 1047 IF (hord .EQ. hord_pert)
THEN 1049 & isd:ied, jsd:jed, k, iq), cx(is:ie+1, jsd&
1050 & :jed, k), cx_tl(is:ie+1, jsd:jed, k), cy(&
1051 & isd:ied, js:je+1, k), cy_tl(isd:ied, js:&
1052 & je+1, k), npx, npy, hord, fx, fx_tl, fy, &
1053 & fy_tl, xfx(is:ie+1, jsd:jed, k), xfx_tl(&
1054 & is:ie+1, jsd:jed, k), yfx(isd:ied, js:je+&
1055 & 1, k), yfx_tl(isd:ied, js:je+1, k), &
1056 & gridstruct, bd, ra_x, ra_x_tl, ra_y, &
1057 & ra_y_tl, mfx=mfx(is:ie+1, js:je, k), &
1058 & mfx_tl=mfx_tl(is:ie+1, js:je, k), mfy=mfy&
1059 & (is:ie, js:je+1, k), mfy_tl=mfy_tl(is:ie&
1060 & , js:je+1, k), mass=dp1(isd:ied, jsd:jed&
1061 & , k), mass_tl=dp1_tl(isd:ied, jsd:jed, k)&
1062 & , nord=nord_tr, damp_c=trdm)
1064 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:&
1065 & ied, jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k&
1066 & ), cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, &
1067 & js:je+1, k), cy_tl(isd:ied, js:je+1, k), npx&
1068 & , npy, hord_pert, fx, fx_tl, fy, fy_tl, xfx(&
1069 & is:ie+1, jsd:jed, k), xfx_tl(is:ie+1, jsd:&
1070 & jed, k), yfx(isd:ied, js:je+1, k), yfx_tl(&
1071 & isd:ied, js:je+1, k), gridstruct, bd, ra_x, &
1072 & ra_x_tl, ra_y, ra_y_tl, mfx=mfx(is:ie+1, js:&
1073 & je, k), mfx_tl=mfx_tl(is:ie+1, js:je, k), &
1074 & mfy=mfy(is:ie, js:je+1, k), mfy_tl=mfy_tl(is&
1075 & :ie, js:je+1, k), mass=dp1(isd:ied, jsd:jed&
1076 & , k), mass_tl=dp1_tl(isd:ied, jsd:jed, k), &
1077 & nord=nord_tr_pert, damp_c=trdm_pert)
1078 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1079 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1080 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k), &
1081 mass=dp1(isd:ied,jsd:jed,k), nord=nord_tr, damp_c=trdm)
1083 ELSE IF (hord .EQ. hord_pert)
THEN 1084 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:&
1085 & ied, jsd:jed, k, iq), cx(is:ie+1, jsd:jed, &
1086 & k), cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied&
1087 & , js:je+1, k), cy_tl(isd:ied, js:je+1, k), &
1088 & npx, npy, hord, fx, fx_tl, fy, fy_tl, xfx(&
1089 & is:ie+1, jsd:jed, k), xfx_tl(is:ie+1, jsd:&
1090 & jed, k), yfx(isd:ied, js:je+1, k), yfx_tl(&
1091 & isd:ied, js:je+1, k), gridstruct, bd, ra_x&
1092 & , ra_x_tl, ra_y, ra_y_tl, mfx=mfx(is:ie+1, &
1093 & js:je, k), mfx_tl=mfx_tl(is:ie+1, js:je, k)&
1094 & , mfy=mfy(is:ie, js:je+1, k), mfy_tl=mfy_tl&
1095 & (is:ie, js:je+1, k))
1097 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:ied&
1098 & , jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k), &
1099 & cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, js:je+&
1100 & 1, k), cy_tl(isd:ied, js:je+1, k), npx, npy, &
1101 & hord_pert, fx, fx_tl, fy, fy_tl, xfx(is:ie+1, &
1102 & jsd:jed, k), xfx_tl(is:ie+1, jsd:jed, k), yfx(&
1103 & isd:ied, js:je+1, k), yfx_tl(isd:ied, js:je+1&
1104 & , k), gridstruct, bd, ra_x, ra_x_tl, ra_y, &
1105 & ra_y_tl, mfx=mfx(is:ie+1, js:je, k), mfx_tl=&
1106 & mfx_tl(is:ie+1, js:je, k), mfy=mfy(is:ie, js:&
1107 & je+1, k), mfy_tl=mfy_tl(is:ie, js:je+1, k))
1108 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1109 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1110 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
1114 q_tl(i, j, k, iq) = ((q_tl(i, j, k, iq)*dp1(i, j, k)+q(i&
1115 & , j, k, iq)*dp1_tl(i, j, k)+rarea(i, j)*(fx_tl(i, j)-&
1116 & fx_tl(i+1, j)+fy_tl(i, j)-fy_tl(i, j+1)))*dp2(i, j)-(q&
1117 & (i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-fx(i+1, j)+(fy(i&
1118 & , j)-fy(i, j+1)))*rarea(i, j))*dp2_tl(i, j))/dp2(i, j)&
1120 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-&
1121 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, &
1126 IF (it .NE. nsplt)
THEN 1129 dp1_tl(i, j, k) = dp2_tl(i, j)
1130 dp1(i, j, k) = dp2(i, j)
1137 IF (it .NE. nsplt)
THEN 1146 IF (
PRESENT(dpa)) dpa = dp1(bd%is:bd%ie, bd%js:bd%je, 1:npz)
1148 SUBROUTINE tracer_2d(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain&
1149 & , npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, &
1150 & trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
1153 INTEGER,
INTENT(IN) :: npx
1154 INTEGER,
INTENT(IN) :: npy
1155 INTEGER,
INTENT(IN) :: npz
1157 INTEGER,
INTENT(IN) :: nq
1158 INTEGER,
INTENT(IN) :: hord, nord_tr
1159 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
1160 LOGICAL,
INTENT(IN) :: split_damp_tr
1161 INTEGER,
INTENT(IN) :: q_split
1162 INTEGER,
INTENT(IN) :: id_divg
1163 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
1164 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
1166 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
1168 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1170 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
1172 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
1174 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1176 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1178 REAL,
OPTIONAL,
INTENT(OUT) :: dpa(bd%is:bd%ie, bd%js:bd%je, npz)
1180 TYPE(
domain2d),
INTENT(INOUT) :: domain
1182 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
1183 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
1184 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
1185 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
1186 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
1187 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1188 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1192 INTEGER :: ksplt(npz)
1194 INTEGER :: i, j, k, it, iq
1195 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
1196 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
1197 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
1198 INTEGER :: is, ie, js, je
1199 INTEGER :: isd, ied, jsd, jed
1219 area => gridstruct%area
1220 rarea => gridstruct%rarea
1221 sin_sg => gridstruct%sin_sg
1222 dxa => gridstruct%dxa
1223 dya => gridstruct%dya
1231 IF (cx(i, j, k) .GT. 0.)
THEN 1232 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
1235 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
1242 IF (cy(i, j, k) .GT. 0.)
THEN 1243 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
1246 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
1251 IF (q_split .EQ. 0)
THEN 1253 IF (k .LT. npz/6)
THEN 1256 IF (cx(i, j, k) .GE. 0.)
THEN 1261 IF (cy(i, j, k) .GE. 0.)
THEN 1266 IF (cmax(k) .LT. y1)
THEN 1267 IF (y1 .LT. z1)
THEN 1272 ELSE IF (cmax(k) .LT. z1)
THEN 1282 IF (cx(i, j, k) .GE. 0.)
THEN 1287 IF (cy(i, j, k) .GE. 0.)
THEN 1292 IF (x1 .LT. y3)
THEN 1297 y2 = max1 + 1. - sin_sg(i, j, 5)
1298 IF (cmax(k) .LT. y2)
THEN 1311 IF (q_split .EQ. 0)
THEN 1312 CALL mp_reduce_max(cmax, npz)
1315 IF (npz .NE. 1)
THEN 1318 IF (cmax(k) .LT. c_global)
THEN 1325 nsplt = int(1. + c_global)
1326 IF (is_master() .AND. nsplt .GT. 4)
WRITE(*, *)
'Tracer_2d_split='&
1332 IF (nsplt .NE. 1)
THEN 1336 ksplt(k) = int(1. + cmax(k))
1337 frac = 1./
REAL(ksplt(k))
1340 cx(i, j, k) = cx(i, j, k)*frac
1341 xfx(i, j, k) = xfx(i, j, k)*frac
1346 mfx(i, j, k) = mfx(i, j, k)*frac
1351 cy(i, j, k) = cy(i, j, k)*frac
1352 yfx(i, j, k) = yfx(i, j, k)*frac
1357 mfy(i, j, k) = mfy(i, j, k)*frac
1365 CALL complete_group_halo_update(q_pack, domain)
1373 IF (it .LE. ksplt(k))
THEN 1376 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(&
1377 & mfy(i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
1382 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
1387 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
1391 IF (it .EQ. 1 .AND. trdm .GT. 1.e-4)
THEN 1392 IF (hord .EQ. hord_pert)
THEN 1393 CALL fv_tp_2d(q(isd:ied, jsd:jed, k, iq), cx(is:ie+1&
1394 & , jsd:jed, k), cy(isd:ied, js:je+1, k), npx, &
1395 & npy, hord, fx, fy, xfx(is:ie+1, jsd:jed, k), &
1396 & yfx(isd:ied, js:je+1, k), gridstruct, bd, &
1397 & ra_x, ra_y, mfx(is:ie+1, js:je, k), mfy(is:ie&
1398 & , js:je+1, k), dp1(isd:ied, jsd:jed, k), &
1401 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1402 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1403 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k), &
1404 mass=dp1(isd:ied,jsd:jed,k), nord=nord_tr, damp_c=trdm)
1406 ELSE IF (hord .EQ. hord_pert)
THEN 1407 CALL fv_tp_2d(q(isd:ied, jsd:jed, k, iq), cx(is:ie+1, &
1408 & jsd:jed, k), cy(isd:ied, js:je+1, k), npx, npy&
1409 & , hord, fx, fy, xfx(is:ie+1, jsd:jed, k), yfx(&
1410 & isd:ied, js:je+1, k), gridstruct, bd, ra_x, &
1411 & ra_y, mfx=mfx(is:ie+1, js:je, k), mfy=mfy(is:ie&
1414 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1415 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1416 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
1420 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-&
1421 & fx(i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, &
1426 IF (it .NE. nsplt)
THEN 1429 dp1(i, j, k) = dp2(i, j)
1436 IF (it .NE. nsplt)
THEN 1445 IF (
PRESENT(dpa)) dpa = dp1(bd%is:bd%ie, bd%js:bd%je, 1:npz)
1451 & , mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, &
1452 & npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split&
1453 & , neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, &
1457 INTEGER,
INTENT(IN) :: npx
1458 INTEGER,
INTENT(IN) :: npy
1459 INTEGER,
INTENT(IN) :: npz
1461 INTEGER,
INTENT(IN) :: nq
1462 INTEGER,
INTENT(IN) :: hord, nord_tr
1463 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
1464 LOGICAL,
INTENT(IN) :: split_damp_tr
1465 INTEGER,
INTENT(IN) :: q_split, k_split
1466 INTEGER,
INTENT(IN) :: id_divg
1467 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
1468 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
1470 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
1471 REAL,
INTENT(INOUT) :: q_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
1473 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1474 REAL,
INTENT(INOUT) :: dp1_tl(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1476 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
1477 REAL,
INTENT(INOUT) :: mfx_tl(bd%is:bd%ie+1, bd%js:bd%je, npz)
1479 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
1480 REAL,
INTENT(INOUT) :: mfy_tl(bd%is:bd%ie, bd%js:bd%je+1, npz)
1482 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1483 REAL,
INTENT(INOUT) :: cx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1485 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1486 REAL,
INTENT(INOUT) :: cy_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1490 TYPE(
domain2d),
INTENT(INOUT) :: domain
1492 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
1493 REAL :: dp2_tl(bd%is:bd%ie, bd%js:bd%je)
1494 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
1495 REAL :: fx_tl(bd%is:bd%ie+1, bd%js:bd%je)
1496 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
1497 REAL :: fy_tl(bd%is:bd%ie, bd%js:bd%je+1)
1498 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
1499 REAL :: ra_x_tl(bd%is:bd%ie, bd%jsd:bd%jed)
1500 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
1501 REAL :: ra_y_tl(bd%isd:bd%ied, bd%js:bd%je)
1502 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1503 REAL :: xfx_tl(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1504 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1505 REAL :: yfx_tl(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1510 INTEGER :: nsplt, nsplt_parent
1511 INTEGER,
SAVE :: msg_split_steps=1
1512 INTEGER :: i, j, k, it, iq
1513 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
1514 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
1515 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
1516 INTEGER :: is, ie, js, je
1517 INTEGER :: isd, ied, jsd, jed
1535 area => gridstruct%area
1536 rarea => gridstruct%rarea
1537 sin_sg => gridstruct%sin_sg
1538 dxa => gridstruct%dxa
1539 dya => gridstruct%dya
1549 IF (cx(i, j, k) .GT. 0.)
THEN 1550 xfx_tl(i, j, k) = dxa(i-1, j)*dy(i, j)*sin_sg(i-1, j, 3)*&
1552 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
1555 xfx_tl(i, j, k) = dxa(i, j)*dy(i, j)*sin_sg(i, j, 1)*cx_tl(i&
1557 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
1564 IF (cy(i, j, k) .GT. 0.)
THEN 1565 yfx_tl(i, j, k) = dya(i, j-1)*dx(i, j)*sin_sg(i, j-1, 4)*&
1567 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
1570 yfx_tl(i, j, k) = dya(i, j)*dx(i, j)*sin_sg(i, j, 2)*cy_tl(i&
1572 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
1579 IF (q_split .EQ. 0)
THEN 1589 IF (cx(i, j, k) .GE. 0.)
THEN 1594 IF (cy(i, j, k) .GE. 0.)
THEN 1599 IF (x1 .LT. y1)
THEN 1604 IF (cmax_t .LT. cmax(k))
THEN 1614 IF (cx(i, j, k) .GE. 0.)
THEN 1619 IF (cy(i, j, k) .GE. 0.)
THEN 1624 IF (x2 .LT. y2)
THEN 1629 cmax_t = max1 + 1. - sin_sg(i, j, 5)
1630 IF (cmax_t .LT. cmax(k))
THEN 1639 CALL mp_reduce_max(cmax, npz)
1642 IF (npz .NE. 1)
THEN 1645 IF (cmax(k) .LT. c_global)
THEN 1652 nsplt = int(1. + c_global)
1653 IF (is_master() .AND. nsplt .GT. 3)
WRITE(*, *)
'Tracer_2d_split='&
1657 IF (gridstruct%nested .AND. neststruct%nestbctype .GT. 1)
THEN 1658 IF (q_split/parent_grid%flagstruct%q_split .LT. 1)
THEN 1661 msg_split_steps = q_split/parent_grid%flagstruct%q_split
1666 frac = 1./
REAL(nsplt)
1667 IF (nsplt .NE. 1)
THEN 1672 cx_tl(i, j, k) = frac*cx_tl(i, j, k)
1673 cx(i, j, k) = cx(i, j, k)*frac
1674 xfx_tl(i, j, k) = frac*xfx_tl(i, j, k)
1675 xfx(i, j, k) = xfx(i, j, k)*frac
1680 mfx_tl(i, j, k) = frac*mfx_tl(i, j, k)
1681 mfx(i, j, k) = mfx(i, j, k)*frac
1686 cy_tl(i, j, k) = frac*cy_tl(i, j, k)
1687 cy(i, j, k) = cy(i, j, k)*frac
1688 yfx_tl(i, j, k) = frac*yfx_tl(i, j, k)
1689 yfx(i, j, k) = yfx(i, j, k)*frac
1694 mfy_tl(i, j, k) = frac*mfy_tl(i, j, k)
1695 mfy(i, j, k) = mfy(i, j, k)*frac
1712 IF (gridstruct%nested) neststruct%tracer_nest_timestep = &
1713 & neststruct%tracer_nest_timestep + 1
1716 CALL complete_group_halo_update(q_pack, domain)
1719 IF (gridstruct%nested)
THEN 1722 & , q_tl(isd:ied, jsd:jed, :, iq), &
1723 & 0, 0, npx, npy, npz, bd,
REAL(&
& neststruct%tracer_nest_timestep) &
1724 & + REAL(nsplt*k_split), REAL(nsplt&
1725 & *k_split), neststruct%q_bc(iq), &
1726 & bctype=neststruct%nestbctype)
1735 dp2_tl(i, j) = dp1_tl(i, j, k) + rarea(i, j)*(mfx_tl(i, j, k&
1736 & )-mfx_tl(i+1, j, k)+mfy_tl(i, j, k)-mfy_tl(i, j+1, k))
1737 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(mfy&
1738 & (i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
1743 ra_x_tl(i, j) = xfx_tl(i, j, k) - xfx_tl(i+1, j, k)
1744 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
1749 ra_y_tl(i, j) = yfx_tl(i, j, k) - yfx_tl(i, j+1, k)
1750 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
1754 IF (it .EQ. 1 .AND. trdm .GT. 1.e-4)
THEN 1755 IF (hord .EQ. hord_pert)
THEN 1756 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:&
1757 & ied, jsd:jed, k, iq), cx(is:ie+1, jsd:jed, &
1758 & k), cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied&
1759 & , js:je+1, k), cy_tl(isd:ied, js:je+1, k), &
1760 & npx, npy, hord, fx, fx_tl, fy, fy_tl, xfx(&
1761 & is:ie+1, jsd:jed, k), xfx_tl(is:ie+1, jsd:&
1762 & jed, k), yfx(isd:ied, js:je+1, k), yfx_tl(&
1763 & isd:ied, js:je+1, k), gridstruct, bd, ra_x&
1764 & , ra_x_tl, ra_y, ra_y_tl, mfx=mfx(is:ie+1, &
1765 & js:je, k), mfx_tl=mfx_tl(is:ie+1, js:je, k)&
1766 & , mfy=mfy(is:ie, js:je+1, k), mfy_tl=mfy_tl&
1767 & (is:ie, js:je+1, k), mass=dp1(isd:ied, jsd:&
1768 & jed, k), mass_tl=dp1_tl(isd:ied, jsd:jed, k&
1769 & ), nord=nord_tr, damp_c=trdm)
1771 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:ied&
1772 & , jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k), &
1773 & cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, js:je+&
1774 & 1, k), cy_tl(isd:ied, js:je+1, k), npx, npy, &
1775 & hord_pert, fx, fx_tl, fy, fy_tl, xfx(is:ie+1, &
1776 & jsd:jed, k), xfx_tl(is:ie+1, jsd:jed, k), yfx(&
1777 & isd:ied, js:je+1, k), yfx_tl(isd:ied, js:je+1&
1778 & , k), gridstruct, bd, ra_x, ra_x_tl, ra_y, &
1779 & ra_y_tl, mfx=mfx(is:ie+1, js:je, k), mfx_tl=&
1780 & mfx_tl(is:ie+1, js:je, k), mfy=mfy(is:ie, js:&
1781 & je+1, k), mfy_tl=mfy_tl(is:ie, js:je+1, k), &
1782 & mass=dp1(isd:ied, jsd:jed, k), mass_tl=dp1_tl(&
1783 & isd:ied, jsd:jed, k), nord=nord_tr_pert, &
1785 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1786 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1787 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k), &
1788 mass=dp1(isd:ied,jsd:jed,k), nord=nord_tr, damp_c=trdm)
1790 ELSE IF (hord .EQ. hord_pert)
THEN 1791 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:&
1792 & ied, jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k)&
1793 & , cx_tl(is:ie+1, jsd:jed, k), cy(isd:ied, js:&
1794 & je+1, k), cy_tl(isd:ied, js:je+1, k), npx, &
1795 & npy, hord, fx, fx_tl, fy, fy_tl, xfx(is:ie+1&
1796 & , jsd:jed, k), xfx_tl(is:ie+1, jsd:jed, k), &
1797 & yfx(isd:ied, js:je+1, k), yfx_tl(isd:ied, js:&
1798 & je+1, k), gridstruct, bd, ra_x, ra_x_tl, ra_y&
1799 & , ra_y_tl, mfx=mfx(is:ie+1, js:je, k), mfx_tl&
1800 & =mfx_tl(is:ie+1, js:je, k), mfy=mfy(is:ie, js&
1801 & :je+1, k), mfy_tl=mfy_tl(is:ie, js:je+1, k))
1803 CALL fv_tp_2d_tlm(q(isd:ied, jsd:jed, k, iq), q_tl(isd:ied, &
1804 & jsd:jed, k, iq), cx(is:ie+1, jsd:jed, k), cx_tl(&
1805 & is:ie+1, jsd:jed, k), cy(isd:ied, js:je+1, k), &
1806 & cy_tl(isd:ied, js:je+1, k), npx, npy, hord_pert&
1807 & , fx, fx_tl, fy, fy_tl, xfx(is:ie+1, jsd:jed, k)&
1808 & , xfx_tl(is:ie+1, jsd:jed, k), yfx(isd:ied, js:&
1809 & je+1, k), yfx_tl(isd:ied, js:je+1, k), &
1810 & gridstruct, bd, ra_x, ra_x_tl, ra_y, ra_y_tl, &
1811 & mfx=mfx(is:ie+1, js:je, k), mfx_tl=mfx_tl(is:ie+&
1812 & 1, js:je, k), mfy=mfy(is:ie, js:je+1, k), mfy_tl&
1813 & =mfy_tl(is:ie, js:je+1, k))
1814 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
1815 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
1816 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
1820 q_tl(i, j, k, iq) = ((q_tl(i, j, k, iq)*dp1(i, j, k)+q(i, &
1821 & j, k, iq)*dp1_tl(i, j, k)+rarea(i, j)*(fx_tl(i, j)-fx_tl&
1822 & (i+1, j)+fy_tl(i, j)-fy_tl(i, j+1)))*dp2(i, j)-(q(i, j, &
1823 & k, iq)*dp1(i, j, k)+(fx(i, j)-fx(i+1, j)+(fy(i, j)-fy(i&
1824 & , j+1)))*rarea(i, j))*dp2_tl(i, j))/dp2(i, j)**2
1825 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-fx&
1826 & (i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, j)
1832 IF (it .NE. nsplt)
THEN 1840 IF (gridstruct%nested)
THEN 1843 & , q_tl(isd:ied, jsd:jed, :, iq), &
1844 & 0, 0, npx, npy, npz, bd,
REAL(&
1845 & neststruct%tracer_nest_timestep)&
1846 & , REAL(nsplt*k_split), neststruct&
1847 & %q_bc(iq), bctype=neststruct%&
1853 IF (id_divg .GT. 0)
THEN 1859 dp1_tl(i, j, k) = rarea(i, j)*rdt*(xfx_tl(i+1, j, k)-xfx_tl(&
1860 & i, j, k)+yfx_tl(i, j+1, k)-yfx_tl(i, j, k))
1861 dp1(i, j, k) = (xfx(i+1, j, k)-xfx(i, j, k)+(yfx(i, j+1, k)-&
1862 & yfx(i, j, k)))*rarea(i, j)*rdt
1869 & domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, &
1870 & nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, &
1871 & nord_tr_pert, trdm_pert, split_damp_tr)
1874 INTEGER,
INTENT(IN) :: npx
1875 INTEGER,
INTENT(IN) :: npy
1876 INTEGER,
INTENT(IN) :: npz
1878 INTEGER,
INTENT(IN) :: nq
1879 INTEGER,
INTENT(IN) :: hord, nord_tr
1880 INTEGER,
INTENT(IN) :: hord_pert, nord_tr_pert
1881 LOGICAL,
INTENT(IN) :: split_damp_tr
1882 INTEGER,
INTENT(IN) :: q_split, k_split
1883 INTEGER,
INTENT(IN) :: id_divg
1884 REAL,
INTENT(IN) :: dt, trdm, trdm_pert
1885 TYPE(group_halo_update_type),
INTENT(INOUT) :: q_pack
1887 REAL,
INTENT(INOUT) :: q(bd%isd:bd%ied, bd%jsd:bd%jed, npz, nq)
1889 REAL,
INTENT(INOUT) :: dp1(bd%isd:bd%ied, bd%jsd:bd%jed, npz)
1891 REAL,
INTENT(INOUT) :: mfx(bd%is:bd%ie+1, bd%js:bd%je, npz)
1893 REAL,
INTENT(INOUT) :: mfy(bd%is:bd%ie, bd%js:bd%je+1, npz)
1895 REAL,
INTENT(INOUT) :: cx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1897 REAL,
INTENT(INOUT) :: cy(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1901 TYPE(
domain2d),
INTENT(INOUT) :: domain
1903 REAL :: dp2(bd%is:bd%ie, bd%js:bd%je)
1904 REAL :: fx(bd%is:bd%ie+1, bd%js:bd%je)
1905 REAL :: fy(bd%is:bd%ie, bd%js:bd%je+1)
1906 REAL :: ra_x(bd%is:bd%ie, bd%jsd:bd%jed)
1907 REAL :: ra_y(bd%isd:bd%ied, bd%js:bd%je)
1908 REAL :: xfx(bd%is:bd%ie+1, bd%jsd:bd%jed, npz)
1909 REAL :: yfx(bd%isd:bd%ied, bd%js:bd%je+1, npz)
1914 INTEGER :: nsplt, nsplt_parent
1915 INTEGER,
SAVE :: msg_split_steps=1
1916 INTEGER :: i, j, k, it, iq
1917 REAL,
DIMENSION(:, :),
POINTER :: area, rarea
1918 REAL,
DIMENSION(:, :, :),
POINTER :: sin_sg
1919 REAL,
DIMENSION(:, :),
POINTER :: dxa, dya, dx, dy
1920 INTEGER :: is, ie, js, je
1921 INTEGER :: isd, ied, jsd, jed
1939 area => gridstruct%area
1940 rarea => gridstruct%rarea
1941 sin_sg => gridstruct%sin_sg
1942 dxa => gridstruct%dxa
1943 dya => gridstruct%dya
1951 IF (cx(i, j, k) .GT. 0.)
THEN 1952 xfx(i, j, k) = cx(i, j, k)*dxa(i-1, j)*dy(i, j)*sin_sg(i-1, &
1955 xfx(i, j, k) = cx(i, j, k)*dxa(i, j)*dy(i, j)*sin_sg(i, j, 1&
1962 IF (cy(i, j, k) .GT. 0.)
THEN 1963 yfx(i, j, k) = cy(i, j, k)*dya(i, j-1)*dx(i, j)*sin_sg(i, j-&
1966 yfx(i, j, k) = cy(i, j, k)*dya(i, j)*dx(i, j)*sin_sg(i, j, 2&
1973 IF (q_split .EQ. 0)
THEN 1983 IF (cx(i, j, k) .GE. 0.)
THEN 1988 IF (cy(i, j, k) .GE. 0.)
THEN 1993 IF (x1 .LT. y1)
THEN 1998 IF (cmax_t .LT. cmax(k))
THEN 2008 IF (cx(i, j, k) .GE. 0.)
THEN 2013 IF (cy(i, j, k) .GE. 0.)
THEN 2018 IF (x2 .LT. y2)
THEN 2023 cmax_t = max1 + 1. - sin_sg(i, j, 5)
2024 IF (cmax_t .LT. cmax(k))
THEN 2033 CALL mp_reduce_max(cmax, npz)
2036 IF (npz .NE. 1)
THEN 2039 IF (cmax(k) .LT. c_global)
THEN 2046 nsplt = int(1. + c_global)
2047 IF (is_master() .AND. nsplt .GT. 3)
WRITE(*, *)
'Tracer_2d_split='&
2051 IF (gridstruct%nested .AND. neststruct%nestbctype .GT. 1)
THEN 2052 IF (q_split/parent_grid%flagstruct%q_split .LT. 1)
THEN 2055 msg_split_steps = q_split/parent_grid%flagstruct%q_split
2060 frac = 1./
REAL(nsplt)
2061 IF (nsplt .NE. 1)
THEN 2066 cx(i, j, k) = cx(i, j, k)*frac
2067 xfx(i, j, k) = xfx(i, j, k)*frac
2072 mfx(i, j, k) = mfx(i, j, k)*frac
2077 cy(i, j, k) = cy(i, j, k)*frac
2078 yfx(i, j, k) = yfx(i, j, k)*frac
2083 mfy(i, j, k) = mfy(i, j, k)*frac
2089 IF (gridstruct%nested) neststruct%tracer_nest_timestep = &
2090 & neststruct%tracer_nest_timestep + 1
2093 CALL complete_group_halo_update(q_pack, domain)
2096 IF (gridstruct%nested)
THEN 2098 CALL nested_grid_bc_apply_intt(q(isd:ied, jsd:jed, :, iq), 0, &
2099 & 0, npx, npy, npz, bd,
REAL(neststruct&
& %tracer_nest_timestep) +
REAL(nsplt*&
& k_split),
REAL(nsplt*k_split), &
2100 & neststruct%q_bc(iq), neststruct%&
2110 dp2(i, j) = dp1(i, j, k) + (mfx(i, j, k)-mfx(i+1, j, k)+(mfy&
2111 & (i, j, k)-mfy(i, j+1, k)))*rarea(i, j)
2116 ra_x(i, j) = area(i, j) + (xfx(i, j, k)-xfx(i+1, j, k))
2121 ra_y(i, j) = area(i, j) + (yfx(i, j, k)-yfx(i, j+1, k))
2125 IF (it .EQ. 1 .AND. trdm .GT. 1.e-4)
THEN 2126 IF (hord .EQ. hord_pert)
THEN 2127 CALL fv_tp_2d(q(isd:ied, jsd:jed, k, iq), cx(is:ie+1, &
2128 & jsd:jed, k), cy(isd:ied, js:je+1, k), npx, npy&
2129 & , hord, fx, fy, xfx(is:ie+1, jsd:jed, k), yfx(&
2130 & isd:ied, js:je+1, k), gridstruct, bd, ra_x, &
2131 & ra_y, mfx(is:ie+1, js:je, k), mfy(is:ie, js:je+&
2132 & 1, k), dp1(isd:ied, jsd:jed, k), nord_tr, trdm)
2134 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
2135 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
2136 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k), &
2137 mass=dp1(isd:ied,jsd:jed,k), nord=nord_tr, damp_c=trdm)
2139 ELSE IF (hord .EQ. hord_pert)
THEN 2140 CALL fv_tp_2d(q(isd:ied, jsd:jed, k, iq), cx(is:ie+1, jsd&
2141 & :jed, k), cy(isd:ied, js:je+1, k), npx, npy, hord&
2142 & , fx, fy, xfx(is:ie+1, jsd:jed, k), yfx(isd:ied, &
2143 & js:je+1, k), gridstruct, bd, ra_x, ra_y, mfx=mfx(&
2144 & is:ie+1, js:je, k), mfy=mfy(is:ie, js:je+1, k))
2146 call fv_tp_2d(q(isd:ied,jsd:jed,k,iq), cx(is:ie+1,jsd:jed,k), cy(isd:ied,js:je+1,k), &
2147 npx, npy, hord, fx, fy, xfx(is:ie+1,jsd:jed,k), yfx(isd:ied,js:je+1,k), &
2148 gridstruct, bd, ra_x, ra_y, mfx=mfx(is:ie+1,js:je,k), mfy=mfy(is:ie,js:je+1,k))
2152 q(i, j, k, iq) = (q(i, j, k, iq)*dp1(i, j, k)+(fx(i, j)-fx&
2153 & (i+1, j)+(fy(i, j)-fy(i, j+1)))*rarea(i, j))/dp2(i, j)
2159 IF (it .NE. nsplt)
THEN 2167 IF (gridstruct%nested)
THEN 2169 CALL nested_grid_bc_apply_intt(q(isd:ied, jsd:jed, :, iq), 0, &
2170 & 0, npx, npy, npz, bd,
REAL(neststruct&
& %tracer_nest_timestep),
REAL(nsplt*&
& k_split), neststruct%q_bc(iq), &
2171 & neststruct%nestbctype)
2176 IF (id_divg .GT. 0)
THEN 2182 dp1(i, j, k) = (xfx(i+1, j, k)-xfx(i, j, k)+(yfx(i, j+1, k)-&
2183 & yfx(i, j, k)))*rarea(i, j)*rdt
2191
subroutine, public nested_grid_bc_apply_intt(var_nest, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine, public fv_tp_2d_tlm(q, q_tl, crx, crx_tl, cry, cry_tl, npx, npy, hord, fx, fx_tl, fy, fy_tl, xfx, xfx_tl, yfx, yfx_tl, gridstruct, bd, ra_x, ra_x_tl, ra_y, ra_y_tl, mfx, mfx_tl, mfy, mfy_tl, mass, mass_tl, nord, damp_c)
real, dimension(:,:,:), allocatable nest_fx_south_accum
subroutine, public tracer_2d_1l_tlm(q, q_tl, dp1, dp1_tl, mfx, mfx_tl, mfy, mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public tracer_2d_tlm(q, q_tl, dp1, dp1_tl, mfx, mfx_tl, mfy, mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public tracer_2d_nested(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr)
subroutine, public complete_group_halo_update(group, group_tl, domain)
real, dimension(:,:,:), allocatable nest_fx_north_accum
real, dimension(:,:,:), allocatable nest_fx_west_accum
integer, parameter, public ng
subroutine timing_on(blk_name)
real, dimension(:,:,:), allocatable nest_fx_east_accum
subroutine, public copy_corners(q, npx, npy, dir, nested, bd, sw_corner, se_corner, nw_corner, ne_corner)
subroutine, public tracer_2d(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public nested_grid_bc_apply_intt_tlm(var_nest, var_nest_tl, istag, jstag, npx, npy, npz, bd, step, split, bc, bctype)
subroutine, public tracer_2d_1l(q, dp1, mfx, mfy, cx, cy, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr, dpa)
subroutine, public fv_tp_2d(q, crx, cry, npx, npy, hord, fx, fy, xfx, yfx, gridstruct, bd, ra_x, ra_y, mfx, mfy, mass, nord, damp_c)
subroutine, public copy_corners_tlm(q, q_tl, npx, npy, dir, nested, bd, sw_corner, se_corner, nw_corner, ne_corner)
subroutine, public tracer_2d_nested_tlm(q, q_tl, dp1, dp1_tl, mfx, mfx_tl, mfy, mfy_tl, cx, cx_tl, cy, cy_tl, gridstruct, bd, domain, npx, npy, npz, nq, hord, q_split, dt, id_divg, q_pack, nord_tr, trdm, k_split, neststruct, parent_grid, hord_pert, nord_tr_pert, trdm_pert, split_damp_tr)
subroutine timing_off(blk_name)