**********************************************
DESCRIPTION OF THE PROGRAM   P O L A R P L O T
**********************************************

  PROGRAM POLARPLOT IS DESIGNED FOR PLOTTING OF PARTICLE MOTION
DIAGRAMS FROM FILES LU4 GENERATED IN THE PROGRAM SYNTPL FROM
PROGRAM PACKAGE SEIS83 OR PROGRAMS SYNTAN OR BPLOT FROM PROGRAM 
PACKAGE ANRAY. IT CAN BE ALSO USED TO PLOT PARTICLE MOTION DIAGRAMS 
GENERATED BY OTHER PROGRAMS AND STORED IN THE SAME FORM AS THOSE 
GENERATED IN PROGRAMS SYNTPL, SYNTAN OR BPLOT.


A SHORT DESCRIPTION OF THE PROGRAM
----------------------------------

  PARTICLE MOTION DIAGRAMS ARE PLOTTED IN A FRAME, IN WHICH THE
X- AND Y-AXES CORRESPOND TO TWO SELECTED COMPONENTS OF DISPLA-
CEMENT VECTOR. THE DIAGRAMS MAY BE PLOTTED IN A NORMALIZED FORM,
WITH MAXIMUM AMPLITUDE REACHING THE BOUNDARIES OF THE FRAME FOR
EACH RECEIVER, OR WITH REAL CHANGES OF AMPLITUDES FROM RECEIVER
TO RECEIVER. A SELECTION OF RECEIVERS AT WHICH THE PARTICLE MO-
TION DIAGRAMS ARE TO BE COMPUTED, CAN BE PERFORMED.
   CALCOMP PLOTTING ROUTINES PLOTS, PLOT, NUMBER AND SYMBOL
ARE REQUIRED.


                                                     
DESCRIPTION OF INPUT AND OUTPUT FILES
-------------------------------------
    MAIN INPUT DATA ARE READ FROM THE STANDARD INPUT BY LIST-DIRECTED
INPUT (FREE FORMAT) AND CONSIST OF A SINGLE LINE CONTAINING FOLLOWING
DATA:
    'LIN' 'LOU' 'LU4A' 'LU4B'/
HERE:
    'LIN' IS THE NAME OF THE INPUT DATA FILE LIN.
    'LOU' IS THE NAME OF THE OUTPUT LOG FILE LOU.
    'LU4A' IS THE NAME OF THE INTPUT DATA FILE LU4,
          GENERATED BY PROGRAM SYNTAN OR BPLOT.
    'LU4B' IS THE NAME OF THE INTPUT DATA FILE LU4,
          GENERATED BY PROGRAM SYNTAN OR BPLOT.
    / IS A SLASH RECOMENDED IN BATCH AND SCRIPT FILES TO ENABLE FUTURE
        EXTENSIONS.
DEFAULTS:
    'LIN'='polar.dat'
    'LOU'='polar.out'
    'LU4A'='lu4a.dat'
    'LU4B'='lu4b.dat'
EXAMPLE OF THE MAIN INPUT DATA:
    'polar.dat' /


INPUT DATA CONSIST PARTIALLY OF THE DATA GENERATED BY THE PROGRAM
SYNTAN OR BPLOT AND STORED IN A FORMATTED FORM IN TWO FILES LU4 (EACH 
WITH ONE COMPONENT), AND PARTIALLY OF THE ADDITIONAL INPUT DATA 
READ BY LIST-DIRECTED INPUT (FREE FORMAT). THE ADDITIONAL DATA ARE
SPECIFIED BY THE USER TO CONTROL THE PLOTTING. THEY ARE STORED IN THE 
FILE LIN. OUTPUT DATA DESCRIBING THE COMPUTATIONS ARE STORED IN
THE FILE LOU. THE PROGRAM GENERATES A POSTSCRIPT FILE WITH THE 
DESIRED PLOT.


                                                      
DATA STORED IN FILES LU4
------------------------

IN EACH FILE LU4, THE RAY SYNTHETIC SEISMOGRAMS OF THE SPECIFIED
COMPONENT OF DISPLACEMENT VECTOR ARE STORED TOGETHER WITH SOME 
OTHER RELEVANT IMPORTANT INFORMATION.
THE DATA IN LU4 ARE STORED IN THE FORMATTED FORM IN THE FOLLOWING 
ORDER:
1) MTEXT                                  FORMAT(A)
   ARBITRARY ALPHANUMERIC TEXT DESCRIBING THE COMPUTATIONS. THIS
   TEXT MAY APPEAR UNDER THE PLOTS. IT WAS READ IN THE PROGRAM 
   ANRAY.
