CMIC$ DO ALL
      DO 1000 j = 0,nlat
CMIC$    DO ALL
         DO 1010 i = 0,nlon
            t36(i,j) = 0.25*f(i,j)*(hxt(i,j)*hyt(i,j)+hxt(i,j+1)*hyt(i,
     .  j+1)+hxt(i+1,j)*hyt(i+1,j)+hxt(i+1,j+1)*hyt(i+1,j+1))
1010     CONTINUE
1000  CONTINUE
CMIC$ DO ALL
      DO 1020 k = 1,nlev
CMIC$    DO ALL
         DO 1030 j = 1,nlat+1
CMIC$       DO ALL
            DO 1040 i = 1,nlon+1
               e(i,j,k) = 0.25*((PVZ(i,j,k)**2*hxv(i,j)+PVZ(i,j-1,k)**2
     .  *hxv(i,j-1))/hxt(i,j)+(PUZ(i,j,k)**2*hyu(i,j)+PUZ(i-1,j,k)**2*h
     .  yu(i-1,j))/hyt(i,j))
1040        CONTINUE
1030     CONTINUE
1020  CONTINUE
CMIC$ DO ALL
      DO 1050 k = 1,nlev+1
CMIC$    DO ALL
         DO 1060 j = 0,nlat+2
CMIC$       DO ALL
            DO 1070 i = 0,nlon+2
               p(i,j,k) = AHYB(k)+BHYB(k)*PS(i,j)
1070        CONTINUE
1060     CONTINUE
1050  CONTINUE
CMIC$ DO ALL
      DO 1080 k = 2,nlev+1
CMIC$    DO ALL
         DO 1090 j = 0,nlat+1
CMIC$       DO ALL
            DO 1100 i = 0,nlon+1
               t13(i,j,k) = LOG(p(i,j,k))*p(i,j,k)
1100        CONTINUE
1090     CONTINUE
1080  CONTINUE
CMIC$ DO ALL
      DO 1110 k = 1,nlev
CMIC$    DO ALL
         DO 1120 j = 0,nlat+1
CMIC$       DO ALL
            DO 1130 i = 0,nlon+1
               IF (k.LE.1) THEN
                  lnp(i,j,k) = t13(i,j,2)/(p(i,j,k+1)-p(i,j,k))
               ELSE
                  lnp(i,j,k) = (t13(i,j,k+1)-t13(i,j,k))/(p(i,j,k+1)-p(
     .  i,j,k))
               ENDIF
1130        CONTINUE
1120     CONTINUE
1110  CONTINUE
CMIC$ DO ALL
      DO 1140 k = 2,nlev
CMIC$    DO ALL
         DO 1150 j = 1,nlat+1
CMIC$       DO ALL
            DO 1160 i = 1,nlon+1
               t18(i,j,k) = LOG(p(i,j,k)/p(i,j,k+1))
1160        CONTINUE
1150     CONTINUE
1140  CONTINUE
CMIC$ DO ALL
      DO 1170 j = 1,nlat+1
CMIC$    DO ALL
         DO 1180 i = 1,nlon+1
            t20(i,j,nlev) = 0
1180     CONTINUE
1170  CONTINUE
      DO 1190 k = nlev,2,-1
CMIC$    DO ALL
         DO 1200 j = 1,nlat+1
CMIC$       DO ALL
            DO 1210 i = 1,nlon+1
               t20(i,j,k-1) = t20(i,j,k)+PTZ(i,j,k)*t18(i,j,k)*(0.60782
     .  4693422519*PQZ(i,j,k)+1)
1210        CONTINUE
1200     CONTINUE
1190  CONTINUE
CMIC$ DO ALL
      DO 1220 k = 2,nlev
CMIC$    DO ALL
         DO 1230 j = 1,nlat+1
CMIC$       DO ALL
            DO 1240 i = 1,nlon+1
               t26(i,j,k) = p(i,j,k)*t18(i,j,k)/(p(i,j,k+1)-p(i,j,k))+1
