C
C This file is issued from the MODULEF library, but has been 
C subsequently modified
C
      SUBROUTINE FONDID(NIDENT)
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C           S.P. FONDID          (FONCTIONS INTERPRETEES)
C           -----------
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C BUT :
C     DETRUIRE DE LA TABLE DES IDENTIFICATEURS
C     LES NIDENT DERNIERS IDENTIFICATEURS RENCONTRES
C
C PARAMETRES D ENTREE :
C     NIDENT  : NOMBRE D IDENTIFICATEURS A DETRUIRE
C ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
C PROGRAMMEUR : PATRICK LAUG ; INRIA (3) 954 90 20 POSTE 508
C ......................................................................
      PARAMETER (LIDN=8)
      CHARACTER*256 MIDN(LIDN)
      COMMON /FONIDN/ MIDN
      COMMON /FONNUM/ IDLIG,IFLIG,NITEMS,NBIDEN,IMPLIC
      COMMON /FONLC / LCI,LCR,LCL,LCC,LCD,LCOPN,LCOPT,LCSYM,LCEXP,LCIDN
      COMMON /FONLM / LMI,LMR,LML,LMC,LMD,LMOPN,LMOPT,LMSYM,LMEXP,LMIDN
C
      IF (NIDENT.LE.0) RETURN
      NBIDEN = MAX(NBIDEN-NIDENT, 0)
      IIDENT = 0
C
C PARCOURS INVERSE DE LA CHAINE
  100 IFIN  = INDEX(MIDN(LCIDN), '||')
  200 IFIN = IFIN - 1
      IF (IFIN .LE. 0) THEN
         LCIDN = LCIDN - 1
         IF (LCIDN .LE. 0) THEN
            LCIDN = 1
            MIDN(1)(1:2) = '||'
            RETURN
         END IF
         GOTO 100
      END IF
      IF (MIDN(LCIDN)(IFIN:IFIN) .EQ. '|') THEN
         IIDENT = IIDENT + 1
         IF (IIDENT .EQ. NIDENT) THEN
            MIDN(LCIDN)(IFIN+1:IFIN+1) = '|'
            RETURN
         END IF
      END IF
      GOTO 200
      END
