CMAX: [Version 1.0 (6/22/93)]
CMAX: ----------------------------------------------------
CMAX: Transformation of RDTHRU from rdthru.f
CMAX: ----------------------------------------------------
      SUBROUTINE rdthru(mform,lu)
C  READS THROUGH A DATA TYPE ON THE REPACK DATA SETS
C     REAL              BUFF
C     REAL              FORM
      INTEGER J
      INTEGER MFORM
      INTEGER NBUFF
      INTEGER NFORM
C     REAL              XBUFF
C     REAL              XFORM
      CHARACTER * 60 message
      COMMON / CONTRL / IM, JNP, NB, NDALT, NHMS, NLAY, NLAYM1, NLAYP1, 
     &NYMD, STRAT, IDIMEN, SLP, FDCOS, FSOAR, SAVEAE, SIGDAT, MAXREP
      LOGICAL STRAT, SLP, FDCOS, FSOAR, SAVEAE, SIGDAT
C  OBSERVATIONAL DATA POSITIONING INFORMATION
      COMMON / RECORD / INDAT, INTIM, INCTIM, NFOR (5), NBUF (5)
!hpf$ distribute nbuf(block)
!hpf$ distribute nfor(block)
      message(1:60) = ' '
C  DOUBLE CHECK ON DATA POSITION TO RIGHT DATE/TIME.
      IF ((indat .NE. nymd) .OR. (intim .NE. nhms)) THEN
        WRITE( 6,900 ) nymd,nhms,indat,intim
        message = ' RDTHRU: Dataset positioned to wrong date/time.'
        CALL flash(1,message,5)
      ENDIF
C  Read through data records.
      nbuff = nbuf(lu - 71 + 1)
      nform = mform
 7002 IF ((nform .EQ. mform)) THEN
        IF (nbuff .NE. 0) THEN
          DO 7000 j = 1 , nbuff
            READ( lu ) 
 7000     CONTINUE
        ENDIF
C  Read next subheader.
        READ( lu ) form,buff
        xform = form
        xbuff = buff
        nform = nint(xform)
        nfor(lu - 71 + 1) = nform
        nbuff = nint(xbuff)
        nbuf(lu - 71 + 1) = nbuff
        GOTO 7002
      ENDIF
 7003 CONTINUE
      RETURN
900   FORMAT (' FATAL: The observation data is positioned incorrectly;'/
     &'    >>>: the requested analysis date / time is ',2I8/'    >>>: bu
     &t is positioned to read at date/time = ',2I8)
      END
