Description of the program  S Y N F A N

    Program  SYNFAN  is  designed  for  the  computation  of  ray
synthetic seismograms at a system of receivers situated along the
Earth's surface, an internal interface or vertical profile.

Short description of the program SYNFAN

    Program  SYNFAN is  a modification  of the  program SYNT from
program package BEAM87 written  by V.Cerveny. The seismograms are
computed  from the  frequency responses  stored in  the file LU7,
generated in  the program FRESAN.  Program SYNFAN generates  file
LU8  containing tables  of  synthetic  seismograms  which  can be
plotted in the form of seismograms in the program BPLOT or in the
form of  particle motion diagrams in  the program POLARPLOT. Both
programs are included in the program package ANRAY.

    The fast  Fourier transform algorithm is  used to compute the
synthetic seismograms  corresponding to individual  components of
the  displacement  vector  (vertical  and  two  horizontal)  from
frequency   responses.  Various   source-time  functions   (input
signals)  can be  optionally used  in the  program SYNFAN:  Gabor
signal,  Ricker signal,  Berlage signal,  Muller signal,etc.  Any
other signal  may be easily  introduced in a  discrete form by  a
table of points. The input signal may be filtered in various ways
to  introduce some  required frequency  domain effects (recording
instruments,  etc.). Moreover,  filtering  should  be applied  to
exclude  very  low  frequencies  from  the source-time functions,
since  the ray  method is  a high-frequency  method and  does not
yield  sufficiently accurate  results for  very low  frequencies.
Such filtration  can be suitably  performed by the  double cosine
filter,  see  input  data  No.11.  The  application of the double
cosine filter is also suitable to select only the frequency range
of interest and to increase the numerical efficiency and speed of
computations. Positive  polarity of pulses  in seismograms is  to
the left of vertical time axis.

    Some  plotting  possibilities  are  available  in the program
SYNFAN.  For  each  receiver  under  consideration  the  computed
synthetic seismogram may be optionally plotted in a single frame.
Moreover, it is  also possible to plot optionally  the modulus of
the  frequency  response  and/or  the  amplitude  spectrum of the
synthetic seismograms. All these curves are plotted individually,
one curve  in one frame.  Such figures may  serve for a  detailed
investigation of the wave field at selected receiver positions.

    Several figures may be also  plotted to investigate in detail
the properties of the source-time function: the input signal, its
amplitude spectrum,  the amplitude spectrum  after filtering, and
the  input  signal  after  filtering.  The  last  figure  is very
important since it  enables to see the actual  shape of the input
signal  used  to  construct  synthetic  seismograms.  The program
SYNFAN  also offers  a possibility  to investigate systematically
the  properties  of  various  input  signals  and  the effects of
frequency  filtration of  these signals  on their  shape, without
computation of synthetic seismograms.

    Note that  the program SYNFAN does  not depend on the  way in
which  the frequency  response was  obtained. Thus  any frequency
response stored in  the prescribed way can be  used for computing
synthetic seismograms. Since the program  SYNFAN  uses  the  fast 
Fourier  transform   algorithm,  attention  should   be  paid  to  
possible aliasing effects.

                                                     
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' 'LU7' 'LU8'/
Here:
    'LIN' is the name of the input data file LIN.
    'LOU' is the name of the output log file LOU.
    'LU7' is the name of the input data file LU7,
          generated by program FRESAN.
    'LU8' is the name of the output data file LU8.
    / is a slash recomended in batch and script files to enable future
        extensions.
Defaults:
    'LIN'='synfan.dat'
    'LOU'='synfan.out'
    'LU7'='lu7.dat'
    'LU8'='lu8.dat'
Example of the main input data:
    'synfan.ani' /
    'synfan.qi' /

    Input  data consist  partially of  the data  generated by the
program FRESAN, stored in the formatted form in the file LU7, and
partially  of the  additional  input  data  read by list-directed 
input (free format), prepared by the user and stored in  the file 
LIN. Output  data describing the computations are  stored  in the 
file LOU.  Output data  for  plotting  synthetic  seismograms are 
stored in the  file LU8. The program  generates a postscript file 
with the desired plot.

                                                      
The data stored in LU7

    The data are  stored in LU7 in a  formatted form. For details
see the  description of the  content of the  file LU7 in  program
FRESAN.

