PROGRAM VISU21
!
!          Visualisation du fichier "21" (profils de raies spectrales)
!
      PARAMETER (NPMX=500,NCMX=5,NRAMX=10)
      DIMENSION XMU(NCMX,NRAMX), DL(NPMX,NRAMX), XINT(NPMX,NCMX,NRAMX) &
      , NUMRA(NRAMX), AMBDA(NRAMX), XLA(NPMX,NRAMX), Y(NPMX,NCMX) &
      , XMIN(NRAMX), XMAX(NRAMX), YMIN(NRAMX), YMAX(NRAMX)
!
      IFI = 0
 100  CONTINUE
      READ (21,*,END=200) NRA, FR0, NP, NC
      IFI = IFI + 1
      IF ( IFI .GT. NRAMX ) GO TO 200
      NUMRA(IFI) = NRA
      AMBDA(IFI) = 2.997925E18 / FR0
      READ (21,*) (XMU(J,IFI),J=1,NC)
      READ (21,*) (DL(I,IFI),I=1,NP)
      DO 110 I = 1, NP
!  longueurs d'onde absolues  :    XLA(I,IFI) = AMBDA(IFI) + DL(I,IFI)
!  longueurs d'onde relatives :    XLA(I,IFI) = DL(I,IFI)
      XLA(I,IFI) = DL(I,IFI)
 110  CONTINUE
      DO 120 J = 1, NC
      READ (21,*) (XINT(I,J,IFI),I=1,NP)
 120  CONTINUE
      PRINT *, ' LECTURE ', IFI, NRA
      XMIN(IFI) = AMINI ( XLA(1,IFI), NP )
      XMAX(IFI) = AMAXI ( XLA(1,IFI), NP )
      PRINT 122, XMIN(IFI), XMAX(IFI)
 122  FORMAT ( ' XMIN = ', 1PE12.4, 5X, ' XMAX = ', E12.4 )
      YMIN(IFI) = XINT(1,1,IFI)
      YMAX(IFI) = XINT(1,1,IFI)
      DO 150 J = 1, NC
      DO 150 I = 1, NP
      YMIN(IFI) = AMIN1 ( YMIN(IFI), XINT(I,J,IFI) )
      YMAX(IFI) = AMAX1 ( YMAX(IFI), XINT(I,J,IFI) )
 150  CONTINUE
      PRINT 155, YMIN(IFI), YMAX(IFI)
 155  FORMAT ( ' YMIN = ', 1PE12.4, 5X, ' YMAX = ', E12.4 )
      GO TO 100
!
 200  CONTINUE
      NFIG = IFI
      CALL PSDEB ( 'v21.ps    ' )
!
      DO 500 IFI = 1, NFIG
      NRA = NUMRA(IFI)
      PRINT 222, NRA
 222  FORMAT ( ' TRACE ', I4 )
      IXMIN = IFIX(XMIN(IFI))
      IXMAX = IFIX(XMAX(IFI)+1.)
      XMI = FLOAT(IXMIN)
      XMA = FLOAT(IXMAX)
      NDX = IXMAX - IXMIN
      MINY = IFIX ( ALOG10(YMIN(IFI)) )
      IF ( MINY .LE. 0 ) MINY = MINY - 1
      MAXY = IFIX ( ALOG10(YMAX(IFI)) ) + 1
      IF ( MAXY .LE. 0 ) MAXY = MAXY - 1
      NDY = MAXY - MINY
      YMI = FLOAT ( MINY )
      YMA = FLOAT ( MAXY )
      DO 250 I = 1, NP
      DO 250 J = 1, NC
      Y(I,J) = ALOG10 ( XINT(I,J,IFI) )
 250  CONTINUE
      CALL NVFIGV
      XL = 180.
      YL = 150.
      CALL CHLIMI ( XMI, XMA, 0, 0, 0, YMI, YMA, 0, 0, 0 )
      CALL CHCADR ( 40., 30., NDX, NDY, XL, YL, 4., 4., 0, 0 )
      CALL CADRSP
      CALL TITX ( 'lambda(A)', 9 )
      CALL TITYD ( 'log10(I_nu)', 11, -25. )
      DO 300 J = 1, NC
      IPEN = NC - J
      CALL COLILI ( NP, XLA(1,IFI), Y(1,J), IPEN )
 300  CONTINUE
      YPOS = 190.
      CALL TEXTE ( 'raie no.', 8, 40., YPOS, 4., 0.0 )
      CALL NOMBRE ( FLOAT(NRA), 60., YPOS, 4., 0 )
      CALL NOMBRE ( AMBDA(IFI), 120., YPOS, 4., 2 )
      CALL TEXTE ( 'Angstroms', 9, 150., YPOS, 4., 0.0 )
      CALL FINFIG
!
      NDY = 5
      YMI = 0.0
      YMA = ARRSUP ( YMAX(IFI) )
      DO 350 I = 1, NP
      DO 350 J = 1, NC
      Y(I,J) = XINT(I,J,IFI)
 350  CONTINUE
      CALL NVFIGV
      XL = 180.
      YL = 150.
      CALL CHLIMI ( XMI, XMA, 0, 0, 0, YMI, YMA, 0, 0, 0 )
      CALL CHCADR ( 40., 30., NDX, NDY, XL, YL, 4., 4., 0, -2 )
      CALL CADRSP
      CALL TITX ( 'lambda(A)', 9 )
      CALL TITYD ( 'I_nu', 4, -25. )
      DO 400 J = 1, NC
      IPEN = NC - J
      CALL COLILI ( NP, XLA(1,IFI), Y(1,J), IPEN )
 400  CONTINUE
      YPOS = 190.
      CALL TEXTE ( 'raie no.', 8, 40., YPOS, 4., 0.0 )
      CALL NOMBRE ( FLOAT(NRA), 60., YPOS, 4., 0 )
      CALL NOMBRE ( AMBDA(IFI), 120., YPOS, 4., 2 )
      CALL TEXTE ( 'Angstroms', 9, 150., YPOS, 4., 0.0 )
      CALL FINFIG
!
 500  CONTINUE
!
      CALL PSFIN
      STOP
      END
  FUNCTION AMAXI ( A, N )
  DIMENSION A(N)
  XMAX = A(1)
  DO 100 J = 2, N
  XMAX =  MAX  ( XMAX, A(J) )
 100  CONTINUE
  AMAXI = XMAX
  RETURN
  END
  FUNCTION AMINI ( A, N )
  DIMENSION A(N)
  XMIN = A(1)
  DO 100 J = 2, N
  XMIN =  MIN  ( XMIN, A(J) )
 100  CONTINUE
  AMINI = XMIN
  RETURN
  END
  SUBROUTINE PSDEB ( NOMFI )
