      SUBROUTINE RDFORM(FIELDS,NFIELDS,FORMH)
C
C     MAKE THE FORMAT TO READ THE DEPTH HEADER RECORD
C
      CHARACTER FORMH*(*),FIELDS(50)*10,FLDTYPE*1
      LOGICAL LOOP
C
      NHEAD=1
      NERR=0
      NFOUT=0
      NCOUT=0
      FORMH=' '
C
      NX=ISPCTIM(FIELDS,NF,NERR)
      IF(NF.LE.NFIELDS.AND.NERR.EQ.0)THEN
           NC=ALOG10(FLOAT(NX))+1
           NCOUT=NC+2
           WRITE(FORMH(1:NCOUT),100)NX
  100      FORMAT('(',I<NC>,'X')
C
           NC1=NCOUT
           IF=NF
           DO WHILE (IF.LT.NFIELDS)
                IF=IF+1
                NC=NOCHAR(FIELDS(IF))
                NCOUT=NCOUT+NC+1
                FORMH(1:NCOUT)=FORMH(1:NC1)//','//FIELDS(IF)(1:NC)
                NC1=NCOUT
           ENDDO
           FORMH(NC1+1:NC1+1)=')'
      ENDIF
C
      IF(NERR.EQ.1)THEN
           FORMH='*'
      ENDIF
      RETURN
      END
