C******************** START FILE UF1DRE.FOR ; GROUP UFILES ******************
C--------------------------------------------------------------
C  UF1DRE
C
C  SIMPLIFIED READ ROUTINE FOR 1D DATA.  LABELS FOR DATA ARE
C  NOT RETURNED, ONLY THE DATA ITSELF.  THE DATA LABELS
C  ARE PRINTED ON UNIT LUNO
C
C  ACTUAL READ IS PERFORMED BY UF1DRD, WHICH MAY BE USED
C  DIRECTLY IF LABELS ARE DESIRED.  PURPOSE OF THIS ROUTINE
C  IS TO HAVE A 1D READ ROUTINE WITH AS SIMPLE A LIST OF CALLING
C  ARGUMENTS AS POSSIBLE.
C
        SUBROUTINE UF1DRE(ILUN,X,F,NDIM,NACT,IER,LUNO)
C
C  ILUN (INPUT) - FILE LOGICAL UNIT NUMBER
C    FILENAME WILL HAVE BEEN CONSTRUCTED (SRS. UFSETR,UFOPEN)
C  AND FILE OPENED (SR. UFOPRD) BEFORE THIS ROUTINE IS CALLED
C
C  X  ARRAY FOR INDEPENDENT VARIABLE (RETURNED FROM FILE)
C  F  ARRAY FOR DEPENDENT VARIABLE (RETURNED FROM FILE)
C  NDIM  (INPUT) DIMENSION OF X,F ARRAYS
C  NACT  ACTUAL NUMBER OF X,F POINTS IN FILE
C       ERROR OCCURS IF NACT .GT. NDIM
C  IER   ERROR RETURN CODE 0= NORMAL SUCCESSFUL COMPLETION
C  LUNO  (INPUT) OPEN I/O CHANNEL FOR OUTPUT OF FILE
C        DATA LABELS
C        (OUTPUT SUPPRESSED IF LUNO=0)
C
C---
        USE UFILES
C
        REAL X(NDIM),F(NDIM)
      REAL ZVAL(UFPASC)
      CHARACTER*30 ZLAB(UFPASC)
        CHARACTER*10 ZSDATE
        CHARACTER*30 XLAB,FLAB
      CHARACTER*4 IDEV
C
C$r8real_output: x,f
C
C  READ THE DATA
C
      CALL UFINIT
      CALL UFLCHK(ILUN,'UF1DRE    ',ICHAN,IER)
        CALL UF1DRD(ILUN,IDEV,ZSDATE,X,F,NDIM,NACT,IPROC,
     >     XLAB,FLAB,UFPASC,IVGOT,ZVAL,ZLAB,IER)
C
      IF(LUNO.LE.0) RETURN
C
C  ECHO LABEL; RESULTS INFO
        WRITE(LUNO,1001) IER
 1001   FORMAT(' =============================================='/
     >  ' DATA READ FROM FILE:  IER=',I3,' (0 IS NORMAL)'/)
c
        call ufsnmd(luno,' Ufile Name',ilun)
c
        WRITE(LUNO,1002) ILUN,IDEV,ZSDATE
 1002   FORMAT(' UFILES LOGICAL UNIT NO. ',I2,'  TOKAMAK:  ',A4,
     >  ' SHOT DATE:  ',A10/)
        WRITE(LUNO,1003) NACT,XLAB,FLAB
 1003   FORMAT(1X,I5,' DATA POINTS READ'/
     >  ' X LABEL:  "',A30,'"'/' F LABEL:  "',A30,'"'/)
        IF((IPROC.EQ.1).OR.(IPROC.EQ.3)) WRITE(LUNO,1004)
        IF((IPROC.EQ.2).OR.(IPROC.EQ.3)) WRITE(LUNO,1005)
 1004   FORMAT(' DATA WAS AVERAGED')
 1005   FORMAT(' DATA WAS SMOOTHED')
      IF(IVGOT.EQ.0) GO TO 100
      DO 96 I=1,IVGOT
        WRITE(LUNO,1006) ZVAL(I),ZLAB(I)
 1006   FORMAT(' ASSOCIATED QUANTITY VALUE:  ',1PE12.5/
     >         '                     LABEL:  ',A30/)
 96   CONTINUE
C
 100  CONTINUE
        RETURN
                END
C******************** END FILE UF1DRE.FOR ; GROUP UFILES ******************
