C  PACKWAVE.FTN
C  PROGRAM TO PACK NIH ELEMENTAL DATA BASE SORTED BY INCREASING WAVELENGTH
C
C   COPYRIGHT 1982 GENERAL ELECTRIC CO.
C      WRITTEN APRIL 1982  M.F.GARBAUSKAS
C
C   MINIMUM RELATIVE INTENSITY: 0.06
C
C
      REAL*8 L
      OPEN(UNIT=1,NAME='MASTER.ENG',TYPE='OLD',READONLY)
C PDP11 SIZE = .5 + .5 + 2 + 1 + 1 = 5
C VAX   SIZE = 1  +  1 + 2 + 1 + 1 = 6
      OPEN(UNIT=2,NAME='WAVELH.NIH',TYPE='NEW',ACCESS='DIRECT'
     % ,RECORDSIZE=6)
C PDP11     % ,RECORDSIZE=5)
C
      NREC=1
100   READ(1,9100,END=900,ERR=800)IZ,IEL,L,ITEST,W,RELINT
9100  FORMAT(I2,1X,A2,1X,A8,1X,A2,2X,F12.8,1X,F7.3)
      IF(ITEST.EQ.'AB')GO TO 100
      IF(RELINT.LT.0.06)GO TO 100
      WRITE(2'NREC)IZ,IEL,L,W,RELINT
      NREC=NREC+1
      GO TO 100
800   WRITE(5,9800)IZ,NREC
9800  FORMAT(' * ERROR READING ELEMENT NO. ',I3,' RECORD NO. ',I6)
      STOP
900   NREC=NREC-1
      WRITE(5,9900)NREC
9900  FORMAT(' * RECORDS IN FILE:',I6)
      CLOSE(UNIT=1)
      CLOSE(UNIT=2)
      STOP
      END
