C******************** START FILE UFP2DA.FOR ; GROUP UFCMPR ******************
C-------------------------------------------------------------------
C  UFP2DA
C    -- OPPOSITE OF UFG2DA - MOD TO 3D DMC APR 1986 ***
C
C  TRANSFER WORDS FROM 1D ARRAY TO 3D ARRAY FOR PROCESSING
C
      SUBROUTINE UFP2DA(A3D,NA3D1,NA3D2,NZ,NX,NY,INUM0,A1D,N)
C
      REAL A3D(NA3D1,NA3D2,NZ),A1D(N)
C
C  ARGUMENTS
C   A3D - 3D OUTPUT DATA ARRAY
C     NOTE 1ST DIMENSION NA3D1  2ND DIM NA3D2
C
C   NX,NY-- NUMBER OF ROWS AND COLUMNS IN A3D TO CONTAIN "USEFUL" DATA.
C     NX MAY BE .LT. NA3D1 ... SIMILARLY NY, NA3D2
C
C   A1D - 1D INPUT DATA ARRAY
C     N = A1D DIMENSION = NUMBER OF DATA WORDS TO TRANSFER
C
C   INUM0 - PTS TO THE WORD PRECEDING THE FIRST WORD TO TRANSFER.
C
      IL=INUM0
C
      DO II=1,N
        IL=IL+1
        I3=(IL-1)/(NX*NY)+1
        ILI=IL-(I3-1)*NX*NY
        I2=(ILI-1)/NX+1
        I1=ILI-(I2-1)*NX
C
        A3D(I1,I2,I3)=A1D(II)
C
      ENDDO
C
      RETURN
      END
C******************** END FILE UFP2DA.FOR ; GROUP UFCMPR ******************