1240        CONTINUE
1230     CONTINUE
1220  CONTINUE
CMIC$ DO ALL
      DO 1250 k = 1,nlev
CMIC$    DO ALL
         DO 1260 j = 1,nlat+1
CMIC$       DO ALL
            DO 1270 i = 1,nlon+1
               IF (k.LE.1) THEN
                  phi(i,j,k) = phis(i,j)+198.960966707927*PTZ(i,j,k)*(0
     .  .607824693422519*PQZ(i,j,1)+1)-287.04*t20(i,j,1)
               ELSE
                  phi(i,j,k) = phis(i,j)-287.04*(t20(i,j,k)-PTZ(i,j,k)*
     .  t26(i,j,k)*(0.607824693422519*PQZ(i,j,k)+1))
               ENDIF
1270        CONTINUE
1260     CONTINUE
1250  CONTINUE
CMIC$ DO ALL
      DO 1280 k = 1,nlev
CMIC$    DO ALL
         DO 1290 j = 0,nlat+1
CMIC$       DO ALL
            DO 1300 i = 0,nlon+1
               t31(i,j,k) = hxt(i,j)*hyt(i,j)*(p(i,j,k+1)-p(i,j,k))
1300        CONTINUE
1290     CONTINUE
1280  CONTINUE
CMIC$ DO ALL
      DO 1310 k = 1,nlev
CMIC$    DO ALL
         DO 1320 j = 0,nlat
CMIC$       DO ALL
            DO 1330 i = 0,nlon
               z(i,j,k) = 4*((t36(i,j)-1.56961230576048E-7*(rdlam*(hyv(
     .  i,j)*PVZ(i,j,k)-hyv(i+1,j)*PVZ(i+1,j,k))-rdth*(hxu(i,j)*PUZ(i,j
     .  ,k)-hxu(i,j+1)*PUZ(i,j+1,k))))/(t31(i,j,k)+t31(i,j+1,k)+t31(i+1
     .  ,j,k)+t31(i+1,j+1,k)))
1330        CONTINUE
1320     CONTINUE
1310  CONTINUE
CMIC$ DO ALL
      DO 1340 k = 1,nlev
CMIC$    DO ALL
         DO 1350 j = 1,nlat+1
CMIC$       DO ALL
            DO 1360 i = 0,nlon+1
               t47(i,j,k) = p(i,j,k)+p(i+1,j,k)-p(i,j,k+1)-p(i+1,j,k+1)
1360        CONTINUE
1350     CONTINUE
1340  CONTINUE
CMIC$ DO ALL
      DO 1370 k = 1,nlev
CMIC$    DO ALL
         DO 1380 j = 1,nlat
CMIC$       DO ALL
            DO 1390 i = 1,nlon+1
               t102(i,j,k) = -0.5*hyu(i-1,j)*t47(i-1,j,k)*PUZ(i-1,j,k)*
     .  (lnp(i,j,k)-lnp(i-1,j,k))
1390        CONTINUE
1380     CONTINUE
1370  CONTINUE
CMIC$ DO ALL
      DO 1400 k = 1,nlev
CMIC$    DO ALL
         DO 1410 j = 1,nlat
CMIC$       DO ALL
            DO 1420 i = 1,nlon+1
               t103(i,j,k) = t102(i,j,k)*(PTZ(i,j,k)*PQZ(i,j,k)+PTZ(i-1
     .  ,j,k)*PQZ(i-1,j,k))
1420        CONTINUE
1410     CONTINUE
1400  CONTINUE
CMIC$ DO ALL
      DO 1430 k = 1,nlev
CMIC$    DO ALL
         DO 1440 j = 1,nlat
CMIC$       DO ALL
            DO 1450 i = 1,nlon+1
               t116(i,j,k) = -0.5*hyu(i-1,j)*t47(i-1,j,k)*PUZ(i-1,j,k)*
     .  (PTZ(i,j,k)-PTZ(i-1,j,k))