!
  CHARACTER*10 NOMFI
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
  CHARACTER*12 LIG(6)
  COMMON /CADVEC/ NP, LIG
!
 1    FORMAT ( '%!PS-Adobe-3.0' / &
             '/L {lineto} def /M {moveto} def' / &
             '/RL {rlineto} def /RM {rmoveto} def' / &
             '/N {newpath} def /RD {0 360 arc closepath fill} def' / &
             '/RDC {0 360 arc closepath stroke} def' / &
             '/P {moveto  0  0  rlineto} def' / &
             '%%BoundingBox:    0    0  700  700' )
!
  NOFIG = 0
  XORI = 20.
  YORI = 20.
  NDX = 4
  NDY = 4
  XMIN = 0.0
  XMAX = 1.0
  LOGX = 0
  LXMIN = 0
  LXMAX = 1
  YMIN = 0.0
  YMAX = 1.0
  LOGY = 0
  LYMIN = 0
  LYMAX = 1
  XL = 150.
  YL = 100.
  HL = 5.
  HC = 5.
  I = 1
  NP = 0
!
  OPEN ( UNIT=88, FILE=NOMFI )
  WRITE ( 88, 1 )
!
  RETURN
  END
  SUBROUTINE SLW ( J )
!
 1    FORMAT ( 1X, I3, ' setlinewidth ' )
!
  WRITE ( 88, 1 ) J
  RETURN
  END
  SUBROUTINE PSFIN
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
 1    FORMAT ( / '%%Pages: ', I3 / '%%EOF' )
!
  WRITE ( 88, 1 ) NOFIG
  CLOSE ( UNIT=88 )
  RETURN
  END
  SUBROUTINE ADVEC ( X, Y, IPEN )
!
 1    FORMAT ( 2(1X,I4), ' M' )
 2    FORMAT ( 2(1X,I4), ' L' )
!
  KX =  INT ( X/0.35 + 0.5 )
  KY =  INT ( Y/0.35 + 0.5 )
  IF ( IPEN .EQ. 0 ) WRITE ( 88, 1 ) KX, KY
  IF ( IPEN .EQ. 1 ) WRITE ( 88, 2 ) KX, KY
!
  RETURN
  END
  SUBROUTINE ADVECM ( X, Y, IPEN )
!
  CHARACTER*12 LIG(6)
  COMMON /CADVEC/ NP, LIG
!
 1    FORMAT ( 2(1X,I4), ' M' )
 2    FORMAT ( 2(1X,I4), ' L' )
 3    FORMAT ( 6A12 )
!
  KX =  INT ( X/0.35 + 0.5 )
  KY =  INT ( Y/0.35 + 0.5 )
  IF ( NP < 6 ) THEN
  IF ( IPEN .EQ. 0 ) WRITE ( LIG(NP+1), 1 ) KX, KY
  IF ( IPEN .EQ. 1 ) WRITE ( LIG(NP+1), 2 ) KX, KY
  NP = NP + 1
  ELSE
  WRITE ( 88, 3 ) ( LIG(J), J = 1, 6 )
  IF ( IPEN .EQ. 0 ) WRITE ( LIG(1), 1 ) KX, KY
  IF ( IPEN .EQ. 1 ) WRITE ( LIG(1), 2 ) KX, KY
  NP = 1
  END IF
!
  RETURN
  END
  SUBROUTINE FINTRA
!
  CHARACTER*12 LIG(6)
  COMMON /CADVEC/ NP, LIG
!
  IF ( NP > 0 ) THEN
  WRITE ( 88, 1 ) ( LIG(J), J = 1, NP )
 1   FORMAT ( 6A12 )
  NP = 0
  END IF
  WRITE ( 88, 999 )
 999  FORMAT ( ' stroke' )
!
  RETURN
  END
  SUBROUTINE TRANSL ( X, Y )
!
 1    FORMAT ( 2(1X,I4), ' translate ' )
!
  KX =  INT ( X/0.35 + 0.5 )
  KY =  INT ( Y/0.35 + 0.5 )
  WRITE ( 88, 1 ) KX, KY
!
  RETURN
  END
  SUBROUTINE SCALE ( X, Y )
!
 1    FORMAT ( 2(1X,F10.5), ' scale ' )
!
  WRITE ( 88, 1 ) X, Y
!
  RETURN
  END
  FUNCTION ARRSUP ( X )
  DIMENSION XVA(8)
  DATA XVA / 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0 /
  IF ( X ) 300, 100, 200
 100  CONTINUE
  ARRSUP = 0.0
  RETURN
 200  CONTINUE
  XLOG =  LOG10 ( X )
  NLOG =  INT ( XLOG )
  IF ( XLOG .LT. 0.0 ) NLOG = NLOG - 1
  XPS = 10. ** NLOG
  RAP = X / XPS
  DO 220 II = 1, 8
  I = 9 - II
  IF ( RAP .GE. XVA(I) ) GO TO 240
 220  CONTINUE
 240  CONTINUE
  IF ( I .NE. 8 ) ARRSUP = XVA(I+1) * XPS
  IF ( I .EQ. 8 ) ARRSUP = 10. * XPS
  RETURN
 300  CONTINUE
  XABS = - X
  XLOG =  LOG10 ( XABS )
  NLOG =  INT ( XLOG )
  IF ( XLOG .LT. 0.0 ) NLOG = NLOG - 1
  XPS = 10. ** NLOG
  RAP = XABS / XPS
  DO 320 II = 1, 8
  I = 9 - II
  IF ( RAP .GE. XVA(I) ) GO TO 340
 320  CONTINUE
 340  CONTINUE
  ARRSUP = - XVA(I) * XPS
  RETURN
  END
  SUBROUTINE ECHEL3 ( X, XSUP, NDX )
  DIMENSION XVA(8), NDM(8)
  DATA XVA / 1.0, 1.5, 2.0, 3.0, 4.0, 5.0, 6.0, 8.0 /
  DATA NDM / 3, 4, 6, 8, 5, 6, 8, 5 /
  IF ( X .GT. 0.0 ) GO TO 200
  XSUP = 0.0
  NDX = 1
  RETURN
 200  CONTINUE
  XLOG =  LOG10 ( X )
  NLOG =  INT ( XLOG )
  IF ( XLOG .LT. 0.0 ) NLOG = NLOG - 1
  XPS = 10. ** NLOG
  RAP = X / XPS
  DO 220 II = 1, 8
  I = 9 - II
  IF ( RAP .GE. XVA(I) ) GO TO 240
 220  CONTINUE
 240  CONTINUE
  IF ( I .NE. 8 ) XSUP = XVA(I+1) * XPS
  IF ( I .EQ. 8 ) XSUP = 10. * XPS
  NDX = NDM(I)
  RETURN
  END
  SUBROUTINE FINFIG