1) MPRINT                                   FORMAT(A)
2) IPRINT                                   FORMAT(A)
3) XSOUR,YSOUR,ZSOUR,TSOUR,RSTEP,FL,FD      FORMAT(5F10.5,2E15.7)
4) NDST,NFS,ILS,MCOMP,ILOC                  FORMAT(26I3)
5) DST,AA                                   FORMAT(F10.3,E12.5)
6) (IS(I),I=1,2*NFS)                        FORMAT(12I6)

                                                      
The additional input data

    These data  are specified by  the user. The  data control the
computation of synthetic  seismograms. The places, where the data
from LU7 are read in are denoted by **LU7/1, **LU7/2, etc.

1) Arbitrary alphanumeric text describing the data set.

   TITLE
    
    Default 'SYNFAN'.

2)  Switches controlling  the output  of results  into the output
file LOU and optional name of the plot file..

   IPR1,IPR2,PSTEXT

    IPR1...   controls the storage of a general information and the type 
              of the name of the postscript file with a plot.
              IPR1.GE.0... automatic generation of postscript file
              names: plot00.ps, plot01.ps, etc.
              IPR1.LT.0... postscript file name specified by the user,
              see PSTEXT.
              IPR1=0... input data only are stored. Default value.
              IABS(IPR1)=1... tables   of  input  signal, its amplitude
              spectrum, filtered amplitude spectrum, and filtered
              input signal are stored.
    IPR2...   controls storage of synthetic  frequency responses,
              spectrum  of  synthetic  seismograms  and synthetic
              seismograms.
              IPR2=0... no data are stored.
              IPR2=1... synthetic seismograms are stored.
              IPR2=2... synthetic   seismograms   and   frequency
                        responses are stored.
              IPR2=3... synthetic seismograms,frequency responses
                        and spectra of  synthetic seismograms are
                        stored.
              Warning: The  above tables for  IPR.NE.0 are stored
              for  all  epicentral  distances.  Print  is  heavy,
              particullarly for IPR1=1 or IPR2=3.

    PSTEXT... the name of the postscript file specified by the user;
              it is used only if IPR1.LT.0.

3) Various switches controlling the computations.

   NSIG,NPTS,NT,NWIN,NFILT,NPLOT,NSTOP,NSH,NDER,NINT

    NSIG...   controls the input of the source-time function.
              NSIG=0... analytical signal. Default value.
              NSIG.GT.0... source-time  function  introduced by a
              table, see input data No.10.
    NPTS...   number of  points  in the definition of the signal.
              Use NPTS.LE.2048. Default NPTS=400.
    NT...     number of points in the FFT.  Use 2048,1024,512,256
              or 128. Default NT=1024.
    NWIN...   controls the filtration of the input signal.
              NWIN=0... no filtration. Default value.
              NWIN=1... Fuchs'   double    cosine   filter,   see
              additional input data No.11.
    NFILT...  controls  an  additional  filtering  in the routine
              FILTER.
              NFILT=0... no filtration. Default value.
              NFILT=1... filtration.
    NPLOT...  controls the plotting of results.
              NPLOT=0... no plotting. Default value.
              NPLOT.GT.0... plotting required.
    NSTOP...  NSTOP=0... standard    computation   of   synthetic
              seismograms. Default value.
              NSTOP=1... investigation   and  plotting  of  input
              signal,  its amplitude  spectrum, filtered spectrum
              and  filtered  input   signal.  No  computation  of
              synthetic seismograms. The file LU7 with information
              on frequency step and number of  frequency  samples
              must be, at least formally, available.
    NSH...    shift  between  individual  figures, in cm. Default
              NSH=7.
    NDER...   NDER=0... specified input signal considered. Default
              value.
              NDER=1... derivative of the input signal considered.
    NINT...   NINT=0... specified input signal considered. Default
              value.
              NINT=1... integral of the input signal considered.

4) Specifies the receivers for which plots of frequency response,
   amplitude  spectrum   and  synthetic  seismogram   are  to  be
   performed. Specified only for NPLOT.NE.0.

   NNPLOT,(NDIS(I),I=1,NNPLOT)

    NNPLOT... number of receivers for which plots are to be made.
    NDIS(I)... successive number of the receiver, for which plots
              are to be made.