2) MDIST,MRED,MCOMP,ITPR,VRED,RSTEP,XSOUR,YSOUR,DT  FORMAT(4I5,5F10.5)
      MDIST...  THE NUMBER OF RECEIVER POSITIONS.
      MRED...   MRED=0:NON REDUCED TRAVEL TIMES,
                MRED=1: REDUCED TRAVEL TIMES.
      MCOMP...  MCOMP=0: VERTICAL COMPONENT.
                MCOMP=1: RADIAL COMPONENT.
                MCOMP=2: TRANSVERSE COMPONENT.
      ITPR...   ITPR=0: RECEIVERS ALONG THE EARTH'S SURFACE.
                ITPR=1: RECEIVERS ALONG A VERTICAL PROFILE.
                ITPR.GT.100: RECEIVERS ALONG AN INTERFACE.
      VRED...   REDUCTION VELOCITY
      RSTEP...  AVERAGE DIFFERENCE BETWEEN COORDINATES OF
                NEIGHBOURING RECEIVER POSITIONS.
      XSOUR, YSOUR...  X- AND Y-COORDINATEs OF THE SOURCE.
      DT...     TIME STEP IN SYNTHETIC SEISMOGRAM.
3) XMX,SMAXIM                        FORMAT(22X,F10.5,9X,E15.9)
      XMX...    COORDINATE OF OF THE RECEIVER AT WHICH THE
                MAXIMUM AMPLITUDE 'SMAXIM' WAS RECORDED
                (X-COORDINATE FOR RECEIVERS SITUATED ALONG THE
                EARTH'S SURFACE OR ALONG AN INTERFACE, Z-COOR-
                DINATE FOR RECEIVERS SITUATED ALONG A VERTICAL
                PROFILE).
      SMAXIM... THE MAXIMUM AMPLITUDE OF ALL TRACES.
THE FOLLOWING CARDS 4,5 ARE SUCCESSIVELY REPEATED FOR ALL
RECEIVER POSITIONS:
4) XX,SMAX,TMIN,NPTS            FORMAT(F10.5,E15.8,F10.5,I5)
      XX...     COORDINATE OF THE RECEIVER (X-COORDINATE WHEN
                RECEIVERS ARE SITUATED ALONG THE EARTH'S SURFACE
                OR ALONG AN INTERFACE AND Z-COORDINATE WHEN RE-
                CEIVERS ARE SITUATED ALONG A VERTICAL PROFILE.
      SMAX...   MAXIMUM AMPLITUDE IN THE SYNTHETIC SEISMOGRAM
                AT XX.
      TMIN...   THE TIME CORRESPONDING TO THE FIRST NON-ZERO
                POINT IN THE SYNTHETIC SEISMOGRAM.
      NPTS...   NUMBER OF POINTS IN SYNTHETIC SEISMOGRAM.
5) SYNTHETIC SEISMOGRAM                   FORMAT(20F4.0)
THE MAXIMUM LENGTH OF ONE SYNTHETIC SEISMOGRAM IS 3001 POINTS.
ONLY THE PARTS OF THE SEISMOGRAMS SITUATED BETWEEN THE FIRST
AND THE LAST NON-ZERO ARRIVAL ARE STORED. EACH SEISMOGRAM IS
STORED IN A NORMALIZED FORM, SEE THE FORMAT, WITH MAXIMUM
AMPLITUDE EQUAL 999.

                                                      
THE ADDITIONAL INPUT DATA IN THE FILE LIN
-----------------------------------------

THE FOLLOWING DATA SHOULD BE INTRODUCED DIRECTLY (CARDS, TERMI-
NAL). THEY CONTROL THE PLOTTING OF SYNTHETIC SEISMOGRAMS. THE
DATA FROM LU4A AND LU4B (EACH FOR ONE COMPONENT) ARE READ IN
AFTER ALL THE ADDITIONAL INPUT DATA ARE READ IN.