1450        CONTINUE
1440     CONTINUE
1430  CONTINUE
CMIC$ DO ALL
      DO 1460 k = 1,nlev
CMIC$    DO ALL
         DO 1470 j = 1,nlat
CMIC$       DO ALL
            DO 1480 i = 1,nlon+1
               t151(i,j,k) = -0.5*hyu(i-1,j)*t47(i-1,j,k)*PUZ(i-1,j,k)*
     .  (PQZ(i,j,k)-PQZ(i-1,j,k))
1480        CONTINUE
1470     CONTINUE
1460  CONTINUE
CMIC$ DO ALL
      DO 1490 k = 1,nlev
CMIC$    DO ALL
         DO 1500 j = 0,nlat+1
CMIC$       DO ALL
            DO 1510 i = 1,nlon+1
               t49(i,j,k) = p(i,j,k)+p(i,j+1,k)-p(i,j,k+1)-p(i,j+1,k+1)
1510        CONTINUE
1500     CONTINUE
1490  CONTINUE
CMIC$ DO ALL
      DO 1520 k = 1,nlev
CMIC$    DO ALL
         DO 1530 j = 1,nlat+1
CMIC$       DO ALL
            DO 1540 i = 1,nlon
               t107(i,j,k) = -0.5*hxv(i,j-1)*t49(i,j-1,k)*PVZ(i,j-1,k)*
     .  (lnp(i,j,k)-lnp(i,j-1,k))
1540        CONTINUE
1530     CONTINUE
1520  CONTINUE
CMIC$ DO ALL
      DO 1550 k = 1,nlev
CMIC$    DO ALL
         DO 1560 j = 1,nlat+1
CMIC$       DO ALL
            DO 1570 i = 1,nlon
               t108(i,j,k) = t107(i,j,k)*(PTZ(i,j,k)*PQZ(i,j,k)+PTZ(i,j
     .  -1,k)*PQZ(i,j-1,k))
1570        CONTINUE
1560     CONTINUE
1550  CONTINUE
CMIC$ DO ALL
      DO 1580 k = 1,nlev
CMIC$    DO ALL
         DO 1590 j = 1,nlat+1
CMIC$       DO ALL
            DO 1600 i = 1,nlon
               t120(i,j,k) = -0.5*hxv(i,j-1)*t49(i,j-1,k)*PVZ(i,j-1,k)*
     .  (PTZ(i,j,k)-PTZ(i,j-1,k))
1600        CONTINUE
1590     CONTINUE
1580  CONTINUE
CMIC$ DO ALL
      DO 1610 k = 1,nlev
CMIC$    DO ALL
         DO 1620 j = 1,nlat+1
CMIC$       DO ALL
            DO 1630 i = 1,nlon
               t155(i,j,k) = -0.5*hxv(i,j-1)*t49(i,j-1,k)*PVZ(i,j-1,k)*
     .  (PQZ(i,j,k)-PQZ(i,j-1,k))
1630        CONTINUE
1620     CONTINUE
1610  CONTINUE
CMIC$ DO ALL
      DO 1640 j = 1,nlat+1
CMIC$    DO ALL
         DO 1650 i = 1,nlon+2
            t61(i,j,nlev+1) = 0
1650     CONTINUE
1640  CONTINUE
      DO 1660 k = nlev,1,-1
CMIC$    DO ALL
         DO 1670 j = 1,nlat+1
CMIC$       DO ALL
            DO 1680 i = 1,nlon+2
               t61(i,j,k) = t61(i,j,k+1)+t47(i-1,j,k)*PUZ(i-1,j,k)
1680        CONTINUE
1670     CONTINUE
1660  CONTINUE
CMIC$ DO ALL
      DO 1690 k = 1,nlev+1
CMIC$    DO ALL
         DO 1700 j = 1,nlat+1
CMIC$       DO ALL
            DO 1710 i = 1,nlon+2
               t61(i,j,k) = -0.5*t61(i,j,k)
