C******************** START FILE UFG2DA.FOR ; GROUP UFCMPR ******************
C-------------------------------------------------------------------
C  UFG2DA
C
C  TRANSFER WORDS FROM 3D ARRAY TO 1D ARRAY FOR PROCESSING
C
C  MOD DMC APR 1986 - INCREASED FROM 2D TO 3D
C
      SUBROUTINE UFG2DA(A3D,NA3D1,NA3D2,NZ,NX,NY,INUM0,A1D,N)
C
      REAL A3D(NA3D1,NA3D2,NZ),A1D(N)
C
C  ARGUMENTS
C   A3D - 3D INPUT DATA ARRAY
C     NOTE 1ST DIMENSION NA3D1 2ND DIM NA3D2
C
C   NX,NY-- NUMBER OF ROWS AND COLUMNS IN A2D CONTAINING "USEFUL" DATA.
C     NX MAY BE .LT. NA3D1  SIM. FOR NY, NA3D2
C
C   A1D - 1D OUTPUT 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
        A1D(II)=A3D(I1,I2,I3)
C
      ENDDO
C
      RETURN
      END
C******************** END FILE UFG2DA.FOR ; GROUP UFCMPR ******************
