52 SUBROUTINE d2c_setup_fwd(u, v, ua, va, uc, vc, dord4, isd, ied, jsd, &
53 & jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, &
54 & sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
56 LOGICAL,
INTENT(IN) :: dord4
57 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed, is, ie, js, je, npx, npy&
59 REAL,
INTENT(IN) :: u(isd:ied, jsd:jed+1)
60 REAL,
INTENT(IN) :: v(isd:ied+1, jsd:jed)
61 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: ua
62 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: va
63 REAL,
DIMENSION(isd:ied+1, jsd:jed) :: uc
64 REAL,
DIMENSION(isd:ied, jsd:jed+1) :: vc
65 LOGICAL,
INTENT(IN) :: nested, se_corner, sw_corner, ne_corner, &
67 REAL,
INTENT(IN) :: rsin_u(isd:ied+1, jsd:jed)
68 REAL,
INTENT(IN) :: rsin_v(isd:ied, jsd:jed+1)
69 REAL,
INTENT(IN) :: cosa_s(isd:ied, jsd:jed)
70 REAL,
INTENT(IN) :: rsin2(isd:ied, jsd:jed)
72 REAL,
DIMENSION(isd:ied, jsd:jed) :: utmp, vtmp
73 REAL,
PARAMETER :: t11=27./28., t12=-(13./28.), t13=3./7., t14=6./7.&
75 REAL,
PARAMETER :: a1=0.5625
76 REAL,
PARAMETER :: a2=-0.0625
77 REAL,
PARAMETER :: c1=-(2./14.)
78 REAL,
PARAMETER :: c2=11./14.
79 REAL,
PARAMETER :: c3=5./14.
80 INTEGER :: npt, i, j, ifirst, ilast, id
119 IF (
grid_type .LT. 3 .AND. (.NOT.nested))
THEN 130 IF (npt .LT. js - 1)
THEN 135 IF (npy - npt .GT. je + 1)
THEN 141 IF (npt .LT. isd)
THEN 146 IF (npx - npt .GT. ied)
THEN 156 IF (npt .LT. jsd)
THEN 161 IF (npy - npt .GT. jed)
THEN 167 IF (npt .LT. is - 1)
THEN 172 IF (npx - npt .GT. ie + 1)
THEN 186 IF (js .EQ. 1 .OR. jsd .LT. npt)
THEN 191 IF (je + 1 .EQ. npy .OR. jed .GE. npy - npt)
THEN 196 IF (is .EQ. 1 .OR. isd .LT. npt)
THEN 197 IF (npt .LT. jsd)
THEN 202 IF (npy - npt .GT. jed)
THEN 211 IF (ie + 1 .EQ. npx .OR. ied .GE. npx - npt)
THEN 212 IF (npt .LT. jsd)
THEN 217 IF (npy - npt .GT. jed)
THEN 255 IF (
grid_type .LT. 3 .AND. (.NOT.nested))
THEN 256 IF (3 .LT. is - 1)
THEN 261 IF (npx - 2 .GT. ie + 2)
THEN 275 IF (is .EQ. 1 .AND. (.NOT.nested))
THEN 280 IF (ie + 1 .EQ. npx .AND. (.NOT.nested))
THEN 313 IF (j .EQ. 1 .AND. (.NOT.nested))
THEN 315 ELSE IF ((j .EQ. 0 .OR. j .EQ. npy - 1) .AND. (.NOT.nested)) &
318 ELSE IF ((j .EQ. 2 .OR. j .EQ. npy + 1) .AND. (.NOT.nested)) &
321 ELSE IF (j .EQ. npy .AND. (.NOT.nested))
THEN 376 SUBROUTINE d2c_setup_bwd(u, u_ad, v, v_ad, ua, va, uc, uc_ad, vc, &
377 & vc_ad, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, &
378 & grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, &
379 & rsin_u, rsin_v, cosa_s, rsin2)
381 LOGICAL,
INTENT(IN) :: dord4
382 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed, is, ie, js, je, npx, npy&
384 REAL,
INTENT(IN) :: u(isd:ied, jsd:jed+1)
385 REAL :: u_ad(isd:ied, jsd:jed+1)
386 REAL,
INTENT(IN) :: v(isd:ied+1, jsd:jed)
387 REAL :: v_ad(isd:ied+1, jsd:jed)
388 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: ua
389 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: va
390 REAL,
DIMENSION(isd:ied+1, jsd:jed) :: uc
391 REAL,
DIMENSION(isd:ied+1, jsd:jed) :: uc_ad
392 REAL,
DIMENSION(isd:ied, jsd:jed+1) :: vc
393 REAL,
DIMENSION(isd:ied, jsd:jed+1) :: vc_ad
394 LOGICAL,
INTENT(IN) :: nested, se_corner, sw_corner, ne_corner, &
396 REAL,
INTENT(IN) :: rsin_u(isd:ied+1, jsd:jed)
397 REAL,
INTENT(IN) :: rsin_v(isd:ied, jsd:jed+1)
398 REAL,
INTENT(IN) :: cosa_s(isd:ied, jsd:jed)
399 REAL,
INTENT(IN) :: rsin2(isd:ied, jsd:jed)
400 REAL,
DIMENSION(isd:ied, jsd:jed) :: utmp, vtmp
401 REAL,
DIMENSION(isd:ied, jsd:jed) :: utmp_ad, vtmp_ad
402 REAL,
PARAMETER :: t11=27./28., t12=-(13./28.), t13=3./7., t14=6./7.&
404 REAL,
PARAMETER :: a1=0.5625
405 REAL,
PARAMETER :: a2=-0.0625
406 REAL,
PARAMETER :: c1=-(2./14.)
407 REAL,
PARAMETER :: c2=11./14.
408 REAL,
PARAMETER :: c3=5./14.
409 INTEGER :: npt, i, j, ifirst, ilast, id
459 IF (branch .EQ. 0)
THEN 475 IF (branch .LT. 2)
THEN 476 IF (branch .EQ. 0)
THEN 478 vtmp_ad(i, j-2) = vtmp_ad(i, j-2) + a2*vc_ad(i, j)
479 vtmp_ad(i, j+1) = vtmp_ad(i, j+1) + a2*vc_ad(i, j)
480 vtmp_ad(i, j-1) = vtmp_ad(i, j-1) + a1*vc_ad(i, j)
481 vtmp_ad(i, j) = vtmp_ad(i, j) + a1*vc_ad(i, j)
486 temp_ad2 = rsin_v(i, npy)*vc_ad(i, npy)
487 vtmp_ad(i, npy-1) = vtmp_ad(i, npy-1) + t14*temp_ad2
488 vtmp_ad(i, npy) = vtmp_ad(i, npy) + t14*temp_ad2
489 vtmp_ad(i, npy-2) = vtmp_ad(i, npy-2) + t12*temp_ad2
490 vtmp_ad(i, npy+1) = vtmp_ad(i, npy+1) + t12*temp_ad2
491 vtmp_ad(i, npy-3) = vtmp_ad(i, npy-3) + t15*temp_ad2
492 vtmp_ad(i, npy+2) = vtmp_ad(i, npy+2) + t15*temp_ad2
496 ELSE IF (branch .EQ. 2)
THEN 498 vtmp_ad(i, j+1) = vtmp_ad(i, j+1) + c1*vc_ad(i, j)
499 vtmp_ad(i, j) = vtmp_ad(i, j) + c2*vc_ad(i, j)
500 vtmp_ad(i, j-1) = vtmp_ad(i, j-1) + c3*vc_ad(i, j)
503 ELSE IF (branch .EQ. 3)
THEN 505 vtmp_ad(i, j-2) = vtmp_ad(i, j-2) + c1*vc_ad(i, j)
506 vtmp_ad(i, j-1) = vtmp_ad(i, j-1) + c2*vc_ad(i, j)
507 vtmp_ad(i, j) = vtmp_ad(i, j) + c3*vc_ad(i, j)
512 temp_ad1 = rsin_v(i, 1)*vc_ad(i, 1)
513 vtmp_ad(i, 0) = vtmp_ad(i, 0) + t14*temp_ad1
514 vtmp_ad(i, 1) = vtmp_ad(i, 1) + t14*temp_ad1
515 vtmp_ad(i, -1) = vtmp_ad(i, -1) + t12*temp_ad1
516 vtmp_ad(i, 2) = vtmp_ad(i, 2) + t12*temp_ad1
517 vtmp_ad(i, -2) = vtmp_ad(i, -2) + t15*temp_ad1
518 vtmp_ad(i, 3) = vtmp_ad(i, 3) + t15*temp_ad1
539 vtmp_ad(i, j-2) = vtmp_ad(i, j-2) + a2*vc_ad(i, j)
540 vtmp_ad(i, j+1) = vtmp_ad(i, j+1) + a2*vc_ad(i, j)
541 vtmp_ad(i, j-1) = vtmp_ad(i, j-1) + a1*vc_ad(i, j)
542 vtmp_ad(i, j) = vtmp_ad(i, j) + a1*vc_ad(i, j)
548 IF (branch .EQ. 0)
THEN 551 utmp_ad(ie-j, npy) = utmp_ad(ie-j, npy) - vtmp_ad(npx, npy+j)
552 vtmp_ad(npx, npy+j) = 0.0
558 IF (branch .EQ. 0)
THEN 560 utmp_ad(ie+j, 0) = utmp_ad(ie+j, 0) + vtmp_ad(npx, j)
561 vtmp_ad(npx, j) = 0.0
565 IF (branch .EQ. 0)
THEN 567 utmp_ad(j+1, npy) = utmp_ad(j+1, npy) + vtmp_ad(0, npy+j)
568 vtmp_ad(0, npy+j) = 0.0
572 IF (branch .EQ. 0)
THEN 574 utmp_ad(1-j, 0) = utmp_ad(1-j, 0) - vtmp_ad(0, j)
579 IF (branch .EQ. 0)
THEN 581 utmp_ad(npx, j) = utmp_ad(npx, j) + c3*uc_ad(npx+1, j)
582 utmp_ad(npx+1, j) = utmp_ad(npx+1, j) + c2*uc_ad(npx+1, j)
583 utmp_ad(npx+2, j) = utmp_ad(npx+2, j) + c1*uc_ad(npx+1, j)
584 uc_ad(npx+1, j) = 0.0
585 temp_ad0 = rsin_u(npx, j)*uc_ad(npx, j)
586 utmp_ad(npx-1, j) = utmp_ad(npx-1, j) + t14*temp_ad0
587 utmp_ad(npx, j) = utmp_ad(npx, j) + t14*temp_ad0
588 utmp_ad(npx-2, j) = utmp_ad(npx-2, j) + t12*temp_ad0
589 utmp_ad(npx+1, j) = utmp_ad(npx+1, j) + t12*temp_ad0
590 utmp_ad(npx-3, j) = utmp_ad(npx-3, j) + t15*temp_ad0
591 utmp_ad(npx+2, j) = utmp_ad(npx+2, j) + t15*temp_ad0
593 utmp_ad(npx-3, j) = utmp_ad(npx-3, j) + c1*uc_ad(npx-1, j)
594 utmp_ad(npx-2, j) = utmp_ad(npx-2, j) + c2*uc_ad(npx-1, j)
595 utmp_ad(npx-1, j) = utmp_ad(npx-1, j) + c3*uc_ad(npx-1, j)
596 uc_ad(npx-1, j) = 0.0
598 ELSE IF (branch .NE. 1)
THEN 602 IF (branch .EQ. 0)
THEN 604 utmp_ad(3, j) = utmp_ad(3, j) + c1*uc_ad(2, j)
605 utmp_ad(2, j) = utmp_ad(2, j) + c2*uc_ad(2, j)
606 utmp_ad(1, j) = utmp_ad(1, j) + c3*uc_ad(2, j)
608 temp_ad = rsin_u(1, j)*uc_ad(1, j)
609 utmp_ad(0, j) = utmp_ad(0, j) + t14*temp_ad
610 utmp_ad(1, j) = utmp_ad(1, j) + t14*temp_ad
611 utmp_ad(-1, j) = utmp_ad(-1, j) + t12*temp_ad
612 utmp_ad(2, j) = utmp_ad(2, j) + t12*temp_ad
613 utmp_ad(-2, j) = utmp_ad(-2, j) + t15*temp_ad
614 utmp_ad(3, j) = utmp_ad(3, j) + t15*temp_ad
616 utmp_ad(-2, j) = utmp_ad(-2, j) + c1*uc_ad(0, j)
617 utmp_ad(-1, j) = utmp_ad(-1, j) + c2*uc_ad(0, j)
618 utmp_ad(0, j) = utmp_ad(0, j) + c3*uc_ad(0, j)
622 100
DO j=je+1,js-1,-1
624 utmp_ad(i-1, j) = utmp_ad(i-1, j) + a1*uc_ad(i, j)
625 utmp_ad(i, j) = utmp_ad(i, j) + a1*uc_ad(i, j)
626 utmp_ad(i-2, j) = utmp_ad(i-2, j) + a2*uc_ad(i, j)
627 utmp_ad(i+1, j) = utmp_ad(i+1, j) + a2*uc_ad(i, j)
633 IF (branch .EQ. 0)
THEN 635 vtmp_ad(0, je+i) = vtmp_ad(0, je+i) + utmp_ad(i, npy)
636 utmp_ad(i, npy) = 0.0
640 IF (branch .EQ. 0)
THEN 642 vtmp_ad(npx, je-i) = vtmp_ad(npx, je-i) - utmp_ad(npx+i, npy)
643 utmp_ad(npx+i, npy) = 0.0
647 IF (branch .EQ. 0)
THEN 649 vtmp_ad(npx, i+1) = vtmp_ad(npx, i+1) + utmp_ad(npx+i, 0)
650 utmp_ad(npx+i, 0) = 0.0
654 IF (branch .EQ. 0)
THEN 656 vtmp_ad(0, 1-i) = vtmp_ad(0, 1-i) - utmp_ad(i, 0)
661 IF (branch .LT. 2)
THEN 662 IF (branch .EQ. 0)
THEN 664 v_ad(ied, j) = v_ad(ied, j) + 0.5*vtmp_ad(ied, j)
665 v_ad(ied+1, j) = v_ad(ied+1, j) + 0.5*vtmp_ad(ied, j)
666 vtmp_ad(ied, j) = 0.0
667 v_ad(isd, j) = v_ad(isd, j) + 0.5*vtmp_ad(isd, j)
668 v_ad(isd+1, j) = v_ad(isd+1, j) + 0.5*vtmp_ad(isd, j)
669 vtmp_ad(isd, j) = 0.0
671 v_ad(i-1, j) = v_ad(i-1, j) + a2*vtmp_ad(i, j)
672 v_ad(i+2, j) = v_ad(i+2, j) + a2*vtmp_ad(i, j)
673 v_ad(i, j) = v_ad(i, j) + a1*vtmp_ad(i, j)
674 v_ad(i+1, j) = v_ad(i+1, j) + a1*vtmp_ad(i, j)
679 u_ad(i, jed) = u_ad(i, jed) + 0.5*utmp_ad(i, jed)
680 u_ad(i, jed+1) = u_ad(i, jed+1) + 0.5*utmp_ad(i, jed)
681 utmp_ad(i, jed) = 0.0
682 u_ad(i, jsd) = u_ad(i, jsd) + 0.5*utmp_ad(i, jsd)
683 u_ad(i, jsd+1) = u_ad(i, jsd+1) + 0.5*utmp_ad(i, jsd)
684 utmp_ad(i, jsd) = 0.0
688 u_ad(i, j-1) = u_ad(i, j-1) + a2*utmp_ad(i, j)
689 u_ad(i, j+2) = u_ad(i, j+2) + a2*utmp_ad(i, j)
690 u_ad(i, j) = u_ad(i, j) + a1*utmp_ad(i, j)
691 u_ad(i, j+1) = u_ad(i, j+1) + a1*utmp_ad(i, j)
698 IF (branch .NE. 2)
THEN 700 DO i=ied,npx-npt+1,-1
701 v_ad(i, j) = v_ad(i, j) + 0.5*vtmp_ad(i, j)
702 v_ad(i+1, j) = v_ad(i+1, j) + 0.5*vtmp_ad(i, j)
704 u_ad(i, j) = u_ad(i, j) + 0.5*utmp_ad(i, j)
705 u_ad(i, j+1) = u_ad(i, j+1) + 0.5*utmp_ad(i, j)
711 IF (branch .EQ. 0)
THEN 714 v_ad(i, j) = v_ad(i, j) + 0.5*vtmp_ad(i, j)
715 v_ad(i+1, j) = v_ad(i+1, j) + 0.5*vtmp_ad(i, j)
717 u_ad(i, j) = u_ad(i, j) + 0.5*utmp_ad(i, j)
718 u_ad(i, j+1) = u_ad(i, j+1) + 0.5*utmp_ad(i, j)
724 IF (branch .EQ. 0)
THEN 725 DO j=jed,npy-npt+1,-1
727 v_ad(i, j) = v_ad(i, j) + 0.5*vtmp_ad(i, j)
728 v_ad(i+1, j) = v_ad(i+1, j) + 0.5*vtmp_ad(i, j)
730 u_ad(i, j) = u_ad(i, j) + 0.5*utmp_ad(i, j)
731 u_ad(i, j+1) = u_ad(i, j+1) + 0.5*utmp_ad(i, j)
737 IF (branch .EQ. 0)
THEN 740 v_ad(i, j) = v_ad(i, j) + 0.5*vtmp_ad(i, j)
741 v_ad(i+1, j) = v_ad(i+1, j) + 0.5*vtmp_ad(i, j)
743 u_ad(i, j) = u_ad(i, j) + 0.5*utmp_ad(i, j)
744 u_ad(i, j+1) = u_ad(i, j+1) + 0.5*utmp_ad(i, j)
753 DO i=ad_to0,ad_from0,-1
754 v_ad(i-1, j) = v_ad(i-1, j) + a2*vtmp_ad(i, j)
755 v_ad(i+2, j) = v_ad(i+2, j) + a2*vtmp_ad(i, j)
756 v_ad(i, j) = v_ad(i, j) + a1*vtmp_ad(i, j)
757 v_ad(i+1, j) = v_ad(i+1, j) + a1*vtmp_ad(i, j)
764 DO i=ad_to,ad_from,-1
765 u_ad(i, j-1) = u_ad(i, j-1) + a2*utmp_ad(i, j)
766 u_ad(i, j+2) = u_ad(i, j+2) + a2*utmp_ad(i, j)
767 u_ad(i, j) = u_ad(i, j) + a1*utmp_ad(i, j)
768 u_ad(i, j+1) = u_ad(i, j+1) + a1*utmp_ad(i, j)
774 SUBROUTINE d2c_setup(u, v, ua, va, uc, vc, dord4, isd, ied, jsd, jed, &
775 & is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, &
776 & ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
778 LOGICAL,
INTENT(IN) :: dord4
779 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed, is, ie, js, je, npx, npy&
781 REAL,
INTENT(IN) :: u(isd:ied, jsd:jed+1)
782 REAL,
INTENT(IN) :: v(isd:ied+1, jsd:jed)
783 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: ua
784 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: va
785 REAL,
DIMENSION(isd:ied+1, jsd:jed),
INTENT(OUT) :: uc
786 REAL,
DIMENSION(isd:ied, jsd:jed+1),
INTENT(OUT) :: vc
787 LOGICAL,
INTENT(IN) :: nested, se_corner, sw_corner, ne_corner, &
789 REAL,
INTENT(IN) :: rsin_u(isd:ied+1, jsd:jed)
790 REAL,
INTENT(IN) :: rsin_v(isd:ied, jsd:jed+1)
791 REAL,
INTENT(IN) :: cosa_s(isd:ied, jsd:jed)
792 REAL,
INTENT(IN) :: rsin2(isd:ied, jsd:jed)
794 REAL,
DIMENSION(isd:ied, jsd:jed) :: utmp, vtmp
795 REAL,
PARAMETER :: t11=27./28., t12=-(13./28.), t13=3./7., t14=6./7.&
797 REAL,
PARAMETER :: a1=0.5625
798 REAL,
PARAMETER :: a2=-0.0625
799 REAL,
PARAMETER :: c1=-(2./14.)
800 REAL,
PARAMETER :: c2=11./14.
801 REAL,
PARAMETER :: c3=5./14.
802 INTEGER :: npt, i, j, ifirst, ilast, id
822 IF (
grid_type .LT. 3 .AND. (.NOT.nested))
THEN 830 utmp(i, j) = a2*(u(i, j-1)+u(i, j+2)) + a1*(u(i, j)+u(i, j+1))
835 utmp(i, jsd) = 0.5*(u(i, jsd)+u(i, jsd+1))
837 utmp(i, jed) = 0.5*(u(i, jed)+u(i, jed+1))
841 vtmp(i, j) = a2*(v(i-1, j)+v(i+2, j)) + a1*(v(i, j)+v(i+1, j))
844 vtmp(isd, j) = 0.5*(v(isd, j)+v(isd+1, j))
846 vtmp(ied, j) = 0.5*(v(ied, j)+v(ied+1, j))
850 ua(i, j) = (utmp(i, j)-vtmp(i, j)*cosa_s(i, j))*rsin2(i, j)
851 va(i, j) = (vtmp(i, j)-utmp(i, j)*cosa_s(i, j))*rsin2(i, j)
860 IF (npt .LT. js - 1)
THEN 865 IF (npy - npt .GT. je + 1)
THEN 871 IF (npt .LT. isd)
THEN 876 IF (npx - npt .GT. ied)
THEN 882 utmp(i, j) = a2*(u(i, j-1)+u(i, j+2)) + a1*(u(i, j)+u(i, j+1))
885 IF (npt .LT. jsd)
THEN 890 IF (npy - npt .GT. jed)
THEN 896 IF (npt .LT. is - 1)
THEN 901 IF (npx - npt .GT. ie + 1)
THEN 907 vtmp(i, j) = a2*(v(i-1, j)+v(i+2, j)) + a1*(v(i, j)+v(i+1, j))
914 IF (js .EQ. 1 .OR. jsd .LT. npt)
THEN 917 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
918 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
922 IF (je + 1 .EQ. npy .OR. jed .GE. npy - npt)
THEN 925 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
926 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
930 IF (is .EQ. 1 .OR. isd .LT. npt)
THEN 931 IF (npt .LT. jsd)
THEN 936 IF (npy - npt .GT. jed)
THEN 943 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
944 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
948 IF (ie + 1 .EQ. npx .OR. ied .GE. npx - npt)
THEN 949 IF (npt .LT. jsd)
THEN 954 IF (npy - npt .GT. jed)
THEN 961 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
962 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
969 ua(i, j) = (utmp(i, j)-vtmp(i, j)*cosa_s(i, j))*rsin2(i, j)
970 va(i, j) = (vtmp(i, j)-utmp(i, j)*cosa_s(i, j))*rsin2(i, j)
981 utmp(i, 0) = -vtmp(0, 1-i)
986 utmp(npx+i, 0) = vtmp(npx, i+1)
991 utmp(npx+i, npy) = -vtmp(npx, je-i)
996 utmp(i, npy) = vtmp(0, je+i)
999 IF (
grid_type .LT. 3 .AND. (.NOT.nested))
THEN 1000 IF (3 .LT. is - 1)
THEN 1005 IF (npx - 2 .GT. ie + 2)
THEN 1019 uc(i, j) = a1*(utmp(i-1, j)+utmp(i, j)) + a2*(utmp(i-2, j)+utmp(&
1025 IF (is .EQ. 1 .AND. (.NOT.nested))
THEN 1027 uc(0, j) = c1*utmp(-2, j) + c2*utmp(-1, j) + c3*utmp(0, j)
1028 uc(1, j) = (t14*(utmp(0, j)+utmp(1, j))+t12*(utmp(-1, j)+utmp(&
1029 & 2, j))+t15*(utmp(-2, j)+utmp(3, j)))*rsin_u(1, j)
1030 uc(2, j) = c1*utmp(3, j) + c2*utmp(2, j) + c3*utmp(1, j)
1033 IF (ie + 1 .EQ. npx .AND. (.NOT.nested))
THEN 1035 uc(npx-1, j) = c1*utmp(npx-3, j) + c2*utmp(npx-2, j) + c3*utmp&
1037 uc(npx, j) = (t14*(utmp(npx-1, j)+utmp(npx, j))+t12*(utmp(npx-&
1038 & 2, j)+utmp(npx+1, j))+t15*(utmp(npx-3, j)+utmp(npx+2, j)))*&
1040 uc(npx+1, j) = c3*utmp(npx, j) + c2*utmp(npx+1, j) + c1*utmp(&
1050 vtmp(0, j) = -utmp(1-j, 0)
1055 vtmp(0, npy+j) = utmp(j+1, npy)
1060 vtmp(npx, j) = utmp(ie+j, 0)
1065 vtmp(npx, npy+j) = -utmp(ie-j, npy)
1070 IF (j .EQ. 1 .AND. (.NOT.nested))
THEN 1072 vc(i, 1) = (t14*(vtmp(i, 0)+vtmp(i, 1))+t12*(vtmp(i, -1)+&
1073 & vtmp(i, 2))+t15*(vtmp(i, -2)+vtmp(i, 3)))*rsin_v(i, 1)
1075 ELSE IF ((j .EQ. 0 .OR. j .EQ. npy - 1) .AND. (.NOT.nested)) &
1078 vc(i, j) = c1*vtmp(i, j-2) + c2*vtmp(i, j-1) + c3*vtmp(i, j)
1080 ELSE IF ((j .EQ. 2 .OR. j .EQ. npy + 1) .AND. (.NOT.nested)) &
1083 vc(i, j) = c1*vtmp(i, j+1) + c2*vtmp(i, j) + c3*vtmp(i, j-1)
1085 ELSE IF (j .EQ. npy .AND. (.NOT.nested))
THEN 1087 vc(i, npy) = (t14*(vtmp(i, npy-1)+vtmp(i, npy))+t12*(vtmp(i&
1088 & , npy-2)+vtmp(i, npy+1))+t15*(vtmp(i, npy-3)+vtmp(i, npy+2&
1089 & )))*rsin_v(i, npy)
1094 vc(i, j) = a2*(vtmp(i, j-2)+vtmp(i, j+1)) + a1*(vtmp(i, j-1)&
1103 vc(i, j) = a2*(vtmp(i, j-2)+vtmp(i, j+1)) + a1*(vtmp(i, j-1)+&
1109 SUBROUTINE d2a_setup(u, v, ua, va, dord4, isd, ied, jsd, jed, is, ie, &
1110 & js, je, npx, npy, grid_type, nested, cosa_s, rsin2)
1112 LOGICAL,
INTENT(IN) :: dord4
1113 INTEGER,
INTENT(IN) :: isd, ied, jsd, jed, is, ie, js, je, npx, npy&
1115 REAL,
INTENT(IN) :: u(isd:ied, jsd:jed+1)
1116 REAL,
INTENT(IN) :: v(isd:ied+1, jsd:jed)
1117 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: ua
1118 REAL,
DIMENSION(isd:ied, jsd:jed),
INTENT(OUT) :: va
1119 REAL,
INTENT(IN) :: cosa_s(isd:ied, jsd:jed)
1120 REAL,
INTENT(IN) :: rsin2(isd:ied, jsd:jed)
1121 LOGICAL,
INTENT(IN) :: nested
1123 REAL,
DIMENSION(isd:ied, jsd:jed) :: utmp, vtmp
1124 REAL,
PARAMETER :: t11=27./28., t12=-(13./28.), t13=3./7., t14=6./7.&
1126 REAL,
PARAMETER :: a1=0.5625
1127 REAL,
PARAMETER :: a2=-0.0625
1128 REAL,
PARAMETER :: c1=-(2./14.)
1129 REAL,
PARAMETER :: c2=11./14.
1130 REAL,
PARAMETER :: c3=5./14.
1131 INTEGER :: npt, i, j, ifirst, ilast, id
1151 IF (
grid_type .LT. 3 .AND. (.NOT.nested))
THEN 1159 utmp(i, j) = a2*(u(i, j-1)+u(i, j+2)) + a1*(u(i, j)+u(i, j+1))
1164 utmp(i, jsd) = 0.5*(u(i, jsd)+u(i, jsd+1))
1166 utmp(i, jed) = 0.5*(u(i, jed)+u(i, jed+1))
1170 vtmp(i, j) = a2*(v(i-1, j)+v(i+2, j)) + a1*(v(i, j)+v(i+1, j))
1173 vtmp(isd, j) = 0.5*(v(isd, j)+v(isd+1, j))
1175 vtmp(ied, j) = 0.5*(v(ied, j)+v(ied+1, j))
1178 IF (npt .LT. js - 1)
THEN 1183 IF (npy - npt .GT. je + 1)
THEN 1192 IF (npt .LT. isd)
THEN 1197 IF (npx - npt .GT. ied)
THEN 1203 utmp(i, j) = a2*(u(i, j-1)+u(i, j+2)) + a1*(u(i, j)+u(i, j+1))
1206 IF (npt .LT. jsd)
THEN 1211 IF (npy - npt .GT. jed)
THEN 1217 IF (npt .LT. is - 1)
THEN 1222 IF (npx - npt .GT. ie + 1)
THEN 1228 vtmp(i, j) = a2*(v(i-1, j)+v(i+2, j)) + a1*(v(i, j)+v(i+1, j))
1235 IF (js .EQ. 1 .OR. jsd .LT. npt)
THEN 1238 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
1239 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
1243 IF (je + 1 .EQ. npy .OR. jed .GE. npy - npt)
THEN 1246 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
1247 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
1251 IF (is .EQ. 1 .OR. isd .LT. npt)
THEN 1252 IF (npt .LT. jsd)
THEN 1257 IF (npy - npt .GT. jed)
THEN 1264 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
1265 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
1269 IF (ie + 1 .EQ. npx .OR. ied .GE. npx - npt)
THEN 1270 IF (npt .LT. jsd)
THEN 1275 IF (npy - npt .GT. jed)
THEN 1282 utmp(i, j) = 0.5*(u(i, j)+u(i, j+1))
1283 vtmp(i, j) = 0.5*(v(i, j)+v(i+1, j))
1289 DO j=js-1-id,je+1+id
1290 DO i=is-1-id,ie+1+id
1291 ua(i, j) = (utmp(i, j)-vtmp(i, j)*cosa_s(i, j))*rsin2(i, j)
1292 va(i, j) = (vtmp(i, j)-utmp(i, j)*cosa_s(i, j))*rsin2(i, j)
subroutine, public d2c_setup(u, v, ua, va, uc, vc, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
subroutine, public pushcontrol(ctype, field)
subroutine, public d2c_setup_fwd(u, v, ua, va, uc, vc, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
subroutine, public d2c_setup_bwd(u, u_ad, v, v_ad, ua, va, uc, uc_ad, vc, vc_ad, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, se_corner, sw_corner, ne_corner, nw_corner, rsin_u, rsin_v, cosa_s, rsin2)
subroutine, public popcontrol(ctype, field)
Derived type containing the data.
subroutine, public d2a_setup(u, v, ua, va, dord4, isd, ied, jsd, jed, is, ie, js, je, npx, npy, grid_type, nested, cosa_s, rsin2)