      subroutine LIST(OUTLUN,SPOOL)
      include 'INPAR.INC'
      include 'UNITS.INC'
      real XT
      integer EOF,ERROR,LENS(3),INUNIT,MINS(3),NTABL,OUTLUN,REPEAT,
     &SPOOL,UP,KNT,IMBED,II,IT,MATCH,IS,ITAB,LRAIL,J
      integer THREE, NAMLEN
      character BLANK*1,HOLD(4)*64,NAME(11)*1,SUFFIX(20)*2,TABID*7
      character REQFMT(2)*31
      data REQFMT(1)/'(1X,''Enter Table Number -> ''  )'/
      data REQFMT(2)/'(1X,''More? (Yes/No/Quit)-> ''  )'/
      data TABID /' Table '/
      data THREE,NAMLEN/3,11/
      data SUFFIX/'1.','2.','3.','4.','5.','6.','7.','8.','9.',
     & '10','11','12','13','14','15','16','17','18','19','20'/
      data LENS,MINS/3,4,4,1,1,1/
      data NAME,BLANK/'A','L','L','Q','U','I','T','H','E','L','P',' '/
      START = STOPIT+1
      REPEAT = 0
      KNT = 0
      go to 110
100   continue
      write (TTYOUT(MACHNO),5000)
5000  format ('       At the prompt, enter a Table number, "Quit,"',/,' 
     &      or "Help" to see a catalog of the output tables.')
      REQFMT(1)(29:30) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT(1))
      INUNIT = TTYIN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 260
      STOPIT = 0
      START = 1
110   continue
      NTABL = 21
      START = IMBED(INPUT,START-1)
      if (START.eq.-999) go to 100
      II = START-1
      call SKAN (INPUT,START,STOPIT,TYPE,BLANK,1)
      if (TYPE.eq.100) STOPIT = 81
      IT = MATCH(THREE,NAMLEN,LENS,NAME,MINS)
      IT = IT+1
      go to (130,160,280,120), IT
120   continue
      write (TTYOUT(MACHNO),5010)
5010  format (//                                                        
     -  '   1 Chemical inputs: FATE Data'/                              
     -  '   2 Chemical inputs: PRODUCT Chemistry'/                      
     -  '   3 PULSE Chemical Loadings'/                                 
     -  '   4 Environmental Input Data: BIOLOGICAL Parameters'/         
     -  '   5 Environmental Input Data: HYDROLOGIC Parameters')
      write (TTYOUT(MACHNO),5020)
5020  format (                                                          
     -  '   6 Environmental Input Data: SEDIMENT Properties'/           
     -  '   7 Environmental Input Data: PHYSICAL GEOMETRY'/             
     -  '   8 MISCellaneous Environmental Input Data: Wind, D.O., etc.'/
     -  '   9 Input specifications: ADVECTIVE transport field'/         
     -  '  10 Input specifications: DISPERSIVE transport field')
      write (TTYOUT(MACHNO),5030)
5030  format (                                                          
     -  '  11 Environmental Input Data: GLOBAL site parameters'/        
     -  '  12 KINETIC PROFILE of Synthetic Chemical'/                   
     -  '  13 Chemical REACTIVITY PROFILE of Ecosystem'/                
     -  '  14 Allochthonous Chemical LOADS and Pulses'/                 
     -  '  15 DISTRIBUTION of Chemical in Environment')
      write (TTYOUT(MACHNO),5040)
5040  format (                                                          
     -  '  16 Chemical SPECIATION of Dissolved Concentrations'/         
     -  '  17 Chemical Concentration MEANS, Maxima, and Minima'/        
     -  '  18 Sensitivity Analysis of Chemical FATE'/                   
     -  '  19 Summary TIME-TRACE of Chemical Concentrations'/           
     -  '  20 Exposure Analysis SUMMARY'/                               
     -  ' ALL Entire Report')
      go to 100
130   continue
      STOPIT = II
      call GETNUM (ERROR,XT)
      if (ERROR-1) 150, 100, 140
140   continue
      write (TTYOUT(MACHNO),5050)