!
  WRITE ( 88, 990 )
 990  FORMAT ( ' showpage' )
!
  RETURN
  END
  SUBROUTINE NOMBRE ( XVAL, XPOS, YPOS, HEIGHT, INUM )
  CALL ADVEC ( XPOS, YPOS, 0 )
  IFONT =  INT ( 4.0 * HEIGHT )
  WRITE ( 88, 115 ) IFONT
 115  FORMAT ( ' /Helvetica    findfont ', i2, ' scalefont setfont' )
  IF ( INUM .EQ. 0 ) THEN
  IVAL =  INT ( XVAL+0.5 )
  IF ( XVAL .LT. 0.0 ) IVAL =  INT ( XVAL-0.5 )
  WRITE ( 88, 200 ) IVAL
 200  FORMAT ( ' (', I5, ') show' )
  END IF
  IF ( INUM .EQ. 1 ) WRITE ( 88, 201 ) XVAL
 201  FORMAT ( ' (', f8.1, ') show' )
  IF ( INUM .EQ. 2 ) WRITE ( 88, 202 ) XVAL
 202  FORMAT ( ' (', f8.2, ') show' )
  IF ( INUM .EQ. 3 ) WRITE ( 88, 203 ) XVAL
 203  FORMAT ( ' (', f10.3, ') show' )
  IF ( INUM .LT. 0 .OR. INUM .GT. 3 ) WRITE ( 88, 222 ) XVAL
 222  FORMAT ( ' (', 1pe10.1, ') show' )
  RETURN
  END
  SUBROUTINE NBRENT ( IVAL, XPOS, YPOS, IFONT )
  CALL ADVEC ( XPOS, YPOS, 0 )
  WRITE ( 88, 115 ) IFONT
 115  FORMAT ( ' /Helvetica    findfont ', i2, ' scalefont setfont' )
  WRITE ( 88, 200 ) IVAL
 200  FORMAT ( ' (', I5, ') show' )
  RETURN
  END
  SUBROUTINE NVFIGV
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
 1    FORMAT ( / '%%Page: ', I3 )
 2    FORMAT ( ' 35 120 translate' / &
             '  0.80  0.80 scale' / &
             ' 1 setlinecap 1 setlinejoin 1 setlinewidth' / &
             ' 0.000 0.000 0.000 setrgbcolor' )
!
  NOFIG = NOFIG + 1
  WRITE ( 88, 1 ) NOFIG
  WRITE ( 88, 2 )
!
  RETURN
  END
  SUBROUTINE SETRGB ( R, G, B )
!
 1    FORMAT ( 3(1X,F7.3), ' setrgbcolor' )
!
  WRITE ( 88, 1 ) R, G, B
!
  RETURN
  END
  SUBROUTINE TEXTE ( TEXT, N, XPOS, YPOS, HEIGHT, ANGLE )
  CHARACTER*1 TEXT(N)
  CHARACTER*3 TRUC
  CHARACTER*25 FMT
  KX =  INT ( XPOS/0.35 + 0.5 )
  KY =  INT ( YPOS/0.35 + 0.5 )
  WRITE ( 88, 1 ) KX, KY
 1  FORMAT ( 2I5, ' M' )
  IFONT =  INT ( 4.0 * HEIGHT )
  WRITE ( 88, 2 ) IFONT
 2  FORMAT ( ' /Helvetica findfont ', I2, ' scalefont setfont' )
  IANG =  INT ( ANGLE )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) IANG
 3  FORMAT ( 1X, I4, ' rotate' )
  WRITE ( TRUC, "(I3)" ) N
  FMT = "( ' ('," // TRUC // "A1, ') show ' )"
  WRITE ( 88, FMT ) ( TEXT(J), J = 1, N )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) - IANG
!
  RETURN
  END
  SUBROUTINE TXTCOU ( TEXT, N, XPOS, YPOS, HEIGHT, ANGLE )
  CHARACTER*1 TEXT(N)
  CHARACTER*3 TRUC
  CHARACTER*25 FMT
  KX =  INT ( XPOS/0.35 + 0.5 )
  KY =  INT ( YPOS/0.35 + 0.5 )
  WRITE ( 88, 1 ) KX, KY
 1  FORMAT ( 2I5, ' M' )
  IFONT =  INT ( 4.0 * HEIGHT )
  WRITE ( 88, 2 ) IFONT
 2  FORMAT ( ' /Courier findfont ', I2, ' scalefont setfont' )
  IANG =  INT ( ANGLE )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) IANG
 3  FORMAT ( 1X, I4, ' rotate' )
  WRITE ( TRUC, "(I3)" ) N
  FMT = "( ' ('," // TRUC // "A1, ') show ' )"
  WRITE ( 88, FMT ) ( TEXT(J), J = 1, N )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) - IANG
!
  RETURN
  END
  SUBROUTINE TXTSYM ( TEXT, N, XPOS, YPOS, HEIGHT, ANGLE )
  CHARACTER*1 TEXT(N)
  CHARACTER*3 TRUC
  CHARACTER*25 FMT
  KX =  INT ( XPOS/0.35 + 0.5 )
  KY =  INT ( YPOS/0.35 + 0.5 )
  WRITE ( 88, 1 ) KX, KY
 1  FORMAT ( 2I5, ' M' )
  IFONT =  INT ( 4.0 * HEIGHT )
  WRITE ( 88, 2 ) IFONT
 2  FORMAT ( ' /Symbol findfont ', I2, ' scalefont setfont' )
  IANG =  INT ( ANGLE )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) IANG
 3  FORMAT ( 1X, I4, ' rotate' )
  WRITE ( TRUC, "(I3)" ) N
  FMT = "( ' ('," // TRUC // "A1, ') show ' )"
  WRITE ( 88, FMT ) ( TEXT(J), J = 1, N )
  IF ( IANG .NE. 0 ) WRITE ( 88, 3 ) - IANG
