C   07/06/96 606071906  MEMBER NAME  RDDA     (S4)          FORTG1
      SUBROUTINE RDDA(NRC,NTOT,BUF)
C     BOS SUBPROGRAM  =4.6=
      COMMON/BCS/IW(1)
C   07/06/96 606071821  MEMBER NAME  CCS      (S4)          FORTG1
      COMMON/CCS/IUND,INDT,INDC,NPT,INDA,LISTE(5),IPAS
      INTEGER BUF(1610),BUFA(NTOT)
      IG=IUND-16
      GOTO (1,2,3),IG
    1 CONTINUE
*** PMF 11/10/1999
*     DEFINE FILE 17(200,1610,U,IVAR)
      OPEN(UNIT=17,ACCESS='DIRECT',RECL=1610
     +     ,FORM='UNFORMATTED',STATUS='UNKNOWN')
      NRC=1
*** PMF (END)
      GOTO 10
    2 CONTINUE
*** PMF 11/10/1999
*     DEFINE FILE 18(200,1610,U,IVAR)
      OPEN(UNIT=18,ACCESS='DIRECT',RECL=1610
     +     ,FORM='UNFORMATTED',STATUS='UNKNOWN')
      NRC=1
*** PMF (END)
      GOTO 10
    3 CONTINUE

*** PMF 11/10/1999 
*     DEFINE FILE 19(200,1610,U,IVAR)
*     10 READ(IUND'NRC) NTOT,BUF
      OPEN(UNIT=19,ACCESS='DIRECT',RECL=1610
     +     ,FORM='UNFORMATTED',STATUS='UNKNOWN')
      NRC=1
   10 READ(IUND,REC=NRC) NTOT,BUF
      NRC=NRC+1
***PMF (End)
      GOTO 100
C
      ENTRY WRDA(NRC,NTOT,BUFA)
***PMF  11/10/99
*     IF(NTOT.NE.0) WRITE(IUND'NRC) NTOT,BUFA
*     IF(NTOT.EQ.0) WRITE(IUND'NRC) NTOT,NTOT
      IF(NTOT.NE.0) THEN
         WRITE(IUND,REC=NRC) NTOT,BUFA
         NRC=NRC+1
      ENDIF
      IF(NTOT.EQ.0) THEN
         WRITE(IUND,REC=NRC) NTOT,NTOT
         NRC=NRC+1
      ENDIF
***PMF (End)
      GOTO 100
C
      ENTRY RDSQ(IUNTP,NTOT,BUFA,*)
      READ(IUNTP,END=101) NTOT,BUFA
      GOTO 100
C
      ENTRY WRSQ(IUNTP,NTOT,BUFA)
      WRITE(IUNTP) NTOT,BUFA
C
  100 RETURN
  101 RETURN 1
      END