1710        CONTINUE
1700     CONTINUE
1690  CONTINUE
CMIC$ DO ALL
      DO 1720 j = 1,nlat+2
CMIC$    DO ALL
         DO 1730 i = 1,nlon+1
            t65(i,j,nlev+1) = 0
1730     CONTINUE
1720  CONTINUE
      DO 1740 k = nlev,1,-1
CMIC$    DO ALL
         DO 1750 j = 1,nlat+2
CMIC$       DO ALL
            DO 1760 i = 1,nlon+1
               t65(i,j,k) = t65(i,j,k+1)+t49(i,j-1,k)*PVZ(i,j-1,k)
1760        CONTINUE
1750     CONTINUE
1740  CONTINUE
CMIC$ DO ALL
      DO 1770 k = 1,nlev+1
CMIC$    DO ALL
         DO 1780 j = 1,nlat+2
CMIC$       DO ALL
            DO 1790 i = 1,nlon+1
               t65(i,j,k) = -0.5*t65(i,j,k)
1790        CONTINUE
1780     CONTINUE
1770  CONTINUE
CMIC$ DO ALL
      DO 1800 k = 1,nlev+1
CMIC$    DO ALL
         DO 1810 j = 1,nlat+1
CMIC$       DO ALL
            DO 1820 i = 1,nlon+1
               t70(i,j,k) = 1.56961230576048E-7*((rdlam*(hyu(i,j)*t61(i
     .  +1,j,k)-hyu(i-1,j)*t61(i,j,k))+rdth*(hxv(i,j)*t65(i,j+1,k)-hxv(
     .  i,j-1)*t65(i,j,k)))/(hxt(i,j)*hyt(i,j)))
1820        CONTINUE
1810     CONTINUE
1800  CONTINUE
CMIC$ DO ALL
      DO 1830 j = 1,nlat+1
CMIC$    DO ALL
         DO 1840 i = 1,nlon+1
            PDPSDT(i,j) = -t70(i,j,1)
1840     CONTINUE
1830  CONTINUE
CMIC$ DO ALL
      DO 1850 k = 1,nlev
CMIC$    DO ALL
         DO 1860 j = 1,nlat+1
CMIC$       DO ALL
            DO 1870 i = 1,nlon+1
               etap(i,j,k) = t70(i,j,k)+PDPSDT(i,j)*(1-BHYB(k))
1870        CONTINUE
1860     CONTINUE
1850  CONTINUE
CMIC$ DO ALL
      DO 1880 k = 2,nlev
CMIC$    DO ALL
         DO 1890 j = 1,nlat
CMIC$       DO ALL
            DO 1900 i = 1,nlon
               t144(i,j,k) = etap(i,j,k)*(PTZ(i,j,k-1)-PTZ(i,j,k))
1900        CONTINUE
1890     CONTINUE
1880  CONTINUE
CMIC$ DO ALL
      DO 1910 k = 2,MAX(2,nlev)
CMIC$    DO ALL
         DO 1920 j = 1,nlat
CMIC$       DO ALL
            DO 1930 i = 1,nlon
               t166(i,j,k) = etap(i,j,k)*(PQZ(i,j,k)-PQZ(i,j,k-1))
1930        CONTINUE
1920     CONTINUE
1910  CONTINUE
CMIC$ DO ALL
      DO 1940 k = 1,nlev
CMIC$    DO ALL
         DO 1950 j = 1,nlat