!
  RETURN
  END
  SUBROUTINE APPTXT ( TEXT, N, HEIGHT, ISTYL, ANGLE )
  CHARACTER*1 TEXT(N)
  CHARACTER*3 TRUC
  CHARACTER*25 FMT
  IFONT =  INT ( 4.0 * HEIGHT )
  IF ( ISTYL == 1 ) WRITE ( 88, 1 ) IFONT
  IF ( ISTYL == 2 ) WRITE ( 88, 2 ) IFONT
  IF ( ISTYL == 3 ) WRITE ( 88, 3 ) IFONT
 1  FORMAT ( ' /Helvetica findfont ', I2, ' scalefont setfont' )
 2  FORMAT ( ' /Courier   findfont ', I2, ' scalefont setfont' )
 3  FORMAT ( ' /Symbol    findfont ', I2, ' scalefont setfont' )
  IANG =  INT ( ANGLE )
  IF ( IANG .NE. 0 ) WRITE ( 88, 7 ) IANG
 7  FORMAT ( 1X, I4, ' rotate' )
  WRITE ( TRUC, "(I3)" ) N
  FMT = "( ' ('," // TRUC // "A1, ') show ' )"
  WRITE ( 88, FMT ) ( TEXT(J), J = 1, N )
  IF ( IANG .NE. 0 ) WRITE ( 88, 7 ) - IANG
!
  RETURN
  END
  SUBROUTINE TITRE ( TEXT, N )
!
  CHARACTER*1 TEXT(N)
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XPOS = XORI + 0.5 * XL - HL * 0.5 * FLOAT(N-1)
  YPOS = YORI + YL + 2.0 * HL
  HEIGHT = HL
  CALL TEXTE ( TEXT, N, XPOS, YPOS, HEIGHT, 0.0 )
!
  RETURN
  END
  SUBROUTINE TITX ( TEXT, N )
!
  CHARACTER*1 TEXT(N)
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XPOS = XORI + 0.5 * XL - HL * 0.5 * FLOAT(N-1)
  YPOS = YORI - 2.0 * HC - 2.0 * HL
  HEIGHT = HL
  CALL TEXTE ( TEXT, N, XPOS, YPOS, HEIGHT, 0.0 )
!
  RETURN
  END
  SUBROUTINE TITY ( TEXT, N )
!
  CHARACTER*1 TEXT(N)
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XPOS = XORI - FLOAT(NCY+3) * HC
  YPOS = YORI + 0.5 * YL - 0.5 * HL * FLOAT(N-1)
  HEIGHT = HL
  CALL TEXTE ( TEXT, N, XPOS, YPOS, HEIGHT, 90. )
!
  RETURN
  END
  SUBROUTINE TITYD ( TEXT, N, XXX )
!
  CHARACTER*1 TEXT(N)
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XPOS = XORI + XXX
  YPOS = YORI + 0.5 * YL - 0.5 * HL * FLOAT(N-1)
  HEIGHT = HL
  CALL TEXTE ( TEXT, N, XPOS, YPOS, HEIGHT, 90. )
!
  RETURN
  END
  SUBROUTINE CADRSP
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  IF ( LOGX == 0 .AND. LOGY == 0 ) THEN
  CALL CADRE ( XORI, YORI, XL, YL, NDX, NDY, HC, XMIN, XMAX &
    , YMIN, YMAX, NCX, NCY )
  END IF
  IF ( LOGX == 0 .AND. LOGY == 1 ) THEN
  CALL CALILO ( XORI, YORI, XL, YL, NDX, HC, XMIN, XMAX, LYMIN, LYMAX &
    , NCX )
  END IF
  IF ( LOGX == 1 .AND. LOGY == 0 ) THEN
  CALL CALOLI ( XORI, YORI, XL, YL, NDY, HC, LXMIN, LXMAX, YMIN, YMAX &
    , NCY )
  END IF
  IF ( LOGX == 1 .AND. LOGY == 1 ) THEN
  CALL CADLOG ( XORI, YORI, XL, YL, HC, LXMIN, LXMAX, LYMIN, LYMAX )
  END IF
  IF ( LOGX == 2 .AND. LOGY == 2 ) THEN
  CALL CALOFL ( XORI, YORI, XL, YL, HC, XMIN, XMAX, YMIN, YMAX )
  END IF
!
  RETURN
  END
  SUBROUTINE CHCADR ( XO, YO, IDX, IDY, XLON, YLON, HLET, HCHIF &
    , NC1, NC2 )
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XORI = XO
  YORI = YO
  NDX = IDX
  NDY = IDY
  XL = XLON
  YL = YLON
  HL = HLET
  HC = HCHIF
  NCX = NC1
  NCY = NC2
!
  RETURN
  END
  SUBROUTINE CADRE ( XORI, YORI, XL, YL, NDX, NDY, HC &
    , XMIN, XMAX, YMIN, YMAX, NCX, NCY )
!
 1    FORMAT ( ' /Helvetica   findfont ', i2,' scalefont setfont' )
 2    FORMAT ( 2I5, ' M' )
 3    FORMAT ( ' (', I2, ') show' )
 4    FORMAT ( ' (*) show' )
 5    FORMAT ( 2I5, ' L' )
!
  HEIGHT = ABS ( HC )
!
  CALL ADVEC ( XORI, YORI, 0 )
  CALL ADVEC ( XORI+XL, YORI, 1 )
  CALL ADVEC ( XORI+XL, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI, 1 )
!
  IF ( NDX .GT. 0 ) THEN
  DO I = 1, NDX+1
  FRAC = FLOAT (I-1) / FLOAT (NDX)
  XPOS = XORI + XL * FRAC
  XVAL = XMIN + ( XMAX - XMIN ) * FRAC
  INUM = NCX
  IF ( INUM .GE. 0 ) THEN
  XDNUM = XPOS - 0.5 * HEIGHT * FLOAT ( NCX + 4 )
  ELSE
  XDNUM = XPOS - 3. * HEIGHT
  END IF
  YDNUM = YORI - 2.0 * HEIGHT
  IF ( HC < 0.0 ) YDNUM = YDNUM - HEIGHT
  CALL NOMBRE ( XVAL, XDNUM, YDNUM, HEIGHT, INUM )
  CALL ADVEC ( XPOS, YORI, 0 )
  CALL ADVEC ( XPOS, YORI+HC, 1 )
  CALL ADVEC ( XPOS, YORI+YL-HC, 0 )
  CALL ADVEC ( XPOS, YORI+YL, 1 )
  END DO
  END IF