1) ONE LINE
   IPRINT,XSHIFT,YSHIFT,PSTEXT
        IPRINT...CONTROLS STORAGE OF SOME DATA IN THE FILE LOU,
                 SEE DETAILS IN THE SECTION ON OUTPUT TABLES
                 AND THE TYPE OF THE NAME OF THE POSTSCRIPT FILE 
                 WITH A PLOT.
                 IPRINT.GE.0... AUTOMATIC GENERATION OF POSTSCRIPT FILE
                 NAMES: PLOT00.PS, PLOT01.PS, ETC.
                 IPRINT.LT.0... POSTSCRIPT FILE NAME SPECIFIED BY THE USER,
                 SEE PSTEXT.
                 DEFAULT IPRINT=0.
        XSHIFT...THE SHIFT BETWEEN INDIVIDUAL PICTURES IN THE
                 X-DIRECTION, IN CM. DEFAULT XSHIFT=3.
        YSHIFT...THE SHIFT BETWEEN INDIVIDUAL PICTURES IN THE
                 Y-DIRECTION, IN CM. DEFAULT YSHIFT=6.

        PSTEXT...THE NAME OF THE POSTSCRIPT FILE SPECIFIED BY THE USER;
                 IT IS USED ONLY IF IPR.LT.0.

2) ONE LINE, VARIOUS SWITCHES
  MCONT,MEPIC,NTICX,NTEXT,NVER
         MCONT... MCONT=0: THE COMPUTATION TERMINATES. DEFAULT
                  VALUE.
                  MCONT=1: A NEW PLOT OF SYNTHETIC SEISMOGRAMS
                  WILL BE MADE FROM THE SAME FILE AS THE PRECE-
                  DING PLOT.
         MEPIC... CONTROLS THE SELECTION OF RECEIVER POSITIONS
                  MEPIC=0: NO SELECTION. DEFAULT VALUE.
                  MEPIC=1: SELECTION APPLIED, SEE LINE NO.3
         NTICX... THE NUMBER OF MARKED INTERVALS BETWEEN TWO AD-
                  JOINING TICS DENOTED BY COORDINATE VALUES ALONG
                  X- AND Y-AXES. DEFAULT NTICX=1.
         NTEXT... SELECTION OF THE TEXT WHICH SHOULD APPEAR UNDER
                  THE PLOTS:
                  NTEXT.LT.0: ONLY DESCRIPTION OF AXES AND THE
                  TEXT 'TXT', SEE BELOW; NO ADDITIONAL TEXTS
                  ARE TO BE PLOTTED.
                  NEXT=0: THE TEXT 'TEXT' STORED IN FILE LU4, IS
                  TO BE PLOTTED. DEFAULT VALUE.
                  NTEXT=1: THE TEXT 'TXT' READ FROM INPUT DATA
                  LINE NO.5, SEE BELOW, IS TO BE PLOTTED.
         NVER...  CONTROLS ORIENTATION OF THE VERTICAL AXIS OF THE 
                  FRAME IF IT CORRESPONDS TO THE VERTICAL COMPONENT;
                  NVER=0: POSITIVE DIRECTION OF THE VERTICAL AXIS
                  UPWARDS. DEFAULT VALUE.
                  NVER=1: POSITIVE DIRECTION OF THE VERTICAL AXIS
                  DOWNWARDS.

3) ONE LINE, SELECTION OF RECEIVER POSITIONS.
  INCLUDED ONLY WHEN MEPIC.NE.0.
     NEPIC,(IEP(I),I=1,NEPIC)
         NEPIC... NUMBER OF SELECTED RECEIVER POSITIONS AT WHICH
                  SYNTHETIC SEISMOGRAMS ARE TO BE CONSTRUCTED.
         IEP(1),IEP(2),...,IEP(NEPIC)... SEQUENTIAL NUMBERS OF
                  SELECTED RECEIVER POSITIONS (IN INCREASING
                  ORDER).
  NOTE: SIMILAR SELECTION CAN BE DONE ALREADY IN THE PROGRAM
  SYNTPL OR BPLOT. THE SELECTION HERE IS MADE AMONG THOSE 
  RECEIVERS WHICH REMAINED AFTER THE SELECTION IN SYNTPL OR
  BPLOT.

