      subroutine RECALL
      include 'SIZE.INC'
      include 'GLOBAL.INC'
      include 'LOCAL.INC'
      include 'INPAR.INC'
      include 'UNITS.INC'
      real RESULT
      integer INUNIT,WHICH,CC,VRAIL,EOF,IREC,KT,II,J,NUSED,IMBED,KP
      character*1 CBUFF(VARCEC), NAME(50)
      character REQFMT*51
      data REQFMT
     &  /'(1X,''Please enter the Recall Access Password-> ''  )'/
      INUNIT = TTYIN(MACHNO)
      call DECOD1 (2,WHICH,CC,RESULT)
      if (CC.gt.1) go to 160
      IREC = ifix(RESULT)
      KT = 1
      if (MCHEMG.ge.1) KT = MCHEMG
      if (WHICH.ne.1) go to 100
      call DECOD4 (2,IREC,KT,KCHEM,CC)
      if (CC.gt.1) go to 150
100   continue
      call DECOD2 (IREC,CC,WHICH,II,CBUFF)
      if (CC.eq.3) go to 150
      if (CC.eq.1) go to 110
      write (TTYOUT(MACHNO),5000)
5000  format (//' No entry in the catalog at this location.')
      go to 150
110   continue
      read (RANUNT(MACHNO),rec=II) CBUFF
      do 120 J = 1, 50
         NAME(J) = CBUFF(J)
120   continue
      NUSED = 50
      do 130 J = 1, 6
         RPASS(WHICH)(J:J) = CBUFF(NUSED+1)
         NUSED = NUSED+2
130   continue
      if (RPASS(WHICH).eq.'GLOBAL') go to 140
      write (TTYOUT(MACHNO),5010)
5010  format (' This entry is protected from unauthorized access.')
      REQFMT(49:50) = CRSTOP(MACHNO)
      write (TTYOUT(MACHNO),REQFMT)
      call INREC (EOF,INUNIT,INPUT)
      if (EOF.eq.1) then
         write (TTYOUT(MACHNO),5020)
5020  format (' End-of-file while reading password -- RECALL aborted.')
         go to 150
      endif
      START = IMBED(INPUT,0)
      if (START.eq.-999) then
         write (TTYOUT(MACHNO),5030)
5030     format (' RECALL cancelled.')
         go to 150
      endif
      if (INPUT(START:START+5).eq.RPASS(WHICH).or.INPUT(START:START+5)
     &   .eq.SYSPAS) go to 140
      write (TTYOUT(MACHNO),5040)
5040  format (' Password does not match.  Please check your records;'/  
     &' the RECALL has been cancelled.')
      go to 150
140   continue
      if (WHICH.eq.1) call UNPAK (IREC,KT)
      if (WHICH.eq.2) call UNPENV (IREC)
      if (WHICH.eq.3) call UNPLDS (IREC)
      if (WHICH.eq.4) call UNPPRO (IREC)
      KP = VRAIL(NAME)
      if (WHICH.eq.1) write (TTYOUT(MACHNO),5050) (NAME(J),J=1,KP)
5050  format (/' Selected compound is: ',50A1)
      if (WHICH.eq.2) write (TTYOUT(MACHNO),5060) (NAME(J),J=1,KP)
5060  format (/' Selected environment is: ',50A1)
      if (WHICH.eq.3) write (TTYOUT(MACHNO),5070) (NAME(J),J=1,KP)
5070  format (/' Selected load is: ',50A1)
      if (WHICH.eq.4) write (TTYOUT(MACHNO),5080) (NAME(J),J=1,KP)
5080  format (/' Selected product is: ',50A1)
150   continue
      RPASS(WHICH) = 'GLOBAL'
      WPASS(WHICH) = 'GLOBAL'
160   continue
      return
      end