!
  IF ( NDY .GT. 0 ) THEN
  DO I = 1, NDY+1
  FRAC = FLOAT (I-1) / FLOAT (NDY)
  YPOS = YORI + YL * FRAC
  YVAL = YMIN + ( YMAX - YMIN ) * FRAC
  INUM = NCY
  XDNUM = XORI - 3.0 * HEIGHT - 0.7 * HEIGHT * FLOAT(INUM)
  IF ( HC < 0.0 ) XDNUM = XDNUM - HEIGHT
  IF ( YVAL .GE. 10.0 ) XDNUM = XDNUM - HEIGHT
  IF ( YVAL .GE. 100. ) XDNUM = XDNUM - HEIGHT
  IF ( YVAL .LT. 0.0 ) XDNUM = XDNUM - 0.5 * HEIGHT
  IF ( YVAL .LE. -10. ) XDNUM = XDNUM - HEIGHT
  IF ( YVAL .LE. -100. ) XDNUM = XDNUM - HEIGHT
  IF ( INUM .LT. 0 ) XDNUM = XORI - 7.0 * HEIGHT
  YDNUM = YPOS - 0.5 * HEIGHT
  CALL NOMBRE ( YVAL, XDNUM, YDNUM, HEIGHT, INUM )
  CALL ADVEC ( XORI, YPOS, 0 )
  CALL ADVEC ( XORI+HC, YPOS, 1 )
  CALL ADVEC ( XORI+XL-HC, YPOS, 0 )
  CALL ADVEC ( XORI+XL, YPOS, 1 )
  END DO
  END IF
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE CADLOG ( XORI, YORI, XL, YL, HC, LXMIN, LXMAX, LYMIN &
    , LYMAX )
!
 1    FORMAT ( ' /Helvetica   findfont ', i2,' scalefont setfont' )
 2    FORMAT ( 2I5, ' M' )
 3    FORMAT ( ' (', I2, ') show' )
 4    FORMAT ( ' (*) show' )
 5    FORMAT ( 2I5, ' L' )
!
!        TRACE DU CADRE
!
  CALL ADVEC ( XORI, YORI, 0 )
  CALL ADVEC ( XORI+XL, YORI, 1 )
  CALL ADVEC ( XORI+XL, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI, 1 )
!
!          TRACE DES GRADUATIONS EN X
!
  NDX = LXMAX - LXMIN
  HCR = 0.7 * HC
  DELTAX = XL / FLOAT(NDX)
  DO 200 I = 1, NDX+1
  FRAC = FLOAT (I-1) / FLOAT (NDX)
  XPOS = XORI + XL * FRAC
  LXVAL = LXMIN + I - 1
  XDNUM = XPOS - 2. * HC
  CALL NOMBRE ( 10., XDNUM, YORI-2.5*HC, HC, 0 )
  CALL NOMBRE ( FLOAT(LXVAL), XDNUM+1.8*HC, YORI-1.3*HC, 0.8*HC, 0 )
  CALL ADVEC ( XPOS, YORI, 0 )
  CALL ADVEC ( XPOS, YORI+HC, 1 )
  CALL ADVEC ( XPOS, YORI+YL-HC, 0 )
  CALL ADVEC ( XPOS, YORI+YL, 1 )
  IF ( I .LE. NDX ) THEN
  DO 150 K = 2, 9
  XKK = FLOAT ( K )
  XKK = XPOS + DELTAX *  LOG10 ( XKK )
  CALL ADVEC ( XKK, YORI, 0 )
  CALL ADVEC ( XKK, YORI+HCR, 1 )
  CALL ADVEC ( XKK, YORI+YL-HCR, 0 )
  CALL ADVEC ( XKK, YORI+YL, 1 )
 150  CONTINUE
  END IF
 200  CONTINUE
!
!        TRACE DES GRADUATIONS EN Y
!
  NDY = LYMAX - LYMIN
  DELTAY = YL / FLOAT(NDY)
  DO 300 I = 1, NDY+1
  FRAC = FLOAT (I-1) / FLOAT (NDY)
  YPOS = YORI + YL * FRAC
  LYVAL = LYMIN + I - 1
  YDNUM = YPOS - 0.5 * HC
  CALL NOMBRE ( 10., XORI-4.5*HC, YDNUM, HC, 0 )
  CALL NOMBRE ( FLOAT(LYVAL), XORI-2.7*HC, YDNUM+1.2*HC, 0.8*HC, 0 )
  CALL ADVEC ( XORI, YPOS, 0 )
  CALL ADVEC ( XORI+HC, YPOS, 1 )
  CALL ADVEC ( XORI+XL-HC, YPOS, 0 )
  CALL ADVEC ( XORI+XL, YPOS, 1 )
  IF ( I .LE. NDY ) THEN
  DO 250 K = 2, 9
  YKK = FLOAT ( K )
  YKK = YPOS + DELTAY *  LOG10 ( YKK )
  CALL ADVEC ( XORI, YKK, 0 )
  CALL ADVEC ( XORI+HCR, YKK, 1 )
  CALL ADVEC ( XORI+XL-HCR, YKK, 0 )
  CALL ADVEC ( XORI+XL, YKK, 1 )
 250  CONTINUE
  END IF
 300  CONTINUE
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE CALOFL ( XORI, YORI, XL, YL, HC, XMIN, XMAX, YMIN, YMAX )
!
!     CADRE LOG-LOG FLOTTANT
!
 1    FORMAT ( ' /Helvetica   findfont ', i2,' scalefont setfont' )
 2    FORMAT ( 2I5, ' M' )
 3    FORMAT ( ' (', I2, ') show' )
 4    FORMAT ( ' (*) show' )
 5    FORMAT ( 2I5, ' L' )
!
  CALL ADVEC ( XORI, YORI, 0 )
  CALL ADVEC ( XORI+XL, YORI, 1 )
  CALL ADVEC ( XORI+XL, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI, 1 )
