      SUBROUTINE MENUS(IPFK,IBOUT,IDEROUL,IRC)
      INCLUDE 'com_boutons.f'
      INCLUDE 'com_coor.f'
      INCLUDE 'com_faces.f'
      INCLUDE 'com_options.f'
      PARAMETER (NDERMAX=64)
      CHARACTER*32 CDEROUL(NDERMAX),CTITRE(5)
      INTEGER      LDEROUL(NDERMAX),ICOLDEROUL(NDERMAX),ISAUVE(NDERMAX)
     &            ,ICDER(NDERMAX),IEXCL(NDERMAX),ICHOIX(NDERMAX)
     &            ,LTITRE(5),ICTITRE(5)
      DIMENSION RORO(3,3)
C
      IF (IBOUT.EQ.3333) THEN
        IBOUT = 0
        CALL LESCOULEURS(CDEROUL,LDEROUL,ICOLDEROUL,ILANG)
        IF (ILANG.EQ.0) THEN
          CDEROUL(17) = 'Inchangée'
        ELSE
          CDEROUL(17) = 'Unchanged'
        ENDIF
        LDEROUL(17) = 9
        ICOLDEROUL(17) = 0
        NDER = 17
        IDEROUL = 17
        XBS1 = XBOUT(1,IBFREEZ)
        XBS2 = XBOUT(2,IBFREEZ)
        YBS1 = YBOUT(1,IBFREEZ)
        YBS2 = YBOUT(2,IBFREEZ)
        DX = XHELP-XDMIN
        DY = (YDMAX-YDMIN)*.035
        XBOUT(2,IBFREEZ) = XCOUL
        XBOUT(1,IBFREEZ) = XBOUT(2,IBFREEZ)-DX*.9
        YBOUT(1,IBFREEZ) = YBIDONCOM+DY*.5
        YBOUT(2,IBFREEZ) = YBOUT(1,IBFREEZ)-DY
        NTITRE = 3
        IF (ILANG.EQ.0) THEN
          CTITRE(1) = 'Nouvelle couleur pour'
          LTITRE(1) = 21
        ELSE
          CTITRE(1) = 'New color for'
          LTITRE(1) = 13
        ENDIF
        ICTITRE(1) = 3
        IF (ISO.EQ.2) THEN
          WRITE(CTITRE(2),'("V =",G13.4)')
     &         .5*(VAL(IRC-18)+VAL(IRC-17))
          LTITRE(2) = 16
        ELSE
          WRITE(CTITRE(2),'(G13.4," < V <",G13.4)')
     &         VAL(IRC-18),VAL(IRC-17)
          LTITRE(2) = 32
        ENDIF
        LTITRE(2) = 32

        ICTITRE(2) = 3
        IF (ILANG.EQ.0) THEN
          CTITRE(3)(1:15) = '(couleur numéro'
          WRITE(CTITRE(3)(16:20),'(I4,")")') IRC-18
          LTITRE(3) = 20
        ELSE
          CTITRE(3)(1:13) = '(color number'
          WRITE(CTITRE(3)(14:18),'(I4,")")') IRC-18
          LTITRE(3) = 18
        ENDIF
        ICTITRE(3) = 3
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBFREEZ),YBOUT(1,IBFREEZ),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,0,IFONT7,2)
        XBOUT(1,IBFREEZ) = XBS1
        XBOUT(2,IBFREEZ) = XBS2
        YBOUT(1,IBFREEZ) = YBS1
        YBOUT(2,IBFREEZ) = YBS2
        RETURN
      ENDIF
      NTITRE = 0
      IF (IPFK.EQ.-18) THEN
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Num. interactifs'
          LDEROUL(1) = 16
          CDEROUL(2) = 'Pas de numéros'
          LDEROUL(2) = 14
          CDEROUL(3) = 'Noeuds'
          LDEROUL(3) = 6
          CDEROUL(4) = 'Eléments'
          LDEROUL(4) = 8
          CDEROUL(5) = 'Références'
          LDEROUL(5) = 10
          CDEROUL(6) = 'Références non nulles'
          LDEROUL(6) = 21
        ELSE
          CDEROUL(1) = 'Interactive num.'
          LDEROUL(1) = 16
          CDEROUL(2) = 'No numbers'
          LDEROUL(2) = 10
          CDEROUL(3) = 'Nodes'
          LDEROUL(3) = 5
          CDEROUL(4) = 'Elements'
          LDEROUL(4) = 8
          CDEROUL(5) = 'References'
          LDEROUL(5) = 10
          CDEROUL(6) = 'Non-zero references'
          LDEROUL(6) = 19
        ENDIF
        NDER = 6
        DO I=1,NDER
          ICOLDEROUL(I) = 0
        ENDDO
        IF (INUMER.EQ.0) THEN
          IDEROUL = 2
        ELSEIF(INUMER.EQ.1) THEN
          IDEROUL = 4
        ELSEIF(INUMER.EQ.-1) THEN
          IDEROUL = 3
        ELSEIF(INUMER.EQ.-2) THEN
          IDEROUL = 5
        ELSE
          IDEROUL = 6
        ENDIF
        IDER0 = IDEROUL
        XB1SAUV = XBOUT(1,IBOUT)
        XB2SAUV = XBOUT(2,IBOUT)
        XBOUT(1,IBOUT) = 2.*XB1SAUV - XB2SAUV
        XBOUT(2,IBOUT) = 3.*XB2SAUV - 2.*XB1SAUV
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XB1SAUV
        XBOUT(2,IBOUT) = XB2SAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER
     &  .OR.IDEROUL.EQ.IDER0) IDEROUL = 0
      ELSEIF(IPFK.EQ.-11) THEN
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Isométrique'
          LDEROUL(1) = 11
          ICOLDEROUL(1) = 0
          CDEROUL(2) = 'Lointaine'
          LDEROUL(2) = 9
          ICOLDEROUL(2) = 0
          CDEROUL(3) = 'Moyenne'
          LDEROUL(3) = 7
          ICOLDEROUL(3) = 0
          CDEROUL(4) = 'Proche'
          LDEROUL(4) = 6
          ICOLDEROUL(4) = 0
        ELSE
          CDEROUL(1) = 'Isometric'
          LDEROUL(1) = 9
          ICOLDEROUL(1) = 0
          CDEROUL(2) = 'Faraway'
          LDEROUL(2) = 7
          ICOLDEROUL(2) = 0
          CDEROUL(3) = 'Medium'
          LDEROUL(3) = 6
          ICOLDEROUL(3) = 0
          CDEROUL(4) = 'Close'
          LDEROUL(4) = 5
          ICOLDEROUL(4) = 0
        ENDIF
        NDER = 4
        IF (IPERSP.EQ.1) THEN
          IDEROUL = 1
        ELSE
          IDEROUL = 1-IPERSP
        ENDIF
        IDER0 = IDEROUL
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IF (IDEROUL.EQ.1) THEN
            IPERSP = -3
          ELSEIF(IDEROUL.EQ.2) THEN
            IPERSP = 1
          ELSE
            IPERSP = 2-IDEROUL
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.-10) THEN
        DO I=1,8
          LDEROUL(I) = 4
          ICOLDEROUL(I) = 0
        ENDDO
        CDEROUL(1)(1:4) = '0: '//CHAR(92)
        CDEROUL(2)(1:4) = '1: /'
        CDEROUL(3)(1:4) = '2: |'
        CDEROUL(4)(1:4) = '3: '//CHAR(92)
        CDEROUL(5)(1:4) = '4: |'
        CDEROUL(6)(1:4) = '5: /'
        CDEROUL(7)(1:4) = '6: .'
        IF (ILANG.EQ.0) THEN
          CDEROUL(8)(1:12) = 'Pas d''ombres'
          LDEROUL(8) = 12
        ELSE
          CDEROUL(8)(1:14) = 'Flat lightning'
          LDEROUL(8) = 14
        ENDIF
        NDER = 8
        IF (ICTFAC.LT.96) THEN
          IDEROUL = 8
        ELSE
          IDEROUL = 1+IDIRL
        ENDIF
        IDER0 = IDEROUL
        XBSAUV = XBOUT(1,IBOUT)
        XBOUT(1,IBOUT) = XBOUT(1,IBOUT)*1.5 - .5*XBOUT(2,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IF (IDEROUL.LE.7) THEN
            IF (ICTFAC.LT.96) ICTFAC=99
            IDIRL = IDEROUL-2
            IF (IDIRL.EQ.-1) IDIRL = 6
          ELSE
            ICTFAC = 0
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.-6) THEN
        IDEROUL = -1
        NDER = 16
        DO I=1,NDER
          LDEROUL(I) = 6
          ICOLDEROUL(I) = 0
        ENDDO
        IF (ILANG.EQ.0) THEN
          CDEROUL(1)(1:6) = 'Manuel'
        ELSE
          CDEROUL(1)(1:6) = 'Manual'
        ENDIF
        CDEROUL(2)(1:6) = 'x 1.1 '
        CDEROUL(3)(1:6) = 'x 1.5 '
        CDEROUL(4)(1:6) = 'x 2   '
        CDEROUL(5)(1:6) = 'x 3   '
        CDEROUL(6)(1:6) = 'x 4   '
        CDEROUL(7)(1:6) = 'x 5   '
        CDEROUL(8)(1:6) = 'x 10  '
        CDEROUL(9)(1:6) = '/ 1.1  '
        CDEROUL(10)(1:6) = '/ 1.5 '
        CDEROUL(11)(1:6) = '/ 2   '
        CDEROUL(12)(1:6) = '/ 3   '
        CDEROUL(13)(1:6) = '/ 4   '
        CDEROUL(14)(1:6) = '/ 5   '
        CDEROUL(15)(1:6) = '/ 10  '
        CDEROUL(16)(1:6) = 'x (-1)'
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
      ELSEIF(IPFK.EQ.-5) THEN
        CALL LESCOULEURS(CDEROUL(2),LDEROUL(2),ICOLDEROUL(2),ILANG)
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Pas de flèches'
          LDEROUL(1) = 14
          CDEROUL(18) = 'Champ scalaire'
          LDEROUL(18) = 14
        ELSE
          CDEROUL(1) = 'No arrows'
          LDEROUL(1) = 9
          CDEROUL(18) = 'Scalar field'
          LDEROUL(18) = 12
        ENDIF
        ICOLDEROUL(1) = 0
        ICOLDEROUL(18) = 0
        NDER = 18
        IF (IVIT.GT.0) THEN
          IDEROUL = 1
        ELSE
          IDEROUL = ICTFLE+2
        ENDIF
        IDER0 = IDEROUL
        XBSAUV = XBOUT(1,IBOUT)
        XBOUT(1,IBOUT) = 2.*XBSAUV - XBOUT(2,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IF (IDEROUL.GE.2) THEN
            ICTFLE = IDEROUL-2
            IVIT = IABS(IVIT)
          ELSE
            IVIT = -IABS(IVIT)
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.-2) THEN
        IF (NUMSD.LE.1) THEN
          IDEROUL = 0
          GOTO 1000
        ELSE
          IF (NUMSD.GT.NDERMAX) THEN
            IF (ILANG.EQ.0) THEN
              PRINT*,'*** Impossible d''afficher tout le menu des SD'
            ELSE
              PRINT*,'*** Too many SD to display the whole menu'
            ENDIF
          ENDIF
          NDER = MIN(NDERMAX,NUMSD)
          IF (ILANG.EQ.0) THEN
            CTITRE(1) = 'Sélection des'
            CTITRE(2) = 'sous-domaines'
            LTITRE(1) = 13
            LTITRE(2) = 13
          ELSE
            CTITRE(1) = 'Subdomains'
            CTITRE(2) = 'selection'
            LTITRE(1) = 10
            LTITRE(2) = 9
          ENDIF
          NTITRE = 2
          ICTITRE(1) = 3
          ICTITRE(2) = 3
          DO I=1,NDER
            WRITE(CDEROUL(I)(1:4),'(I4)') I
            LDEROUL(I) = 4
            ICOLDEROUL(I) = 0
            ISAUVE(I) = ISDVU(I)
            IEXCL(I) = 0
          ENDDO
          CALL CHOIXACOCHER(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &                     ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL
     &                     ,LDEROUL,ICOLDEROUL,NDER,ISDVU,IMENU(IBOUT)
     &                     ,IFONT7,IEXCL)
          IDEROUL = 0
          DO I=1,NDER
            IF (ISAUVE(I).NE.ISDVU(I)) IDEROUL = 1
          ENDDO
        ENDIF
      ELSEIF(IPFK.EQ.-1) THEN
        NTITRE = 1
        ICTITRE(1) = 3
        IF (ILANG.EQ.0) THEN
          CTITRE(1) = "Types de boites et d'échelles"
          LTITRE(1) = 28