CMIC$       DO ALL
            DO 1960 i = 1,nlon
               IF (nlev.LE.k) THEN
                  PDQDT(i,j,k) = (7.84806152880239E-8*((rdlam*((-t151(i
     .  ,j,nlev))-t151(i+1,j,nlev))+rdth*((-t155(i,j,nlev))-t155(i,j+1,
     .  nlev)))/(hxt(i,j)*hyt(i,j)))-0.5*t166(i,j,nlev))/(p(i,j,k+1)-p(
     .  i,j,k))
               ELSE IF (k.LE.1) THEN
                  PDQDT(i,j,k) = (7.84806152880239E-8*((rdlam*((-t151(i
     .  ,j,1))-t151(i+1,j,1))+rdth*((-t155(i,j,1))-t155(i,j+1,1)))/(hxt
     .  (i,j)*hyt(i,j)))-0.5*t166(i,j,2))/(p(i,j,k+1)-p(i,j,k))
               ELSE
                  PDQDT(i,j,k) = (7.84806152880239E-8*((rdlam*((-t151(i
     .  ,j,k))-t151(i+1,j,k))+rdth*((-t155(i,j,k))-t155(i,j+1,k)))/(hxt
     .  (i,j)*hyt(i,j)))-0.5*(t166(i,j,k)+t166(i,j,k+1)))/(p(i,j,k+1)-p
     .  (i,j,k))
               ENDIF
1960        CONTINUE
1950     CONTINUE
1940  CONTINUE
CMIC$ DO ALL
      DO 1970 k = 2,MAX(2,nlev)
CMIC$    DO ALL
         DO 1980 j = 1,nlat
CMIC$       DO ALL
            DO 1990 i = 1,nlon
               t192(i,j,k) = (PUZ(i,j,k)-PUZ(i,j,k-1))*(etap(i,j,k)+eta
     .  p(i+1,j,k))
1990        CONTINUE
1980     CONTINUE
1970  CONTINUE
CMIC$ DO ALL
      DO 2000 k = 2,MAX(2,nlev)
CMIC$    DO ALL
         DO 2010 j = 1,nlat
CMIC$       DO ALL
            DO 2020 i = 1,nlon
               t219(i,j,k) = (PVZ(i,j,k)-PVZ(i,j,k-1))*(etap(i,j,k)+eta
     .  p(i,j+1,k))
2020        CONTINUE
2010     CONTINUE
2000  CONTINUE
CMIC$ DO ALL
      DO 2030 k = 1,nlev
CMIC$    DO ALL
         DO 2040 j = 1,nlat
CMIC$       DO ALL
            DO 2050 i = 1,nlon+1
               t90(i,j,k) = t102(i,j,k)*(PTZ(i,j,k)*(1-PQZ(i,j,k))+PTZ(
     .  i-1,j,k)*(1-PQZ(i-1,j,k)))
2050        CONTINUE
2040     CONTINUE
2030  CONTINUE
CMIC$ DO ALL
      DO 2060 k = 1,nlev
CMIC$    DO ALL
         DO 2070 j = 1,nlat+1
CMIC$       DO ALL
            DO 2080 i = 1,nlon
               t95(i,j,k) = t107(i,j,k)*(PTZ(i,j,k)*(1-PQZ(i,j,k))+PTZ(
     .  i,j-1,k)*(1-PQZ(i,j-1,k)))
2080        CONTINUE
2070     CONTINUE
2060  CONTINUE
CMIC$ DO ALL
      DO 2090 k = 1,nlev
CMIC$    DO ALL
         DO 2100 j = 1,nlat
