C
C This file is issued from the MODULEF library, but has been 
C subsequently modified
C
      SUBROUTINE ZALDY3 (M,NOM,LONG,ITYPE,IADRES,IA,IPOPRE)
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C BUT :
C     ALLOCATION DYNAMIQUE - CHERCHER UN TABLEAU
C
C PARAMETRES :
C    M SUPER TABLEAU
C    IN: NOM
C
C    OUT: LONG    NOMBRE DE MOT DU TABLEAU NOM
C         ITYPE   TYPE
C         IADRES  ADRESSE
C         IA      POINTEUR
C         IPOPRE  POINTEUR PRECEDENT
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C PROGRAMMEUR : F. HECHT - INRIA - AVRIL 86
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
      DIMENSION M(*),NOMCP(64)
      CHARACTER*(*) NOM
      DATA IDEBUT/5/
      CALL CHAINT (NOM,NOMCP,64,NBCS)
      LM=M(1)
      IA=1
      IB=-IDEBUT
    5 IB=-IB
   10 IF(IA.GE.IB) GOTO 300
      IPOPRE=IA
      IA=IB
      IF(IA.GT.LM) GOTO 100
      IB=M(IA)
      IF(IB.GT.0) GOTO 20
      GOTO 5
   20   CONTINUE
      DO 30 I=1,NBCS
       IAI=IA+I
       IF(M(IAI).NE.NOMCP(I)) GOTO 10
   30 CONTINUE
      ITYPE=M(IAI+1)
      LONG =M(IAI+2)
      IADRES=IAI+3
      IF(ITYPE.LE.4) RETURN
      IF(ITYPE.LT.7) THEN
       IADRES=IADRES+MOD(IADRES+1,2)
      ELSE
       IADRES=IADRES+3-MOD(IADRES+2,4)
      END IF
      RETURN
  100 IF(IA.NE.LM+1) GOTO 300
      IA=0
      ITYPE=0
      LONG=0
      IADRES=0
      RETURN
C                 ERREUR
  300 CONTINUE
      CALL IMALDY(M)
      STOP
      END
