49 real(kind=kind_real),
intent(in ) :: usrf(geom%isc:geom%iec,geom%jsc:geom%jec)
50 real(kind=kind_real),
intent(in ) :: vsrf(geom%isc:geom%iec,geom%jsc:geom%jec)
51 real(kind=kind_real),
intent(in ) :: f10r(geom%isc:geom%iec,geom%jsc:geom%jec)
52 real(kind=kind_real),
intent(out) :: spd10m(geom%isc:geom%iec,geom%jsc:geom%jec)
53 real(kind=kind_real),
intent(out) :: dir10m(geom%isc:geom%iec,geom%jsc:geom%jec)
56 integer :: isc,iec,jsc,jec,i,j
58 real(kind=kind_real) :: windangle, windratio
59 real(kind=kind_real),
parameter :: windscale = 999999.0_kind_real
60 real(kind=kind_real),
parameter :: windlimit = 0.0001_kind_real
61 real(kind=kind_real),
parameter :: quadcof(4,2) = reshape((/ 0.0_kind_real, 1.0_kind_real, 1.0_kind_real, 2.0_kind_real, &
62 1.0_kind_real, -1.0_kind_real, 1.0_kind_real, -1.0_kind_real /), (/4, 2/))
72 spd10m(isc:iec,jsc:jec) = f10r(isc:iec,jsc:jec)*sqrt( usrf(isc:iec,jsc:jec)*usrf(isc:iec,jsc:jec) + &
73 vsrf(isc:iec,jsc:jec)*vsrf(isc:iec,jsc:jec) )
79 if (usrf(i,j)*f10r(i,j) >= 0.0_kind_real .and. vsrf(i,j)*f10r(i,j) >= 0.0_kind_real) iquad = 1
80 if (usrf(i,j)*f10r(i,j) >= 0.0_kind_real .and. vsrf(i,j)*f10r(i,j) < 0.0_kind_real) iquad = 2
81 if (usrf(i,j)*f10r(i,j) < 0.0_kind_real .and. vsrf(i,j)*f10r(i,j) >= 0.0_kind_real) iquad = 3
82 if (usrf(i,j)*f10r(i,j) < 0.0_kind_real .and. vsrf(i,j)*f10r(i,j) < 0.0_kind_real) iquad = 4
84 if (abs(vsrf(i,j)*f10r(i,j)) >= windlimit)
then 85 windratio = (usrf(i,j)*f10r(i,j)) / (vsrf(i,j)*f10r(i,j))
87 windratio = 0.0_kind_real
88 if (abs(usrf(i,j)*f10r(i,j)) > windlimit)
then 89 windratio = windscale * usrf(i,j)*f10r(i,j)
93 windangle = atan(abs(windratio))
95 dir10m(i,j) =
rad2deg*(quadcof(iquad,1) *
pi + windangle * quadcof(iquad, 2))
110 real(kind=kind_real),
intent(inout) :: u(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
111 real(kind=kind_real),
intent(inout) :: v(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
112 real(kind=kind_real),
intent(inout) :: vort(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
113 real(kind=kind_real),
intent(inout) :: divg(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
115 real(kind=kind_real),
intent(inout) :: ua(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
116 real(kind=kind_real),
intent(inout) :: va(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
117 real(kind=kind_real) :: uc(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
118 real(kind=kind_real) :: vc(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
119 real(kind=kind_real) :: ut(geom%isd:geom%ied+1,geom%jsd:geom%jed )
120 real(kind=kind_real) :: vt(geom%isd:geom%ied ,geom%jsd:geom%jed+1)
122 real(kind=kind_real) :: wbuffer(geom%jsc:geom%jec,geom%npz)
123 real(kind=kind_real) :: sbuffer(geom%isc:geom%iec,geom%npz)
124 real(kind=kind_real) :: ebuffer(geom%jsc:geom%jec,geom%npz)
125 real(kind=kind_real) :: nbuffer(geom%isc:geom%iec,geom%npz)
127 integer :: i,j,k,isc,iec,jsc,jec,npz
128 real(kind=kind_real) :: dt
153 call d_to_ac(geom,u,v,ua,va,uc,vc)
172 vort(i,j,k) = (va(i+1,j,k) - va(i-1,j,k))/(geom%dxc(i,j)+geom%dxc(i-1,j)) - (ua(i,j+1,k) - ua(i,j-1,k))/(geom%dyc(i,j)+geom%dyc(i,j-1))
194 divg(i,j,k) = (ua(i+1,j,k) - ua(i-1,j,k))/(geom%dxc(i,j)+geom%dxc(i-1,j)) + (va(i,j+1,k) - va(i,j-1,k))/(geom%dyc(i,j)+geom%dyc(i,j-1))
210 real(kind=kind_real),
intent(in) :: vort(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
211 real(kind=kind_real),
intent(in) :: divg(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
212 real(kind=kind_real),
intent(out) :: psi (geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
213 real(kind=kind_real),
intent(out) :: chi (geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
215 real(kind=kind_real) :: psinew(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
217 integer :: i,j,k,isc,iec,jsc,jec,npz
218 integer :: maxiter, iter, ierr
219 real(kind=kind_real) :: tolerance, converged, convergedg
245 real(kind=kind_real),
intent(inout) :: x(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
246 real(kind=kind_real),
intent(in ) :: b(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
248 integer :: i,j,k,isc,iec,jsc,jec,npz
249 integer :: maxiter, iter, ierr
250 real(kind=kind_real) :: tolerance, converged, convergedg
251 real(kind=kind_real) :: xnew(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
261 converged = 1.0_kind_real
262 tolerance = 10e-4_kind_real
267 do while (iter < maxiter .and. converged > tolerance)
271 xnew(isc:iec,jsc:jec,:) = x(isc:iec,jsc:jec,:)
279 xnew(i,j,k) = 0.25_kind_real*(xnew(i+1,j,k)+xnew(i,j+1,k)+xnew(i-1,j,k)+xnew(i,j-1,k)-geom%dxa(i,j)**2*b(i,j,k))
285 converged = maxval(abs((xnew-x)))
286 call mpi_allreduce(converged,convergedg,1,mpi_real8,mpi_max,mpi_comm_world,ierr)
306 real(kind=kind_real),
intent(inout) :: psi(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
307 real(kind=kind_real),
intent(inout) :: chi(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
308 real(kind=kind_real),
intent(out) :: ua(geom%isc:geom%iec,geom%jsc:geom%jec,1:geom%npz)
309 real(kind=kind_real),
intent(out) :: va(geom%isc:geom%iec,geom%jsc:geom%jec,1:geom%npz)
328 do j=geom%jsc,geom%jec
329 do i=geom%isc,geom%iec
331 ua(i,j,k) = (psi(i,j+1,k) - psi(i,j-1,k))/(geom%dyc(i,j) + geom%dyc(i,j+1)) + &
332 (chi(i+1,j,k) - chi(i-1,j,k))/(geom%dxc(i,j) + geom%dxc(i+1,j))
333 va(i,j,k) = -(psi(i+1,j,k) - psi(i-1,j,k))/(geom%dxc(i,j) + geom%dxc(i+1,j)) + &
334 (chi(i,j+1,k) - chi(i,j-1,k))/(geom%dyc(i,j) + geom%dyc(i,j+1))
350 real(kind=kind_real),
intent(inout) :: psi_ad(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
351 real(kind=kind_real),
intent(inout) :: chi_ad(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
352 real(kind=kind_real),
intent(inout) :: ua_ad(geom%isc:geom%iec,geom%jsc:geom%jec,1:geom%npz)
353 real(kind=kind_real),
intent(inout) :: va_ad(geom%isc:geom%iec,geom%jsc:geom%jec,1:geom%npz)
356 real(kind=kind_real) :: temp1
357 real(kind=kind_real) :: temp2
358 real(kind=kind_real) :: temp3
359 real(kind=kind_real) :: temp4
373 do j=geom%jec,geom%jsc,-1
374 do i=geom%iec,geom%isc,-1
376 temp1 = va_ad(i,j,k)/(geom%dyc(i,j)+geom%dyc(i,j+1))
377 temp2 = -(va_ad(i,j,k)/(geom%dxc(i,j)+geom%dxc(i+1,j)))
378 chi_ad(i,j+1,k) = chi_ad(i,j+1,k) + temp1
379 chi_ad(i,j-1,k) = chi_ad(i,j-1,k) - temp1
380 psi_ad(i+1,j,k) = psi_ad(i+1,j,k) + temp2
381 psi_ad(i-1,j,k) = psi_ad(i-1,j,k) - temp2
384 temp3 = ua_ad(i,j,k)/(geom%dyc(i,j)+geom%dyc(i,j+1))
385 temp4 = ua_ad(i,j,k)/(geom%dxc(i,j)+geom%dxc(i+1,j))
386 psi_ad(i,j+1,k) = psi_ad(i,j+1,k) + temp3
387 psi_ad(i,j-1,k) = psi_ad(i,j-1,k) - temp3
388 chi_ad(i+1,j,k) = chi_ad(i+1,j,k) + temp4
389 chi_ad(i-1,j,k) = chi_ad(i-1,j,k) - temp4
409 real(kind=kind_real),
intent(inout) :: psi(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
410 real(kind=kind_real),
intent(inout) :: chi(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
411 real(kind=kind_real),
intent(out) :: u(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
412 real(kind=kind_real),
intent(out) :: v(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
415 real(kind=kind_real) :: chib(geom%isd:geom%ied,geom%jsd:geom%jed,1:geom%npz)
434 call a2b_ord4(chi, chib, geom, geom%npx, geom%npy, geom%isc, geom%iec, geom%jsc, geom%jec, geom%halo)
437 do j=geom%jsc,geom%jec
438 do i=geom%isc,geom%iec
440 u(i,j,k) = (psi(i,j+1,k) - psi(i,j,k))/(geom%dyc(i,j)) + &
441 (chib(i+1,j,k) - chib(i,j,k))/(geom%dx (i,j))
442 v(i,j,k) = -(psi(i+1,j,k) - psi(i,j,k))/(geom%dxc(i,j)) + &
443 (chib(i,j+1,k) - chib(i,j,k))/(geom%dy (i,j))
456 subroutine d_to_ac(geom, u, v, ua, va, uc, vc)
466 real(kind=kind_real),
intent(inout) :: u(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
467 real(kind=kind_real),
intent(inout) :: v(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
468 real(kind=kind_real),
intent(inout) :: ua(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
469 real(kind=kind_real),
intent(inout) :: va(geom%isd:geom%ied ,geom%jsd:geom%jed ,1:geom%npz)
470 real(kind=kind_real),
optional,
intent(inout) :: uc(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
471 real(kind=kind_real),
optional,
intent(inout) :: vc(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
473 real(kind=kind_real) :: wbuffer(geom%jsc:geom%jec,geom%npz)
474 real(kind=kind_real) :: sbuffer(geom%isc:geom%iec,geom%npz)
475 real(kind=kind_real) :: ebuffer(geom%jsc:geom%jec,geom%npz)
476 real(kind=kind_real) :: nbuffer(geom%isc:geom%iec,geom%npz)
478 integer isc,iec,jsc,jec
479 integer isd,ied,jsd,jed
483 real(kind=kind_real) :: ut(geom%isd:geom%ied, geom%jsd:geom%jed)
484 real(kind=kind_real) :: vt(geom%isd:geom%ied, geom%jsd:geom%jed)
486 real(kind=kind_real) :: uctemp(geom%isd:geom%ied+1,geom%jsd:geom%jed ,1:geom%npz)
487 real(kind=kind_real) :: vctemp(geom%isd:geom%ied ,geom%jsd:geom%jed+1,1:geom%npz)
499 uctemp = 0.0_kind_real
500 vctemp = 0.0_kind_real
504 wbuffery=wbuffer, ebuffery=ebuffer, &
505 sbufferx=sbuffer, nbufferx=nbuffer, &
506 gridtype=dgrid_ne, complete=.true. )
509 u(i,jec+1,k) = nbuffer(i,k)
512 v(iec+1,j,k) = ebuffer(j,k)
522 ua(:,:,k), va(:,:,k), uctemp(:,:,k), vctemp(:,:,k), &
526 if (
present(uc)) uc = uctemp
527 if (
present(vc)) vc = vctemp
533 subroutine d2a2c_vect(geom, u, v, ua, va, uc, vc, ut, vt, dord4)
537 logical,
intent(in):: dord4
538 real(kind=kind_real),
intent(in) :: u(geom%isd:geom%ied ,geom%jsd:geom%jed+1)
539 real(kind=kind_real),
intent(in) :: v(geom%isd:geom%ied+1,geom%jsd:geom%jed)
540 real(kind=kind_real),
intent(out),
dimension(geom%isd:geom%ied+1,geom%jsd:geom%jed ):: uc
541 real(kind=kind_real),
intent(out),
dimension(geom%isd:geom%ied ,geom%jsd:geom%jed+1):: vc
542 real(kind=kind_real),
intent(out),
dimension(geom%isd:geom%ied ,geom%jsd:geom%jed ):: ua, va
543 real(kind=kind_real),
intent(out),
dimension(geom%isd:geom%ied ,geom%jsd:geom%jed ):: ut, vt
546 real(kind=kind_real),
dimension(geom%isd:geom%ied,geom%jsd:geom%jed):: utmp, vtmp
547 integer npt, i, j, ifirst, ilast, id
549 integer :: is, ie, js, je
550 integer :: isd, ied, jsd, jed
552 real(kind=kind_real),
pointer,
dimension(:,:,:) :: sin_sg
553 real(kind=kind_real),
pointer,
dimension(:,:) :: cosa_u, cosa_v, cosa_s
554 real(kind=kind_real),
pointer,
dimension(:,:) :: rsin_u, rsin_v, rsin2
555 real(kind=kind_real),
pointer,
dimension(:,:) :: dxa,dya
557 real(kind=kind_real),
parameter :: a1 = 0.5625
558 real(kind=kind_real),
parameter :: a2 = -0.0625
559 real(kind=kind_real),
parameter :: c1 = -2./14.
560 real(kind=kind_real),
parameter :: c2 = 11./14.
561 real(kind=kind_real),
parameter :: c3 = 5./14.
574 sin_sg => geom%sin_sg
575 cosa_u => geom%cosa_u
576 cosa_v => geom%cosa_v
577 cosa_s => geom%cosa_s
578 rsin_u => geom%rsin_u
579 rsin_v => geom%rsin_v
593 utmp(:,:) = 1.0e8_kind_real
594 vtmp(:,:) = 1.0e8_kind_real
599 do j=
max(npt,js-1),
min(npy-npt,je+1)
600 do i=
max(npt,isd),
min(npx-npt,ied)
601 utmp(i,j) = a2*(u(i,j-1)+u(i,j+2)) + a1*(u(i,j)+u(i,j+1))
604 do j=
max(npt,jsd),
min(npy-npt,jed)
605 do i=
max(npt,is-1),
min(npx-npt,ie+1)
606 vtmp(i,j) = a2*(v(i-1,j)+v(i+2,j)) + a1*(v(i,j)+v(i+1,j))
613 if ( js==1 .or. jsd<npt)
then 616 utmp(i,j) = 0.5*(u(i,j) + u(i,j+1))
617 vtmp(i,j) = 0.5*(v(i,j) + v(i+1,j))
621 if ( (je+1)==npy .or. jed>=(npy-npt))
then 624 utmp(i,j) = 0.5*(u(i,j) + u(i,j+1))
625 vtmp(i,j) = 0.5*(v(i,j) + v(i+1,j))
630 if ( is==1 .or. isd<npt )
then 631 do j=
max(npt,jsd),
min(npy-npt,jed)
633 utmp(i,j) = 0.5*(u(i,j) + u(i,j+1))
634 vtmp(i,j) = 0.5*(v(i,j) + v(i+1,j))
638 if ( (ie+1)==npx .or. ied>=(npx-npt))
then 639 do j=
max(npt,jsd),
min(npy-npt,jed)
641 utmp(i,j) = 0.5*(u(i,j) + u(i,j+1))
642 vtmp(i,j) = 0.5*(v(i,j) + v(i+1,j))
650 ua(i,j) = (utmp(i,j)-vtmp(i,j)*cosa_s(i,j)) * rsin2(i,j)
651 va(i,j) = (vtmp(i,j)-utmp(i,j)*cosa_s(i,j)) * rsin2(i,j)
660 if( geom%sw_corner )
then 662 utmp(i,0) = -vtmp(0,1-i)
665 if( geom%se_corner )
then 667 utmp(npx+i,0) = vtmp(npx,i+1)
670 if( geom%ne_corner )
then 672 utmp(npx+i,npy) = -vtmp(npx,je-i)
675 if( geom%nw_corner )
then 677 utmp(i,npy) = vtmp(0,je+i)
681 ifirst =
max(3, is-1)
682 ilast =
min(npx-2,ie+2)
689 uc(i,j) = a2*(utmp(i-2,j)+utmp(i+1,j)) + a1*(utmp(i-1,j)+utmp(i,j))
690 ut(i,j) = (uc(i,j) - v(i,j)*cosa_u(i,j))*rsin_u(i,j)
695 if( geom%sw_corner )
then 699 if( geom%se_corner )
then 700 ua(npx, 0) = va(npx,1)
701 ua(npx+1,0) = va(npx,2)
703 if( geom%ne_corner )
then 704 ua(npx, npy) = -va(npx,npy-1)
705 ua(npx+1,npy) = -va(npx,npy-2)
707 if( geom%nw_corner )
then 708 ua(-1,npy) = va(0,npy-2)
709 ua( 0,npy) = va(0,npy-1)
714 uc(0,j) = c1*utmp(-2,j) + c2*utmp(-1,j) + c3*utmp(0,j)
717 if (ut(1,j) > 0.)
then 718 uc(1,j) = ut(1,j)*sin_sg(0,j,3)
720 uc(1,j) = ut(1,j)*sin_sg(1,j,1)
722 uc(2,j) = c1*utmp(3,j) + c2*utmp(2,j) + c3*utmp(1,j)
723 ut(0,j) = (uc(0,j) - v(0,j)*cosa_u(0,j))*rsin_u(0,j)
724 ut(2,j) = (uc(2,j) - v(2,j)*cosa_u(2,j))*rsin_u(2,j)
728 if( (ie+1)==npx )
then 730 uc(npx-1,j) = c1*utmp(npx-3,j)+c2*utmp(npx-2,j)+c3*utmp(npx-1,j)
732 if (ut(npx,j) > 0.)
then 733 uc(npx,j) = ut(npx,j)*sin_sg(npx-1,j,3)
735 uc(npx,j) = ut(npx,j)*sin_sg(npx,j,1)
737 uc(npx+1,j) = c3*utmp(npx,j) + c2*utmp(npx+1,j) + c1*utmp(npx+2,j)
738 ut(npx-1,j) = (uc(npx-1,j)-v(npx-1,j)*cosa_u(npx-1,j))*rsin_u(npx-1,j)
739 ut(npx+1,j) = (uc(npx+1,j)-v(npx+1,j)*cosa_u(npx+1,j))*rsin_u(npx+1,j)
747 if( geom%sw_corner )
then 749 vtmp(0,j) = -utmp(1-j,0)
752 if( geom%nw_corner )
then 754 vtmp(0,npy+j) = utmp(j+1,npy)
757 if( geom%se_corner )
then 759 vtmp(npx,j) = utmp(ie+j,0)
762 if( geom%ne_corner )
then 764 vtmp(npx,npy+j) = -utmp(ie-j,npy)
767 if( geom%sw_corner )
then 771 if( geom%se_corner )
then 772 va(npx, 0) = ua(npx-1,0)
773 va(npx,-1) = ua(npx-2,0)
775 if( geom%ne_corner )
then 776 va(npx,npy ) = -ua(npx-1,npy)
777 va(npx,npy+1) = -ua(npx-2,npy)
779 if( geom%nw_corner )
then 780 va(0,npy) = ua(1,npy)
781 va(0,npy+1) = ua(2,npy)
789 if (vt(i,j) > 0.)
then 790 vc(i,j) = vt(i,j)*sin_sg(i,j-1,4)
792 vc(i,j) = vt(i,j)*sin_sg(i,j,2)
795 elseif ( j==0 .or. j==(npy-1))
then 797 vc(i,j) = c1*vtmp(i,j-2) + c2*vtmp(i,j-1) + c3*vtmp(i,j)
798 vt(i,j) = (vc(i,j) - u(i,j)*cosa_v(i,j))*rsin_v(i,j)
800 elseif ( j==2 .or. j==(npy+1))
then 802 vc(i,j) = c1*vtmp(i,j+1) + c2*vtmp(i,j) + c3*vtmp(i,j-1)
803 vt(i,j) = (vc(i,j) - u(i,j)*cosa_v(i,j))*rsin_v(i,j)
805 elseif ( j==npy )
then 808 if (vt(i,j) > 0.)
then 809 vc(i,j) = vt(i,j)*sin_sg(i,j-1,4)
811 vc(i,j) = vt(i,j)*sin_sg(i,j,2)
817 vc(i,j) = a2*(vtmp(i,j-2)+vtmp(i,j+1)) + a1*(vtmp(i,j-1)+vtmp(i,j))
818 vt(i,j) = (vc(i,j) - u(i,j)*cosa_v(i,j))*rsin_v(i,j)
831 real(kind=kind_real),
intent(in) :: ua(4)
832 real(kind=kind_real),
intent(in) :: dxa(4)
834 real(kind=kind_real) :: t1, t2
839 ((t2+dxa(3))*ua(3)-dxa(3)*ua(4)) / t2 )
853 real(kind=kind_real),
intent(in),
dimension(geom%isd:geom%ied, geom%jsd:geom%jed+1):: u
854 real(kind=kind_real),
intent(in),
dimension(geom%isd:geom%ied+1,geom%jsd:geom%jed ):: v
855 real(kind=kind_real),
intent(in),
dimension(geom%isd:geom%ied ,geom%jsd:geom%jed ):: ua
856 real(kind=kind_real),
intent(in),
dimension(geom%isd:geom%ied ,geom%jsd:geom%jed ):: va
857 real(kind=kind_real),
intent(out),
dimension(geom%isd:geom%ied+1,geom%jsd:geom%jed+1):: divg_d
860 integer :: is, ie, js, je
863 real(kind=kind_real) :: uf(geom%isc-2:geom%iec+2,geom%jsc-1:geom%jec+2)
864 real(kind=kind_real) :: vf(geom%isc-1:geom%iec+2,geom%jsc-2:geom%jec+2)
875 ie1 =
min(npx-1,ie+1)
879 if ( j==1 .or. j==npy )
then 881 uf(i,j) = u(i,j)*geom%dyc(i,j)*0.5*(geom%sin_sg(i,j-1,4)+geom%sin_sg(i,j,2))
885 uf(i,j) = (u(i,j)-0.25*(va(i,j-1)+va(i,j))*(geom%cos_sg(i,j-1,4)+geom%cos_sg(i,j,2))) &
886 * geom%dyc(i,j)*0.5*(geom%sin_sg(i,j-1,4)+geom%sin_sg(i,j,2))
894 vf(i,j) = (v(i,j) - 0.25*(ua(i-1,j)+ua(i,j))*(geom%cos_sg(i-1,j,3)+geom%cos_sg(i,j,1))) &
895 *geom%dxc(i,j)*0.5*(geom%sin_sg(i-1,j,3)+geom%sin_sg(i,j,1))
897 if ( is == 1 ) vf(1, j) = v(1, j)*geom%dxc(1, j)*0.5*(geom%sin_sg(0,j,3)+geom%sin_sg(1,j,1))
898 if ( (ie+1)==npx ) vf(npx,j) = v(npx,j)*geom%dxc(npx,j)*0.5*(geom%sin_sg(npx-1,j,3)+geom%sin_sg(npx,j,1))
904 divg_d(i,j) = (vf(i,j-1) - vf(i,j)) + (uf(i-1,j) - uf(i,j))
909 if (geom%sw_corner) divg_d(1, 1) = divg_d(1, 1) - vf(1, 0)
910 if (geom%se_corner) divg_d(npx, 1) = divg_d(npx, 1) - vf(npx, 0)
911 if (geom%ne_corner) divg_d(npx,npy) = divg_d(npx,npy) + vf(npx,npy)
912 if (geom%nw_corner) divg_d(1, npy) = divg_d(1, npy) + vf(1, npy)
917 divg_d(i,j) = geom%rarea_c(i,j)*divg_d(i,j)
925 subroutine a2b_ord4(qin, qout, geom, npx, npy, is, ie, js, je, ng)
929 integer,
intent(IN):: npx, npy, is, ie, js, je, ng
930 real(kind=kind_real),
intent(IN):: qin(is-ng:ie+ng,js-ng:je+ng)
931 real(kind=kind_real),
intent(OUT):: qout(is-ng:ie+ng,js-ng:je+ng)
934 real(kind=kind_real) qx(is:ie+1,js-ng:je+ng)
935 real(kind=kind_real) qy(is-ng:ie+ng,js:je+1)
936 real(kind=kind_real) qxx(is-ng:ie+ng,js-ng:je+ng)
937 real(kind=kind_real) qyy(is-ng:ie+ng,js-ng:je+ng)
938 real(kind=kind_real) g_in, g_ou
939 real(kind=kind_real):: p0(2)
940 real(kind=kind_real):: q1(is-1:ie+1), q2(js-1:je+1)
941 integer:: i, j, is1, js1, is2, js2, ie1, je1
943 real(kind=kind_real),
parameter :: c1 = 2./3.
944 real(kind=kind_real),
parameter :: c2 = -1./6.
945 real(kind=kind_real),
parameter :: r3 = 1./3.
946 real(kind=kind_real),
parameter :: a1 = 0.5625
947 real(kind=kind_real),
parameter :: a2 = -0.0625
948 real(kind=kind_real),
parameter :: b1 = 7./12.
949 real(kind=kind_real),
parameter :: b2 = -1./12.
956 ie1 =
min(npx-1,ie+1)
957 je1 =
min(npy-1,je+1)
962 if ( geom%sw_corner )
then 963 p0(1:2) = geom%grid(1,1,1:2)
964 qout(1,1) = (
extrap_corner(p0, geom%agrid(1,1,1:2), geom%agrid( 2, 2,1:2), qin(1,1), qin( 2, 2)) + &
965 extrap_corner(p0, geom%agrid(0,1,1:2), geom%agrid(-1, 2,1:2), qin(0,1), qin(-1, 2)) + &
966 extrap_corner(p0, geom%agrid(1,0,1:2), geom%agrid( 2,-1,1:2), qin(1,0), qin( 2,-1)))*r3
969 if ( geom%se_corner )
then 970 p0(1:2) = geom%grid(npx,1,1:2)
971 qout(npx,1) = (
extrap_corner(p0, geom%agrid(npx-1,1,1:2), geom%agrid(npx-2, 2,1:2), qin(npx-1,1), qin(npx-2, 2)) + &
972 extrap_corner(p0, geom%agrid(npx-1,0,1:2), geom%agrid(npx-2,-1,1:2), qin(npx-1,0), qin(npx-2,-1)) + &
973 extrap_corner(p0, geom%agrid(npx ,1,1:2), geom%agrid(npx+1, 2,1:2), qin(npx ,1), qin(npx+1, 2)))*r3
975 if ( geom%ne_corner )
then 976 p0(1:2) = geom%grid(npx,npy,1:2)
977 qout(npx,npy) = (
extrap_corner(p0, geom%agrid(npx-1,npy-1,1:2), geom%agrid(npx-2,npy-2,1:2), qin(npx-1,npy-1), qin(npx-2,npy-2)) + &
978 extrap_corner(p0, geom%agrid(npx ,npy-1,1:2), geom%agrid(npx+1,npy-2,1:2), qin(npx ,npy-1), qin(npx+1,npy-2)) + &
979 extrap_corner(p0, geom%agrid(npx-1,npy ,1:2), geom%agrid(npx-2,npy+1,1:2), qin(npx-1,npy ), qin(npx-2,npy+1)))*r3
981 if ( geom%nw_corner )
then 982 p0(1:2) = geom%grid(1,npy,1:2)
983 qout(1,npy) = (
extrap_corner(p0, geom%agrid(1,npy-1,1:2), geom%agrid( 2,npy-2,1:2), qin(1,npy-1), qin( 2,npy-2)) + &
984 extrap_corner(p0, geom%agrid(0,npy-1,1:2), geom%agrid(-1,npy-2,1:2), qin(0,npy-1), qin(-1,npy-2)) + &
985 extrap_corner(p0, geom%agrid(1,npy, 1:2), geom%agrid( 2,npy+1,1:2), qin(1,npy ), qin( 2,npy+1)))*r3
991 do j=
max(1,js-2),
min(npy-1,je+2)
992 do i=
max(3,is),
min(npx-2,ie+1)
993 qx(i,j) = b2*(qin(i-2,j)+qin(i+1,j)) + b1*(qin(i-1,j)+qin(i,j))
1000 q2(j) = (qin(0,j)*geom%dxa(1,j) + qin(1,j)*geom%dxa(0,j))/(geom%dxa(0,j) + geom%dxa(1,j))
1003 qout(1,j) = geom%edge_w(j)*q2(j-1) + (1.-geom%edge_w(j))*q2(j)
1006 do j=
max(1,js-2),
min(npy-1,je+2)
1007 g_in = geom%dxa(2,j) / geom%dxa(1,j)
1008 g_ou = geom%dxa(-1,j) / geom%dxa(0,j)
1009 qx(1,j) = 0.5*( ((2.+g_in)*qin(1,j)-qin( 2,j))/(1.+g_in) + &
1010 ((2.+g_ou)*qin(0,j)-qin(-1,j))/(1.+g_ou) )
1011 qx(2,j) = ( 3.*(g_in*qin(1,j)+qin(2,j))-(g_in*qx(1,j)+qx(3,j)) ) / (2.+2.*g_in)
1016 if ( (ie+1)==npx )
then 1018 q2(j) = (qin(npx-1,j)*geom%dxa(npx,j) + qin(npx,j)*geom%dxa(npx-1,j))/(geom%dxa(npx-1,j) + geom%dxa(npx,j))
1021 qout(npx,j) = geom%edge_e(j)*q2(j-1) + (1.-geom%edge_e(j))*q2(j)
1024 do j=
max(1,js-2),
min(npy-1,je+2)
1025 g_in = geom%dxa(npx-2,j) / geom%dxa(npx-1,j)
1026 g_ou = geom%dxa(npx+1,j) / geom%dxa(npx,j)
1027 qx(npx,j) = 0.5*( ((2.+g_in)*qin(npx-1,j)-qin(npx-2,j))/(1.+g_in) + &
1028 ((2.+g_ou)*qin(npx, j)-qin(npx+1,j))/(1.+g_ou) )
1029 qx(npx-1,j) = (3.*(qin(npx-2,j)+g_in*qin(npx-1,j)) - (g_in*qx(npx,j)+qx(npx-2,j)))/(2.+2.*g_in)
1037 do j=
max(3,js),
min(npy-2,je+1)
1038 do i=
max(1,is-2),
min(npx-1,ie+2)
1039 qy(i,j) = b2*(qin(i,j-2)+qin(i,j+1)) + b1*(qin(i,j-1) + qin(i,j))
1046 q1(i) = (qin(i,0)*geom%dya(i,1) + qin(i,1)*geom%dya(i,0))/(geom%dya(i,0) + geom%dya(i,1))
1049 qout(i,1) = geom%edge_s(i)*q1(i-1) + (1.-geom%edge_s(i))*q1(i)
1052 do i=
max(1,is-2),
min(npx-1,ie+2)
1053 g_in = geom%dya(i,2) / geom%dya(i,1)
1054 g_ou = geom%dya(i,-1) / geom%dya(i,0)
1055 qy(i,1) = 0.5*( ((2.+g_in)*qin(i,1)-qin(i,2))/(1.+g_in) + &
1056 ((2.+g_ou)*qin(i,0)-qin(i,-1))/(1.+g_ou) )
1057 qy(i,2) = (3.*(g_in*qin(i,1)+qin(i,2)) - (g_in*qy(i,1)+qy(i,3)))/(2.+2.*g_in)
1062 if ( (je+1)==npy )
then 1064 q1(i) = (qin(i,npy-1)*geom%dya(i,npy) + qin(i,npy)*geom%dya(i,npy-1))/(geom%dya(i,npy-1)+geom%dya(i,npy))
1067 qout(i,npy) = geom%edge_n(i)*q1(i-1) + (1.-geom%edge_n(i))*q1(i)
1070 do i=
max(1,is-2),
min(npx-1,ie+2)
1071 g_in = geom%dya(i,npy-2) / geom%dya(i,npy-1)
1072 g_ou = geom%dya(i,npy+1) / geom%dya(i,npy)
1073 qy(i,npy) = 0.5*( ((2.+g_in)*qin(i,npy-1)-qin(i,npy-2))/(1.+g_in) + &
1074 ((2.+g_ou)*qin(i,npy )-qin(i,npy+1))/(1.+g_ou) )
1075 qy(i,npy-1) = (3.*(qin(i,npy-2)+g_in*qin(i,npy-1)) - (g_in*qy(i,npy)+qy(i,npy-2)))/(2.+2.*g_in)
1081 do j=
max(3,js),
min(npy-2,je+1)
1082 do i=
max(2,is),
min(npx-1,ie+1)
1083 qxx(i,j) = a2*(qx(i,j-2)+qx(i,j+1)) + a1*(qx(i,j-1)+qx(i,j))
1088 do i=
max(2,is),
min(npx-1,ie+1)
1089 qxx(i,2) = c1*(qx(i,1)+qx(i,2))+c2*(qout(i,1)+qxx(i,3))
1092 if ( (je+1)==npy )
then 1093 do i=
max(2,is),
min(npx-1,ie+1)
1094 qxx(i,npy-1) = c1*(qx(i,npy-2)+qx(i,npy-1))+c2*(qout(i,npy)+qxx(i,npy-2))
1099 do j=
max(2,js),
min(npy-1,je+1)
1100 do i=
max(3,is),
min(npx-2,ie+1)
1101 qyy(i,j) = a2*(qy(i-2,j)+qy(i+1,j)) + a1*(qy(i-1,j)+qy(i,j))
1103 if ( is==1 ) qyy(2,j) = c1*(qy(1,j)+qy(2,j))+c2*(qout(1,j)+qyy(3,j))
1104 if((ie+1)==npx) qyy(npx-1,j) = c1*(qy(npx-2,j)+qy(npx-1,j))+c2*(qout(npx,j)+qyy(npx-2,j))
1106 do i=
max(2,is),
min(npx-1,ie+1)
1107 qout(i,j) = 0.5*(qxx(i,j) + qyy(i,j))
1115 real(kind=kind_real) function extrap_corner ( p0, p1, p2, q1, q2 )
1118 real(kind=kind_real),
intent(in ),
dimension(2) :: p0, p1, p2
1119 real(kind=kind_real),
intent(in ) :: q1, q2
1120 real(kind=kind_real) :: x1, x2
1134 real(kind=kind_real),
intent(IN) :: q1(2), q2(2)
1136 real (kind=kind_real):: p1(2), p2(2)
1144 great_circle_dist = asin( sqrt( sin((p1(2)-p2(2))/2.)**2 + cos(p1(2))*cos(p2(2))* &
1145 sin((p1(1)-p2(1))/2.)**2 ) ) * 2.
1158 REAL(kind=kind_real) :: psi(geom%isd:geom%ied, &
1159 & geom%jsd:geom%jed, geom%npz)
1160 REAL(kind=kind_real),
INTENT(INOUT) :: psi_ad(geom%isd:geom%&
1161 & ied, geom%jsd:geom%jed, geom%npz)
1163 REAL(kind=kind_real) :: chi(geom%isd:geom%ied, &
1164 & geom%jsd:geom%jed, geom%npz)
1165 REAL(kind=kind_real),
INTENT(INOUT) :: chi_ad(geom%isd:geom%&
1166 & ied, geom%jsd:geom%jed, geom%npz)
1168 REAL(kind=kind_real) :: u(geom%isd:geom%ied, geom%jsd:geom%&
1170 REAL(kind=kind_real) :: u_ad(geom%isd:geom%ied, geom%jsd:&
1171 & geom%jed+1, geom%npz)
1173 REAL(kind=kind_real) :: v(geom%isd:geom%ied+1, geom%jsd:&
1174 & geom%jed, geom%npz)
1175 REAL(kind=kind_real) :: v_ad(geom%isd:geom%ied+1, geom%jsd:&
1176 & geom%jed, geom%npz)
1178 REAL(kind=kind_real) :: chib(geom%isd:geom%ied, geom%jsd:&
1179 & geom%jed, geom%npz)
1180 REAL(kind=kind_real) :: chib_ad(geom%isd:geom%ied, geom%jsd&
1181 & :geom%jed, geom%npz)
1195 REAL(kind=kind_real) :: temp_ad
1196 REAL(kind=kind_real) :: temp_ad0
1197 REAL(kind=kind_real) :: temp_ad1
1198 REAL(kind=kind_real) :: temp_ad2
1207 DO j=geom%jec,geom%jsc,-1
1208 DO i=geom%iec,geom%isc,-1
1209 temp_ad = v_ad(i, j, k)/geom%dy(i, j)
1210 temp_ad0 = -(v_ad(i, j, k)/geom%dxc(i, j))
1211 chib_ad(i, j+1, k) = chib_ad(i, j+1, k) + temp_ad
1212 chib_ad(i, j, k) = chib_ad(i, j, k) - temp_ad
1213 psi_ad(i+1, j, k) = psi_ad(i+1, j, k) + temp_ad0
1214 psi_ad(i, j, k) = psi_ad(i, j, k) - temp_ad0
1215 v_ad(i, j, k) = 0.0_8
1216 temp_ad1 = u_ad(i, j, k)/geom%dyc(i, j)
1217 temp_ad2 = u_ad(i, j, k)/geom%dx(i, j)
1218 psi_ad(i, j+1, k) = psi_ad(i, j+1, k) + temp_ad1
1219 psi_ad(i, j, k) = psi_ad(i, j, k) - temp_ad1
1220 chib_ad(i+1, j, k) = chib_ad(i+1, j, k) + temp_ad2
1221 chib_ad(i, j, k) = chib_ad(i, j, k) - temp_ad2
1222 u_ad(i, j, k) = 0.0_8
1226 CALL a2b_ord4_adm(chi, chi_ad, chib, chib_ad, geom, geom%npx, geom%&
1227 & npy, geom%isc, geom%iec, geom%jsc, geom%jec&
1237 SUBROUTINE a2b_ord4_adm(qin, qin_ad, qout, qout_ad, geom, npx, npy, is&
1240 INTEGER,
INTENT(IN) :: npx, npy, is, ie, js, je, ng
1242 REAL(kind=kind_real),
INTENT(IN) :: qin(is-ng:ie+ng, js-ng:je+ng)
1243 REAL(kind=kind_real) :: qin_ad(is-ng:ie+ng, js-ng:je+ng)
1245 REAL(kind=kind_real) :: qout(is-ng:ie+ng, js-ng:je+ng)
1246 REAL(kind=kind_real) :: qout_ad(is-ng:ie+ng, js-ng:je+ng)
1248 REAL(kind=kind_real) :: qx(is:ie+1, js-ng:je+ng)
1249 REAL(kind=kind_real) :: qx_ad(is:ie+1, js-ng:je+ng)
1250 REAL(kind=kind_real) :: qy(is-ng:ie+ng, js:je+1)
1251 REAL(kind=kind_real) :: qy_ad(is-ng:ie+ng, js:je+1)
1252 REAL(kind=kind_real) :: qxx(is-ng:ie+ng, js-ng:je+ng)
1253 REAL(kind=kind_real) :: qxx_ad(is-ng:ie+ng, js-ng:je+ng)
1254 REAL(kind=kind_real) :: qyy(is-ng:ie+ng, js-ng:je+ng)
1255 REAL(kind=kind_real) :: qyy_ad(is-ng:ie+ng, js-ng:je+ng)
1256 REAL(kind=kind_real) :: g_in, g_ou
1257 REAL(kind=kind_real) :: p0(2)
1258 REAL(kind=kind_real) :: q1(is-1:ie+1), q2(js-1:je+1)
1259 REAL(kind=kind_real) :: q1_ad(is-1:ie+1), q2_ad(js-1:je+1)
1260 INTEGER :: i, j, is1, js1, is2, js2, ie1, je1
1261 REAL(kind=kind_real),
PARAMETER :: c1=2./3.
1262 REAL(kind=kind_real),
PARAMETER :: c2=-(1./6.)
1263 REAL(kind=kind_real),
PARAMETER :: r3=1./3.
1265 REAL(kind=kind_real),
PARAMETER :: a1=0.5625
1267 REAL(kind=kind_real),
PARAMETER :: a2=-0.0625
1269 REAL(kind=kind_real),
PARAMETER :: b1=7./12.
1270 REAL(kind=kind_real),
PARAMETER :: b2=-(1./12.)
1303 REAL(kind=kind_real) :: result1
1304 REAL(kind=kind_real) :: result1_ad
1305 REAL(kind=kind_real) :: result2
1306 REAL(kind=kind_real) :: result2_ad
1307 REAL(kind=kind_real) :: result3
1308 REAL(kind=kind_real) :: result3_ad
1309 REAL(kind=kind_real) :: temp_ad
1310 REAL(kind=kind_real) :: temp_ad0
1311 REAL(kind=kind_real) :: temp_ad1
1312 REAL(kind=kind_real) :: temp_ad2
1313 REAL(kind=kind_real) :: temp_ad3
1314 real(kind=kind_real) :: temp_ad4
1315 real(kind=kind_real) :: temp_ad5
1316 real(kind=kind_real) :: temp_ad6
1317 real(kind=kind_real) :: temp_ad7
1318 REAL(kind=kind_real) :: temp_ad8
1319 real(kind=kind_real) :: temp_ad9
1320 real(kind=kind_real) :: temp_ad10
1321 real(kind=kind_real) :: temp_ad11
1322 real(kind=kind_real) :: temp_ad12
1323 REAL(kind=kind_real) :: temp_ad13
1324 real(kind=kind_real) :: temp_ad14
1325 real(kind=kind_real) :: temp_ad15
1326 real(kind=kind_real) :: temp_ad16
1327 real(kind=kind_real) :: temp_ad17
1328 REAL(kind=kind_real) :: temp_ad18
1329 real(kind=kind_real) :: temp_ad19
1330 real(kind=kind_real) :: temp_ad20
1331 real(kind=kind_real) :: temp_ad21
1332 real(kind=kind_real) :: temp_ad22
1344 IF (1 .LT. is - 1)
THEN 1349 IF (1 .LT. js - 1)
THEN 1364 IF (npx - 1 .GT. ie + 1)
THEN 1369 IF (npy - 1 .GT. je + 1)
THEN 1376 IF (geom%sw_corner)
THEN 1381 IF (geom%se_corner)
THEN 1386 IF (geom%ne_corner)
THEN 1391 IF (geom%nw_corner)
THEN 1392 p0(1:2) = geom%grid(1, npy, 1:2)
1397 IF (1 .LT. js - 2)
THEN 1402 IF (npy - 1 .GT. je + 2)
THEN 1416 IF (npx - 2 .GT. ie + 1)
THEN 1428 IF (1 .LT. js - 2)
THEN 1433 IF (npy - 1 .GT. je + 2)
THEN 1443 IF (ie + 1 .EQ. npx)
THEN 1444 IF (1 .LT. js - 2)
THEN 1449 IF (npy - 1 .GT. je + 2)
THEN 1463 IF (npy - 2 .GT. je + 1)
THEN 1472 IF (1 .LT. is - 2)
THEN 1477 IF (npx - 1 .GT. ie + 2)
THEN 1489 IF (1 .LT. is - 2)
THEN 1494 IF (npx - 1 .GT. ie + 2)
THEN 1504 IF (je + 1 .EQ. npy)
THEN 1505 IF (1 .LT. is - 2)
THEN 1510 IF (npx - 1 .GT. ie + 2)
THEN 1524 IF (npy - 2 .GT. je + 1)
THEN 1536 IF (npx - 1 .GT. ie + 1)
THEN 1552 IF (npx - 1 .GT. ie + 1)
THEN 1561 IF (je + 1 .EQ. npy)
THEN 1567 IF (npx - 1 .GT. ie + 1)
THEN 1581 IF (npy - 1 .GT. je + 1)
THEN 1592 IF (npx - 2 .GT. ie + 1)
THEN 1606 IF (ie + 1 .EQ. npx)
THEN 1616 IF (npx - 1 .GT. ie + 1)
THEN 1632 DO i=ad_to3,ad_from3,-1
1633 qxx_ad(i, j) = qxx_ad(i, j) + 0.5*qout_ad(i, j)
1634 qyy_ad(i, j) = qyy_ad(i, j) + 0.5*qout_ad(i, j)
1635 qout_ad(i, j) = 0.0_8
1638 IF (branch .NE. 0)
THEN 1639 qy_ad(npx-2, j) = qy_ad(npx-2, j) + c1*qyy_ad(npx-1, j)
1640 qy_ad(npx-1, j) = qy_ad(npx-1, j) + c1*qyy_ad(npx-1, j)
1641 qout_ad(npx, j) = qout_ad(npx, j) + c2*qyy_ad(npx-1, j)
1642 qyy_ad(npx-2, j) = qyy_ad(npx-2, j) + c2*qyy_ad(npx-1, j)
1643 qyy_ad(npx-1, j) = 0.0_8
1646 IF (branch .EQ. 0)
THEN 1647 qy_ad(1, j) = qy_ad(1, j) + c1*qyy_ad(2, j)
1648 qy_ad(2, j) = qy_ad(2, j) + c1*qyy_ad(2, j)
1649 qout_ad(1, j) = qout_ad(1, j) + c2*qyy_ad(2, j)
1650 qyy_ad(3, j) = qyy_ad(3, j) + c2*qyy_ad(2, j)
1651 qyy_ad(2, j) = 0.0_8
1655 DO i=ad_to2,ad_from2,-1
1656 qy_ad(i-2, j) = qy_ad(i-2, j) + a2*qyy_ad(i, j)
1657 qy_ad(i+1, j) = qy_ad(i+1, j) + a2*qyy_ad(i, j)
1658 qy_ad(i-1, j) = qy_ad(i-1, j) + a1*qyy_ad(i, j)
1659 qy_ad(i, j) = qy_ad(i, j) + a1*qyy_ad(i, j)
1660 qyy_ad(i, j) = 0.0_8
1664 IF (branch .EQ. 0)
THEN 1669 qx_ad(i, npy-2) = qx_ad(i, npy-2) + c1*qxx_ad(i, npy-1)
1670 qx_ad(i, npy-1) = qx_ad(i, npy-1) + c1*qxx_ad(i, npy-1)
1671 qout_ad(i, npy) = qout_ad(i, npy) + c2*qxx_ad(i, npy-1)
1672 qxx_ad(i, npy-2) = qxx_ad(i, npy-2) + c2*qxx_ad(i, npy-1)
1673 qxx_ad(i, npy-1) = 0.0_8
1677 IF (branch .EQ. 0)
THEN 1679 qx_ad(i, 1) = qx_ad(i, 1) + c1*qxx_ad(i, 2)
1680 qx_ad(i, 2) = qx_ad(i, 2) + c1*qxx_ad(i, 2)
1681 qout_ad(i, 1) = qout_ad(i, 1) + c2*qxx_ad(i, 2)
1682 qxx_ad(i, 3) = qxx_ad(i, 3) + c2*qxx_ad(i, 2)
1683 qxx_ad(i, 2) = 0.0_8
1689 DO i=ad_to1,ad_from1,-1
1690 qx_ad(i, j-2) = qx_ad(i, j-2) + a2*qxx_ad(i, j)
1691 qx_ad(i, j+1) = qx_ad(i, j+1) + a2*qxx_ad(i, j)
1692 qx_ad(i, j-1) = qx_ad(i, j-1) + a1*qxx_ad(i, j)
1693 qx_ad(i, j) = qx_ad(i, j) + a1*qxx_ad(i, j)
1694 qxx_ad(i, j) = 0.0_8
1698 IF (branch .EQ. 0)
THEN 1702 g_in = geom%dya(i, npy-2)/geom%dya(i, npy-1)
1703 temp_ad19 = qy_ad(i, npy-1)/(g_in*2.+2.)
1704 qin_ad(i, npy-2) = qin_ad(i, npy-2) + 3.*temp_ad19
1705 qy_ad(i, npy) = qy_ad(i, npy) - g_in*temp_ad19
1706 qy_ad(i, npy-2) = qy_ad(i, npy-2) - temp_ad19
1707 qy_ad(i, npy-1) = 0.0_8
1708 g_ou = geom%dya(i, npy+1)/geom%dya(i, npy)
1709 temp_ad21 = 0.5*qy_ad(i, npy)
1710 temp_ad20 = temp_ad21/(g_in+1.)
1711 qin_ad(i, npy-1) = qin_ad(i, npy-1) + (g_in+2.)*temp_ad20 + 3.*&
1713 temp_ad22 = temp_ad21/(g_ou+1.)
1714 qin_ad(i, npy-2) = qin_ad(i, npy-2) - temp_ad20
1715 qin_ad(i, npy) = qin_ad(i, npy) + (g_ou+2.)*temp_ad22
1716 qin_ad(i, npy+1) = qin_ad(i, npy+1) - temp_ad22
1717 qy_ad(i, npy) = 0.0_8
1721 q1_ad(i-1) = q1_ad(i-1) + geom%edge_n(i)*qout_ad(i, npy)
1722 q1_ad(i) = q1_ad(i) + (1.-geom%edge_n(i))*qout_ad(i, npy)
1723 qout_ad(i, npy) = 0.0_8
1726 temp_ad18 = q1_ad(i)/(geom%dya(i, npy-1)+geom%dya(i, npy))
1727 qin_ad(i, npy-1) = qin_ad(i, npy-1) + geom%dya(i, npy)*temp_ad18
1728 qin_ad(i, npy) = qin_ad(i, npy) + geom%dya(i, npy-1)*temp_ad18
1733 IF (branch .EQ. 0)
THEN 1735 g_in = geom%dya(i, 2)/geom%dya(i, 1)
1736 temp_ad14 = qy_ad(i, 2)/(g_in*2.+2.)
1737 qin_ad(i, 1) = qin_ad(i, 1) + 3.*g_in*temp_ad14
1738 qin_ad(i, 2) = qin_ad(i, 2) + 3.*temp_ad14
1739 qy_ad(i, 1) = qy_ad(i, 1) - g_in*temp_ad14
1740 qy_ad(i, 3) = qy_ad(i, 3) - temp_ad14
1742 g_ou = geom%dya(i, -1)/geom%dya(i, 0)
1743 temp_ad15 = 0.5*qy_ad(i, 1)
1744 temp_ad16 = temp_ad15/(g_in+1.)
1745 temp_ad17 = temp_ad15/(g_ou+1.)
1746 qin_ad(i, 1) = qin_ad(i, 1) + (g_in+2.)*temp_ad16
1747 qin_ad(i, 2) = qin_ad(i, 2) - temp_ad16
1748 qin_ad(i, 0) = qin_ad(i, 0) + (g_ou+2.)*temp_ad17
1749 qin_ad(i, -1) = qin_ad(i, -1) - temp_ad17
1753 q1_ad(i-1) = q1_ad(i-1) + geom%edge_s(i)*qout_ad(i, 1)
1754 q1_ad(i) = q1_ad(i) + (1.-geom%edge_s(i))*qout_ad(i, 1)
1755 qout_ad(i, 1) = 0.0_8
1758 temp_ad13 = q1_ad(i)/(geom%dya(i, 0)+geom%dya(i, 1))
1759 qin_ad(i, 0) = qin_ad(i, 0) + geom%dya(i, 1)*temp_ad13
1760 qin_ad(i, 1) = qin_ad(i, 1) + geom%dya(i, 0)*temp_ad13
1767 DO i=ad_to0,ad_from0,-1
1768 qin_ad(i, j-2) = qin_ad(i, j-2) + b2*qy_ad(i, j)
1769 qin_ad(i, j+1) = qin_ad(i, j+1) + b2*qy_ad(i, j)
1770 qin_ad(i, j-1) = qin_ad(i, j-1) + b1*qy_ad(i, j)
1771 qin_ad(i, j) = qin_ad(i, j) + b1*qy_ad(i, j)
1776 IF (branch .EQ. 0)
THEN 1780 g_in = geom%dxa(npx-2, j)/geom%dxa(npx-1, j)
1781 temp_ad9 = qx_ad(npx-1, j)/(g_in*2.+2.)
1782 qin_ad(npx-2, j) = qin_ad(npx-2, j) + 3.*temp_ad9
1783 qx_ad(npx, j) = qx_ad(npx, j) - g_in*temp_ad9
1784 qx_ad(npx-2, j) = qx_ad(npx-2, j) - temp_ad9
1785 qx_ad(npx-1, j) = 0.0_8
1786 g_ou = geom%dxa(npx+1, j)/geom%dxa(npx, j)
1787 temp_ad11 = 0.5*qx_ad(npx, j)
1788 temp_ad10 = temp_ad11/(g_in+1.)
1789 qin_ad(npx-1, j) = qin_ad(npx-1, j) + (g_in+2.)*temp_ad10 + 3.*&
1791 temp_ad12 = temp_ad11/(g_ou+1.)
1792 qin_ad(npx-2, j) = qin_ad(npx-2, j) - temp_ad10
1793 qin_ad(npx, j) = qin_ad(npx, j) + (g_ou+2.)*temp_ad12
1794 qin_ad(npx+1, j) = qin_ad(npx+1, j) - temp_ad12
1795 qx_ad(npx, j) = 0.0_8
1799 q2_ad(j-1) = q2_ad(j-1) + geom%edge_e(j)*qout_ad(npx, j)
1800 q2_ad(j) = q2_ad(j) + (1.-geom%edge_e(j))*qout_ad(npx, j)
1801 qout_ad(npx, j) = 0.0_8
1804 temp_ad8 = q2_ad(j)/(geom%dxa(npx-1, j)+geom%dxa(npx, j))
1805 qin_ad(npx-1, j) = qin_ad(npx-1, j) + geom%dxa(npx, j)*temp_ad8
1806 qin_ad(npx, j) = qin_ad(npx, j) + geom%dxa(npx-1, j)*temp_ad8
1811 IF (branch .EQ. 0)
THEN 1813 g_in = geom%dxa(2, j)/geom%dxa(1, j)
1814 temp_ad4 = qx_ad(2, j)/(g_in*2.+2.)
1815 qin_ad(1, j) = qin_ad(1, j) + 3.*g_in*temp_ad4
1816 qin_ad(2, j) = qin_ad(2, j) + 3.*temp_ad4
1817 qx_ad(1, j) = qx_ad(1, j) - g_in*temp_ad4
1818 qx_ad(3, j) = qx_ad(3, j) - temp_ad4
1820 g_ou = geom%dxa(-1, j)/geom%dxa(0, j)
1821 temp_ad5 = 0.5*qx_ad(1, j)
1822 temp_ad6 = temp_ad5/(g_in+1.)
1823 temp_ad7 = temp_ad5/(g_ou+1.)
1824 qin_ad(1, j) = qin_ad(1, j) + (g_in+2.)*temp_ad6
1825 qin_ad(2, j) = qin_ad(2, j) - temp_ad6
1826 qin_ad(0, j) = qin_ad(0, j) + (g_ou+2.)*temp_ad7
1827 qin_ad(-1, j) = qin_ad(-1, j) - temp_ad7
1831 q2_ad(j-1) = q2_ad(j-1) + geom%edge_w(j)*qout_ad(1, j)
1832 q2_ad(j) = q2_ad(j) + (1.-geom%edge_w(j))*qout_ad(1, j)
1833 qout_ad(1, j) = 0.0_8
1836 temp_ad3 = q2_ad(j)/(geom%dxa(0, j)+geom%dxa(1, j))
1837 qin_ad(0, j) = qin_ad(0, j) + geom%dxa(1, j)*temp_ad3
1838 qin_ad(1, j) = qin_ad(1, j) + geom%dxa(0, j)*temp_ad3
1845 DO i=ad_to,ad_from,-1
1846 qin_ad(i-2, j) = qin_ad(i-2, j) + b2*qx_ad(i, j)
1847 qin_ad(i+1, j) = qin_ad(i+1, j) + b2*qx_ad(i, j)
1848 qin_ad(i-1, j) = qin_ad(i-1, j) + b1*qx_ad(i, j)
1849 qin_ad(i, j) = qin_ad(i, j) + b1*qx_ad(i, j)
1854 IF (branch .NE. 0)
THEN 1855 temp_ad2 = r3*qout_ad(1, npy)
1856 result1_ad = temp_ad2
1857 result2_ad = temp_ad2
1858 result3_ad = temp_ad2
1859 qout_ad(1, npy) = 0.0_8
1861 & npy+1, 1:2), qin(1, npy), qin_ad(1, npy), qin(2, &
1862 & npy+1), qin_ad(2, npy+1), result3_ad)
1864 & 1, npy-2, 1:2), qin(0, npy-1), qin_ad(0, npy-1), &
1865 & qin(-1, npy-2), qin_ad(-1, npy-2), result2_ad)
1867 & , npy-2, 1:2), qin(1, npy-1), qin_ad(1, npy-1), &
1868 & qin(2, npy-2), qin_ad(2, npy-2), result1_ad)
1871 IF (branch .EQ. 0)
THEN 1872 temp_ad1 = r3*qout_ad(npx, npy)
1873 result1_ad = temp_ad1
1874 result2_ad = temp_ad1
1875 result3_ad = temp_ad1
1876 qout_ad(npx, npy) = 0.0_8
1877 p0(1:2) = geom%grid(npx, npy, 1:2)
1879 & (npx-2, npy+1, 1:2), qin(npx-1, npy), qin_ad(npx-&
1880 & 1, npy), qin(npx-2, npy+1), qin_ad(npx-2, npy+1)&
1883 & (npx+1, npy-2, 1:2), qin(npx, npy-1), qin_ad(npx&
1884 & , npy-1), qin(npx+1, npy-2), qin_ad(npx+1, npy-2)&
1887 & agrid(npx-2, npy-2, 1:2), qin(npx-1, npy-1), &
1888 & qin_ad(npx-1, npy-1), qin(npx-2, npy-2), qin_ad(&
1889 & npx-2, npy-2), result1_ad)
1892 IF (branch .EQ. 0)
THEN 1893 temp_ad0 = r3*qout_ad(npx, 1)
1894 result1_ad = temp_ad0
1895 result2_ad = temp_ad0
1896 result3_ad = temp_ad0
1897 qout_ad(npx, 1) = 0.0_8
1898 p0(1:2) = geom%grid(npx, 1, 1:2)
1900 & +1, 2, 1:2), qin(npx, 1), qin_ad(npx, 1), qin(npx&
1901 & +1, 2), qin_ad(npx+1, 2), result3_ad)
1903 & npx-2, -1, 1:2), qin(npx-1, 0), qin_ad(npx-1, 0)&
1904 & , qin(npx-2, -1), qin_ad(npx-2, -1), result2_ad)
1906 & npx-2, 2, 1:2), qin(npx-1, 1), qin_ad(npx-1, 1), &
1907 & qin(npx-2, 2), qin_ad(npx-2, 2), result1_ad)
1910 IF (branch .EQ. 0)
THEN 1911 temp_ad = r3*qout_ad(1, 1)
1912 result1_ad = temp_ad
1913 result2_ad = temp_ad
1914 result3_ad = temp_ad
1915 p0(1:2) = geom%grid(1, 1, 1:2)
1917 & , 1:2), qin(1, 0), qin_ad(1, 0), qin(2, -1), &
1918 & qin_ad(2, -1), result3_ad)
1920 & , 1:2), qin(0, 1), qin_ad(0, 1), qin(-1, 2), &
1921 & qin_ad(-1, 2), result2_ad)
1923 & , 1:2), qin(1, 1), qin_ad(1, 1), qin(2, 2), &
1924 & qin_ad(2, 2), result1_ad)
1933 REAL(kind=kind_real),
DIMENSION(2),
INTENT(IN) :: p0, p1, p2
1934 REAL(kind=kind_real),
INTENT(IN) :: q1, q2
1935 REAL(kind=kind_real) :: q1_ad, q2_ad
1936 REAL(kind=kind_real) :: x1, x2
1937 REAL(kind=kind_real) :: temp_ad
1938 REAL(kind=kind_real) :: extrap_corner_ad
1942 temp_ad = x1*extrap_corner_ad/(x2-x1)
1943 q1_ad = q1_ad + temp_ad + extrap_corner_ad
1944 q2_ad = q2_ad - temp_ad
1949 subroutine a2d(geom, ua, va, ud, vd)
1956 real(kind=kind_real),
intent(in) :: ua(geom%isc:geom%iec,geom%jsc:geom%jec,geom%npz)
1957 real(kind=kind_real),
intent(in) :: va(geom%isc:geom%iec,geom%jsc:geom%jec,geom%npz)
1958 real(kind=kind_real),
intent(inout) :: ud(geom%isc:geom%iec ,geom%jsc:geom%jec+1,geom%npz)
1959 real(kind=kind_real),
intent(inout) :: vd(geom%isc:geom%iec+1,geom%jsc:geom%jec ,geom%npz)
1961 integer :: is ,ie , js ,je
1962 integer :: npx, npy, npz
1963 integer :: i,j,k, im2,jm2
1965 real(kind=kind_real) :: uatemp(geom%isd:geom%ied,geom%jsd:geom%jed,geom%npz)
1966 real(kind=kind_real) :: vatemp(geom%isd:geom%ied,geom%jsd:geom%jed,geom%npz)
1968 real(kind=kind_real) :: v3(geom%isc-1:geom%iec+1,geom%jsc-1:geom%jec+1,3)
1969 real(kind=kind_real) :: ue(geom%isc-1:geom%iec+1,geom%jsc :geom%jec+1,3)
1970 real(kind=kind_real) :: ve(geom%isc :geom%iec+1,geom%jsc-1:geom%jec+1,3)
1971 real(kind=kind_real),
dimension(geom%isc:geom%iec):: ut1, ut2, ut3
1972 real(kind=kind_real),
dimension(geom%jsc:geom%jec):: vt1, vt2, vt3
1988 uatemp(is:ie,js:je,:) = ua
1989 vatemp(is:ie,js:je,:) = va
1998 v3(i,j,1) = uatemp(i,j,k)*geom%vlon(i,j,1) + vatemp(i,j,k)*geom%vlat(i,j,1)
1999 v3(i,j,2) = uatemp(i,j,k)*geom%vlon(i,j,2) + vatemp(i,j,k)*geom%vlat(i,j,2)
2000 v3(i,j,3) = uatemp(i,j,k)*geom%vlon(i,j,3) + vatemp(i,j,k)*geom%vlat(i,j,3)
2006 ue(i,j,1) = v3(i,j-1,1) + v3(i,j,1)
2007 ue(i,j,2) = v3(i,j-1,2) + v3(i,j,2)
2008 ue(i,j,3) = v3(i,j-1,3) + v3(i,j,3)
2014 ve(i,j,1) = v3(i-1,j,1) + v3(i,j,1)
2015 ve(i,j,2) = v3(i-1,j,2) + v3(i,j,2)
2016 ve(i,j,3) = v3(i-1,j,3) + v3(i,j,3)
2024 vt1(j) = geom%edge_vect_w(j)*ve(i,j-1,1)+(1.-geom%edge_vect_w(j))*ve(i,j,1)
2025 vt2(j) = geom%edge_vect_w(j)*ve(i,j-1,2)+(1.-geom%edge_vect_w(j))*ve(i,j,2)
2026 vt3(j) = geom%edge_vect_w(j)*ve(i,j-1,3)+(1.-geom%edge_vect_w(j))*ve(i,j,3)
2028 vt1(j) = geom%edge_vect_w(j)*ve(i,j+1,1)+(1.-geom%edge_vect_w(j))*ve(i,j,1)
2029 vt2(j) = geom%edge_vect_w(j)*ve(i,j+1,2)+(1.-geom%edge_vect_w(j))*ve(i,j,2)
2030 vt3(j) = geom%edge_vect_w(j)*ve(i,j+1,3)+(1.-geom%edge_vect_w(j))*ve(i,j,3)
2040 if ( (ie+1)==npx )
then 2044 vt1(j) = geom%edge_vect_e(j)*ve(i,j-1,1)+(1.-geom%edge_vect_e(j))*ve(i,j,1)
2045 vt2(j) = geom%edge_vect_e(j)*ve(i,j-1,2)+(1.-geom%edge_vect_e(j))*ve(i,j,2)
2046 vt3(j) = geom%edge_vect_e(j)*ve(i,j-1,3)+(1.-geom%edge_vect_e(j))*ve(i,j,3)
2048 vt1(j) = geom%edge_vect_e(j)*ve(i,j+1,1)+(1.-geom%edge_vect_e(j))*ve(i,j,1)
2049 vt2(j) = geom%edge_vect_e(j)*ve(i,j+1,2)+(1.-geom%edge_vect_e(j))*ve(i,j,2)
2050 vt3(j) = geom%edge_vect_e(j)*ve(i,j+1,3)+(1.-geom%edge_vect_e(j))*ve(i,j,3)
2064 ut1(i) = geom%edge_vect_s(i)*ue(i-1,j,1)+(1.-geom%edge_vect_s(i))*ue(i,j,1)
2065 ut2(i) = geom%edge_vect_s(i)*ue(i-1,j,2)+(1.-geom%edge_vect_s(i))*ue(i,j,2)
2066 ut3(i) = geom%edge_vect_s(i)*ue(i-1,j,3)+(1.-geom%edge_vect_s(i))*ue(i,j,3)
2068 ut1(i) = geom%edge_vect_s(i)*ue(i+1,j,1)+(1.-geom%edge_vect_s(i))*ue(i,j,1)
2069 ut2(i) = geom%edge_vect_s(i)*ue(i+1,j,2)+(1.-geom%edge_vect_s(i))*ue(i,j,2)
2070 ut3(i) = geom%edge_vect_s(i)*ue(i+1,j,3)+(1.-geom%edge_vect_s(i))*ue(i,j,3)
2080 if ( (je+1)==npy )
then 2084 ut1(i) = geom%edge_vect_n(i)*ue(i-1,j,1)+(1.-geom%edge_vect_n(i))*ue(i,j,1)
2085 ut2(i) = geom%edge_vect_n(i)*ue(i-1,j,2)+(1.-geom%edge_vect_n(i))*ue(i,j,2)
2086 ut3(i) = geom%edge_vect_n(i)*ue(i-1,j,3)+(1.-geom%edge_vect_n(i))*ue(i,j,3)
2088 ut1(i) = geom%edge_vect_n(i)*ue(i+1,j,1)+(1.-geom%edge_vect_n(i))*ue(i,j,1)
2089 ut2(i) = geom%edge_vect_n(i)*ue(i+1,j,2)+(1.-geom%edge_vect_n(i))*ue(i,j,2)
2090 ut3(i) = geom%edge_vect_n(i)*ue(i+1,j,3)+(1.-geom%edge_vect_n(i))*ue(i,j,3)
2102 ud(i,j,k) = 0.5*( ue(i,j,1)*geom%es(1,i,j,1) + &
2103 ue(i,j,2)*geom%es(2,i,j,1) + &
2104 ue(i,j,3)*geom%es(3,i,j,1) )
2110 vd(i,j,k) = 0.5*( ve(i,j,1)*geom%ew(1,i,j,2) + &
2111 ve(i,j,2)*geom%ew(2,i,j,2) + &
2112 ve(i,j,3)*geom%ew(3,i,j,2) )
2122 subroutine a2d_ad(geom, ua_ad, va_ad, ud_ad, vd_ad)
2128 real(kind=kind_real),
intent(inout) :: ua_ad(geom%isc:geom%iec, geom%jsc:geom%jec, geom%npz)
2129 real(kind=kind_real),
intent(inout) :: va_ad(geom%isc:geom%iec, geom%jsc:geom%jec, geom%npz)
2130 real(kind=kind_real),
intent(inout) :: ud_ad(geom%isc:geom%iec , geom%jsc:geom%jec+1, geom%npz)
2131 real(kind=kind_real),
intent(inout) :: vd_ad(geom%isc:geom%iec+1, geom%jsc:geom%jec , geom%npz)
2133 integer :: is, ie, js, je
2134 integer :: npx, npy, npz
2135 integer :: i, j, k, im2, jm2
2137 real(kind=kind_real) :: uatemp(geom%isd:geom%ied, geom%jsd:geom%jed, geom%npz)
2138 real(kind=kind_real) :: vatemp(geom%isd:geom%ied, geom%jsd:geom%jed, geom%npz)
2140 real(kind=kind_real) :: uatemp_ad(geom%isd:geom%ied, geom%jsd:geom%jed, geom%npz)
2141 real(kind=kind_real) :: vatemp_ad(geom%isd:geom%ied, geom%jsd:geom%jed, geom%npz)
2142 real(kind=kind_real) :: v3_ad(geom%isc-1:geom%iec+1, geom%jsc-1:geom%jec+1, 3)
2143 real(kind=kind_real) :: ue_ad(geom%isc-1:geom%iec+1, geom%jsc:geom%jec+1, 3)
2144 real(kind=kind_real) :: ve_ad(geom%isc:geom%iec+1, geom%jsc-1:geom%jec+1, 3)
2145 real(kind=kind_real),
dimension(geom%isc:geom%iec) :: ut1_ad, ut2_ad, ut3_ad
2146 real(kind=kind_real),
dimension(geom%jsc:geom%jec) :: vt1_ad, vt2_ad, vt3_ad
2147 real(kind=kind_real) :: temp_ad
2148 real(kind=kind_real) :: temp_ad0
2160 uatemp(:, :, :) = 0.0
2161 vatemp(:, :, :) = 0.0
2179 temp_ad0 = 0.5*vd_ad(i, j, k)
2180 ve_ad(i, j, 1) = ve_ad(i, j, 1) + geom%ew(1, i, j, 2)*temp_ad0
2181 ve_ad(i, j, 2) = ve_ad(i, j, 2) + geom%ew(2, i, j, 2)*temp_ad0
2182 ve_ad(i, j, 3) = ve_ad(i, j, 3) + geom%ew(3, i, j, 2)*temp_ad0
2183 vd_ad(i, j, k) = 0.0_8
2189 temp_ad = 0.5*ud_ad(i, j, k)
2190 ue_ad(i, j, 1) = ue_ad(i, j, 1) + geom%es(1, i, j, 1)*temp_ad
2191 ue_ad(i, j, 2) = ue_ad(i, j, 2) + geom%es(2, i, j, 1)*temp_ad
2192 ue_ad(i, j, 3) = ue_ad(i, j, 3) + geom%es(3, i, j, 1)*temp_ad
2193 ud_ad(i, j, k) = 0.0_8
2197 if (je + 1 .eq. npy)
then 2199 ut3_ad(i) = ut3_ad(i) + ue_ad(i, npy, 3)
2200 ue_ad(i, npy, 3) = 0.0_8
2201 ut2_ad(i) = ut2_ad(i) + ue_ad(i, npy, 2)
2202 ue_ad(i, npy, 2) = 0.0_8
2203 ut1_ad(i) = ut1_ad(i) + ue_ad(i, npy, 1)
2204 ue_ad(i, npy, 1) = 0.0_8
2207 if (i .le. im2)
then 2208 ue_ad(i+1, npy, 3) = ue_ad(i+1, npy, 3) + geom%edge_vect_n(i)*ut3_ad(i)
2209 ue_ad(i, npy, 3) = ue_ad(i, npy, 3) + (1.-geom%edge_vect_n(i))*ut3_ad(i)
2211 ue_ad(i+1, npy, 2) = ue_ad(i+1, npy, 2) + geom%edge_vect_n(i)*ut2_ad(i)
2212 ue_ad(i, npy, 2) = ue_ad(i, npy, 2) + (1.-geom%edge_vect_n(i))*ut2_ad(i)
2214 ue_ad(i+1, npy, 1) = ue_ad(i+1, npy, 1) + geom%edge_vect_n(i)*ut1_ad(i)
2215 ue_ad(i, npy, 1) = ue_ad(i, npy, 1) + (1.-geom%edge_vect_n(i))*ut1_ad(i)
2218 ue_ad(i-1, npy, 3) = ue_ad(i-1, npy, 3) + geom%edge_vect_n(i)*ut3_ad(i)
2219 ue_ad(i, npy, 3) = ue_ad(i, npy, 3) + (1.-geom%edge_vect_n(i))*ut3_ad(i)
2221 ue_ad(i-1, npy, 2) = ue_ad(i-1, npy, 2) + geom%edge_vect_n(i)*ut2_ad(i)
2222 ue_ad(i, npy, 2) = ue_ad(i, npy, 2) + (1.-geom%edge_vect_n(i))*ut2_ad(i)
2224 ue_ad(i-1, npy, 1) = ue_ad(i-1, npy, 1) + geom%edge_vect_n(i)*ut1_ad(i)
2225 ue_ad(i, npy, 1) = ue_ad(i, npy, 1) + (1.-geom%edge_vect_n(i))*ut1_ad(i)
2233 ut3_ad(i) = ut3_ad(i) + ue_ad(i, 1, 3)
2234 ue_ad(i, 1, 3) = 0.0_8
2235 ut2_ad(i) = ut2_ad(i) + ue_ad(i, 1, 2)
2236 ue_ad(i, 1, 2) = 0.0_8
2237 ut1_ad(i) = ut1_ad(i) + ue_ad(i, 1, 1)
2238 ue_ad(i, 1, 1) = 0.0_8
2241 if (i .le. im2)
then 2242 ue_ad(i+1, 1, 3) = ue_ad(i+1, 1, 3) + geom%edge_vect_s(i)*ut3_ad(i)
2243 ue_ad(i, 1, 3) = ue_ad(i, 1, 3) + (1.-geom%edge_vect_s(i))*ut3_ad(i)
2245 ue_ad(i+1, 1, 2) = ue_ad(i+1, 1, 2) + geom%edge_vect_s(i)*ut2_ad(i)
2246 ue_ad(i, 1, 2) = ue_ad(i, 1, 2) + (1.-geom%edge_vect_s(i))*ut2_ad(i)
2248 ue_ad(i+1, 1, 1) = ue_ad(i+1, 1, 1) + geom%edge_vect_s(i)*ut1_ad(i)
2249 ue_ad(i, 1, 1) = ue_ad(i, 1, 1) + (1.-geom%edge_vect_s(i))*ut1_ad(i)
2252 ue_ad(i-1, 1, 3) = ue_ad(i-1, 1, 3) + geom%edge_vect_s(i)*ut3_ad(i)
2253 ue_ad(i, 1, 3) = ue_ad(i, 1, 3) + (1.-geom%edge_vect_s(i))*ut3_ad(i)
2255 ue_ad(i-1, 1, 2) = ue_ad(i-1, 1, 2) + geom%edge_vect_s(i)*ut2_ad(i)
2256 ue_ad(i, 1, 2) = ue_ad(i, 1, 2) + (1.-geom%edge_vect_s(i))*ut2_ad(i)
2258 ue_ad(i-1, 1, 1) = ue_ad(i-1, 1, 1) + geom%edge_vect_s(i)*ut1_ad(i)
2259 ue_ad(i, 1, 1) = ue_ad(i, 1, 1) + (1.-geom%edge_vect_s(i))*ut1_ad(i)
2265 if (ie + 1 .eq. npx)
then 2267 vt3_ad(j) = vt3_ad(j) + ve_ad(npx, j, 3)
2268 ve_ad(npx, j, 3) = 0.0_8
2269 vt2_ad(j) = vt2_ad(j) + ve_ad(npx, j, 2)
2270 ve_ad(npx, j, 2) = 0.0_8
2271 vt1_ad(j) = vt1_ad(j) + ve_ad(npx, j, 1)
2272 ve_ad(npx, j, 1) = 0.0_8
2275 if (j .le. jm2)
then 2276 ve_ad(npx, j+1, 3) = ve_ad(npx, j+1, 3) + geom%edge_vect_e(j)*vt3_ad(j)
2277 ve_ad(npx, j, 3) = ve_ad(npx, j, 3) + (1.-geom%edge_vect_e(j))*vt3_ad(j)
2279 ve_ad(npx, j+1, 2) = ve_ad(npx, j+1, 2) + geom%edge_vect_e(j)*vt2_ad(j)
2280 ve_ad(npx, j, 2) = ve_ad(npx, j, 2) + (1.-geom%edge_vect_e(j))*vt2_ad(j)
2282 ve_ad(npx, j+1, 1) = ve_ad(npx, j+1, 1) + geom%edge_vect_e(j)*vt1_ad(j)
2283 ve_ad(npx, j, 1) = ve_ad(npx, j, 1) + (1.-geom%edge_vect_e(j))*vt1_ad(j)
2286 ve_ad(npx, j-1, 3) = ve_ad(npx, j-1, 3) + geom%edge_vect_e(j)*vt3_ad(j)
2287 ve_ad(npx, j, 3) = ve_ad(npx, j, 3) + (1.-geom%edge_vect_e(j))*vt3_ad(j)
2289 ve_ad(npx, j-1, 2) = ve_ad(npx, j-1, 2) + geom%edge_vect_e(j)*vt2_ad(j)
2290 ve_ad(npx, j, 2) = ve_ad(npx, j, 2) + (1.-geom%edge_vect_e(j))*vt2_ad(j)
2292 ve_ad(npx, j-1, 1) = ve_ad(npx, j-1, 1) + geom%edge_vect_e(j)*vt1_ad(j)
2293 ve_ad(npx, j, 1) = ve_ad(npx, j, 1) + (1.-geom%edge_vect_e(j))*vt1_ad(j)
2301 vt3_ad(j) = vt3_ad(j) + ve_ad(1, j, 3)
2302 ve_ad(1, j, 3) = 0.0_8
2303 vt2_ad(j) = vt2_ad(j) + ve_ad(1, j, 2)
2304 ve_ad(1, j, 2) = 0.0_8
2305 vt1_ad(j) = vt1_ad(j) + ve_ad(1, j, 1)
2306 ve_ad(1, j, 1) = 0.0_8
2309 if (j .le. jm2)
then 2310 ve_ad(1, j+1, 3) = ve_ad(1, j+1, 3) + geom%edge_vect_w(j)*vt3_ad(j)
2311 ve_ad(1, j, 3) = ve_ad(1, j, 3) + (1.-geom%edge_vect_w(j))*vt3_ad(j)
2313 ve_ad(1, j+1, 2) = ve_ad(1, j+1, 2) + geom%edge_vect_w(j)*vt2_ad(j)
2314 ve_ad(1, j, 2) = ve_ad(1, j, 2) + (1.-geom%edge_vect_w(j))*vt2_ad(j)
2316 ve_ad(1, j+1, 1) = ve_ad(1, j+1, 1) + geom%edge_vect_w(j)*vt1_ad(j)
2317 ve_ad(1, j, 1) = ve_ad(1, j, 1) + (1.-geom%edge_vect_w(j))*vt1_ad(j)
2320 ve_ad(1, j-1, 3) = ve_ad(1, j-1, 3) + geom%edge_vect_w(j)*vt3_ad(j)
2321 ve_ad(1, j, 3) = ve_ad(1, j, 3) + (1.-geom%edge_vect_w(j))*vt3_ad(j)
2323 ve_ad(1, j-1, 2) = ve_ad(1, j-1, 2) + geom%edge_vect_w(j)*vt2_ad(j)
2324 ve_ad(1, j, 2) = ve_ad(1, j, 2) + (1.-geom%edge_vect_w(j))*vt2_ad(j)
2326 ve_ad(1, j-1, 1) = ve_ad(1, j-1, 1) + geom%edge_vect_w(j)*vt1_ad(j)
2327 ve_ad(1, j, 1) = ve_ad(1, j, 1) + (1.-geom%edge_vect_w(j))*vt1_ad(j)
2335 v3_ad(i-1, j, 3) = v3_ad(i-1, j, 3) + ve_ad(i, j, 3)
2336 v3_ad(i, j, 3) = v3_ad(i, j, 3) + ve_ad(i, j, 3)
2337 ve_ad(i, j, 3) = 0.0_8
2338 v3_ad(i-1, j, 2) = v3_ad(i-1, j, 2) + ve_ad(i, j, 2)
2339 v3_ad(i, j, 2) = v3_ad(i, j, 2) + ve_ad(i, j, 2)
2340 ve_ad(i, j, 2) = 0.0_8
2341 v3_ad(i-1, j, 1) = v3_ad(i-1, j, 1) + ve_ad(i, j, 1)
2342 v3_ad(i, j, 1) = v3_ad(i, j, 1) + ve_ad(i, j, 1)
2343 ve_ad(i, j, 1) = 0.0_8
2349 v3_ad(i, j-1, 3) = v3_ad(i, j-1, 3) + ue_ad(i, j, 3)
2350 v3_ad(i, j, 3) = v3_ad(i, j, 3) + ue_ad(i, j, 3)
2351 ue_ad(i, j, 3) = 0.0_8
2352 v3_ad(i, j-1, 2) = v3_ad(i, j-1, 2) + ue_ad(i, j, 2)
2353 v3_ad(i, j, 2) = v3_ad(i, j, 2) + ue_ad(i, j, 2)
2354 ue_ad(i, j, 2) = 0.0_8
2355 v3_ad(i, j-1, 1) = v3_ad(i, j-1, 1) + ue_ad(i, j, 1)
2356 v3_ad(i, j, 1) = v3_ad(i, j, 1) + ue_ad(i, j, 1)
2357 ue_ad(i, j, 1) = 0.0_8
2363 uatemp_ad(i, j, k) = uatemp_ad(i, j, k) + geom%vlon(i, j, 3)*v3_ad(i, j, 3)
2364 vatemp_ad(i, j, k) = vatemp_ad(i, j, k) + geom%vlat(i, j, 3)*v3_ad(i, j, 3)
2365 v3_ad(i, j, 3) = 0.0_8
2366 uatemp_ad(i, j, k) = uatemp_ad(i, j, k) + geom%vlon(i, j, 2)*v3_ad(i, j, 2)
2367 vatemp_ad(i, j, k) = vatemp_ad(i, j, k) + geom%vlat(i, j, 2)*v3_ad(i, j, 2)
2368 v3_ad(i, j, 2) = 0.0_8
2369 uatemp_ad(i, j, k) = uatemp_ad(i, j, k) + geom%vlon(i, j, 1)*v3_ad(i, j, 1)
2370 vatemp_ad(i, j, k) = vatemp_ad(i, j, k) + geom%vlat(i, j, 1)*v3_ad(i, j, 1)
2371 v3_ad(i, j, 1) = 0.0_8
2379 va_ad = va_ad + vatemp_ad(is:ie, js:je, :)
2380 ua_ad = ua_ad + uatemp_ad(is:ie, js:je, :)
2386 subroutine d2a(geom, u, v, ua, va)
2398 real(kind=kind_real),
intent(inout):: u(geom%isd:geom%ied ,geom%jsd:geom%jed+1,geom%npz)
2399 real(kind=kind_real),
intent(inout):: v(geom%isd:geom%ied+1,geom%jsd:geom%jed ,geom%npz)
2400 real(kind=kind_real),
intent(inout):: ua(geom%isd:geom%ied ,geom%jsd:geom%jed ,geom%npz)
2401 real(kind=kind_real),
intent(inout):: va(geom%isd:geom%ied ,geom%jsd:geom%jed ,geom%npz)
2405 real(kind=kind_real) :: c1 = 1.125
2406 real(kind=kind_real) :: c2 = -0.125
2407 real(kind=kind_real) :: utmp(geom%isc:geom%iec, geom%jsc:geom%jec+1)
2408 real(kind=kind_real) :: vtmp(geom%isc:geom%iec+1,geom%jsc:geom%jec)
2409 real(kind=kind_real) :: wu(geom%isc:geom%iec, geom%jsc:geom%jec+1)
2410 real(kind=kind_real) :: wv(geom%isc:geom%iec+1,geom%jsc:geom%jec)
2413 integer :: is, ie, js, je, npx, npy, npz
2430 do j=
max(2,js),
min(npy-2,je)
2431 do i=
max(2,is),
min(npx-2,ie)
2432 utmp(i,j) = c2*(u(i,j-1,k)+u(i,j+2,k)) + c1*(u(i,j,k)+u(i,j+1,k))
2433 vtmp(i,j) = c2*(v(i-1,j,k)+v(i+2,j,k)) + c1*(v(i,j,k)+v(i+1,j,k))
2439 wv(i,1) = v(i,1,k)*geom%dy(i,1)
2442 vtmp(i,1) = 2.*(wv(i,1) + wv(i+1,1)) / (geom%dy(i,1)+geom%dy(i+1,1))
2443 utmp(i,1) = 2.*(u(i,1,k)*geom%dx(i,1) + u(i,2,k)*geom%dx(i,2)) &
2444 / ( geom%dx(i,1) + geom%dx(i,2))
2448 if ( (je+1)==npy )
then 2451 wv(i,j) = v(i,j,k)*geom%dy(i,j)
2454 vtmp(i,j) = 2.*(wv(i,j) + wv(i+1,j)) / (geom%dy(i,j)+geom%dy(i+1,j))
2455 utmp(i,j) = 2.*(u(i,j,k)*geom%dx(i,j) + u(i,j+1,k)*geom%dx(i,j+1)) &
2456 / ( geom%dx(i,j) + geom%dx(i,j+1))
2463 wv(1,j) = v(1,j,k)*geom%dy(1,j)
2464 wv(2,j) = v(2,j,k)*geom%dy(2,j)
2467 wu(i,j) = u(i,j,k)*geom%dx(i,j)
2470 utmp(i,j) = 2.*(wu(i,j) + wu(i,j+1))/(geom%dx(i,j)+geom%dx(i,j+1))
2471 vtmp(i,j) = 2.*(wv(1,j) + wv(2,j ))/(geom%dy(1,j)+geom%dy(2,j))
2475 if ( (ie+1)==npx)
then 2478 wv(i, j) = v(i, j,k)*geom%dy(i, j)
2479 wv(i+1,j) = v(i+1,j,k)*geom%dy(i+1,j)
2482 wu(i,j) = u(i,j,k)*geom%dx(i,j)
2485 utmp(i,j) = 2.*(wu(i,j) + wu(i, j+1))/(geom%dx(i,j)+geom%dx(i,j+1))
2486 vtmp(i,j) = 2.*(wv(i,j) + wv(i+1,j ))/(geom%dy(i,j)+geom%dy(i+1,j))
2493 ua(i,j,k) = geom%a11(i,j)*utmp(i,j) + geom%a12(i,j)*vtmp(i,j)
2494 va(i,j,k) = geom%a21(i,j)*utmp(i,j) + geom%a22(i,j)*vtmp(i,j)
2504 SUBROUTINE d2a_ad(geom, u_ad, v_ad, ua_ad, va_ad)
2511 REAL(kind=kind_real) :: u(geom%isd:geom%ied, geom%jsd&
2512 & :geom%jed+1, geom%npz)
2513 REAL(kind=kind_real),
INTENT(INOUT) :: u_ad(geom%isd:geom%ied, geom%&
2514 & jsd:geom%jed+1, geom%npz)
2515 REAL(kind=kind_real) :: v(geom%isd:geom%ied+1, geom%&
2516 & jsd:geom%jed, geom%npz)
2517 REAL(kind=kind_real),
INTENT(INOUT) :: v_ad(geom%isd:geom%ied+1, &
2518 & geom%jsd:geom%jed, geom%npz)
2519 REAL(kind=kind_real) :: ua(geom%isd:geom%ied, geom%&
2520 & jsd:geom%jed, geom%npz)
2521 REAL(kind=kind_real),
INTENT(INOUT) :: ua_ad(geom%isd:geom%ied, geom&
2522 & %jsd:geom%jed, geom%npz)
2523 REAL(kind=kind_real) :: va(geom%isd:geom%ied, geom%&
2524 & jsd:geom%jed, geom%npz)
2525 REAL(kind=kind_real),
INTENT(INOUT) :: va_ad(geom%isd:geom%ied, geom&
2526 & %jsd:geom%jed, geom%npz)
2529 REAL(kind=kind_real),
SAVE :: c1=1.125
2530 REAL(kind=kind_real),
SAVE :: c2=-0.125
2531 REAL(kind=kind_real) :: utmp(geom%isc:geom%iec, geom%jsc:geom%jec+1)
2532 REAL(kind=kind_real) :: utmp_ad(geom%isc:geom%iec, geom%jsc:geom%jec&
2534 REAL(kind=kind_real) :: vtmp(geom%isc:geom%iec+1, geom%jsc:geom%jec)
2535 REAL(kind=kind_real) :: vtmp_ad(geom%isc:geom%iec+1, geom%jsc:geom%&
2537 REAL(kind=kind_real) :: wu(geom%isc:geom%iec, geom%jsc:geom%jec+1)
2538 REAL(kind=kind_real) :: wu_ad(geom%isc:geom%iec, geom%jsc:geom%jec+1&
2540 REAL(kind=kind_real) :: wv(geom%isc:geom%iec+1, geom%jsc:geom%jec)
2541 REAL(kind=kind_real) :: wv_ad(geom%isc:geom%iec+1, geom%jsc:geom%jec&
2544 INTEGER :: is, ie, js, je, npx, npy, npz
2551 REAL(kind=kind_real) :: temp_ad
2552 REAL(kind=kind_real) :: temp_ad0
2553 REAL(kind=kind_real) :: temp_ad1
2554 REAL(kind=kind_real) :: temp_ad2
2555 REAL(kind=kind_real) :: temp_ad3
2556 REAL(kind=kind_real) :: temp_ad4
2557 REAL(kind=kind_real) :: temp_ad5
2558 REAL(kind=kind_real) :: temp_ad6
2580 IF (npy - 2 .GT. je)
THEN 2592 IF (npx - 2 .GT. ie)
THEN 2611 IF (je + 1 .EQ. npy)
THEN 2626 IF (ie + 1 .EQ. npx)
THEN 2647 utmp_ad(i, j) = utmp_ad(i, j) + geom%a11(i, j)*ua_ad(i, j, k) &
2648 & + geom%a21(i, j)*va_ad(i, j, k)
2649 vtmp_ad(i, j) = vtmp_ad(i, j) + geom%a12(i, j)*ua_ad(i, j, k) &
2650 & + geom%a22(i, j)*va_ad(i, j, k)
2651 va_ad(i, j, k) = 0.0_8
2652 ua_ad(i, j, k) = 0.0_8
2658 IF (branch .NE. 0)
THEN 2660 temp_ad5 = 2.*vtmp_ad(i, j)/(geom%dy(i, j)+geom%dy(i+1, j))
2661 wv_ad(i, j) = wv_ad(i, j) + temp_ad5
2662 wv_ad(i+1, j) = wv_ad(i+1, j) + temp_ad5
2663 vtmp_ad(i, j) = 0.0_8
2664 temp_ad6 = 2.*utmp_ad(i, j)/(geom%dx(i, j)+geom%dx(i, j+1))
2665 wu_ad(i, j) = wu_ad(i, j) + temp_ad6
2666 wu_ad(i, j+1) = wu_ad(i, j+1) + temp_ad6
2667 utmp_ad(i, j) = 0.0_8
2670 u_ad(i, j, k) = u_ad(i, j, k) + geom%dx(i, j)*wu_ad(i, j)
2674 v_ad(i+1, j, k) = v_ad(i+1, j, k) + geom%dy(i+1, j)*wv_ad(i+1&
2676 wv_ad(i+1, j) = 0.0_8
2677 v_ad(i, j, k) = v_ad(i, j, k) + geom%dy(i, j)*wv_ad(i, j)
2684 IF (branch .EQ. 0)
THEN 2686 temp_ad3 = 2.*vtmp_ad(i, j)/(geom%dy(1, j)+geom%dy(2, j))
2687 wv_ad(1, j) = wv_ad(1, j) + temp_ad3
2688 wv_ad(2, j) = wv_ad(2, j) + temp_ad3
2689 vtmp_ad(i, j) = 0.0_8
2690 temp_ad4 = 2.*utmp_ad(i, j)/(geom%dx(i, j)+geom%dx(i, j+1))
2691 wu_ad(i, j) = wu_ad(i, j) + temp_ad4
2692 wu_ad(i, j+1) = wu_ad(i, j+1) + temp_ad4
2693 utmp_ad(i, j) = 0.0_8
2696 u_ad(i, j, k) = u_ad(i, j, k) + geom%dx(i, j)*wu_ad(i, j)
2700 v_ad(2, j, k) = v_ad(2, j, k) + geom%dy(2, j)*wv_ad(2, j)
2702 v_ad(1, j, k) = v_ad(1, j, k) + geom%dy(1, j)*wv_ad(1, j)
2709 IF (branch .EQ. 0)
THEN 2711 temp_ad1 = 2.*utmp_ad(i, j)/(geom%dx(i, j)+geom%dx(i, j+1))
2712 u_ad(i, j, k) = u_ad(i, j, k) + geom%dx(i, j)*temp_ad1
2713 u_ad(i, j+1, k) = u_ad(i, j+1, k) + geom%dx(i, j+1)*temp_ad1
2714 utmp_ad(i, j) = 0.0_8
2715 temp_ad2 = 2.*vtmp_ad(i, j)/(geom%dy(i, j)+geom%dy(i+1, j))
2716 wv_ad(i, j) = wv_ad(i, j) + temp_ad2
2717 wv_ad(i+1, j) = wv_ad(i+1, j) + temp_ad2
2718 vtmp_ad(i, j) = 0.0_8
2721 v_ad(i, j, k) = v_ad(i, j, k) + geom%dy(i, j)*wv_ad(i, j)
2727 IF (branch .EQ. 0)
THEN 2729 temp_ad = 2.*utmp_ad(i, 1)/(geom%dx(i, 1)+geom%dx(i, 2))
2730 u_ad(i, 1, k) = u_ad(i, 1, k) + geom%dx(i, 1)*temp_ad
2731 u_ad(i, 2, k) = u_ad(i, 2, k) + geom%dx(i, 2)*temp_ad
2732 utmp_ad(i, 1) = 0.0_8
2733 temp_ad0 = 2.*vtmp_ad(i, 1)/(geom%dy(i, 1)+geom%dy(i+1, 1))
2734 wv_ad(i, 1) = wv_ad(i, 1) + temp_ad0
2735 wv_ad(i+1, 1) = wv_ad(i+1, 1) + temp_ad0
2736 vtmp_ad(i, 1) = 0.0_8
2739 v_ad(i, 1, k) = v_ad(i, 1, k) + geom%dy(i, 1)*wv_ad(i, 1)
2746 DO j=ad_to0,ad_from0,-1
2749 DO i=ad_to,ad_from,-1
2750 v_ad(i-1, j, k) = v_ad(i-1, j, k) + c2*vtmp_ad(i, j)
2751 v_ad(i+2, j, k) = v_ad(i+2, j, k) + c2*vtmp_ad(i, j)
2752 v_ad(i, j, k) = v_ad(i, j, k) + c1*vtmp_ad(i, j)
2753 v_ad(i+1, j, k) = v_ad(i+1, j, k) + c1*vtmp_ad(i, j)
2754 vtmp_ad(i, j) = 0.0_8
2755 u_ad(i, j-1, k) = u_ad(i, j-1, k) + c2*utmp_ad(i, j)
2756 u_ad(i, j+2, k) = u_ad(i, j+2, k) + c2*utmp_ad(i, j)
2757 u_ad(i, j, k) = u_ad(i, j, k) + c1*utmp_ad(i, j)
2758 u_ad(i, j+1, k) = u_ad(i, j+1, k) + c1*utmp_ad(i, j)
2759 utmp_ad(i, j) = 0.0_8
subroutine, public extrap_corner_adm(p0, p1, p2, q1, q1_ad, q2, q2_ad, extrap_corner_ad)
subroutine popinteger4(x)
subroutine, public psichi_to_udvd_adm(geom, psi_ad, chi_ad, u_ad, v_ad)
subroutine, public psichi_to_uava_adm(geom, psi_ad, chi_ad, ua_ad, va_ad)
real(kind=kind_real), parameter, public rad2deg
subroutine, public vortdivg_to_psichi(geom, vort, divg, psi, chi)
real(kind=kind_real) function great_circle_dist(q1, q2)
subroutine, public a2b_ord4_adm(qin, qin_ad, qout, qout_ad, geom, npx, npy, is, ie, js, je, ng)
subroutine, public a2b_ord4(qin, qout, geom, npx, npy, is, ie, js, je, ng)
subroutine, public d2a(geom, u, v, ua, va)
subroutine pushcontrol1b(cc)
Fortran derived type to hold geometry data for the FV3JEDI model.
subroutine, public a2d_ad(geom, ua_ad, va_ad, ud_ad, vd_ad)
subroutine, public sfc_10m_winds(geom, usrf, vsrf, f10r, spd10m, dir10m)
subroutine, public uv_to_vortdivg(geom, u, v, ua, va, vort, divg)
real(kind=kind_real) function extrap_corner(p0, p1, p2, q1, q2)
subroutine, public a2d(geom, ua, va, ud, vd)
subroutine, public psichi_to_uava(geom, psi, chi, ua, va)
subroutine, public gauss_seidel(geom, x, b)
Variable transforms on wind variables for fv3-jedi Daniel Holdaway, NASA/JCSDA.
subroutine popcontrol1b(cc)
real(kind=kind_real) function edge_interpolate4(ua, dxa)
Fortran module handling geometry for the FV3 model.
subroutine, public d2a_ad(geom, u_ad, v_ad, ua_ad, va_ad)
subroutine, public d_to_ac(geom, u, v, ua, va, uc, vc)
integer, parameter, public kind_real
subroutine, public psichi_to_udvd(geom, psi, chi, u, v)
subroutine, public d2a2c_vect(geom, u, v, ua, va, uc, vc, ut, vt, dord4)
subroutine, public divergence_corner(geom, u, v, ua, va, divg_d)
subroutine pushinteger4(x)
real(fp), parameter, public pi