CMIC$       DO ALL
            DO 2110 i = 1,nlon
               IF (k.LE.1) THEN
                  PDTDT(i,j,k) = (0.5*t144(i,j,2)+(1.55424620615724E-8*
     .  PTZ(i,j,k)*(1/(0.860825768434464*PQZ(i,j,1)+1)+0.60782469342251
     .  9*(PQZ(i,j,1)/(0.860825768434464*PQZ(i,j,1)+1)))*(rdlam*(hyu(i,
     .  j)*t47(i,j,1)*PUZ(i,j,1)-hyu(i-1,j)*t47(i-1,j,1)*PUZ(i-1,j,1))+
     .  rdth*(hxv(i,j)*t49(i,j,1)*PVZ(i,j,1)-hxv(i,j-1)*t49(i,j-1,1)*PV
     .  Z(i,j-1,1)))+7.84806152880239E-8*(rdlam*((-t116(i,j,1))-t116(i+
     .  1,j,1))+rdth*((-t120(i,j,1))-t120(i,j+1,1)))-0.285714285714286*
     .  ((3.92403076440119E-8*(rdlam*((-t90(i,j,1))-t90(i+1,j,1))+rdth*
     .  ((-t95(i,j,1))-t95(i,j+1,1)))+6.30915356075388E-8*(rdlam*((-t10
     .  3(i,j,1))-t103(i+1,j,1))+rdth*((-t108(i,j,1))-t108(i,j+1,1))))/
     .  (0.860825768434464*PQZ(i,j,1)+1)))/(hxt(i,j)*hyt(i,j)))/(p(i,j,
     .  k+1)-p(i,j,k))
               ELSE IF (nlev.LE.k) THEN
                  PDTDT(i,j,k) = (0.285714285714286*PTZ(i,j,k)*(7.84806
     .  152880239E-8*((t18(i,j,nlev)+t26(i,j,nlev))*(rdlam*(hyu(i,j)*t4
     .  7(i,j,nlev)*PUZ(i,j,nlev)-hyu(i-1,j)*t47(i-1,j,nlev)*PUZ(i-1,j,
     .  nlev))+rdth*(hxv(i,j)*t49(i,j,nlev)*PVZ(i,j,nlev)-hxv(i,j-1)*t4
     .  9(i,j-1,nlev)*PVZ(i,j-1,nlev)))/(hxt(i,j)*hyt(i,j)))-t18(i,j,nl
     .  ev)*(PDPSDT(i,j)+t70(i,j,nlev+1)))*(1/(0.860825768434464*PQZ(i,
     .  j,nlev)+1)+0.607824693422519*(PQZ(i,j,nlev)/(0.860825768434464*
     .  PQZ(i,j,nlev)+1)))+0.5*t144(i,j,nlev)+(7.84806152880239E-8*(rdl
     .  am*((-t116(i,j,nlev))-t116(i+1,j,nlev))+rdth*((-t120(i,j,nlev))
     .  -t120(i,j+1,nlev)))-0.285714285714286*((3.92403076440119E-8*(rd
     .  lam*((-t90(i,j,nlev))-t90(i+1,j,nlev))+rdth*((-t95(i,j,nlev))-t
     .  95(i,j+1,nlev)))+6.30915356075388E-8*(rdlam*((-t103(i,j,nlev))-
     .  t103(i+1,j,nlev))+rdth*((-t108(i,j,nlev))-t108(i,j+1,nlev))))/(
     .  0.860825768434464*PQZ(i,j,nlev)+1)))/(hxt(i,j)*hyt(i,j)))/(p(i,
     .  j,k+1)-p(i,j,k))
               ELSE
                  PDTDT(i,j,k) = (0.285714285714286*PTZ(i,j,k)*(7.84806
     .  152880239E-8*((t18(i,j,k)+t26(i,j,k))*(rdlam*(hyu(i,j)*t47(i,j,
     .  k)*PUZ(i,j,k)-hyu(i-1,j)*t47(i-1,j,k)*PUZ(i-1,j,k))+rdth*(hxv(i
     .  ,j)*t49(i,j,k)*PVZ(i,j,k)-hxv(i,j-1)*t49(i,j-1,k)*PVZ(i,j-1,k))
     .  )/(hxt(i,j)*hyt(i,j)))-t18(i,j,k)*(PDPSDT(i,j)+t70(i,j,k+1)))*(
     .  1/(0.860825768434464*PQZ(i,j,k)+1)+0.607824693422519*(PQZ(i,j,k
     .  )/(0.860825768434464*PQZ(i,j,k)+1)))+0.5*(t144(i,j,k)+t144(i,j,
     .  k+1))+(7.84806152880239E-8*(rdlam*((-t116(i,j,k))-t116(i+1,j,k)
     .  )+rdth*((-t120(i,j,k))-t120(i,j+1,k)))-0.285714285714286*((3.92
     .  403076440119E-8*(rdlam*((-t90(i,j,k))-t90(i+1,j,k))+rdth*((-t95
     .  (i,j,k))-t95(i,j+1,k)))+6.30915356075388E-8*(rdlam*((-t103(i,j,
     .  k))-t103(i+1,j,k))+rdth*((-t108(i,j,k))-t108(i,j+1,k))))/(0.860
     .  825768434464*PQZ(i,j,k)+1)))/(hxt(i,j)*hyt(i,j)))/(p(i,j,k+1)-p
     .  (i,j,k))
               ENDIF