5050  format (/,' Unable to interpret input; please re-enter.')
      go to 100
150   continue
      NTABL = int(XT)
      if (NTABL.lt.1.or.NTABL.gt.20) go to 290
160   continue
      open (unit=RPTLUN(MACHNO),status='OLD',access='SEQUENTIAL',form=
     &'FORMATTED',FILE='REPORT.XMS',err=270)
      if (.not.(TOPOPN(MACHNO))) rewind RPTLUN(MACHNO)
      if (SPOOL .eq. 1) then
         if (MACHIN .eq. 'DOS') open (unit=OUTLUN,
     &                          file='PRN', status='unknown')
         if (MACHIN .eq. 'DEC') open (unit=OUTLUN,
     &                          file='sys$login:PRN.EXA', status='new')
      endif
      IS = 0
      ITAB = NTABL
      if (NTABL.ne.21) go to 180
170   continue
      INUNIT = RPTLUN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 300
      KNT = KNT+1
      UP = LRAIL(INPUT,80)
      if (UP.eq.1) then
         write (OUTLUN,5060)
5060     format ('  ')
      else
         write (OUTLUN,5070) INPUT(2:UP)
5070     format (1X,A)
      endif
      go to 170
180   continue
      INUNIT = RPTLUN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 300
      KNT = KNT+1
190   continue
      IS = IS+1
      if (IS.eq.5) IS = 1
      HOLD(IS) = INPUT
      if (INPUT(2:7).ne.TABID(2:7).or.INPUT(8:9).ne.SUFFIX(ITAB)) go to
     &   180
      if (REPEAT.eq.0) go to 210
200   continue
      REQFMT(2)(29:30) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT(2))
      INUNIT = TTYIN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 300
      START = IMBED(INPUT,0)
      if (START.eq.-999) goto 210
      if (INPUT(START:START).eq.'Q'.or.INPUT(START:START).eq.'q') go to
     &   300
      if (INPUT(START:START).eq.'N'.or.INPUT(START:START).eq.'n') go to
     &   180
      if (INPUT(START:START).eq.'Y'.or.INPUT(START:START).eq.'y') go to
     &   210
      write (TTYOUT(MACHNO),5080)
5080  format (/1X,'Response was not understood; Please try again.')
      go to 200
210   continue
      IS = IS+1
      if (IS.eq.5) IS = 1
      do 220 J = 1, 4
         INPUT = HOLD(IS)
         UP = LRAIL(INPUT,80)
         if (UP.eq.1) then
            write (OUTLUN,5060)
         else
            write (OUTLUN,5070) INPUT(2:UP)
         endif
         IS = IS+1
         if (IS.eq.5) IS = 1
220   continue
230   continue
      INUNIT = RPTLUN(MACHNO)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) go to 300
      KNT = KNT+1
      if (INPUT(1:1).eq.'1') go to 240
      UP = LRAIL(INPUT,80)
      if (UP.eq.1) then
         write (OUTLUN,5060)
      else
         write (OUTLUN,5070) INPUT(2:UP)
      endif
      go to 230
240   continue
      REPEAT = 1
      IS = 0
      go to 190
260   continue
      write (TTYOUT(MACHNO),5090)
5090  format (/1X,'End-of-File encountered; LIST terminated.')
      go to 500
270   continue
      write (TTYOUT(MACHNO),5100)
5100  format (/1X,'Cannot find results file; command cancelled.')
      go to 500
280   continue
      go to 500
290   continue
      write (TTYOUT(MACHNO),5110)
5110  format (/1X,'Entry out-of-range')
      go to 500
300   continue
      if (KNT.eq.0) then
         write (TTYOUT(MACHNO),5120)
      else
         if (SPOOL .eq. 1) then
            close (unit=OUTLUN)
         endif
      endif
5120  format (//' No records found in the report file.')
5130  format (/1X,'Requested report has been routed to printer.')
5140  format (/' Requested report has been written in'/                 
     &' file "PRN.EXA" for later retrieval.')
500   continue
      close (unit=RPTLUN(MACHNO))
      return
      end
