



      SUBROUTINE WIF021



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'DATBAS.INC'
      INTEGER       I, ISEQ, IERR







      IF (WIFPAR(12).EQ.1) GOTO 998

         CALL GVSCTB (ALLHST,MAXADB*MAXSEQ)
         CALL GVSCCC (LINE,FILDIR(27),'ALLHST.HST')
         CALL GETFILE (11,' ',LINE,IERR)
         IF (IERR.NE.0) GOTO 998



         DO 10 ISEQ=1,NBINDB
            CALL GVSFMT ('?FMT487')
            READ (11,FMT,END=999,ERR=999) 
     +       (ALLHST(I,ISEQ),I=1,NAAFIL(ISEQ))
   10    CONTINUE
         GOTO 998



  999    CONTINUE
         CALL GVSTT6 ('?ERF001')




  998 CONTINUE
      CALL GVSCLF (11)


      RETURN
      END
      SUBROUTINE WIF023



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'ANISOU.INC'
      INCLUDE       'CLUFAM.INC'
      INCLUDE       'CRDINC.INC'
      INCLUDE       'DATBAS.INC'
      INCLUDE       'DGLOOP.INC'
      INCLUDE       'EAAINC.INC'
      INCLUDE       'HBONDS.INC'
      INCLUDE       'HGRINC.INC'
      INCLUDE       'HSPINC.INC'
      INCLUDE       'HSTINC.INC'
      INCLUDE       'IRIGRA.INC'
      INCLUDE       'JUNIOR.INC'
      INCLUDE       'LABELS.INC'
      INCLUDE       'MAKMOL.INC'
      INCLUDE       'MAPINC.INC'
      INCLUDE       'MOLITM.INC'
      INCLUDE       'NOTINC.INC'
      INCLUDE       'OPTION.INC'
      INCLUDE       'PDBINC.INC'
      INCLUDE       'PDBLIS.INC'
      INCLUDE       'QUALTY.INC'
      INCLUDE       'RESULT.INC'
      INCLUDE       'SELECT.INC'
      INCLUDE       'SOGINC.INC'
      INCLUDE       'SOLIDS.INC'
      INCLUDE       'SYMINC.INC'
      INCLUDE       'SUGARS.INC'
      INCLUDE       'VECTOR.INC'
      INCLUDE       'WALIGN.INC'
      INCLUDE       'WALSER.INC'
      INCLUDE       'GETMOL.INC'
      INCLUDE       'HISTOG.INC'
      INCLUDE       'ANATRA.INC'
      INCLUDE       'XRAY.INC'
      INCLUDE       'JMOL.INC'
      INCLUDE       'REFMAC.INC'
      INCLUDE       'DRGINC.INC'
      INCLUDE       'AUDOCK.INC'
      INCLUDE       'ESPACE.INC'






      INTEGER       IWF12, IERR, IAT
      LOGICAL       FIRST, GVFFOP
      CHARACTER*80  LOCLIN
      SAVE          FIRST
      DATA FIRST    /.TRUE./







      IU54=61
      HSTUNT=0
      UNKDEL=0
      DINOUT=.FALSE.



      IF (DAVBUG.NE.1) THEN
         IF (GVFFOP(DAVBUG)) CALL GVSCLF (DAVBUG)
         DAVBUG=1
      END IF



      IF (FIRST) THEN
         IWF12=WIFPAR(12)
         CALL GVSIT0 (WIFPAR,MAXPAR)
         WIFPAR(12)=IWF12
         CALL GVSCTB (HISTOR,20*80)
         CALL GVSIT0 (SUBUSE,MAXSUU)
         ALTUNT=0
         LENPROF=0
         NUMPPP=0
         WIFPAR(560)=2
         DATLOG=0
         DATOPE=.FALSE.
         USEANI=.FALSE.
         USE300=.FALSE.
         CALL SETLANG ('ENGLISH')
         CALL WIF023A (IERR)
         FIRST=.FALSE.
         CALL GVSSTX (LOGNAM,'LOGFIL.TXT')
      END IF
      CALL C1234567 ('In WIF023 at 1')
      CALL GVSDEL ('MODEL_SYNC.ERROR')



      IAMDUMB=.FALSE.



      CALL GVSCTB (OPTINP,LEN(OPTINP))
      CALL GVSCTB (VPROMPT,80)
      CALL GVSCTB (DEMOTX,10*80)
      CALL GVSSTX (MTYPE(1),'?M1701')
      CALL GVSSTX (MTYPE(2),'?M1702')
      CALL GVSSTX (MTYPE(3),'?M1703')
      CALL GVSSTX (MTYPE(4),'?M1704')
      CALL GVSSTX (MTYPE(5),'?M1705')
      CALL GVSSTX (MTYPE(6),'?M1706')
      CALL GVSSTX (MTYPE(7),'?M1707')
      CALL GVSSTX (MTYPE(8),'?M1708')
      CALL GVSCTB (PDB4LC,4)
      CALL C1234567 ('In WIF023 at 1a')
      CALL GVSCTB (BLNK80,80)



      NUMATF=0
      NUMAAF=0
      NUMAAT=0
      NUMSOU=0
      NUMCOF=0
      NCRD=0
      USEALT=.FALSE.



      DONUNT=0



      CALL GVSSTX (EXTION,'box')



      CTRUNT=0
      DORND1=.TRUE.
      DORND2=.TRUE.
      DOCLNA=.TRUE.
      CALL C1234567 ('In WIF023 at 1b')



      AD_AT(1) ='A '
      AD_AT(2) ='C '
      AD_AT(3) ='HD'
      AD_AT(4) ='H '
      AD_AT(5) ='N '
      AD_AT(6) ='NA'
      AD_AT(7) ='OA'
      AD_AT(8) ='SA'
      AD_AT(9) ='F '
      AD_AT(10)='MG'
      AD_AT(11)='CA'
      AD_AT(12)='MN'
      AD_AT(13)='FE'
      AD_AT(14)='ZN'
      AD_AT(15)='P '
      AD_AT(16)='CL'
      AD_AT(17)='BR'
      AD_AT(18)='I '
      AD_AT(19)='S '
      AD_AT(20)='  '









      SOGUNT=0



      HSP_SHO=.FALSE.






      CALL C1234567 ('In WIF023 at 1c')



      CALL GVSCTB (RFMINN,4)
      CALL GVSCTB (RFMOUN,4)






      DRGPNT=0
      DRGUNT=0
      DRGUN2=0
      ATMML2=0
      BNDML2=0
      SGRML2=0
      ML2UNT=0
      HASML2=.FALSE.
      DRGDBG=.FALSE.
      CALL C1234567 ('In WIF023 at 1d')



      IF (OUTUNT.NE.0) CALL GVSCLF (OUTUNT)
      OUTUNT=0
      OUTONF=.FALSE.



      CALL ENVINI
      CALL C1234567 ('In WIF023 at 1e')






      CALL C1234567 ('In WIF023 at 1f')



      IU60=0
      IU66=0
      IU67=0
      IU68=0
      CALL C1234567 ('In WIF023 at 1f1')



      ISOLID=.FALSE.
      CPKSCL=0.5
      BNDTHI=0.4 
      BNDDSH=0.5
      SURP3=0.5
      SURP4=0.5
      CPKP3=0.5
      CPKP4=0.5
      CPKTRA=FLOAT(WIFPAR(1250))/100.0
      SURTRA=FLOAT(WIFPAR(1251))/100.0
      SURSHI=FLOAT(WIFPAR(1253))/100.0
      CPKSHI=FLOAT(WIFPAR(1253))/100.0
      CALL C1234567 ('In WIF023 at 1f2')
      CALL X11PARM (15,NINT(FLOAT(WIFPAR(1254))/100.0))
      CALL C1234567 ('In WIF023 at 1f3')
      CALL GVSBTF (SOLDON,MAXAT)
      CALL C1234567 ('In WIF023 at 1g')



      CALL GVSCTB (SCLCR1,MAXSET*80)
      CALL GVSCTB (SCLCR2,MAXSET*80)
      CALL GVSCTB (SCLCR3,MAXSET*80)
      CALL GVSCTB (CRYCRD,MAXSET*80)
      XDCSCL=1.0
      PDRESO=-1.0
      HAS_Z=.FALSE.



      PDBLUN=0
      CALL GVSRTC (GENRVL,-999.9,MAXGENRVL)
      CALL GVSITC (GENIVL,-999,MAXGENIVL)
      CALL C1234567 ('In WIF023 at 1h')



      NUMGRT=0



      CALL GVSBTF (USE3SP,MAXSEQ)
      CALL C1234567 ('In WIF023 at 1i')
      CALL C1234567 ('In WIF023 at 1j')
      CALL GVSRT0 (IONASD,3*MAXPOL)
      CALL C1234567 ('In WIF023 at 1k')




         CALL NQA041
         CALL C1234567 ('In WIF023 at 2')





         CALL QUA099
         CALL C1234567 ('In WIF023 at 3')




      CALL GVSBTT (ISATOK,MAXAT)
      ATSDON=.FALSE.
      ATSNEW=.FALSE.
      CALL GVSIT0 (BOUND_TO,8*MAXAT)



      HBODON = .FALSE.









      NOTUNT=91
      NOTOUT=.FALSE.
      CALL GVSCTB (AANFIL,80)
      CALL GVSCTB (GENFIL,80)



      CALL GVSIT0 (JUNIAA,MAXAA)
      CALL GVSIT0 (PREVSHOW,MAXAA)
      CALL C1234567 ('In WIF023 at 4')



      CALL GVSCTB (LOCHST,MAXAA)
      HSTDON=.FALSE.



      CALL GVSCTB (FAMNAM,MAXFAM*80)
      CALL GVSIT0 (FAMILY,2*MAXFAM)
      CALL GVSIT0 (CLUSTR,MAXCLL*MAXCLU)
      CALL GVSCTB (CLUNAM,MAXCLL*80)
      CALL GVSIT0 (LENCLU,MAXCLL)
      CLU_ONCE=.FALSE.
      FAM_ONCE=.FALSE.
      CALL C1234567 ('In WIF023 at 5')



      CALL GVSRT0 (FTCRDS,4*MAXIG)
      CALL GVSRT0 (DGWVAL,MAXIG)
      CALL C1234567 ('In WIF023 at 5a')



      CALL MOL100
      NUMSOU=0
      NUMRNG=0
      CELMUL=0
      CALL C1234567 ('In WIF023 at 6')




         CALL SUPINI
         CALL C1234567 ('In WIF023 at 6a')
         CALL SUP3SP
         CALL C1234567 ('In WIF023 at 6b')




      CALL GVSCTB (SPCNAM,12)
      SYMGCA=.FALSE.
      CALL C1234567 ('In WIF023 at 6d')
      CALL GVSRT0 (SYMSCL,9)
      CALL C1234567 ('In WIF023 at 6e')
      SYMSCL(1,1)=0.001
      SYMSCL(2,2)=0.001
      SYMSCL(3,3)=0.001
      CALL GVSRT0 (SYMINV,9)
      CALL C1234567 ('In WIF023 at 6f')
      SYMINV(1,1)=1000.0
      SYMINV(2,2)=1000.0
      SYMINV(3,3)=1000.0
      CALL SYMINI
      CALL C1234567 ('In WIF023 at 6g')
      CELDIM(1)=1000.0
      CELDIM(2)=1000.0
      CELDIM(3)=1000.0
      CELDIM(4)=90.0
      CELDIM(5)=90.0
      CELDIM(6)=90.0
      CALL C1234567 ('In WIF023 at 7')



      CALL GVSIT0 (ESPUSE,ESPBLK)
      CALL C1234567 ('In WIF023 at 8')







      CALL C1234567 ('In WIF023 at 9')




      CALL GVSIT0 (FRCCYS,2*MAXCYS)
      CALL C1234567 ('In WIF023 at 11a')

      CALL C1234567 ('In WIF023 at 13')



      MAPNUM=0
      MAPNOW=0



      JMLDNB=0
      JMLNXT=0
      JMLGWD=400
      CALL GVSCTB (JMLDIR,80)



      ASMEAA='    '



      CALL WIF023B



      SPCSOL=917
      CALL GVSRT0 (P1XYZ,3)
      CALL GVSRT0 (P2XYZ,3)
      X_MLOW=0.0
      Y_MLOW=0.0
      X_MHGH=0.0
      Y_MHGH=0.0
      MENIRI=1
      IRISFLAGS(3)=.TRUE.
      PLOTNR=100
      CALL C1234567 ('In WIF023 at 13a')
      CALL GVSBTF (BUTTONS,36)
      BUTTONS(1)=.TRUE.
      BUTTONS(7)=.TRUE.
      BUTTONS(8)=.TRUE.
      BUTTONS(9)=.TRUE.
      BUTTONS(11)=.TRUE.
      BUTTONS(36)=.TRUE.
      CALL C1234567 ('In WIF023 at 13b')
      CALL GVSRT0 (SAVM1234,26*4)
      CALL C1234567 ('In WIF023 at 13c')
      CALL GVSBTF (M1DONE,4)
      CALL C1234567 ('In WIF023 at 13d')
      CALL GVSMTU (WORKMAT,4)
      CALL C1234567 ('In WIF023 at 13e')
      CALL GRTVIN
      CALL C1234567 ('In WIF023 at 13f')
      CALL GVSIT0 (HUEVAL,MAXVEC)
      CALL GVSIT0 (MITEMS,9*MAXITM)
      CALL GVSCTB (MITEXT,80*9*MAXITM)
      CALL GVSBTF (WRK1TF,MAXAA)
      CALL GVSBTF (WRK2TF,MAXAA)
      CALL GVSBTF (WRK3TF,MAXAA)
      CALL GVSBTF (WRK4TF,MAXAA)
      GPCRUSE=0
      CALL C1234567 ('In WIF023 at 14')



      CALL GVSCTB (HEND,4*2*MAXHEL*MAX7GR)






      CALL C1234567 ('In WIF023 at 15')



      CALL GVSSTX (IONTYP,'**')
      POLION=.FALSE.
      IONLOW=1.5
      IONHGH=3.5
      CALL GVSIT0 (SUGREA,MAXAA)



      CALL MOLINI
      CALL C1234567 ('In WIF023 at 16')



      IF (NUMATF.GE.1) THEN
         DO 20 IAT=1,NUMATF
            ATTVAL(IAT)=0.0
 20      CONTINUE
      END IF
      CALL C1234567 ('In WIF023 at 17')
      CALL GVSRT0 (ACONVC,3)
      NUMFAM=0
      NUMCLU=0
      LOGGER=.FALSE.
      HBODON=.FALSE.
      CALL C1234567 ('In WIF023 at 18')







      STAUNT=0
      STACNT=0



      CALL GVSCTB (LOCLIN,80)
      CALL GVSSTX (LOCLIN,'All parameters initialized')
      CALL SETHIS (LOCLIN)

      CALL C1234567 ('In WIF023 at the end')



      CALL SETHIS ('?M5144')


      RETURN
      END
      SUBROUTINE WIF023A (IERR)


















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, GVFLFR, I, IPAR, IVAL
      LOGICAL       GVFIBN, GVFISF
      REAL          ROW(2)







      IERR=0



      IF (GVFISF('PARAMS.FIG')) THEN
         CALL GVSSTX (LINE,'PARAMS.FIG')
      ELSE
         CALL GVSCCC (LINE,WHERIS,'PARAMS.FIG')
      END IF



      CALL GETFILE (11,' ',LINE,IERR)
      IF (IERR.NE.0) GOTO 998



    5 CONTINUE
         CALL GETLINE (11,LINE,IERR)
         IF (IERR.NE.0) STOP 'BUG in parameter reading'
      IF (LINE(1:1).NE.'*') GOTO 5



   10 CONTINUE
         CALL GETLINE (11,LINE,IERR)



         IF (IERR.EQ.1) STOP 'BUG in parameter reading'



         IF (IERR.EQ.2.OR.LINE(1:4).EQ.'*END') GOTO 998



         CALL GVSCUC (LINE)
         IF (LINE(1:5).EQ.'     ') GOTO 10



         CALL GVSFMT ('?FMT1286')
         READ (LINE,FMT,ERR=20,END=998) IPAR,IVAL



         IF (.NOT.GVFIBN(IPAR,1,MAXPAR)) THEN
            CALL GVSTTB ('?PRFOOR')
            CALL GVSTT6 (LINE)
            IERR=1
            GOTO 998
         END IF
         WIFPAR(IPAR)=IVAL
         GOTO 10



 20      CONTINUE
         I=GVFLFR(2,ROW,LINE)



         IF (I.NE.2) THEN
            CALL GVSTTB ('?NTNPAR')
            CALL GVSTT6 (LINE)
         END IF
         IPAR=NINT(ROW(1))



         IF (.NOT.GVFIBN(IPAR,1,MAXPAR)) THEN
            CALL GVSTTB ('?PRFOOR')
            CALL GVSTT6 (LINE)
            IERR=1
            GOTO 998
         END IF



         WIFPAR(IPAR)=NINT(ROW(2))
      GOTO 10



  998 CONTINUE


      RETURN
      END
      SUBROUTINE WIF023B

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IUNIT, ICNT, IERR, I
      LOGICAL       GRTFILE
      CHARACTER*80  LOCLIN, LOCLN2








      ICNT=0
      IUNIT=0
      CALL GVSRT0 (SIGMAP,MAXSIG)



      CALL GVSCCC (LOCLIN,FILDIR(27),'SIGMAP.FIL')
      IF (.NOT.GRTFILE(IUNIT,LOCLIN)) THEN
         CALL GVSCCC (LOCLN2,WHERIS,'SIGMAP.FIL')
         CALL GVSCP (LOCLIN,LOCLN2,LINE250)
         IF (.NOT.GRTFILE(IUNIT,LOCLIN)) GOTO 998
      END IF



      DO 10 I=1,1000000




         CALL GVSCTB (LOCLIN,80)
         CALL GETLINE (IUNIT,LOCLIN,IERR)

         IF (IERR.NE.0) GOTO 998
         IF (LOCLIN(1:4).EQ.'*END') GOTO 998



         IF (LOCLIN(1:1).EQ.'#') THEN

            GOTO 10
         END IF
         ICNT=ICNT+1
         CALL GVSFMT ('?FMT1287')
         READ (LOCLIN,FMT,ERR=999,END=999) SIGMAP(ICNT)
 10   CONTINUE
      GOTO 998



 999  CONTINUE
      CALL GVSTTE ('?M3191')
      CALL GVSEIR ('INI023B')



  998 CONTINUE
      IF (IUNIT.NE.0) CALL GVSCLF (IUNIT)



      RETURN
      END   
      SUBROUTINE WIF023C (IPAR,VALIN)

















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INTEGER       IERR, IUNIT, JUNIT, IPAR, I, J, GVFLFR, ICNT
      REAL          VALIN, VAL
      LOGICAL       GVFISF
      CHARACTER*80  LOCLIN







      ICNT=0
      IUNIT=0
      JUNIT=0
      IF (WIFPAR(12).NE.0) GOTO 998




      CALL GVSROF (IUNIT,IERR)
      IF (IUNIT.LE.0.OR.IERR.NE.0) GOTO 998
      CALL GVSCCC (LOCLIN,FILDIR(27),'SIGMAP.FIL')
      IF (.NOT.GVFISF(LOCLIN)) GOTO 999
      CALL GETFILE (IUNIT,' ',LOCLIN,IERR)
      IF (IERR.NE.0) GOTO 999
      CALL GVSROF (JUNIT,IERR)
      IF (JUNIT.LE.0.OR.IERR.NE.0) GOTO 998
      CALL GVSREW (IUNIT)
      CALL GVSDEL ('XXX')
      CALL GETFILN (JUNIT,' ','XXX',IERR)
      IF (IERR.NE.0) GOTO 999



      DO 10 I=1,1000000
         CALL GVSCTB (LOCLIN,80)
         CALL GETLINE (IUNIT,LOCLIN,IERR)
         IF (IERR.NE.0) GOTO 11
         IF (LOCLIN(1:1).EQ.'#') THEN
            CALL GVSTTU (JUNIT,LOCLIN)
            CALL GVSTTU (6,LOCLIN)
            GOTO 10
         ELSE
            ICNT=ICNT+1
         END IF
         IF (ICNT.EQ.IPAR) THEN
            J=GVFLFR(1,VAL,LOCLIN)
            IF (J.EQ.1) THEN
               CALL GVSFMT ('?FMT527')
               WRITE (JUNIT,FMT,ERR=999) VALIN
               PRINT*,'Put parameter ',IPAR,' in SIGMAP as ',VALIN
            ELSE
               CALL GVSTTE ('ERROR decoding SIGMAP line:')
               CALL GVSTTE (LOCLIN)
               CALL GVSTTU (JUNIT,LOCLIN)
            END IF
         ELSE
            CALL GVSTTU (JUNIT,LOCLIN)
         END IF
 10   CONTINUE
 11   CONTINUE
      CALL GVSCCC (LOCLIN,FILDIR(27),'SIGMAP.FIL')
      CALL GVSMV  (LOCLIN,'XXX',BIGLIN)
      GOTO 998



  999 CONTINUE
      CALL GVSEIW ('WIF023C')



  998 CONTINUE
      IF (IUNIT.NE.0) CALL GVSCLF (IUNIT)
      IF (JUNIT.NE.0) CALL GVSCLF (JUNIT)


      RETURN
      END
      SUBROUTINE WIF024



















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'IMPROP.INC'
      INTEGER       ATT, IRT, LUN, IERR
      REAL          AVE, SIG
      LOGICAL       GVFFOP, GVFISF
      CHARACTER*80  LOCLIN







      LUN=0
      IF (WIFPAR(12).NE.0) GOTO 998
      CALL GVSRTC (IMPAVE,-999.9,NUMUA*MAXTAT)
      CALL GVSRTC (IMPSIG,180.0,NUMUA*MAXTAT)



      CALL GVSROF (LUN,IERR)
      IF (IERR.NE.0) GOTO 999
      CALL GVSCCC (LOCLIN,FILDIR(27),'IMPROPER.DAT')
      IF (.NOT.GVFISF(LOCLIN)) THEN
         CALL GVSCCC (LOCLIN,WHERIS,'IMPROPER.DAT')
         IF (.NOT.GVFISF(LOCLIN)) THEN
            CALL GVSTTE ('?M4848')
            GOTO 998
         END IF
      END IF
      CALL GVSOPF (LOCLIN,LUN,'OLD')
      IF (.NOT.GVFFOP(LUN)) THEN
         CALL GVSTTE ('?M4848')
         GOTO 998
      END IF



      CALL GVSFMT ('?FMT926')
   10 CONTINUE
         READ (LUN,FMT,ERR=999,END=998) ATT,IRT,AVE,SIG

         IMPAVE(ATT,IRT)=AVE
         IMPSIG(ATT,IRT)=SIG
      GOTO 10
      GOTO 998



  999 CONTINUE
      CALL GVSTTE ('?R00285')



  998 CONTINUE
      IF (LUN.NE.0) CALL GVSCLF (LUN)


      RETURN
      END
      SUBROUTINE WIF109

















      IMPLICIT      NONE
      INCLUDE       'EAAINC.INC'












      NAMEAA(1)='BIG '
      NAMEAA(2)='SML '
      NAMEAA(3)='POS '
      NAMEAA(4)='NEG '
      NAMEAA(5)='POL '
      NAMEAA(6)='ARO '



      NUMEAA=6



      CALL GVSIT0 (LENEAA,MAXEAA)
      LENEAA(1)=7
      LENEAA(2)=3
      LENEAA(3)=2
      LENEAA(4)=2
      LENEAA(5)=7
      LENEAA(6)=3





      RETURN
      END
      SUBROUTINE WIFRDF






















      IMPLICIT      NONE
      INCLUDE       'BIGINC.INC'
      INCLUDE       'DATBAS.INC'
      INTEGER       IAA, ISEQ, LOCNAF
      LOGICAL       GVFISF







      CALL GVSCCC (LINE,FILDIR(27),'TOTALS.SEQ')
      IF (.NOT.GVFISF(LINE)) THEN
         CALL GVSTT6 ('?FNF005')
         CALL GVSTT6 ('?NODBOP')



         CALL GVS2T0 (ALLSEQ,MAXADB*MAXSEQ)
         GOTO 998
      END IF



      CALL GVSCLF (11)




         OPEN (UNIT=11,FILE=LINE,FORM='FORMATTED',STATUS='UNKNOWN')





      DO 10 ISEQ=1,NBINDB
         CALL GVSFMT ('?FMT022')
         READ (11,FMT,ERR=999,END=999) LOCNAF

         IF (LOCNAF.NE.NAAFIL(ISEQ)) THEN
            CALL GVSTTI3 ('ISEQ,LOCNAF,NAAFIL=',ISEQ,LOCNAF,
     +       NAAFIL(ISEQ))
            GOTO 999
         END IF
         CALL GVSFMT ('?FMT833')
         READ (11,FMT,ERR=999,END=999)
     +    (ALLSEQ(IAA,ISEQ),IAA=1,NAAFIL(ISEQ))
   10 CONTINUE
      GOTO 998



  999 CONTINUE
      CALL GVSTT6 (LINE)
      CALL GVSTT6 ('?ERF005')



  998 CONTINUE
      CALL GVSCLF (11)


      RETURN
      END
      BLOCK DATA INI
      IMPLICIT      NONE
      INCLUDE       'EAAINC.INC'
      INTEGER       MREST
      PARAMETER     (MREST=MAXEAA*20-120)
      DATA MATEAA  /19,20,5,7,15,9,11,13*0,
     +              6,1,16,17*0,
     +              15,9,18*0,
     +              4,3,18*0,
     +              15,9,4,3,14,12,7,13*0,
     +              5,19,20,17*0,
     +              MREST*0/
      END
