C   07/06/96 606071908  MEMBER NAME  SIMBOS   (S4)          FORTG1
      SUBROUTINE BLOC(INDA,NAMEA,NRA,*)
      COMMON/BCS/IW(3000)
      INTEGER IU(1),   NOFF/10/
      EQUIVALENCE (IU(1),IW( 11))
C     INTEGER IU(1),   NOFF/2000/
C     EQUIVALENCE (IU(1),IW(2001))
C
C     FOR THE PLUTO ONLINE PROGRAM, THIS IS A PROGRAM FOR THE
C     SIMULATION OF SEVERAL BOS-ENTRIES, USING THE MBOS PROGRAM.
C     THE FOLLOWING ENTRIES ARE SIMULATED.
C         BLOC
C         BPOS/BNXT
C         BCRE          SEE REMARKS BELOW
C         BDLS
C         BMVE          DUMMY
C         BCHL          SEE REMARKS BELOW
C         BGAR
C     THE MBOS PROGRAM USES AN ARRAY IU IN THE HIGH-PART OF
C     COMMON/BCS/IW(...)     (SEE STATEMENTS ABOVE)
C     THE MBOS-ARRAY HAS TO BE INITIALIZED BY E.G. (FOR 29 POINTERS)
C     CALL MBOS(IU,IU(30),1000)
C     ALL BANKS MUST HAVE ASSOCIATED POINTERS WITHIN IU( ) AND
C     A NAME AND A NUMBER. THE SIMULATED BCRE NEEDS A BANK OF
C     THE SAME NAME AND NUMBER. THIS CAN BE DONE BY CALLS
C        CALL MNNR(IU,NAME,NR)
C        CALL MCRE(IU,IU(L),0)
C     CREATING A BANK OF LENGTH ZERO. IF THE SIMULATED BCRE (OR
C     BCHL) IS CALLED, ALL BANKS BEHIND THE CREATED BANK ARE
C     SHIFTED.
C
C
C     ENTRY BLOC(INDA,NAMEA,NRA,*)
      IGO=1
      GOTO 88
C
C
      ENTRY BPOS(NAMEA)
      IGO=2
      GOTO 89
   10 IU(N-8)=IU(IND-1)
      GOTO 100
   12 IU(N-8)=-1
      GOTO 100
C
C
      ENTRY BCRE(INDA,NAMEA,NRA,NWA,*,IER)
      IGO=3
      IER=0
      GOTO 88
   20 K=IU(IND-1)
      CALL MCRE(IU,IU(K),NWA)
      IU(N-7)=K
      IF(IU(IND).NE.NWA) GOTO 22
      IF(NWA.EQ.0) GOTO 99
      CALL VZERO(IU(IND+1),NWA)
      GOTO 99
   22 IER=2
      GOTO 101
C
C
      ENTRY BDLS(NAMEA,NRA)
      IGO=4
      GOTO 88
   30 K=IU(IND-1)
      CALL MDRP(IU,IU(K),IU(K))
      GOTO 100
C
C
      ENTRY BNXT(INDA,*)
      N=IU(1)
      IF(IU(N-8)) 40,42,44
   40 IU(N-8)=0
      GOTO 101
   42 INDA=INDA-NOFF
      IND=INDA+4+IU(INDA)
      IF(IU(IND-3).EQ.IU(INDA-3)) GOTO 99
      GOTO 101
   44 K=IU(N-8)
      IU(N-8)=0
      IND=IU(K)
      GOTO 99
C
C
      ENTRY BMVE(INDA,*)
      GOTO 100
C
C
      ENTRY BCHL(NWA,*)
      IF(IU(N-7).EQ.0) GOTO 102
      K=IU(N-7)
      IF(IU(K).EQ.0) GOTO 102
      NW=IU(IU(K))+NWA
      CALL MCRE(IU,IU(K),NW)
      IF(IU(IU(K)).EQ.NW) GOTO 100
      GOTO 102
C
C
      ENTRY BGAR(IGA)
      CALL MBOS(IU,IU,NFRE)
      IGA=1
      GOTO 100
C
C
   88 NR  =NRA
   89 NAME=NAMEA
C     LOCATE NAME
      N=IU(1)
      L=IU(N)
      IND=L+4
   90 IF(IND.GE.IU(N-1)) GOTO 96
      IF(IU(IND-3).EQ.NAME) GOTO 91
      IND=IND+4+IU(IND)
      GOTO 90
C     NAME FOUND
   91 GOTO (93,10,93,93),IGO
C     LOCATE NR
   92 IF(IND.GE.IU(N-1)) GOTO 96
      IF(IU(IND-3).NE.NAME) GOTO 96
   93 IF(IU(IND-2)-NR) 94,95,96
   94 IND=IND+4+IU(IND)
      GOTO 92
C     NR FOUND
   95 GOTO (99,100,20,30),IGO
C     NOT FOUND
   96 GOTO (101,12,22,100),IGO
C
C
   99 INDA=IND+NOFF
  100 RETURN
  101 INDA=0
  102 RETURN 1
      END