Cfj          CDEROUL(1) = 'Pas de boite'
Cfj          LDEROUL(1) = 12
Cfj          CDEROUL(2) = 'Boite ouverte nue'
Cfj          LDEROUL(2) = 17
Cfj          CDEROUL(3) = 'Boite fermée nue'
Cfj          LDEROUL(3) = 16
Cfj          CDEROUL(4) = 'Boite ouverte + traits'
Cfj          LDEROUL(4) = 22
Cfj          CDEROUL(5) = 'Boite fermée + traits'
Cfj          LDEROUL(5) = 21
Cfj          CDEROUL(6) = 'Ouverte + traits + numéros'
Cfj          LDEROUL(6) = 26
Cfj          CDEROUL(7) = 'Fermée + traits + numéros'
Cfj          LDEROUL(7) = 25
Cfj          CDEROUL(8) = 'Ouverte + traits + grilles'
Cfj          LDEROUL(8) = 26
Cfj          CDEROUL(9) = 'Fermée + traits + grilles'
Cfj          LDEROUL(9) = 25
Cfj          CDEROUL(10) = 'Ouverte + traits + num + grilles'
Cfj          LDEROUL(10) = 32
Cfj          CDEROUL(11) = 'Fermée + traits + num + grilles'
Cfj          LDEROUL(11) = 31
          CDEROUL(1) = 'Pas de boite'
          LDEROUL(1) = 12
          CDEROUL(2) = 'Fermée'
          LDEROUL(2) = 6
          CDEROUL(3) = 'Traits'
          LDEROUL(3) = 6
          CDEROUL(4) = 'Numéros'
          LDEROUL(4) = 7
          CDEROUL(5) = 'Grilles'
          LDEROUL(5) = 7
        ELSE
          CTITRE(1) = 'Box and scale types'
          LTITRE(1) = 19