!
!          TRACE DES GRADUATIONS EN X
!
  LXMIN = INT(XMIN)
  IF ( LXMIN < 0 ) LXMIN = LXMIN - 1
  LXMAX = INT ( XMAX )
  IF ( LXMAX > 0 ) LXMAX = LXMAX + 1
  ECH = XL / ( XMAX - XMIN )
  DX1 = XMIN - FLOAT ( LXMIN )
  XORID = XORI - DX1 * ECH
  XLV = FLOAT ( LXMAX - LXMIN ) * ECH
  NDX = LXMAX - LXMIN
  HCR = 0.7 * HC
  DELTAX = XLV / FLOAT(NDX)
  DO I = 1, NDX+1
  FRAC = FLOAT (I-1) / FLOAT (NDX)
  XPOS = XORID + XLV * FRAC
  IF ( XPOS .GE. XORI .AND. XPOS .LE. XORI+XL ) THEN
  LXVAL = LXMIN + I - 1
  XDNUM = XPOS - 2. * HC
  CALL NOMBRE ( 10., XDNUM, YORI-2.5*HC, HC, 0 )
  CALL NOMBRE ( FLOAT(LXVAL), XDNUM+1.8*HC, YORI-1.3*HC, 0.8*HC, 0 )
  CALL ADVEC ( XPOS, YORI, 0 )
  CALL ADVEC ( XPOS, YORI+HC, 1 )
  CALL ADVEC ( XPOS, YORI+YL-HC, 0 )
  CALL ADVEC ( XPOS, YORI+YL, 1 )
  END IF
  IF ( I .LE. NDX ) THEN
  DO K = 2, 9
  XKK = FLOAT ( K )
  XKK = XPOS + DELTAX *  LOG10 ( XKK )
  IF ( XKK .LE. XORI .OR. XKK .GE. XORI+XL ) CYCLE
  CALL ADVEC ( XKK, YORI, 0 )
  CALL ADVEC ( XKK, YORI+HCR, 1 )
  CALL ADVEC ( XKK, YORI+YL-HCR, 0 )
  CALL ADVEC ( XKK, YORI+YL, 1 )
  END DO !  (K = 2, 9)
  END IF
  END DO !  (I = 1, NDX+1)
!
!        TRACE DES GRADUATIONS EN Y
!
  LYMIN = INT(YMIN)
  IF ( LYMIN < 0 ) LYMIN = LYMIN - 1
  LYMAX = INT ( YMAX)
  IF ( LYMAX > 0 ) LYMAX = LYMAX + 1
  ECH = YL / ( YMAX - YMIN )
  DY1 = YMIN - FLOAT ( LYMIN )
  YORID = YORI - DY1 * ECH
  YLV = FLOAT ( LYMAX - LYMIN ) * ECH
  NDY = LYMAX - LYMIN
  DELTAY = YLV / FLOAT(NDY)
  DO I = 1, NDY+1
  FRAC = FLOAT (I-1) / FLOAT (NDY)
  YPOS = YORID + YLV * FRAC
  IF ( YPOS .GE. YORI .AND. YPOS .LE. YORI+YL ) THEN
  LYVAL = LYMIN + I - 1
  YDNUM = YPOS - 0.5 * HC
  CALL NOMBRE ( 10., XORI-4.5*HC, YDNUM, HC, 0 )
  CALL NOMBRE ( FLOAT(LYVAL), XORI-2.7*HC, YDNUM+1.2*HC, 0.8*HC, 0 )
  CALL ADVEC ( XORI, YPOS, 0 )
  CALL ADVEC ( XORI+HC, YPOS, 1 )
  CALL ADVEC ( XORI+XL-HC, YPOS, 0 )
  CALL ADVEC ( XORI+XL, YPOS, 1 )
  END IF
  IF ( I .LE. NDY ) THEN
  DO K = 2, 9
  YKK = FLOAT ( K )
  YKK = YPOS + DELTAY *  LOG10 ( YKK )
  IF ( YKK .LE. YORI .OR. YKK .GE. YORI+YL ) CYCLE
  CALL ADVEC ( XORI, YKK, 0 )
  CALL ADVEC ( XORI+HCR, YKK, 1 )
  CALL ADVEC ( XORI+XL-HCR, YKK, 0 )
  CALL ADVEC ( XORI+XL, YKK, 1 )
  END DO !  (K = 2, 9)
  END IF
  END DO !  (I = 1, NDY+1)
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE CALILO ( XORI, YORI, XL, YL, NDX, HC, XMIN, XMAX &
    , LYMIN, LYMAX, NCX )
!
 1    FORMAT ( ' /Helvetica   findfont ', i2,' scalefont setfont' )
 2    FORMAT ( 2I5, ' M' )
 3    FORMAT ( ' (', I2, ') show' )
 4    FORMAT ( ' (*) show' )
 5    FORMAT ( 2I5, ' L' )
!
  CALL ADVEC ( XORI, YORI, 0 )
  CALL ADVEC ( XORI+XL, YORI, 1 )
  CALL ADVEC ( XORI+XL, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI, 1 )
!
  IF ( NDX .GT. 0 ) THEN
     DO I = 1, NDX+1
  FRAC = FLOAT (I-1) / FLOAT (NDX)
  XPOS = XORI + XL * FRAC
  XVAL = XMIN + ( XMAX - XMIN ) * FRAC
  HEIGHT = HC
  INUM = NCX
  IF ( INUM .GE. 0 ) THEN
  XDNUM = XPOS - 0.5 * HC * FLOAT ( NCX + 4 )
  ELSE
  XDNUM = XPOS - 3. * HC
  END IF
  CALL NOMBRE ( XVAL, XDNUM, YORI-2.0*HC, HEIGHT, INUM )
  CALL ADVEC ( XPOS, YORI, 0 )
  CALL ADVEC ( XPOS, YORI+HC, 1 )
  CALL ADVEC ( XPOS, YORI+YL-HC, 0 )
  CALL ADVEC ( XPOS, YORI+YL, 1 )
     END DO
  END IF
!
  NDY = LYMAX - LYMIN
  HCR = 0.7 * HC
  DELTAY = YL / FLOAT(NDY)
    DO I = 1, NDY+1
  FRAC = FLOAT (I-1) / FLOAT (NDY)
  YPOS = YORI + YL * FRAC
  LYVAL = LYMIN + I - 1
  YDNUM = YPOS - 0.5 * HC
  CALL NOMBRE ( 10., XORI-4.5*HC, YDNUM, HC, 0 )
  CALL NOMBRE ( FLOAT(LYVAL), XORI-2.7*HC, YDNUM+1.2*HC, 0.8*HC, 0 )
  CALL ADVEC ( XORI, YPOS, 0 )
  CALL ADVEC ( XORI+HC, YPOS, 1 )
  CALL ADVEC ( XORI+XL-HC, YPOS, 0 )
  CALL ADVEC ( XORI+XL, YPOS, 1 )
  IF ( I .LE. NDY ) THEN
    DO K = 2, 9
  YKK = FLOAT ( K )
  YKK = YPOS + DELTAY *  LOG10 ( YKK )
  CALL ADVEC ( XORI, YKK, 0 )
  CALL ADVEC ( XORI+HCR, YKK, 1 )
  CALL ADVEC ( XORI+XL-HCR, YKK, 0 )
  CALL ADVEC ( XORI+XL, YKK, 1 )
    END DO
  END IF
    END DO
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE CALOLI ( XORI, YORI, XL, YL, NDY, HC, LXMIN, LXMAX, YMIN, YMAX &
    , NCY )