**LU7/1
**LU7/2
**LU7/3
**LU7/4

5)  Data for  plots of  frequency responses.  Under the frequency
    response, the modulus of the frequency response is understood
    here. The phase of the frequency response is not plotted.

   ARESP(1)-ARESP(6),JRESP(1)-JRESP(4)

    ARESP(1)... horizontal  (frequency)  axis: minimum frequency,
              in Hz.
    ARESP(2)... horizontal  (frequency)  axis: maximum frequency,
              in Hz..
    ARESP(3)... length of the horizontal axis, in cm.
    ARESP(4)... vertical  (frequency   response)  axis:   minimum
              value.
    ARESP(5)...  vertical  (frequency   response)  axis:  maximum
              value.
    ARESP(6)... length of the vertical axis, in cm.
    JRESP(1)... number of intervals along the horizontal axis.
    JRESP(2)... number of intervals along the vertical axis.
    JRESP(3),JRESP(4)... control   the   precision   of   numbers
              describing  the  coordinate   axes  in  the  plots.
              JRESP(3)   corresponds  to   the  horizontal  axis,
              JRESP(4) to the vertical axis.
              JRESP.GT.0... the number of  digits to the right of
              the decimal point.
              JRESP=0...  only  integer  portions  of the numbers
              with decimal points.
              JRESP.LT.0... integers.

6) Data  for  plots of  amplitude spectra  of input signal and/or
   synthetic seismograms. Phase spectra are not plotted.

    ASPECT(1)-ASPECT(6),JSPECT(1)-JSPECT(4)

              The meaning  of the parameters is  analogous to the
              parameters specified in additional input data No.5,
              horizontal axis corresponds  to frequency, vertical
              axis to spectral values.

7) Data for plots of synthetic seismograms and/or input signals.

   ASYNT(1)-ASYNT(6),JSYNT(1)-JSYNT(4)

              The meaning  of the parameters is  analogous to the
              parameters specified in additional input data No.5,
              horizontal axis corresponds  to time, vertical axis
              to values in which seismogram (impulse) is measured.

8) Controls  the   plotting  of  the  input  signal  (source-time
   function) and related functions.

   NPL1,NPL2,NPL3,NPL4

    NPL1...   controls input signal (source-time function).
    NPL2...   amplitude spectrum of the input signal.
    NPL3...   amplitude spectrum of the  filtered and/or windowed
              input signal.
    NPL4...   filtered and/or windowed input signal.
              NPL=0... no plot. Default value.
              NPL=1... reduced plot, with unit maximum.
              NPL=2... non-reduced plot.

9) Data for  input signal  given analytically.  Included only for 
   NSIG=0. The computations  are  performed in the  routine SFUN. 
   The user is free to add to the routine SFUN its own analytical
   signals.

   IAUX(1)-IAUX(4),AUX(1)-AUX(4),TO

    IAUX(1)... specifies the type of the input signal.
           IAUX(1)=1... Gabor signal:

              F(T)=EXP(-(2*PI*FM*(T-TI)/GAMMA)**2)
                   *COS(2*PI*FM*(T-TI)+VNI)

              IAUX(2)-IAUX(4)... no meaning.
              AUX(1)=FM   (prevailing frequency)
              AUX(2)=GAMMA
              AUX(3)=VNI
              AUX(4)=TI

           IAUX(1)=2... Berlage signal:

              F(T)=EXP(-BETA*(T-TI))*SIN(2*PI*FM*(T-TI))*
                                                  *(T-TI)**VNI

              IAUX(2)-IAUX(4)... no meaning.
              AUX(1)=FM
              AUX(2)=BETA
              AUX(3)=VNI
              AUX(4)=TI

           IAUX(1)=3... Muller signal:

              F(T)=SIN(N*PI*(T-TI)/TP)-(N/(N+2))*SIN((N+2)*PI*(T-TI)/TP)

                                 for  0.LE.T.LE.TP,
              F(T)=0             for  T.LT.0 AND FOR T.GT.TP

              IAUX(2)=N
              IAUX(3),IAUX(4)... no meaning.
              AUX(1)=TP
              AUX(2)=TI

           IAUX(1)=4... Ricker signal:

              F(T)=(1-2*((T-TI)*BETA)**2)*EXP(-(BETA*(T-TI))**2)

              F(T) is the normalized second time derivative
              of the Gaussian signal EXP(-(BETA*(T-TI))**2)

              IAUX(2)-IAUX(4)... no meaning.
              AUX(1)=BETA
              AUX(2)=TI

           IAUX(1)=5... Box-car signal:

              F(T)=0           for T.LT.AUX(1) and T.GT.AUX(2)
              F(T)=AUX(3)      for AUX(1).LE.T.LE.AUX(2)

           IAUX(1)=6... Ramp function:

              F(T)=0           for T.LE.AUX(1) and T.GT.AUX(3)
              F(T)=AUX(4)      for AUX(2).LE.T.LE.AUX(3)
              F(T)             is  linear   between   AUX(1)  and 
                               AUX(2)

           IAUX(1)=7... Triagonal function:

              F(T)=0           for T.LE.AUX(1) and T.GE.AUX(3)
              F(T)=AUX(4)      for T=AUX(2)
              F(T)             is  linear   between   AUX(1)  and 
                               AUX(2)  and  between   AUX(2)  and 
                               AUX(3).

           IAUX(1)=8... One sample function:

              F(I)=AUX(1)         for I=IAUX(2)
              F(I)=0              for I.NE.IAUX(2).

    TO... time, from which the signal is considered. For example,
          for symmetric signals with arrival time related to their
          maximum, TO should be chosen as negative halfwidth of
          the signal.