2110        CONTINUE
2100     CONTINUE
2090  CONTINUE
CMIC$ DO ALL
      DO 2120 k = 1,nlev
CMIC$    DO ALL
         DO 2130 j = 1,nlat
CMIC$       DO ALL
            DO 2140 i = 1,nlon
               IF (nlev.LE.k) THEN
                  PDUDT(i,j,k) = 0.5*(t192(i,j,nlev)/t47(i,j,nlev))+(rd
     .  lam*(1.56961230576048E-7*(e(i,j,k)+phi(i,j,nlev)-e(i+1,j,k)-phi
     .  (i+1,j,nlev))+2.25270758122744E-5*(0.30391234671126*(PQZ(i,j,nl
     .  ev)+PQZ(i+1,j,nlev))+1)*(lnp(i,j,k)-lnp(i+1,j,k))*(PTZ(i,j,k)+P
     .  TZ(i+1,j,k)))-0.0625*(z(i,j,k)+z(i,j-1,k))*(hyv(i,j)*t49(i,j,nl
     .  ev)*PVZ(i,j,nlev)+hyv(i,j-1)*t49(i,j-1,nlev)*PVZ(i,j-1,nlev)+hy
     .  v(i+1,j)*t49(i+1,j,nlev)*PVZ(i+1,j,nlev)+hyv(i+1,j-1)*t49(i+1,j
     .  -1,nlev)*PVZ(i+1,j-1,nlev)))/hxu(i,j)
               ELSE IF (k.LE.1) THEN
                  PDUDT(i,j,k) = 0.5*(t192(i,j,2)/t47(i,j,1))+(rdlam*(1
     .  .56961230576048E-7*(e(i,j,k)+phi(i,j,1)-e(i+1,j,k)-phi(i+1,j,1)
     .  )+2.25270758122744E-5*(0.30391234671126*(PQZ(i,j,1)+PQZ(i+1,j,1
     .  ))+1)*(lnp(i,j,k)-lnp(i+1,j,k))*(PTZ(i,j,k)+PTZ(i+1,j,k)))-0.06
     .  25*(z(i,j,k)+z(i,j-1,k))*(hyv(i,j)*t49(i,j,1)*PVZ(i,j,1)+hyv(i,
     .  j-1)*t49(i,j-1,1)*PVZ(i,j-1,1)+hyv(i+1,j)*t49(i+1,j,1)*PVZ(i+1,
     .  j,1)+hyv(i+1,j-1)*t49(i+1,j-1,1)*PVZ(i+1,j-1,1)))/hxu(i,j)
               ELSE
                  PDUDT(i,j,k) = 0.5*((t192(i,j,k)+t192(i,j,k+1))/t47(i
     .  ,j,k))+(rdlam*(1.56961230576048E-7*(e(i,j,k)+phi(i,j,k)-e(i+1,j
     .  ,k)-phi(i+1,j,k))+2.25270758122744E-5*(0.30391234671126*(PQZ(i,
     .  j,k)+PQZ(i+1,j,k))+1)*(lnp(i,j,k)-lnp(i+1,j,k))*(PTZ(i,j,k)+PTZ
     .  (i+1,j,k)))-0.0625*(z(i,j,k)+z(i,j-1,k))*(hyv(i,j)*t49(i,j,k)*P
     .  VZ(i,j,k)+hyv(i,j-1)*t49(i,j-1,k)*PVZ(i,j-1,k)+hyv(i+1,j)*t49(i
     .  +1,j,k)*PVZ(i+1,j,k)+hyv(i+1,j-1)*t49(i+1,j-1,k)*PVZ(i+1,j-1,k)
     .  ))/hxu(i,j)
               ENDIF