Cfj          CDEROUL(1) = 'No boxes'
Cfj          LDEROUL(1) = 8
Cfj          CDEROUL(2) = 'Open box alone'
Cfj          LDEROUL(2) = 14
Cfj          CDEROUL(3) = 'Closed box alone'
Cfj          LDEROUL(3) = 16
Cfj          CDEROUL(4) = 'Open box + tics'
Cfj          LDEROUL(4) = 15
Cfj          CDEROUL(5) = 'Closed box + tics'
Cfj          LDEROUL(5) = 17
Cfj          CDEROUL(6) = 'Open + tics + numbers'
Cfj          LDEROUL(6) = 21
Cfj          CDEROUL(7) = 'Closed + tics + numbers'
Cfj          LDEROUL(7) = 23
Cfj          CDEROUL(8) = 'Open + tics + grids'
Cfj          LDEROUL(8) = 19
Cfj          CDEROUL(9) = 'Closed + tics + grids'
Cfj          LDEROUL(9) = 21
Cfj          CDEROUL(10) = 'Open + tics + numbers + grids'
Cfj          LDEROUL(10) = 29
Cfj          CDEROUL(11) = 'Closed + tics + numbers + grids'
Cfj          LDEROUL(11) = 31
          CDEROUL(1) = 'No box'
          LDEROUL(1) = 6
          CDEROUL(2) = 'Closed'
          LDEROUL(2) = 6
          CDEROUL(3) = 'Tics'
          LDEROUL(3) = 4
          CDEROUL(4) = 'Numbers'
          LDEROUL(4) = 7
          CDEROUL(5) = 'Grids'
          LDEROUL(5) = 5
        ENDIF
Cfj        NDER = 11
        NDER = 5
        DO I=1,NDER
          ICOLDEROUL(I) = 0
          IEXCL(I) = 1001
          ICHOIX(I) = 0
        ENDDO
        IEXCL(1) = 1005
Cfj        IF (IBOITE.EQ.0) THEN
Cfj          IDEROUL = 1
Cfj        ELSE
Cfj          IDEROUL = 1 + IBOITE + 2*IECBOI
Cfj        ENDIF
        IF (IBOITE.EQ.0) THEN
          ICHOIX(1) = 1
        ELSE
          IF (IBOITE.EQ.2) ICHOIX(2) = 1
          IF (IECBOI.GT.0) THEN
            IF (IECBOI.LT.5) ICHOIX(3) = 1
            IF (MOD(IECBOI,2).EQ.0) ICHOIX(4) = 1
            IF (MOD((IECBOI+1)/2,2).EQ.0) ICHOIX(5) = 1
          ENDIF
        ENDIF
        DO I=1,NDER
          ISAUVE(I) = ICHOIX(I)
        ENDDO
Cfj
Cfj        IDER0 = IDEROUL
        XBSAUV1 = XBOUT(1,IBOUT)
        XBSAUV2 = XBOUT(2,IBOUT)
        XBOUT(1,IBOUT) = XDMIN
        XBOUT(2,IBOUT) = XHELP
Cfj        XBOUT(1,IBOUT) = XDMIN
Cfj        XBOUT(2,IBOUT) = XHELP*1.3 -.3*XDMIN
Cfj        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
Cfj     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
Cfj     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        CALL CHOIXACOCHER(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &                   ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL
     &                   ,LDEROUL,ICOLDEROUL,NDER,ICHOIX,IMENU(IBOUT)
     &                   ,IFONT7,IEXCL)
Cfj
        XBOUT(1,IBOUT) = XBSAUV1
        XBOUT(2,IBOUT) = XBSAUV2
Cfj        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
Cfj          IDEROUL = 0
Cfj        ELSE
Cfj          IF (IDEROUL.EQ.1) THEN
Cfj            IBOITE = 0
Cfj          ELSE
Cfj            IBOITE = 1 + MOD(IDEROUL,2)
Cfj            IECBOI = (IDEROUL-1-IBOITE)/2
Cfj          ENDIF
Cfj        ENDIF
        IDEROUL = 0
        DO I=1,NDER
          IF (ISAUVE(I).NE.ICHOIX(I)) IDEROUL = 1
        ENDDO
        IF (IDEROUL.NE.0) THEN
          IF (ICHOIX(1).NE.0) THEN
            IBOITE = 0
          ELSE
            IBOITE = 1+ICHOIX(2)
            IF (ICHOIX(3).NE.0.OR.ICHOIX(4).NE.0.OR.ICHOIX(5).NE.0) THEN
              IECBOI = 1
              IF (ICHOIX(3).EQ.0) IECBOI = IECBOI+4
              IF (ICHOIX(4).EQ.1) IECBOI = IECBOI+1
              IF (ICHOIX(5).EQ.1) IECBOI = IECBOI+2
            ELSE
              IECBOI = 0
            ENDIF
          ENDIF
        ENDIF