The last four signals serve only for special purposes. Please, do 
not use them without a suitably chosen frequency window.

10) Data for input signal given  discretly by  a table.  Included 
    only for NSIG.NE.0

   IS(I),I=1,NPTS

    IS(I)...  I-th sample of the discretly specified  source-time 
              function (input signal). The actual signal is given 
              by the relation:
              F(I)=IS(I)*10**(-NSIG),
              where F(I) corresponds to the time 
              T=T0+DT*FLOAT(I-1).

11) Data for the frequency  filter  (double cosine Fuchs filter). 
    Included only if NWIN=1.

   FLO,FLEFT,FRIGHT,FRO,FEXP

    FLO,FLEFT,FRIGHT,FRO,FEXP... parameters of the filter.
              FLO.LE.FLEFT.LE.FRIGHT.LE.FRO.
              Outside the interval , the filter is zero.
              Inside the interval ,  the filter is 
              equal one. Within  the  intervals   and 
              , cosine smoothing  with  the exponent 
              FEXP is applied. 
              For example, for FLO.LT.F.LT.FLEFT:
              W(F)=(0.5+0.5*COS(PI*(F-FLO))/(FLEFT-FLO))**FEXP, 
              with PI=3.14159.
              Choose FLO.GE.FL and FRO.LE.FR, where FL and FR are 
              lower and upper limit  of frequency  range in which 
              frequency response was computed.

**LU7/5
**LU7/6

Data LU7/5 and LU7/6 are  successively  read in  from LU7 for all 
receivers (NDST times).

12) Data for plots of frequency responses, synthetic seismograms, 
    etc., for individual receivers.

   NPR1,NPR2,NPR3,TMIN,TMAX,TLEN

    NPR1...   index controlling frequency response (modulus).
    NPR2...   index  controlling   amplitude   spectrum  of   the 
              synthetic seismogram.
    NPR3...   index controlling synthetic seismogram.
              NPR=0... no plot. Default value.
              NPR=1... reduced plot,maximum=1.
              NPR=2... non-reduced plot.
    TMIN...   specifies initial time for the plot of synthetic 
              seismogram.
    TMAX...   specifies maximum time for the plot of synthetic 
              seismogram.
    TLEN...   length of the time axis in the synthetic seismogram 
              plot, in cm.

Example of data LIN for anisotropic model
Example of data LIN for isotropic model for QI computations

Termination of computations.

    The input  data sub 12 are repeated  NNPLOT times,  see input 
data sub 4 for NNPLOT, for each receiver, for which plots are re-
quired. The selection of receivers is performed  as follows:  The  
data  LU7/5 and LU7/6 are  read  successively for  all receivers. 
For each reading,  it is  checked  whether  DST read  from  LU7/5 
corresponds to some NDIS(I). If yes, input data  sub 12 are  read 
in and plotting is performed. Thus, the order of readings 12 must  
correspond to the order of receivers  NDIS(I). After  reading the  
data  for  all selected receivers, the computations terminate.