!
 1    FORMAT ( ' /Helvetica   findfont ', i2,' scalefont setfont' )
 2    FORMAT ( 2I5, ' M' )
 3    FORMAT ( ' (', I2, ') show' )
 4    FORMAT ( ' (*) show' )
 5    FORMAT ( 2I5, ' L' )
!
  CALL ADVEC ( XORI, YORI, 0 )
  CALL ADVEC ( XORI+XL, YORI, 1 )
  CALL ADVEC ( XORI+XL, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI+YL, 1 )
  CALL ADVEC ( XORI, YORI, 1 )
!
  NDX = LXMAX - LXMIN
  HCR = 0.7 * HC
  DELTAX = XL / FLOAT(NDX)
    DO I = 1, NDX+1
  FRAC = FLOAT (I-1) / FLOAT (NDX)
  XPOS = XORI + XL * FRAC
  LXVAL = LXMIN + I - 1
  XDNUM = XPOS - 2. * HC
  CALL NOMBRE ( 10., XDNUM, YORI-2.5*HC, HC, 0 )
  CALL NOMBRE ( FLOAT(LXVAL), XDNUM+1.8*HC, YORI-1.3*HC, 0.8*HC, 0 )
  CALL ADVEC ( XPOS, YORI, 0 )
  CALL ADVEC ( XPOS, YORI+HC, 1 )
  CALL ADVEC ( XPOS, YORI+YL-HC, 0 )
  CALL ADVEC ( XPOS, YORI+YL, 1 )
  IF ( I .LE. NDX ) THEN
    DO K = 2, 9
  XKK = FLOAT ( K )
  XKK = XPOS + DELTAX *  LOG10 ( XKK )
  CALL ADVEC ( XKK, YORI, 0 )
  CALL ADVEC ( XKK, YORI+HCR, 1 )
  CALL ADVEC ( XKK, YORI+YL-HCR, 0 )
  CALL ADVEC ( XKK, YORI+YL, 1 )
    END DO
  END IF
    END DO
!
  IF ( NDY .GT. 0 ) THEN
    DO I = 1, NDY+1
  FRAC = FLOAT (I-1) / FLOAT (NDY)
  YPOS = YORI + YL * FRAC
  YVAL = YMIN + ( YMAX - YMIN ) * FRAC
  HEIGHT = HC
  INUM = NCY
  XDNUM = XORI - 3.0 * HC - 0.7 * HC * FLOAT(INUM)
  IF ( YVAL .GE. 10.0 ) XDNUM = XDNUM - HC
  IF ( YVAL .GE. 100. ) XDNUM = XDNUM - HC
  IF ( YVAL .LT. 0.0 ) XDNUM = XDNUM - 0.5 * HC
  IF ( YVAL .LE. -10. ) XDNUM = XDNUM - HC
  IF ( YVAL .LE. -100. ) XDNUM = XDNUM - HC
  IF ( INUM .LT. 0 ) XDNUM = XORI - 7.0 * HC
  CALL NOMBRE ( YVAL, XDNUM, YPOS-0.5*HC, HEIGHT, INUM )
  CALL ADVEC ( XORI, YPOS, 0 )
  CALL ADVEC ( XORI+HC, YPOS, 1 )
  CALL ADVEC ( XORI+XL-HC, YPOS, 0 )
  CALL ADVEC ( XORI+XL, YPOS, 1 )
    END DO
  END IF
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE CHLIMI ( XMI, XMA, LX, LXI, LXA, YMI, YMA, LY, LYI, LYA &
    )
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  XMIN = XMI
  XMAX = XMA
  LOGX = LX
  LXMIN = LXI
  LXMAX = LXA
  YMIN = YMI
  YMAX = YMA
  LOGY = LY
  LYMIN = LYI
  LYMAX = LYA
!
  RETURN
  END
  SUBROUTINE COLILI ( NP, X, Y, NT )
!
  COMMON /VISU/ XORI, YORI, XL, YL, HL, HC, XMIN, XMAX, YMIN, YMAX &
    , NOFIG, NDX, NDY, LOGX, LXMIN, LXMAX, LOGY, LYMIN, LYMAX &
    , NCX, NCY
!
  DIMENSION X(NP), Y(NP)
  DIMENSION T1(5), T2(5), T3(5), T4(5)
!
  T1 = (/ 5., 0.5, 6.,  10., 5. /)
  T2 = (/ 2., 3.,  2.,  2., 5.  /)
  T3 = (/ 5., 0.5, 0.5, 10., 5. /)
  T4 = (/ 2., 3.,  2.,  2., 5.  /)
!
  IF ( NT .LE. -1 ) GO TO 100
  IT = MOD ( NT, 6 )
  IF ( IT .EQ. 0 ) THEN
  CALL COUSUC ( NP, X, Y, XORI, YORI, XL, YL, XMIN, XMAX, YMIN, YMAX &
    , LOGX, LOGY, LXMIN, LXMAX, LYMIN, LYMAX )
  ELSE
  CALL COUSUP ( NP, X, Y, T1(IT), T2(IT), T3(IT), T4(IT), XORI, YORI &
    , XL, YL, XMIN, XMAX, YMIN, YMAX, LOGX, LOGY, LXMIN, LXMAX, LYMIN &
    , LYMAX )
  END IF
  RETURN
!
 100  CONTINUE
  WRITE ( 88, 111 )
 111  FORMAT ( ' 2 setlinewidth' )
  CALL COUSUC ( NP, X, Y, XORI, YORI, XL, YL, XMIN, XMAX, YMIN, YMAX &
    , LOGX, LOGY, LXMIN, LXMAX, LYMIN, LYMAX )
  WRITE ( 88, 133 )
 133  FORMAT ( ' 1 setlinewidth' )
  RETURN
!
  END
  SUBROUTINE COUSUP ( NP, X, Y, T1, T2, T3, T4, XORI, YORI, XL, YL &
    , XMIN, XMAX, YMIN, YMAX, LOGX, LOGY, LXMIN, LXMAX, LYMIN, LYMAX )