Cfj
      ELSEIF(IPFK.EQ.1) THEN
        IF (ISYM.LT.10) THEN
          DO I=1,ISYM
            WRITE(CDEROUL(I)(1:3),'(I1,"/",I1)') I,ISYM
            LDEROUL(I) = 3
            ICOLDEROUL(I) = 0
          ENDDO
        ELSE
          DO I=1,ISYM
            WRITE(CDEROUL(I)(1:5),'(I2,"/",I2)') I,ISYM
            LDEROUL(I) = 5
            ICOLDEROUL(I) = 0
          ENDDO
        ENDIF
        NDER = NRECONMAX
        IDEROUL = NRECON
        IDER0 = IDEROUL
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER
     &  .OR.IDEROUL.EQ.IDER0) IDEROUL = 0
      ELSEIF(IPFK.EQ.3) THEN
        CALL LESCOULEURS(CDEROUL,LDEROUL,ICOLDEROUL,ILANG)
        NDER = 16
        IDEROUL = ICTFON+1
        IDER0 = IDEROUL
        XBSAUV1 = XBOUT(1,IBOUT)
        XBSAUV2 = XBOUT(2,IBOUT)
        XBOUT(1,IBOUT) = 1.5*XBSAUV1 - 0.5*XBSAUV2
        XBOUT(2,IBOUT) = 1.5*XBSAUV2 - 0.5*XBSAUV1
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV1
        XBOUT(2,IBOUT) = XBSAUV2
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          ICTFON = IDEROUL-1
        ENDIF
      ELSEIF(IPFK.EQ.11) THEN
        DO I=1,NBANG
          LDEROUL(I) = 4
          ICOLDEROUL(I) = 0
          WRITE(CDEROUL(I)(1:4),'(SP,I4,SP)') IANG(I)
        ENDDO
        NDER = NBANG
        IDEROUL = IANGLE
        IDER0 = IDEROUL
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IANGLE = IDEROUL
        ENDIF
      ELSEIF(IPFK.EQ.15) THEN
        NDER = 1
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Rien'
          LDEROUL(1) = 4
          IF (IFBLO.EQ.0) THEN
            NDER = NDER+1
            CDEROUL(NDER) = 'Références'
            LDEROUL(NDER) = 10
          ELSE
            NDER = NDER+1
            CDEROUL(NDER) = 'Blocages'
            LDEROUL(NDER) = 8
            NDER = NDER+1
            CDEROUL(NDER) = 'Références'
            LDEROUL(NDER) = 10
            NDER = NDER+1
            CDEROUL(NDER) = 'Blocages + références'
            LDEROUL(NDER) = 21
          ENDIF
          IF (IGROUP.GT.1) THEN
            NDER = NDER+1
            CDEROUL(NDER) = 'Frontières de sd'
            LDEROUL(NDER) = 16
          ENDIF
        ELSE
          CDEROUL(1) = 'Nothing'
          LDEROUL(1) = 7
          IF (IFBLO.EQ.0) THEN
            NDER = NDER+1
            CDEROUL(NDER) = 'Références'
            LDEROUL(NDER) = 9
          ELSE
            NDER = NDER+1
            CDEROUL(NDER) = 'Boundary conditions'
            LDEROUL(NDER) = 19
            NDER = NDER+1
            CDEROUL(NDER) = 'References'
            LDEROUL(NDER) = 9
            NDER = NDER+1
            CDEROUL(NDER) = 'Bound. cond. + ref.'
            LDEROUL(NDER) = 19
          ENDIF
          IF (IGROUP.GT.1) THEN
            NDER = NDER+1
            CDEROUL(NDER) = 'Sub-dom. boundaries'
            LDEROUL(NDER) = 19
          ENDIF
        ENDIF
        DO I=1,NDER
          ICOLDEROUL(I) = 0
        ENDDO
        IF (IFRONT.EQ.0) THEN
          IDEROUL = 1
        ELSEIF(IFRONT.EQ.1) THEN
          IDEROUL = 2
        ELSEIF(IFRONT.EQ.2) THEN
          IF (IFBLO.EQ.0) THEN
            IDEROUL = 2
          ELSE
            IDEROUL = 3
          ENDIF
        ELSEIF(IFRONT.EQ.3) THEN
          IDEROUL = 4
        ELSE
          IDEROUL = NDER
        ENDIF
        IDER0 = IDEROUL
        XBSAUV = XBOUT(1,IBOUT)
        XBOUT(1,IBOUT) = 2.*XBSAUV-XBOUT(2,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IF (IDEROUL.EQ.1) THEN
            IFRONT = 0
          ELSEIF(IDEROUL.EQ.2) THEN
            IF (IFBLO.EQ.0) THEN
              IFRONT = 2
            ELSE
              IFRONT = 1
            ENDIF
          ELSEIF(IDEROUL.EQ.3) THEN
            IF (IFBLO.EQ.0) THEN
              IFRONT = -1
            ELSE
              IFRONT = 2
            ENDIF
          ELSEIF(IDEROUL.EQ.4) THEN
            IFRONT = 3
          ELSE
            IFRONT = -1
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.17.AND.IACTIF(IBOUT).NE.0) THEN
        DO I=1,12
          ICOLDEROUL(I) = 0
        ENDDO
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Rien'
          LDEROUL(1) = 4
          CDEROUL(2) = 'Remplissage'
          LDEROUL(2) = 11
          CDEROUL(3) = 'Rempl.+traits'
          LDEROUL(3) = 13
          CDEROUL(4) = 'Rempl+traits+val'
          LDEROUL(4) = 16
          CDEROUL(5) = 'Au trait'
          LDEROUL(5) = 8
          CDEROUL(6) = 'Trait+valeurs'
          LDEROUL(6) = 13
          CDEROUL(7) = 'Remplissage interpolé'
          LDEROUL(7) = 21
          CDEROUL(8) = 'Rempl. interp.+traits'
          LDEROUL(8) = 21
          CDEROUL(9) = 'Rempl. interp+traits+val'
          LDEROUL(9) = 24
          CDEROUL(10) = 'Interpolé au trait'
          LDEROUL(10) = 18
          CDEROUL(11) = 'Interpolé au trait+val'
          LDEROUL(11) = 22
          CDEROUL(12) = 'Constant par morceaux'
          LDEROUL(12) = 21
        ELSE
          CDEROUL(1) = 'Nothing'
          LDEROUL(1) = 7
          CDEROUL(2) = 'Contour plot'
          LDEROUL(2) = 12
          CDEROUL(3) = 'Contour plot+lines'
          LDEROUL(3) = 18
          CDEROUL(4) = 'Contour plot+lines+data'
          LDEROUL(4) = 23
          CDEROUL(5) = 'Contour lines'
          LDEROUL(5) = 13
          CDEROUL(6) = 'Contour lines+data'
          LDEROUL(6) = 18
          CDEROUL(7) = 'Interpolated contour plot'
          LDEROUL(7) = 25
          CDEROUL(8) = 'Interp contour plot+lines'
          LDEROUL(8) = 25
          CDEROUL(9) = 'Int cont.+lines+data'
          LDEROUL(9) = 20
          CDEROUL(10) = 'Interp contour lines'
          LDEROUL(10) = 20
          CDEROUL(11) = 'Int cont. lines+data'
          LDEROUL(11) = 20
          CDEROUL(12) = 'Piecewise constant'
          LDEROUL(12) = 18
        ENDIF
        IF (ISO.EQ.0) THEN
          IDEROUL = 1
        ELSEIF(ISO.EQ.1) THEN
          IF (ISOFRO.EQ.0) THEN
            IDEROUL = 2
          ELSE
            IF (IVALMAR.EQ.0) THEN
              IDEROUL = 3
            ELSE
              IDEROUL = 4
            ENDIF
          ENDIF
          IF (ICENTRISO.NE.0) IDEROUL=IDEROUL+5
        ELSEIF(ISO.EQ.3) THEN
          IDEROUL = 12
        ELSEIF(IVALMAR.EQ.0) THEN
          IF (ICENTRISO.EQ.0) THEN
            IDEROUL = 5
          ELSE
            IDEROUL = 10
          ENDIF
        ELSE
          IF (ICENTRISO.EQ.0) THEN
            IDEROUL = 6
          ELSE
            IDEROUL = 11
          ENDIF
        ENDIF
        IDER0 = IDEROUL
        IF (ICENTR.EQ.0) THEN
          NDER = 6
        ELSE
          NDER = 12
        ENDIF
        IF (ICOURB.GT.0) THEN
          XBSAUV = XBOUT(2,IBOUT)
          XBOUT(2,IBOUT) = 2.*XBSAUV-XBOUT(1,IBOUT)
        ELSE
          XBSAUV = XBOUT(1,IBOUT)
          XBOUT(1,IBOUT) = 2.*XBSAUV-XBOUT(2,IBOUT)
        ENDIF
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        IF (ICOURB.GT.0) THEN
          XBOUT(2,IBOUT) = XBSAUV
        ELSE
          XBOUT(1,IBOUT) = XBSAUV
        ENDIF
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER
     &  .OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IRC = ISO
          CALL ACTISO2(IDEROUL)
        ENDIF
      ELSEIF(IPFK.EQ.18) THEN
        CALL LESCOULEURS(CDEROUL,LDEROUL,ICOLDEROUL,ILANG)
        NDER = 16
        IDEROUL = ICT
        IDER0 = IDEROUL
        XBSAUV = XBOUT(2,IBOUT)
        XBOUT(2,IBOUT) = 1.5*XBSAUV-.5*XBOUT(1,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(2,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          ICT = IDEROUL-1
        ENDIF
      ELSEIF(IPFK.EQ.20) THEN
        CALL TABCOL(3333,0)
        NDER = NTABMAX
        DO I=1,NDER
          WRITE(CDEROUL(I)(1:2),'(I2)') I
          LDEROUL(I) = 2
          ICOLDEROUL(I) = 0
        ENDDO
        IDEROUL = ITABLE
        IDER0 = IDEROUL
        XBSAUV = XBOUT(2,IBOUT)
        XBOUT(2,IBOUT) = 1.7*XBSAUV - 0.7*XBOUT(1,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT1,1)
        XBOUT(2,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          ITABLE = IDEROUL-1
          IF (ITABLE.EQ.0) ITABLE = NDER
        ENDIF
      ELSEIF(IPFK.EQ.22) THEN
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Pas d''axes'
          LDEROUL(1) = 10
          ICOLDEROUL(1) = 0
          CDEROUL(2) = 'En haut à gauche'
          LDEROUL(2) = 16
          ICOLDEROUL(2) = 0
          CDEROUL(3) = 'En haut à droite'
          LDEROUL(3) = 16
          ICOLDEROUL(3) = 0
          CDEROUL(4) = 'En bas à droite'
          LDEROUL(4) = 15
          ICOLDEROUL(4) = 0
          CDEROUL(5) = 'En bas à gauche'
          LDEROUL(5) = 15
        ELSE
          CDEROUL(1) = 'No axis'
          LDEROUL(1) = 7
          ICOLDEROUL(1) = 0
          CDEROUL(2) = 'Upper left'
          LDEROUL(2) = 10
          ICOLDEROUL(2) = 0
          CDEROUL(3) = 'Upper right'
          LDEROUL(3) = 11
          ICOLDEROUL(3) = 0
          CDEROUL(4) = 'Lower right'
          LDEROUL(4) = 11
          ICOLDEROUL(4) = 0
          CDEROUL(5) = 'Lower left'
          LDEROUL(5) = 10
        ENDIF
        ICOLDEROUL(5) = 0
        NDER = 5
        IDEROUL = IAXES+1
        IDER0 = IDEROUL
        XBSAUV1 = XBOUT(1,IBOUT)
        XBSAUV2 = XBOUT(2,IBOUT)
        IF (ICOURB.GT.0) THEN
          XBOUT(1,IBOUT) = XBOUT(1,IBOUT)-(XBSAUV2-XBSAUV1)
          XBOUT(2,IBOUT) = XBOUT(2,IBOUT)+2.*(XBSAUV2-XBSAUV1)
        ELSE
          XBOUT(2,IBOUT) = XBOUT(2,IBOUT)+(XBSAUV2-XBSAUV1)
        ENDIF
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV1
        XBOUT(2,IBOUT) = XBSAUV2
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IRC = IAXES
          IAXES = IDEROUL-2
        ENDIF
      ELSEIF(IPFK.EQ.25) THEN
        CALL LESCOULEURS(CDEROUL,LDEROUL,ICOLDEROUL,ILANG)
        NDER = 16
        IF (I2D.EQ.0) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = '-1: Num. faces'
          ELSE
            CDEROUL(NDER) = '-1: Faces num.'
          ENDIF
          LDEROUL(NDER) = 14
          ICOLDEROUL(NDER) = 0
        ENDIF
        IF (IFLAG3.NE.0) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = '-2: Num. matériaux'
          ELSE
            CDEROUL(NDER) = '-2: materials num.'
          ENDIF
          LDEROUL(NDER) = 18
          ICOLDEROUL(NDER) = 0
        ENDIF
        IF (IGROUP.GT.1) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = '-3: Num. sous-dom.'
          ELSE
            CDEROUL(NDER) = '-3: Sub-dom. numb.'
          ENDIF
          LDEROUL(NDER) = 18
          ICOLDEROUL(NDER) = 0
        ENDIF
        NDER = NDER+1
        IF (ILANG.EQ.0) THEN
          CDEROUL(NDER) = '99: Ombres normales'
        ELSE
          CDEROUL(NDER) = '99: Default shadows'
        ENDIF
        LDEROUL(NDER) = 19
        ICOLDEROUL(NDER) = 0
        NDER = NDER+1
        IF (ILANG.EQ.0) THEN
          CDEROUL(NDER) = '98: Ombres fortes'
          LDEROUL(NDER) = 17
        ELSE
          CDEROUL(NDER) = '98: Strong shadows'
          LDEROUL(NDER) = 18
        ENDIF
        ICOLDEROUL(NDER) = 0
        NDER = NDER+1
        IF (ILANG.EQ.0) THEN
          CDEROUL(NDER) = '97: Gouraud normal'
          LDEROUL(NDER) = 18
        ELSE
          CDEROUL(NDER) = '97: Default Gouraud'
          LDEROUL(NDER) = 19
        ENDIF
        ICOLDEROUL(NDER) = 0
        NDER = NDER+1
        IF (ILANG.EQ.0) THEN
          CDEROUL(NDER) = '96: Gouraud fort'
          LDEROUL(NDER) = 16
        ELSE
          CDEROUL(NDER) = '96: Strong Gouraud'
          LDEROUL(NDER) = 18
        ENDIF
        ICOLDEROUL(NDER) = 0
        IF (ICTFAC.GE.0.AND.ICTFAC.LE.15) THEN
          IDEROUL = ICTFAC+1
        ELSE
          WRITE(CDEROUL(NDER+1)(1:2),'(I2)') ICTFAC
          IDEROUL = 0
          DO I=17,NDER
            IF (CDEROUL(NDER+1)(1:2).EQ.CDEROUL(I)(1:2)) IDEROUL=I
          ENDDO
        ENDIF
        IDER0 = IDEROUL
        XBSAUV = XBOUT(1,IBOUT)
        XBOUT(1,IBOUT) = 1.75*XBSAUV-.75*XBOUT(2,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IF (IDEROUL.LE.16) THEN
            ICTFAC = IDEROUL-1
          ELSE
            IBID = ICHAR(CDEROUL(IDEROUL)(2:2)) - 48
            IF (CDEROUL(IDEROUL)(1:1).EQ.'-') THEN
              ICTFAC = -IBID
            ELSE
              ICTFAC = IBID + 10*(ICHAR(CDEROUL(IDEROUL)(1:1)) - 48)
            ENDIF
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.27) THEN
        NDER = 0
        IF (IFVIT.NE.0) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = '| Champ vectoriel |'
            LDEROUL(NDER) = 19
          ELSE
            CDEROUL(NDER) = '| Vector field |'
            LDEROUL(NDER) = 16
          ENDIF
          ICDER(NDER) = 7
          IF (I2D.NE.0) THEN
            NDER = NDER+1
            IF (ILANG.EQ.0) THEN
              CDEROUL(NDER) = 'Phase du champ vectoriel'
              LDEROUL(NDER) = 24
            ELSE
              CDEROUL(NDER) = 'Vector field''s phase'
              LDEROUL(NDER) = 20
            ENDIF
            ICDER(NDER) = 8
          ENDIF
          IF (I2D.NE.2) THEN
            NDER = NDER+1
            IF (ILANG.EQ.0) THEN
              CDEROUL(NDER) = 'Composante X du champ vect.'
            ELSE
              CDEROUL(NDER) = 'X component of vector field'
            ENDIF
            LDEROUL(NDER) = 27
            ICDER(NDER) = 4
          ENDIF
          IF (I2D.NE.3) THEN
            NDER = NDER+1
            IF (ILANG.EQ.0) THEN
              CDEROUL(NDER) = 'Composante Y du champ vect.'
            ELSE
              CDEROUL(NDER) = 'Y component of vector field'
            ENDIF
            LDEROUL(NDER) = 27
            ICDER(NDER) = 5
          ENDIF
          IF (I2D.NE.1) THEN
            NDER = NDER+1
            IF (ILANG.EQ.0) THEN
              CDEROUL(NDER) = 'Composante Z du champ vect.'
            ELSE
              CDEROUL(NDER) = 'Z component of vector field'
            ENDIF
            LDEROUL(NDER) = 27
            ICDER(NDER) = 6
          ENDIF
        ENDIF
        IF (I2D.NE.2) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = 'Coordonnée X'
          ELSE
            CDEROUL(NDER) = 'X coordinate'
          ENDIF
          LDEROUL(NDER) = 12
          ICDER(NDER) = 2
        ENDIF
        IF (I2D.NE.3) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = 'Coordonnée Y'
          ELSE
            CDEROUL(NDER) = 'Y coordinate'
          ENDIF
          LDEROUL(NDER) = 12
          ICDER(NDER) = 3
        ENDIF
        IF (I2D.NE.1) THEN
          NDER = NDER+1
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = 'Coordonnée Z'
          ELSE
            CDEROUL(NDER) = 'Z coordinate'
          ENDIF
          LDEROUL(NDER) = 12
          ICDER(NDER) = 1
        ENDIF
        IF (NBCORN.NE.0) THEN
          NDER = NDER+1
          ICDER(NDER) = 9
          ICDER(NDER+1) = 10
          ICDER(NDER+2) = 11
          ICDER(NDER+3) = 12
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = 'Rayons de courbure (0)'
            LDEROUL(NDER) = 22
            NDER = NDER+1
            CDEROUL(NDER) = 'Dioptries (0)'
            LDEROUL(NDER) = 13
            NDER = NDER+1
            CDEROUL(NDER) = 'Rayons de courbure (2)'
            LDEROUL(NDER) = 22
            NDER = NDER+1
            CDEROUL(NDER) = 'Dioptries (2)'
            LDEROUL(NDER) = 13
          ELSE
            CDEROUL(NDER) = 'Radii of curvature (0)'
            LDEROUL(NDER) = 22
            NDER = NDER+1
            CDEROUL(NDER) = 'Diopters (0)'
            LDEROUL(NDER) = 12
            NDER = NDER+1
            CDEROUL(NDER) = 'Radii of curvature (2)'
            LDEROUL(NDER) = 22
            NDER = NDER+1
            CDEROUL(NDER) = 'Diopters (2)'
            LDEROUL(NDER) = 12
          ENDIF
        ENDIF
        IF (ICOURB.GT.0.OR.ICOURB.EQ.-5) THEN
          NDER = NDER+1
          ICDER(NDER) = 13
          ICDER(NDER+1) = 14
          ICDER(NDER+2) = 15
          ICDER(NDER+3) = 16
          IF (ILANG.EQ.0) THEN
            CDEROUL(NDER) = 'Numéros de noeuds'
            LDEROUL(NDER) = 17
            NDER = NDER+1
            CDEROUL(NDER) = 'Numéros d''éléments'
            LDEROUL(NDER) = 18
            NDER = NDER+1
            CDEROUL(NDER) = 'Qualité (angles)'
            LDEROUL(NDER) = 16
            NDER = NDER+1
            CDEROUL(NDER) = 'Qualité (cercles)'
            LDEROUL(NDER) = 17
          ELSE
            CDEROUL(NDER) = 'Node numbers'
            LDEROUL(NDER) = 12
            NDER = NDER+1
            CDEROUL(NDER) = 'Elements numbers'
            LDEROUL(NDER) = 16
            NDER = NDER+1
            CDEROUL(NDER) = 'Quality (angles)'
            LDEROUL(NDER) = 16
            NDER = NDER+1
            CDEROUL(NDER) = 'Quality (circles)'
            LDEROUL(NDER) = 17
          ENDIF
        ENDIF
        DO I=1,NDER
          ICOLDEROUL(I) = 0
        ENDDO
        IDEROUL = 0
        DO I=1,NDER
          IF (ISOBID.EQ.ICDER(I)) IDEROUL = I
        ENDDO
        IDER0 = IDEROUL
        XBSAUV = XBOUT(1,IBOUT)
        XBOUT(1,IBOUT) = 2.*XBSAUV-XBOUT(2,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(1,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          IDEROUL = ICDER(IDEROUL)
        ENDIF
      ELSEIF(IPFK.EQ.28) THEN
        NTITRE = 2
        ICTITRE(1) = 3
        ICTITRE(2) = 3
        IF (ILANG.EQ.0) THEN
          CTITRE(1) = 'Que sauve-t-on dans les'
          CTITRE(2) = 'fichiers PostScript ?'
          LTITRE(1) = 23
          LTITRE(2) = 21
          CDEROUL(1) = 'Dessin seul'
          LDEROUL(1) = 11
          CDEROUL(2) = 'Table seule'
          LDEROUL(2) = 11
c          CDEROUL(3) = 'Signature'
c          LDEROUL(3) = 9
          CDEROUL(3) = 'Zone d''info à droite'
          LDEROUL(3) = 20
          CDEROUL(4) = 'Landscape (sinon portrait)'
          LDEROUL(4) = 26
        ELSE
          CTITRE(1) = 'What is saved in'
          CTITRE(2) = 'PostScript files ?'
          LTITRE(1) = 16
          LTITRE(2) = 18
          CDEROUL(1) = 'Object alone'
          LDEROUL(1) = 12
          CDEROUL(2) = 'Color table alone'
          LDEROUL(2) = 17
c          CDEROUL(3) = 'Signature'
c          LDEROUL(3) = 9
          CDEROUL(3) = 'Informations on the right'
          LDEROUL(3) = 25
          CDEROUL(4) = 'Landscape (else portrait)'
          LDEROUL(4) = 25
        ENDIF
        NDER = 4
        DO I=1,NDER
          ICOLDEROUL(I) = 0
          IEXCL(I) = 1002
          ICHOIX(I) = 0
        ENDDO
        IEXCL(1) = 1004
        IEXCL(2) = 1004
        IF (IDSEUL.EQ.1) THEN
          ICHOIX(1) = 1
        ELSEIF(IDSEUL.EQ.2) THEN
          ICHOIX(2) = 1
        ELSE
          I = IDEFPS
cc          ICHOIX(3) = 1-MOD(I,2)
          I = I/2
          ICHOIX(3) = MOD(I,2)
          I = I/2
          ICHOIX(4) = MOD(I,2)
        ENDIF
        DO I=1,NDER
          ISAUVE(I) = ICHOIX(I)
        ENDDO
        CALL CHOIXACOCHER(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &                   ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL
     &                   ,LDEROUL,ICOLDEROUL,NDER,ICHOIX,IMENU(IBOUT)
     &                   ,IFONT7,IEXCL)
        IDEROUL = 0
        DO I=1,NDER
          IF (ISAUVE(I).NE.ICHOIX(I)) IDEROUL = 1
        ENDDO
        IF (IDEROUL.NE.0) THEN
          IF (ICHOIX(1).GT.0) THEN
            IDEFPS = 8
          ELSEIF(ICHOIX(2).GT.0) THEN
            IDEFPS = 9
          ELSE
            IDEFPS = 0
c            IF (ICHOIX(3).EQ.0) IDEFPS = IDEFPS+1
            IF (ICHOIX(3).GT.0) IDEFPS = IDEFPS+2
            IF (ICHOIX(4).GT.0) IDEFPS = IDEFPS+4
          ENDIF
        ENDIF
      ELSEIF(IPFK.EQ.30) THEN
        CDEROUL(1) = 'xyz'
        LDEROUL(1) = 3
        CDEROUL(2) = 'xy'
        LDEROUL(2) = 2
        CDEROUL(3) = 'yz'
        LDEROUL(3) = 2
        CDEROUL(4) = 'zx'
        LDEROUL(4) = 2
        CDEROUL(5) = '-xyz'
        LDEROUL(5) = 4
        CDEROUL(6) = '-xy'
        LDEROUL(6) = 3
        CDEROUL(7) = '-yz'
        LDEROUL(7) = 3
        CDEROUL(8) = '-zx'
        LDEROUL(8) = 3
        IDEROUL = 0
        NDER = 8
        DO K=1,NDER
          ICOLDEROUL(K) = 0
        ENDDO
        DO K=1,NDER
          CALL CALROT(RORO,K)
          DIFF = 0.
          DO J=1,3
            DO I=1,3
              DIFF = DIFF+ABS(RORO(I,J)-ROTA(I,J))
            ENDDO
          ENDDO
          IF (DIFF.LT.1.E-3) THEN
            IDEROUL = K
            GOTO 3535
          ENDIF
        ENDDO
 3535   CONTINUE
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        IF (IDEROUL.LT.0.OR.IDEROUL.GT.NDER) IDEROUL = 0
      ELSEIF(IPFK.EQ.33) THEN
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Maillage'
          LDEROUL(1) = 8
          CDEROUL(2) = 'Maillage + bord épais'
          LDEROUL(2) = 21
          CDEROUL(3) = 'Bord seul épais'
          LDEROUL(3) = 15
          CDEROUL(4) = 'Bord seul fin'
          LDEROUL(4) = 13
          CDEROUL(5) = 'Pas de maillage'
          LDEROUL(5) = 15
          CDEROUL(6) = 'Boules (moyennes)'
          LDEROUL(6) = 17
          CDEROUL(7) = 'Boules (petites)'
          LDEROUL(7) = 16
          CDEROUL(8) = 'Boules (grosses)'
          LDEROUL(8) = 16
          CDEROUL(9) = 'Ronds (moyens)'
          LDEROUL(9) = 14
          CDEROUL(10) = 'Ronds (petits)'
          LDEROUL(10) = 14
          CDEROUL(11) = 'Ronds (gros)'
          LDEROUL(11) = 12
        ELSE
          CDEROUL(1) = 'Mesh'
          LDEROUL(1) = 4
          CDEROUL(2) = 'Mesh + thick boundary'
          LDEROUL(2) = 21
          CDEROUL(3) = 'Thick boundary alone'
          LDEROUL(3) = 20
          CDEROUL(4) = 'Thin boundary alone'
          LDEROUL(4) = 19
          CDEROUL(5) = 'No mesh'
          LDEROUL(5) = 7
          CDEROUL(6) = 'Spheres (mid-size)'
          LDEROUL(6) = 18
          CDEROUL(7) = 'Spheres (small)'
          LDEROUL(7) = 15
          CDEROUL(8) = 'Spheres (big)'
          LDEROUL(8) = 13
          CDEROUL(9) = 'Circles (mid-size)'
          LDEROUL(9) = 18
          CDEROUL(10) = 'Circles (small)'
          LDEROUL(10) = 15
          CDEROUL(11) = 'Circles (big)'
          LDEROUL(11) = 13
        ENDIF
        NDER = 11
        DO I=1,NDER
          ICOLDEROUL(I) = 0
        ENDDO
        IF (IMAILL.LT.0) THEN
          IDEROUL = 4-IMAILL
        ELSEIF(IBORD.EQ.1) THEN
          IDEROUL = 1
        ELSEIF(IBORD.EQ.0) THEN
          IDEROUL = 2
        ELSEIF(IEPBOR2.EQ.2) THEN
          IDEROUL = 3
        ELSE
          IDEROUL = 4
        ENDIF
        IDER0 = IDEROUL
        XBSAUV = XBOUT(2,IBOUT)
        XBOUT(2,IBOUT) = 1.5*XBSAUV-.5*XBOUT(1,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(2,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSE
          CALL ACTBOR2(IDEROUL)
        ENDIF
      ELSEIF(IPFK.EQ.39) THEN
        NDER = 5
        IF (IVIT.GT.0) THEN
          IDEROUL = 1
        ELSE
          IDEROUL = ITYPFL+1
        ENDIF
        IDER0 = IDEROUL
        DO I=1,NDER
          ICOLDEROUL(I) = 0
        ENDDO
        IF (ILANG.EQ.0) THEN
          CDEROUL(1) = 'Pas de flèches'
          LDEROUL(1) = 14
          CDEROUL(2) = 'Pas de pointe'
          LDEROUL(2) = 13
          CDEROUL(3) = 'Au trait'
          LDEROUL(3) = 8
          CDEROUL(4) = 'Pointe triangulaire'
          LDEROUL(4) = 19
          CDEROUL(5) = 'Pointe jolie'
          LDEROUL(5) = 12
        ELSE
          CDEROUL(1) = 'No arrows'
          LDEROUL(1) = 9
          CDEROUL(2) = 'No extremities'
          LDEROUL(2) = 14
          CDEROUL(3) = 'Outline'
          LDEROUL(3) = 7
          CDEROUL(4) = 'Triangle'
          LDEROUL(4) = 8
          CDEROUL(5) = 'Fancy extremities'
          LDEROUL(5) = 17
        ENDIF
        XBSAUV = XBOUT(2,IBOUT)
        XBOUT(2,IBOUT) = 1.5*XBSAUV - 0.5*XBOUT(1,IBOUT)
        CALL DEROULE(CTITRE,LTITRE,NTITRE,ICTITRE,IFONT8
     &              ,XBOUT(1,IBOUT),YBOUT(1,IBOUT),CDEROUL,LDEROUL
     &              ,ICOLDEROUL,NDER,IDEROUL,IMENU(IBOUT),IFONT7,0)
        XBOUT(2,IBOUT) = XBSAUV
        IF (IDEROUL.LE.0.OR.IDEROUL.GT.NDER.OR.IDEROUL.EQ.IDER0) THEN
          IDEROUL = 0
        ELSEIF(IDEROUL.EQ.1) THEN
          IVIT = IABS(IVIT)
        ELSE
          IVIT = -IABS(IVIT)
          ITYPFL = IDEROUL-2
          IF (ITYPFL.LT.1) ITYPFL = 4
        ENDIF
      ENDIF
C
 1000 IF (IDEROUL.EQ.0) THEN
        CALL MYBORD(XBOUT(1,IBOUT),YBOUT(1,IBOUT),BID,0,ITOUR2,7,15)
cc        ITYP = 0
        IBOUT = 0
      ENDIF
      END
C-----------------------------------------------------------------------
      SUBROUTINE LESCOULEURS(CDEROUL,LDEROUL,ICOLDEROUL,ILANG)
      CHARACTER*32 CDEROUL(*)
      INTEGER      LDEROUL(*),ICOLDEROUL(*)
C
      IF (ILANG.EQ.0) THEN
        CDEROUL(1) = '0 : Noir'
        LDEROUL(1) = 8
        CDEROUL(2) = '1 : Rouge'
        LDEROUL(2) = 9
        CDEROUL(3) = '2 : Vert'
        LDEROUL(3) = 8
        CDEROUL(4) = '3 : Bleu'
        LDEROUL(4) = 8
        CDEROUL(5) = '4 : Cyan'
        LDEROUL(5) = 8
        CDEROUL(6) = '5 : Jaune'
        LDEROUL(6) = 9
        CDEROUL(7) = '6 : Magenta'
        LDEROUL(7) = 11
        CDEROUL(8) = '7 : Blanc'
        LDEROUL(8) = 9
        CDEROUL(9) = '8 : Gris clair'
        LDEROUL(9) = 14
        CDEROUL(10) = '9 : Framboise'
        LDEROUL(10) = 13
        CDEROUL(11) = '10: Vert pâle'
        LDEROUL(11) = 13
        CDEROUL(12) = '11: Bleu gris'
        LDEROUL(12) = 13
        CDEROUL(13) = '12: Bleu pâle'
        LDEROUL(13) = 13
        CDEROUL(14) = '13: Cyan foncé'
        LDEROUL(14) = 14
        CDEROUL(15) = '14: Mauve'
        LDEROUL(15) = 9
        CDEROUL(16) = '15: Gris foncé'
        LDEROUL(16) = 14
      ELSE
        CDEROUL(1) = '0 : Black'
        LDEROUL(1) = 9
        CDEROUL(2) = '1 : Red'
        LDEROUL(2) = 7
        CDEROUL(3) = '2 : Green'
        LDEROUL(3) = 9
        CDEROUL(4) = '3 : Blue'
        LDEROUL(4) = 8
        CDEROUL(5) = '4 : Cyan'
        LDEROUL(5) = 8
        CDEROUL(6) = '5 : Yellow'
        LDEROUL(6) = 10
        CDEROUL(7) = '6 : Magenta'
        LDEROUL(7) = 11
        CDEROUL(8) = '7 : White'
        LDEROUL(8) = 9
        CDEROUL(9) = '8 : Light grey'
        LDEROUL(9) = 14
        CDEROUL(10) = '9 : Deep pink'
        LDEROUL(10) = 14
        CDEROUL(11) = '10: Light green'
        LDEROUL(11) = 16
        CDEROUL(12) = '11: Slate blue'
        LDEROUL(12) = 14
        CDEROUL(13) = '12: Light blue'
        LDEROUL(13) = 14
        CDEROUL(14) = '13: Dark cyan'
        LDEROUL(14) = 13
        CDEROUL(15) = '14: Purple'
        LDEROUL(15) = 10
        CDEROUL(16) = '15: Dark grey'
        LDEROUL(16) = 13
      ENDIF
      DO I=1,16
        ICOLDEROUL(I) = I-1
      ENDDO
      ICOLDEROUL(3) = 16
      ICOLDEROUL(9) = 0
      END
