      SUBROUTINE DZ2OLD(D,Z,U,V,MEND1,IROMB,MWVD2,MUWVD2)
C
C  THIS ROUTINE PERFORMS CONVERSION OF TRUE SCALAR RELATIVE
C  VORTICITY (Z), DIVERGENCE (D) TO PSEUDO SCALAR U AND V
C  IN SPECTRAL SPACE.
C
C  CALL DZTOUV(D,Z,U,V,MEND1,IROMB,MWVD2,MUWVD2)
C
C  D      ..... DIVERGENCE
C  Z      ..... RELATIVE VORTICITY
C  U      ..... OUTPUT PSEUDO SCALAR ZONAL WIND (=UCOS(PHI))
C  V      ..... OUTPUT PSEUDO SCALAR MERID WIND (=VCOS(PHI))
C  MEND1  ..... ZONAL WAVENUMBER + 1
C  IROMB  ..... TRUNCATION INDICATOR (=1 RHOMBOIDAL, =0 TRIANGULAR)
C  MWVD2  ..... DIMENSION OF Z AND D
C  MUWVD2 ..... DIMENSION OF U AND V
C
C  HUA-LU PAN / DiMego  23 MAY 1990
C
      DIMENSION U(MUWVD2), V(MUWVD2), Z(MUWVD2), D(MUWVD2)
      data ER / 6.3712 E+6 /
      EPS(N,M) = SQRT(FLOAT(N*N-M*M)/FLOAT(4*N*N-1))
      U(MUWVD2-1) = 0.
      U(MUWVD2  ) = 0.
      V(MUWVD2-1) = 0.
      V(MUWVD2  ) = 0.
C
C  HANDLE M = 0 SEPERATELY
C
      NM = 0
      NMU = 0
      MM = 1
      M = 0
      NEND1 = MEND1
      IF(IROMB.EQ.1) NEND1 = MM + MEND1 - 1
      D2 = 0.
      DO 100 NN = MM, NEND1+1
      NM = NM + 1
      NMU = NMU + 1
      NMT2 = NM * 2
      NMUT2 = NMU * 2
      N = NN - 1
      D1 = D2
      D2 = EPS(N+1,M)
      FAC1 = ER * D2 / FLOAT(N+1)
      IF(N.GT.0) FAC2 = ER * D1 / FLOAT(N)
      IF(N.EQ.M) THEN
        U(NMUT2-1) =  Z(NMT2+1) * FAC1
        U(NMUT2  ) =  Z(NMT2+2) * FAC1
        V(NMUT2-1) = -D(NMT2+1) * FAC1
        V(NMUT2  ) = -D(NMT2+2) * FAC1
      ELSEIF(N.GT.M.AND.N.LT.NEND1-1) THEN
        U(NMUT2-1) =  Z(NMT2+1) * FAC1 - Z(NMT2-3) * FAC2
        U(NMUT2  ) =  Z(NMT2+2) * FAC1 - Z(NMT2-2) * FAC2
        V(NMUT2-1) = -D(NMT2+1) * FAC1 + D(NMT2-3) * FAC2
        V(NMUT2  ) = -D(NMT2+2) * FAC1 + D(NMT2-2) * FAC2
      ELSE
        U(NMUT2-1) = -Z(NMT2-3) * FAC2
        U(NMUT2  ) = -Z(NMT2-2) * FAC2
        V(NMUT2-1) =  D(NMT2-3) * FAC2
        V(NMUT2  ) =  D(NMT2-2) * FAC2
      ENDIF
 100  CONTINUE
      NM = NM - 1
C
C  REST OF ZONAL WAVENUMBERS
C
      DO 300 MM = 2, MEND1
      M = MM - 1
      NEND1 = MEND1
      IF(IROMB.EQ.1) NEND1 = MM + MEND1 - 1
      D2 = 0.
      DO 200 NN = MM, NEND1+1
      NM = NM + 1
      NMU = NMU + 1
      NMT2 = NM * 2
      NMUT2 = NMU * 2
      N = NN - 1
      D1 = D2
      D2 = EPS(N+1,M)
      FAC1 = ER * D2 / FLOAT(N+1)
      FAC2 = ER * D1 / FLOAT(N)
      FAC3 = ER * FLOAT(M) / FLOAT(N * (N+1))
      IF(N.EQ.M.and.n.lt.nend1-1) THEN
        U(NMUT2-1) =  Z(NMT2+1) * FAC1 + D(NMT2  ) * FAC3
        U(NMUT2  ) =  Z(NMT2+2) * FAC1 - D(NMT2-1) * FAC3
        V(NMUT2-1) = -D(NMT2+1) * FAC1 + Z(NMT2  ) * FAC3
        V(NMUT2  ) = -D(NMT2+2) * FAC1 - Z(NMT2-1) * FAC3
      ELSEIF(N.GT.M.AND.N.LT.NEND1-1) THEN
        U(NMUT2-1) =  Z(NMT2+1) * FAC1 - Z(NMT2-3) * FAC2
     &              + D(NMT2  ) * FAC3
        U(NMUT2  ) =  Z(NMT2+2) * FAC1 - Z(NMT2-2) * FAC2
     &              - D(NMT2-1) * FAC3
        V(NMUT2-1) = -D(NMT2+1) * FAC1 + D(NMT2-3) * FAC2
     &              + Z(NMT2  ) * FAC3
        V(NMUT2  ) = -D(NMT2+2) * FAC1 + D(NMT2-2) * FAC2
     &              - Z(NMT2-1) * FAC3
      ELSEIF(N.EQ.NEND1-1) THEN
        U(NMUT2-1) = -Z(NMT2-3) * FAC2 + D(NMT2  ) * FAC3
        U(NMUT2  ) = -Z(NMT2-2) * FAC2 - D(NMT2-1) * FAC3
        V(NMUT2-1) =  D(NMT2-3) * FAC2 + Z(NMT2  ) * FAC3
        V(NMUT2  ) =  D(NMT2-2) * FAC2 - Z(NMT2-1) * FAC3
      ELSE
        U(NMUT2-1) = -Z(NMT2-3) * FAC2
        U(NMUT2  ) = -Z(NMT2-2) * FAC2
        V(NMUT2-1) =  D(NMT2-3) * FAC2
        V(NMUT2  ) =  D(NMT2-2) * FAC2
      ENDIF
 200  CONTINUE
      NM = NM - 1
 300  CONTINUE
      RETURN
      END