!
!     COURBE SUPPLEMENTAIRE EN POINTILLES
!
!         np : nombre de points de donnees
!         x  : tableau des abscisses
!         y  : tableau des ordonnees
!         t1, t2, t3, t4 : longueur des traits du pointille
!
  REAL, DIMENSION(NP) :: X, Y
  REAL, DIMENSION(4) :: P
!
!              initialisation
!
  TOT = T1 + T2 + T3 + T4
  P(1) = T1 / TOT
  P(2) = ( T1 + T2 ) / TOT
  P(3) = ( T1 + T2 + T3 ) / TOT
  P(4) = 1.0
!
!     positionnement au premier point situe a l'interieur du cadre
!
  IP = 0
 100  CONTINUE
  IP = IP + 1
  IF ( IP > NP ) GO TO 900
  IF ( LOGX == 0 ) XX = XL * ( X(IP) - XMIN ) / ( XMAX - XMIN )
  IF ( LOGX == 1 ) XX = XL * ( LOG10 ( X(IP) ) - FLOAT ( LXMIN ) ) / &
    FLOAT ( LXMAX - LXMIN )
  IF ( LOGX == 2 ) XX = XL * ( LOG10(X(IP)) - XMIN ) / ( XMAX - XMIN )
  IF ( LOGY == 0 ) YY = YL * ( Y(IP) - YMIN ) / ( YMAX - YMIN )
  IF ( LOGY == 1 ) YY = YL * ( LOG10 ( Y(IP) ) - FLOAT ( LYMIN ) ) / &
    FLOAT ( LYMAX - LYMIN )
  IF ( LOGY == 2 ) YY = YL * ( LOG10(Y(IP)) - YMIN ) / ( YMAX - YMIN )
  IF ( XX < 0.0 .OR. XX > XL .OR. YY < 0.0 .OR. YY > YL ) GO TO 100
  PP = 0.0
  IEPP = 1
  CALL ADVECM ( XORI+XX, YORI+YY, 0 )
 200  CONTINUE
!
!              coordonnees du point vise
!
  IF ( LOGX == 0 ) XXN = XL * ( X(IP+1) - XMIN ) / ( XMAX - XMIN )
  IF ( LOGX == 1 ) XXN = XL * ( LOG10 ( X(IP+1) ) - FLOAT ( LXMIN ) ) &
    / FLOAT ( LXMAX  - LXMIN )
  IF ( LOGX == 2 ) XXN = XL * ( LOG10 ( X(IP+1) ) - XMIN ) / &
    ( XMAX - XMIN )
  IF ( LOGY == 0 ) YYN = YL * ( Y(IP+1) - YMIN ) / ( YMAX - YMIN )
  IF ( LOGY == 1 ) YYN = YL * ( LOG10 ( Y(IP+1) ) - FLOAT ( LYMIN ) ) &
    / FLOAT ( LYMAX  - LYMIN )
  IF ( LOGY == 2 ) YYN = YL * ( LOG10 ( Y(IP+1) ) - YMIN ) / &
    ( YMAX - YMIN )
  IF ( XXN < 0.0 .OR. XXN > XL .OR. YYN < 0.0 .OR. YYN > YL ) GO TO 100
 300  CONTINUE
!
!              distance et direction du point vise
!
  dx = xxn - xx
  dy = yyn - yy
  ds = sqrt ( dx*dx + dy*dy )
  if ( ds .ne. 0.0 ) then
  u = dx / ds
  v = dy / ds
  end if
!
!      dp = distance du point courant au point de changement
!         de la plume
!
  dp = ( p(iepp) - pp ) * tot
  if ( dp .gt. ds ) go to 400
!
!      deplacement jusqu'au point de changement de plume
!
  ipen = 1
  if ( mod ( iepp, 2 ) .eq. 0 ) ipen = 0
  xx = xx + dp * u
  yy = yy + dp * v
  call advecm ( xori+xx, yori+yy, ipen )
  pp = p(iepp)
  iepp = iepp + 1
  if ( iepp .eq. 5 ) then
  iepp = 1
  pp = 0.0
  end if
  go to 300
 400  continue
!
!       deplacement jusqu'au point de donnees suivant sans
!         changement de l'etat de la plume
!
  xx = xxn
  yy = yyn
  ipen = 1
  if ( mod ( iepp, 2 ) .eq. 0 ) ipen = 0
  call advecm ( xori+xx, yori+yy, ipen )
  pp = pp + ds / tot
  ip = ip + 1
  if ( ip .eq. np ) go to 900
  go to 200
!
 900  CONTINUE
  CALL FINTRA
!
  RETURN
  END
  SUBROUTINE COUSUC ( NP, X, Y, XORI, YORI, XL, YL, XMIN, XMAX &
    , YMIN, YMAX, LOGX, LOGY, LXMIN, LXMAX, LYMIN, LYMAX )
!
!     COURBE EN TRAIT CONTINU
!
  DIMENSION X(NP), Y(NP)
!
  IP1 = 0
  DO I = 1, NP
  IF ( LOGX == 0 ) XX = XL * ( X(I) - XMIN ) / ( XMAX - XMIN )
  IF ( LOGX == 1 ) XX = XL * ( LOG10 ( X(I) ) - FLOAT ( LXMIN ) ) / &
    FLOAT ( LXMAX - LXMIN )
  IF ( LOGX == 2 ) XX = XL * ( LOG10 ( X(I) ) - XMIN ) / ( XMAX - XMIN )
  IF ( LOGY == 0 ) YY = YL * ( Y(I) - YMIN ) / ( YMAX - YMIN )
  IF ( LOGY == 1 ) YY = YL * ( LOG10 ( Y(I) ) - FLOAT ( LYMIN ) ) / &
    FLOAT ( LYMAX  - LYMIN )
  IF ( LOGY == 2 ) YY = YL * ( LOG10 ( Y(I) ) - YMIN ) / ( YMAX - YMIN )
  IP2 = 1
  IF ( XX .LT. 0.0 .OR. XX .GT. XL ) IP2 = 0
  IF ( YY .LT. 0.0 ) YY = 0.0
  IF ( YY .GT. YL ) YY = YL
  IF ( IP2 .EQ. 0 ) GO TO 180
  IPEN = 1
  IF ( IP1 .EQ. 0 ) IPEN = 0
  CALL ADVECM ( XORI+XX, YORI+YY, IPEN )
 180  CONTINUE
  IP1 = IP2
  END DO !  (I = 1, NP)
!
  CALL FINTRA
  RETURN
  END