2140        CONTINUE
2130     CONTINUE
2120  CONTINUE
CMIC$ DO ALL
      DO 2150 k = 1,nlev
CMIC$    DO ALL
         DO 2160 j = 1,nlat
CMIC$       DO ALL
            DO 2170 i = 1,nlon
               IF (nlev.LE.k) THEN
                  PDVDT(i,j,k) = 0.5*(t219(i,j,nlev)/t49(i,j,nlev))+(rd
     .  th*(1.56961230576048E-7*(e(i,j,k)+phi(i,j,nlev)-e(i,j+1,k)-phi(
     .  i,j+1,nlev))+2.25270758122744E-5*(0.30391234671126*(PQZ(i,j,nle
     .  v)+PQZ(i,j+1,nlev))+1)*(lnp(i,j,k)-lnp(i,j+1,k))*(PTZ(i,j,k)+PT
     .  Z(i,j+1,k)))+0.0625*(z(i,j,k)+z(i-1,j,k))*(hxu(i,j)*t47(i,j,nle
     .  v)*PUZ(i,j,nlev)+hxu(i,j+1)*t47(i,j+1,nlev)*PUZ(i,j+1,nlev)+hxu
     .  (i-1,j)*t47(i-1,j,nlev)*PUZ(i-1,j,nlev)+hxu(i-1,j+1)*t47(i-1,j+
     .  1,nlev)*PUZ(i-1,j+1,nlev)))/hyv(i,j)
               ELSE IF (k.LE.1) THEN
                  PDVDT(i,j,k) = 0.5*(t219(i,j,2)/t49(i,j,1))+(rdth*(1.
     .  56961230576048E-7*(e(i,j,k)+phi(i,j,1)-e(i,j+1,k)-phi(i,j+1,1))
     .  +2.25270758122744E-5*(0.30391234671126*(PQZ(i,j,1)+PQZ(i,j+1,1)
     .  )+1)*(lnp(i,j,k)-lnp(i,j+1,k))*(PTZ(i,j,k)+PTZ(i,j+1,k)))+0.062
     .  5*(z(i,j,k)+z(i-1,j,k))*(hxu(i,j)*t47(i,j,1)*PUZ(i,j,1)+hxu(i,j
     .  +1)*t47(i,j+1,1)*PUZ(i,j+1,1)+hxu(i-1,j)*t47(i-1,j,1)*PUZ(i-1,j
     .  ,1)+hxu(i-1,j+1)*t47(i-1,j+1,1)*PUZ(i-1,j+1,1)))/hyv(i,j)
               ELSE
                  PDVDT(i,j,k) = 0.5*((t219(i,j,k)+t219(i,j,k+1))/t49(i
     .  ,j,k))+(rdth*(1.56961230576048E-7*(e(i,j,k)+phi(i,j,k)-e(i,j+1,
     .  k)-phi(i,j+1,k))+2.25270758122744E-5*(0.30391234671126*(PQZ(i,j
     .  ,k)+PQZ(i,j+1,k))+1)*(lnp(i,j,k)-lnp(i,j+1,k))*(PTZ(i,j,k)+PTZ(
     .  i,j+1,k)))+0.0625*(z(i,j,k)+z(i-1,j,k))*(hxu(i,j)*t47(i,j,k)*PU
     .  Z(i,j,k)+hxu(i,j+1)*t47(i,j+1,k)*PUZ(i,j+1,k)+hxu(i-1,j)*t47(i-
     .  1,j,k)*PUZ(i-1,j,k)+hxu(i-1,j+1)*t47(i-1,j+1,k)*PUZ(i-1,j+1,k))
     .  )/hyv(i,j)
               ENDIF
2170        CONTINUE
2160     CONTINUE
2150  CONTINUE