4) ONE LINE, DESCRIPTION OF AXES IN THE PLOT
  XLEN,DTICX,SC,TSTART,TFIN,AMP,B1
        XLEN...   LENGTH OF X- AND Y-AXES (IN CM). THE MINIMUM
                  AND MAXIMUM VALUES ON BOTH AXES ARE -1.0 AND
                  1.0 RESPECTIVELY.
        DTICX...  THE DISTANCE BETWEEN TWO ADJOINING TICS WHICH
                  ARE DENOTED BY CORRESPONDING COORDINATE VALUES
                  ON BOTH AXES.
        SC...     CONTROLS THE SCALES OF TICS AND ALPHANUMERICAL
                  TEXTS. FOR SC=1., THE TICS ARE 0.15 CM LONG
                  AND COORDINATES AND TEXTS DESCRIBING THE PLOTS
                  ARE 0.4 AND 0.45 CM HIGH, RESPECTIVELY. DEFAULT
                  SC=1.
        TSTART,TFIN... MINIMUM AND MAXIMUM VALUES OF THE TIME IN-
                  TERVAL FOR WHICH PARTICLE MOTION DIAGRAMS ARE
                  TO BE PLOTTED. THE VALUES APPEAR IN THE PLOT.
                  DEFAULT TSTART=0., TFIN=10.
        AMP,B1... PARAMETERS OF THE AMPLITUDE SCALING OF PARTICLE
                  MOTION DIAGRAMS. THEY CONTROL THE SCALING OF
                  PARTICLE MOTION DIAGRAMS. DEFAULT AMP=0., B1=1.
                  DENOTE DDX=0.5*XLEN. THEN THE FOLLOWING SYSTEMS
                  OF SCALING CAN BE USED:

    1) FACTOR=B1*DDX/SMAXI,
       WHEN AMP=0.
       NORMALIZATION OF MAXIMUM AMPLITUDES IN ALL DIAGRAMS:
       FOR B1=1, IN EACH FRAME THE PARTICLE MOTION DIAGRAM TOUCHES
       THE FRAME OF THE DIAGRAM WITH ITS MAXIMUM AMPLITUDE.
    2) FACTOR=B1*DDX/SMAXIM,
       WHEN AMP=-1,
       REAL CHANGES OF AMPLITUDES BETWEEN DIAGRAMS:
       FOR B1=1, THE PARTICLE MOTION DIAGRAM FOR THE RECEIVER WITH
       MAXIMUM AMPLITUDE TOUCHES THE FRAME OF THE DIAGRAM. ALL THE
       OTHER DIAGRAMS ARE WITHIN THEIR FRAMES.
    3) FACTOR=B1,
       WHEN AMP=1,
       REAL AMPLITUDES: MANUAL DETERMINATION OF THE SCALING FACTOR
       BY SPECIFYING B1.

 5) ONE LINE, ALPHANUMERICAL TEXT DESCRIBING THE PLOTS. IT APPEARS
    UNDER THE PLOTS WHEN NTEXT=1 IN INPUT DATA LINE NO.2.
     TXT
    DEFAULT 'POLAR'.

LU4/1
LU4/2
LU4/3
LU4/4
LU4/5

Example of data LIN

TERMINATION OF COMPUTATIONS
---------------------------

IF MCONT=1 IN LINE NO.2, THE LINES 2-5 CAN BE REPEATED AN ARBI-
TRARY NUMBER OF TIMES TO PLOT PARTICLE MOTION DIAGRAMS WITH DIF-
FERENT AMPLITUDE SCALING, DIFFERENT TIME INTERVALS, ETC.
THE COMPUTATION TERMINATES WHEN MCONT=0 IN THE INPUT DATA LINE
NO.2.


                                                      
OUTPUT TO THE FILE LOU
----------------------

ALL THE ADDITIONAL INPUT DATA ARE STORED IN THE FILE LOU.
THE STORAGE OF OTHER DATA IS CONTROLLED BY THE PARAMETER IPRINT,
SEE INPUT DATA LINE NO.1.
FOR IPRINT=0: ALSO THE DATA LU4/1,LU4/2 AND LU4/3 FROM BOTH FILES
LU4A AND LU4B ARE PRINTED.
FOR IPRINT=1: THE SAME AS FOR IPRINT=0. IN ADDITION, ONE LINE IS
PRINTED FOR EACH RECEIVER POSITION:
XX,SMAX,FACTOR,SFMAX
WHERE XX IS THE COORDINATE OF THE RECEIVER (X-COORDINATE FOR RECE-
IVERS SITUATED ALONG THE EARTH'S SURFACE OR ALONG AN INTERFACE,
Z-COORDINATE FOR RECEIVERS SITUATED ALONG A VERTICAL PROFILE),
SMAX IS THE MAXIMUM AMPLITUDE IN THE CORRESPONDING PARTICLE MOTION
DIAGRAM, FACTOR IS THE AMPLITUDE SCALING FACTOR CORRESPONDING TO
THE SPECIFIED RECEIVER, AND SFMAX IS THE MAXIMUM AMPLITUDE IN THE
PARTICLE MOTION DIAGRAM AFTER SCALING.