OUTPUT TABLES

                                                      
Output to the file LOU (information about computations)

All the input data  are  automatically  stored  in  the file LOU. 
In addition the data LU7/1-LU7/5 are  also  automatically stored.

The additional print is controlled by the input parameters IPR1 
and IPR2:
    If IPR1.NE.0, four tables relevant to the input signal are 
printed, with the following headings and quantities:
    A) INPUT SIGNAL   TO,DT,AREDUC,NPTS
    B) AMPLITUDE SPECTRUM OF THE INPUT SIGNAL   DF,AREDUC,IRS
    C) AMPLITUDE SPECTRUM OF THE INPUT SIGNAL, WINDOW APPLIED
       DF,AREDUC,IRS
    D) INPUT SIGNAL,FREQUENCY WINDOW APPLIED  TO DT,AREDUC,NPTS

    If IPR2.ne.0, one or two or three tables are printed for each 
receiver position:
    A) For IPR2=1, synthetic seismograms are printed. Heading 
shows the quantities DST,TO,DT,AREDUC,NT
    B) For IPR2=2, modulus of the frequency response is printed 
in addition to the table of synthetic seismograms. Heading shows 
DST,DF,AREDUC,IRSS.
    C) For IPR2=3, amplitude spectrum of the synthetic seismograms 
are printed, in addition to A and B. Heading also shows the quantities 
DST,DF,AREDUC,IRSS.


                                                      
OUTPUT TO THE FILE LU8

To plot the synthetic seismogram section in the program BPLOT and/or 
the particle motion diagrams in the program POLAR, the synthetic 
seismograms calculated in the program SYNFAN are stored in the file 
LU8, together with some other necessary or informative data. The 
data in LU8 are stored in the following order:

1) MPRINT                                   FORMAT(A)
   alphanumeric text, describing the input data file in the program 
ANRAY.

2) IPRINT                                   FORMAT(A)
   alphanumeric text, describing the input data file from the 
program FRESAN.

3) STEXT                                    FORMAT(A)
   alphanumeric text, describing the input data file from the 
program SYNTAN.

4) XSOUR,YSOUR,ZSOUR,TSOUR,RSTEP,DT,DF      FORMAT(5F10.5,2E15.7)

    XSOUR,YSOUR,ZSOUR... coordinates of the source.
    TSOUR...  initial time.
    RSTEP...  the distance between recievers for a regularly 
              distributed system of receivers. The average 
              distance between recievers for an irregularly 
              distributed system of receivers.
    DT...     time step.
    DF...     frequency step.

5) NDST,NT,MCOMP,ILOC                       FORMAT(16I5)

    NDST...   number of receivers.
    NT...     number of points in the Fast Fourier Transform 
              algorithm (2048,1024,512... ).
    MCOMP...  MCOMP=0...  vertical component.
              MCOMP=1...  component along the x-axis.
              MCOMP=2...  component along the y-axis.
    ILOC...   controls the orientation and position of the profile, 
              on which receivers are situated.
              ILOC=0:  Receivers along a surface profile.
              ILOC=1:  Receivers along a vertical profile.
              ILOC.GT.1:  Receivers along the ILOC-th interface.

6) DST,TO,AREDUC,NT              FORMAT(2F10.3,1E12.5,I5)

    DST...    x-coordinate of the receiver.
    TO...     initial time corresponding to the first point
              of synthetic seismogram.
    AREDUC... maximum amplitude in the synthetic seismograms 
              corresponds to NT given in LU8/5.
    NT...     number of points of the synthetic seismograms.

7) IS(I),I=1,NT                             FORMAT(20I4)

    Synthetic seismogram corresponding to the reciever situated 
at the x-coordinate given by DST, see LU8/6, in a reduced form.
Note that the quantities XSOUR, YSOUR, ZSOUR, TSOUR have only 
informative meaning and are not used in the computations in the
programs BPLOT and POLAR.


GRAPHICAL OUTPUT

The graphical output has many options which are well described in 
this documentation, see above. In fact, most of the computed 
quantities can be plotted. In addition to four pictures for the
input signal, three pictures can be optionally plotted for each 
receiver position. Thus the maximum number of generated figures is 
3*NDST+4.