[cig-commits] r13922 - in seismo/3D/SPECFEM3D_SESAME/trunk: . USER_MANUAL

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Thu Jan 22 14:15:26 PST 2009


Author: dkomati1
Date: 2009-01-22 14:15:26 -0800 (Thu, 22 Jan 2009)
New Revision: 13922

Removed:
   seismo/3D/SPECFEM3D_SESAME/trunk/USER_MANUAL/manual_SPECFEM3D.lyx
Modified:
   seismo/3D/SPECFEM3D_SESAME/trunk/compute_forces.f90
Log:
removed some parentheses in compute_forces.
suppressed the LyX file because we now use regular LaTeX instead.


Deleted: seismo/3D/SPECFEM3D_SESAME/trunk/USER_MANUAL/manual_SPECFEM3D.lyx
===================================================================
--- seismo/3D/SPECFEM3D_SESAME/trunk/USER_MANUAL/manual_SPECFEM3D.lyx	2009-01-22 21:32:01 UTC (rev 13921)
+++ seismo/3D/SPECFEM3D_SESAME/trunk/USER_MANUAL/manual_SPECFEM3D.lyx	2009-01-22 22:15:26 UTC (rev 13922)
@@ -1,5883 +0,0 @@
-#LyX 1.5.1 created this file. For more info see http://www.lyx.org/
-\lyxformat 276
-\begin_document
-\begin_header
-\textclass book
-\begin_preamble
-%\renewcommand{\baselinestretch}{1.5}
-
-% figures
-\usepackage[dvips]{epsfig}
-
-\usepackage{wrapfig}
-
-
-% fonts
-\usepackage{times}
-
-% hyperlinks to sections and references
-\usepackage[pdftex,bookmarks=true,bookmarksnumbered=true,pdfpagemode=None,pdfstartview=FitH,pdfpagelayout=SinglePage,pdfborder={0 0 0}]{hyperref}
-
-\let\myUrl\url
-\renewcommand{\url}[1]{(\myUrl{#1})}
-
-% biblio GJI
-\bibliographystyle{abbrvnat}
-
-\newcommand{\toall}[1]{\textbf{*** All: #1 ***}}
-\newcommand{\tojeroen}[1]{\textbf{*** Jeroen: #1 ***}}
-\newcommand{\tobrian}[1]{\textbf{*** Brian: #1 ***}}
-\newcommand{\tovala}[1]{\textbf{*** Vala: #1 ***}}
-\newcommand{\tovalabrian}[1]{\textbf{*** Vala \& Brian: #1 ***}}
-\newcommand{\tovalaqinya}[1]{\textbf{*** Vala \& Qinya: #1 ***}}
-\newcommand{\toqinya}[1]{\textbf{*** Qinya: #1 ***}}
-\newcommand{\tomin}[1]{\textbf{*** Min: #1 ***}}
-\newcommand{\toalessia}[1]{\textbf{*** Alessia: #1 ***}}
-\newcommand{\todimitri}[1]{\textbf{*** Dimitri: #1 ***}}
-
-\newcommand{\nexxi}{\mbox{\texttt{NEX\_XI\/}}}
-\newcommand{\nexeta}{\mbox{\texttt{NEX\_ETA\/}}}
-\newcommand{\nprocxi}{\mbox{\texttt{NPROC\_XI\/}}}
-\newcommand{\nproceta}{\mbox{\texttt{NPROC\_ETA\/}}}
-\newcommand{\nchunks}{\mbox{\texttt{NCHUNKS\/}}}
-\end_preamble
-\options onecolumn
-\language english
-\inputencoding latin1
-\font_roman default
-\font_sans default
-\font_typewriter default
-\font_default_family default
-\font_sc false
-\font_osf false
-\font_sf_scale 100
-\font_tt_scale 100
-\graphics default
-\paperfontsize default
-\spacing single
-\papersize default
-\use_geometry true
-\use_amsmath 2
-\use_esint 0
-\cite_engine natbib_authoryear
-\use_bibtopic false
-\paperorientation portrait
-\leftmargin 1in
-\topmargin 1in
-\rightmargin 1in
-\bottommargin 1in
-\secnumdepth 3
-\tocdepth 3
-\paragraph_separation indent
-\defskip medskip
-\quotes_language swedish
-\papercolumns 1
-\papersides 1
-\paperpagestyle default
-\tracking_changes false
-\output_changes false
-\author "" 
-\author "" 
-\end_header
-
-\begin_body
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-thispagestyle{empty}
-\end_layout
-
-\end_inset
-
-
-\series bold
-
-\begin_inset Float figure
-placement H
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\begin_inset Graphics
-	filename figures/specfem_3d_basin-cover.pdf
-	width 75page%
-	rotateOrigin centerTop
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Title
-
-\series bold
-SPECFEM3D
-\series default
-
-\newline
-
-\series bold
-User Manual
-\end_layout
-
-\begin_layout Author
-© California Institute of Technology (U.S.) and
-\newline
-University of Pau (France)
-\newline
-Version
- 1.4.3
-\end_layout
-
-\begin_layout Standard
-
-\newpage
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand tableofcontents
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-Introduction
-\end_layout
-
-\begin_layout Standard
-The software package SPECFEM3D simulates southern California seismic wave
- propagation based upon the spectral-element method (SEM).
- Effects due to lateral variations in compressional-wave speed, shear-wave
- speed, density, a 3D crustal model, topography and bathymetry are included.
- For a detailed introduction to the SEM as applied to regional seismic wave
- propagation, please consult 
-\begin_inset LatexCommand citet
-key "KoVi98,KoTr99"
-
-\end_inset
-
- and in particular 
-\begin_inset LatexCommand citet
-key "KoLiTrSuStSh04"
-
-\end_inset
-
-.
- If you use the 3D southern California model, please cite 
-\begin_inset LatexCommand citet
-key "SuSh03"
-
-\end_inset
-
- (LA), 
-\begin_inset LatexCommand citet
-key "lovelyetal06"
-
-\end_inset
-
- (Salton Trough), and 
-\begin_inset LatexCommand citet
-key "hauksson2000"
-
-\end_inset
-
- (southern California).
- The Moho map was determined by 
-\begin_inset LatexCommand citet
-key "zhu&kanamori2000"
-
-\end_inset
-
-.
- The 1D SoCal model was developed by 
-\begin_inset LatexCommand citet
-key "DrHe90"
-
-\end_inset
-
-.
- The package can accommodate full 21-parameter anisotropy (see\InsetSpace ~
-
-\begin_inset LatexCommand citet
-key "ChenTr07"
-
-\end_inset
-
-) as well as lateral variations in attenuation.
- Adjoint capabilities and finite-frequency kernel simulations are included
- 
-\begin_inset LatexCommand citep
-key "Liu06a"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-All SPECFEM3D software is written in Fortran90, and conforms strictly to
- the Fortran95 standard.
- It uses no obsolete or obsolescent features of Fortran77.
- The package uses parallel programming based upon the Message Passing Interface
- (MPI) 
-\begin_inset LatexCommand citep
-key "GrLuSk94,Pac97"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Section
-Citation
-\end_layout
-
-\begin_layout Standard
-If you use SPECFEM3D for your own research, please cite at least one of
- the following articles: 
-\begin_inset ERT
-status open
-
-\begin_layout Standard
-
-
-\backslash
-cite{KoLiTrSuStSh04,KoTr99}
-\end_layout
-
-\end_inset
-
- or 
-\begin_inset ERT
-status open
-
-\begin_layout Standard
-
-
-\backslash
-cite {KoVi98}
-\end_layout
-
-\end_inset
-
-.
- The corresponding BibTeX entries may be found in file 
-\family typewriter
-USER_MANUAL/bibliography.bib
-\family default
- or in comments at the beginning of file 
-\family typewriter
-specfem3D.f90
-\family default
-.
-\end_layout
-
-\begin_layout Section
-Support
-\end_layout
-
-\begin_layout Standard
-This material is based upon work supported by the U.S.
- National Science Foundation under Grants No.
- EAR-0406751 and EAR-0711177, by the French CNRS, French INRIA Sud-Ouest
- MAGIQUE-3D, French ANR NUMASIS under Grant No.
- ANR-05-CIGC-002, and European FP6 Marie Curie International Reintegration
- Grant No.
- MIRG-CT-2005-017461.
- Any opinions, findings, and conclusions or recommendations expressed in
- this material are those of the authors and do not necessarily reflect the
- views of the U.S.
- National Science Foundation, CNRS, INRIA, ANR or the European Marie Curie
- program.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:Getting-Started"
-
-\end_inset
-
-Getting Started
-\end_layout
-
-\begin_layout Standard
-The SPECFEM3D software package comes in a gzipped tar ball.
- In the directory in which you want to install the package, type 
-\end_layout
-
-\begin_layout LyX-Code
-
-\family typewriter
-\size small
-tar
-\family default
- 
-\family typewriter
--zxvf
-\family default
- 
-\family typewriter
-SPECFEM3D_V1.4.3.tar.gz
-\end_layout
-
-\begin_layout Standard
-The directory 
-\family typewriter
-\size small
-SPECFEM3D_V1.4.3
-\family default
-\size default
- will then contain the source code.
- To configure the software for your system, run the 
-\family typewriter
-configure
-\family default
- shell script.
- This script will attempt to guess the appropriate configuration values
- for your system.
- However, at a minimum, it is recommended that you explicitly specify the
- appropriate command names for your Fortran90 compiler and MPI package:
-\end_layout
-
-\begin_layout LyX-Code
-./configure FC=ifort MPIFC=mpif90
-\end_layout
-
-\begin_layout Standard
-To compile a serial version of the code for small meshes that fit on one
- compute node and can therefore be run serially, run 
-\family typewriter
-configure
-\family default
- with the 
-\family typewriter
---without-mpi
-\family default
- option to suppress all calls to MPI.
-\end_layout
-
-\begin_layout Standard
-A summary of the most important configuration variables follows.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-F90
-\family default
- Path to the Fortran90 compiler.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-MPIF90
-\family default
- Path to MPI Fortran90.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-MPI_FLAGS
-\family default
- Some systems require this flag to link to MPI libraries.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-FLAGS_CHECK
-\family default
- Compiler flag for non-critical subroutines.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-FLAGS_NO_CHECK
-\family default
- Compiler flag for creating fast, production-run code for critical subroutines.
- 
-\end_layout
-
-\begin_layout Standard
-The 
-\family typewriter
-Makefile
-\family default
- contains a number of suggested entries for various compilers, e.g., Portland,
- Intel, Absoft, NAG, and Lahey.
- The software has run on a wide variety of compute platforms, e.g., various
- PC clusters and machines from Sun, SGI, IBM, Compaq, and NEC.
- Select the compiler you wish to use on your system and choose the related
- optimization flags.
- Note that the default flags in the 
-\family typewriter
-Makefile
-\family default
- are undoubtedly not optimal for your system, so we encourage you to experiment
- with these flags and to solicit advice from your systems administrator.
- Selecting the right compiler and optimization flags can make a tremendous
- difference in terms of performance.
- We welcome feedback on your experience with various compilers and flags.
-\end_layout
-
-\begin_layout Standard
-Now that you have set the compiler information, you need to select a number
- of flags in the 
-\family typewriter
-constants.h
-\family default
- file depending on your system: 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LOCAL_PATH_IS_ALSO_GLOBAL
-\family default
- Set to 
-\family typewriter
-.false.
-
-\family default
- on most cluster applications.
- For reasons of speed, the (parallel) mesher typically writes a (parallel)
- database for the solver on the local disks of the compute nodes.
- Some systems have no local disks, e.g., BlueGene or the Earth Simulator,
- and other systems have a fast parallel file system, in which case this
- flag should be set to 
-\family typewriter
-.true.
-\family default
-.
- Note that this flag is not used by the mesher or the solver; it is only
- used for some of the post-processing.
- 
-\end_layout
-
-\begin_layout Standard
-The package can run either in single or in double precision.
- The default is single precision mode because this requires exactly half
- as much memory.
- Select your preference by selecting the appropriate setting in the 
-\family typewriter
-constants.h
-\family default
- file: 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-CUSTOM_REAL
-\family default
- Set to 
-\family typewriter
-SIZE_REAL
-\family default
- for single precision and 
-\family typewriter
-SIZE_DOUBLE
-\family default
- for double precision.
- 
-\end_layout
-
-\begin_layout Standard
-In the 
-\family typewriter
-precision.h
-\family default
- file: 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-CUSTOM_MPI_TYPE
-\family default
- Set to 
-\family typewriter
-MPI_REAL
-\family default
- for single precision and 
-\family typewriter
-MPI_DOUBLE_PRECISION
-\family default
- for double precision.
- 
-\end_layout
-
-\begin_layout Standard
-On a new system, it is definitely worth experimenting with single versus
- double precision simulations to determine which is faster.
- Note that on many current processors (e.g., Intel, AMD, IBM Power), single
- precision calculations are often significantly faster; the difference can
- typically be 10% to 25%.
- It is therefore often worth using single precision if you can.
- We recommend running the same calculation once in single precision and
- in double precision on your system and comparing the seismograms.
- If they are identical, you should probably select single precision for
- your future runs.
-\end_layout
-
-\begin_layout Standard
-When running on an SGI add ``
-\family typewriter
-setenv TRAP_FPE OFF
-\family default
-'' to your .cshrc file 
-\shape italic
-before
-\shape default
- compiling in order to turn underflow trapping off.
-\end_layout
-
-\begin_layout Standard
-Finally, before compiling make sure that the subdirectories 
-\family typewriter
-obj
-\family default
- and 
-\family typewriter
-OUTPUT_FILES
-\family default
- exist within the directory with the source code (
-\family typewriter
-SPECFEM3D_V1.4.3
-\family default
-).
- The 
-\family typewriter
-go_mesher
-\family default
- script discussed in Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Running-the-Mesher"
-
-\end_inset
-
- automatically takes care of creating the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory.
-\end_layout
-
-\begin_layout Standard
-Note that if you run very large meshes on a relatively small number of processor
-s, the memory size needed on each processor might become greater than 2
- gigabytes, which is the upper limit for 32-bit addressing; in this case,
- on some compilers you may need to add "
-\family typewriter
--mcmodel=medium
-\family default
-" to the compiler options otherwise the compiler will display an error message.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:Running-the-Mesher"
-
-\end_inset
-
-Running the Mesher 
-\family typewriter
-xmeshfem3D
-\end_layout
-
-\begin_layout Standard
-\noindent
-\align left
-\begin_inset Float figure
-placement t
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-\begin_inset Graphics
-	filename figures/socal_map_mpi.eps
-	scale 50
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "fig:For-parallel-computing"
-
-\end_inset
-
-For parallel computing purposes, the model block is subdivided in 
-\begin_inset Formula $\nprocxi\times\nproceta$
-\end_inset
-
- slices of elements.
- In this example we use 
-\begin_inset Formula $5^{2}=25$
-\end_inset
-
- processors.
- 
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-You are now ready to compile the mesher.
- In the directory with the source code type `
-\family typewriter
-make meshfem3D
-\family default
-'.
- If all paths and flags have been set correctly, the mesher should now compile
- and produce the executable 
-\family typewriter
-xmeshfem3D
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-Input for the mesher (and the solver) is provided through the parameter
- file 
-\family typewriter
-Par_file
-\family default
-, which resides in the subdirectory 
-\family typewriter
-DATA
-\family default
-.
- Before running the mesher, a number of parameters need to be set in the
- 
-\family typewriter
-Par_file
-\family default
-.
- This requires a basic understanding of how the SEM is implemented, and
- we encourage you to read 
-\begin_inset LatexCommand citet
-key "KoVi98,KoTr99"
-
-\end_inset
-
- and 
-\begin_inset LatexCommand citet
-key "KoLiTrSuStSh04"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-The mesher and the solver use UTM coordinates internally, therefore you
- need to define the zone number for the UTM projection (e.g., zone 11 for
- Los Angeles).
- Use decimal values for latitude and longitude (no minutes/seconds).
- These values are approximate; the mesher will round them off to define
- a square mesh in UTM coordinates.
- When running benchmarks on rectangular models, turn the UTM projection
- off by using the flag 
-\family typewriter
-\size small
-SUPPRESS_UTM_PROJECTION
-\family default
-\size default
-, in which case all `longitude' parameters simply refer to the 
-\begin_inset Formula $x$
-\end_inset
-
-\InsetSpace ~
-axis, and all `latitude' parameters simply refer to the 
-\begin_inset Formula $y$
-\end_inset
-
-\InsetSpace ~
-axis.
- To run the mesher for a global simulation, the following parameters need
- to be set in the 
-\family typewriter
-Par_file
-\family default
-: 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-SIMULATION_TYPE
-\family default
- is set to 1 for forward simulations, 2 for adjoint simulations (see Section
- 
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-finite"
-
-\end_inset
-
-) and 3 for kernel simulations (see Section 
-\begin_inset LatexCommand ref
-reference "sec:Finite-Frequency-Kernels"
-
-\end_inset
-
-).
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-SAVE_FORWARD
-\family default
- is only set to 
-\family typewriter
-.true.
-
-\family default
- for a forward simulation with the last frame of the simulation saved, as
- part of the finite-frequency kernel calculations (see Section 
-\begin_inset LatexCommand ref
-reference "sec:Finite-Frequency-Kernels"
-
-\end_inset
-
-).
- For a regular forward simulation, leave 
-\family typewriter
-SIMULATION_TYPE
-\family default
- and 
-\family typewriter
-SAVE_FORWARD
-\family default
- at their default values.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LATITUDE_MIN
-\family default
- Minimum latitude in the block (negative for South).
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LATITUDE_MAX
-\family default
- Maximum latitude in the block.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LONGITUDE_MIN
-\family default
- Minimum longitude in the block (negative for West).
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LONGITUDE_MAX
-\family default
- Maximum longitude in the block.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-DEPTH_BLOCK_KM
-\family default
- Depth of bottom of mesh in kilometers.
- 
-\end_layout
-
-\begin_layout Description
-\begin_inset Formula $\nexxi$
-\end_inset
-
- The number of spectral elements along one side of the block.
- This number 
-\shape italic
-must
-\shape default
- be 8\InsetSpace ~
-
-\begin_inset Formula $\times$
-\end_inset
-
-\InsetSpace ~
-a multiple of 
-\begin_inset Formula $\nprocxi$
-\end_inset
-
- defined below.
- Based upon benchmarks against semi-analytical discrete wavenumber synthetic
- seismograms 
-\begin_inset LatexCommand citep
-key "KoLiTrSuStSh04"
-
-\end_inset
-
-, determined that a 
-\begin_inset Formula $\nexxi=288$
-\end_inset
-
- run is accurate to a shortest period of roughly 2\InsetSpace ~
-s.
- Therefore, since accuracy is determined by the number of grid points per
- shortest wavelength, for any particular value of 
-\begin_inset Formula $\nexxi$
-\end_inset
-
- the simulation will be accurate to a shortest period determined by 
-\begin_inset Formula \begin{equation}
-\mbox{shortest period (s)}=(288/\nexxi)\times2.\label{eq:shortest_period}\end{equation}
-
-\end_inset
-
-The number of grid points in each orthogonal direction of the reference
- element, i.e., the number of Gauss-Lobatto-Legendre points, is determined
- by 
-\family typewriter
-NGLLX
-\family default
- in the 
-\family typewriter
-constants.h
-\family default
- file.
- We generally use 
-\begin_inset Formula $\mbox{\texttt{NGLLX\/}}=5$
-\end_inset
-
-, for a total of 
-\begin_inset Formula $5^{3}=125$
-\end_inset
-
- points per elements.
- We suggest not to change this value.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-\noun on
-UTM_PROJECTION_ZONE
-\family default
-\noun default
- UTM projection zone in which your model resides, only valid when 
-\family typewriter
-SUPPRESS_UTM_
-\newline
-PROJECTION
-\family default
- is 
-\family typewriter
-.false.
-\family default
-.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-SUPPRESS_UTM_PROJECTION
-\family default
- set to be 
-\family typewriter
-.false.
-
-\family default
- when your model range is specified in the geographical coordinates, and
- needs to be 
-\family typewriter
-.true.
-
-\family default
- when your model is specified in a cartesian coordinates.
- 
-\noun on
-UTM projection zone in which your simulation region resides.
-\end_layout
-
-\begin_layout Description
-\begin_inset Formula $\nexeta$
-\end_inset
-
- The number of spectral elements along the other side of the block.
- This number 
-\shape italic
-must
-\shape default
- be 8\InsetSpace ~
-
-\begin_inset Formula $\times$
-\end_inset
-
-\InsetSpace ~
-a multiple of 
-\begin_inset Formula $\nproceta$
-\end_inset
-
- defined below.
- 
-\end_layout
-
-\begin_layout Description
-\begin_inset Formula $\nprocxi$
-\end_inset
-
- The number of processors or slices along one side of the block (see Figure\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "fig:For-parallel-computing"
-
-\end_inset
-
-); we must have 
-\begin_inset Formula $\nexxi=8\times c\times\nprocxi$
-\end_inset
-
-, where 
-\begin_inset Formula $c\ge1$
-\end_inset
-
- is a positive integer.
- 
-\end_layout
-
-\begin_layout Description
-\begin_inset Formula $\nproceta$
-\end_inset
-
- The number of processors or slices along the other side of the block; we
- must have 
-\begin_inset Formula $\nexeta=8\times c\times\nproceta$
-\end_inset
-
-, where 
-\begin_inset Formula $c\ge1$
-\end_inset
-
- is a positive integer.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-MODEL
-\family default
- Must be set to one of the following: 
-\end_layout
-
-\begin_deeper
-\begin_layout Description
-
-\family typewriter
-SoCal
-\family default
- Isotropic, southern California layercake model developed by 
-\begin_inset LatexCommand citet
-key "DrHe90"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-Harvard_LA
-\family default
- 3D model based upon the high-resolution Los Angeles basin model developed
- by 
-\begin_inset LatexCommand citet
-key "SuSh03"
-
-\end_inset
-
- the Salton Trough model developed by 
-\begin_inset LatexCommand citet
-key "lovelyetal06"
-
-\end_inset
-
-, the regional tomographic model of 
-\begin_inset LatexCommand citet
-key "hauksson2000"
-
-\end_inset
-
-, and the Moho map determined by 
-\begin_inset LatexCommand citet
-key "zhu&kanamori2000"
-
-\end_inset
-
-.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Description
-
-\family typewriter
-OCEANS
-\family default
- Set to 
-\family typewriter
-.true.
-
-\family default
- if the effect of the oceans on seismic wave propagation should be incorporated
- based upon the approximate treatment discussed in 
-\begin_inset LatexCommand citet
-key "KoTr02b"
-
-\end_inset
-
-.
- This feature is inexpensive from a numerical perspective, both in terms
- of memory requirements and CPU time.
- This approximation is accurate at periods of roughly 20\InsetSpace ~
-s and longer.
- At shorter periods the effect of water phases/reverberations is not taken
- into account, even when the flag is on.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-TOPOGRAPHY
-\family default
- Set to 
-\family typewriter
-.true.
-
-\family default
- if topography and bathymetry should be incorporated based upon model ETOPO5
- 
-\begin_inset LatexCommand citep
-key "Etopo5"
-
-\end_inset
-
-.
- This feature adds no cost to the simulation.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-ATTENUATION
-\family default
- Set to 
-\family typewriter
-.true.
-
-\family default
- if attenuation should be incorporated.
- Turning this feature on increases the memory requirements significantly
- (roughly by a factor of\InsetSpace ~
-1.5), and is numerically fairly expensive.
- See 
-\begin_inset LatexCommand citet
-key "KoTr99,KoTr02a"
-
-\end_inset
-
- for a discussion on the implementation of attenuation based upon standard
- linear solids.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-USE_OLSEN_ATTENUATION
-\family default
- Set to 
-\family typewriter
-.true.
-
-\family default
- if you want to use the attenuation model that scaled from the velocity
- model using Olsen's empirical relation (reference).
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-ABSORBING_CONDITIONS
-\family default
- Set to 
-\family typewriter
-.true.
-
-\family default
- to turn on Clayton-Enquist absorbing boundary conditions (see 
-\begin_inset LatexCommand citet
-key "KoTr99"
-
-\end_inset
-
-).
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-RECORD_LENGTH_IN_MINUTES
-\family default
- Choose the desired record length of the synthetic seismograms (in minutes).
- This controls the length of the numerical simulation, i.e., twice the record
- length requires twice as much CPU time.
- This feature is not used at the time of meshing but is required for the
- solver, i.e., you may change this parameter after running the mesher.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-MOVIE_SURFACE
-\family default
- Set to 
-\family typewriter
-.false.
-\family default
-, unless you want to create a movie of seismic wave propagation on the Earth's
- surface.
- Turning this option on generates large output files.
- See Section 
-\begin_inset LatexCommand ref
-reference "sec:Movies"
-
-\end_inset
-
- for a discussion on the generation of movies.
- This feature is not used at the time of meshing but is relevant for the
- solver.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-MOVIE_VOLUME
-\family default
- Set to 
-\family typewriter
-.false.
-\family default
-, unless you want to create a movie of seismic wave propagation in the Earth's
- interior.
- Turning this option on generates huge output files.
- See Section 
-\begin_inset LatexCommand ref
-reference "sec:Movies"
-
-\end_inset
-
- for a discussion on the generation of movies.
- This feature is not used at the time of meshing but is relevant for the
- solver.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-NTSTEP_BETWEEN_FRAMES
-\family default
- Determines the number of timesteps between movie frames.
- Typically you want to save a snapshot every 100 timesteps.
- The smaller you make this number the more output will be generated! See
- Section 
-\begin_inset LatexCommand ref
-reference "sec:Movies"
-
-\end_inset
-
- for a discussion on the generation of movies.
- This feature is not used at the time of meshing but is relevant for the
- solver.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-CREATE_SHAKEMAP
-\family default
- Set this flag to 
-\family typewriter
-.true.
-
-\family default
- to create a ShakeMap, i.e., a peak ground velocity map.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-SAVE_DISPLACEMENT
-\family default
- Set this flag to 
-\family typewriter
-.true.
-
-\family default
- if you want to save the displacement instead of velocity for the movie
- frames.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-USE_HIGHRES_FOR_MOVIES
-\family default
- Set this flag to 
-\family typewriter
-.true.
-
-\family default
- if you want to save the values at all the NGLL grid points for the movie
- frames.
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-SAVE_MESH_FILES
-\family default
- Set this flag to 
-\family typewriter
-.true.
-
-\family default
- to save 
-\begin_inset LatexCommand htmlurl
-name "AVS"
-target "www.avs.com"
-
-\end_inset
-
-, 
-\begin_inset LatexCommand htmlurl
-name "OpenDX"
-target "www.opendx.org"
-
-\end_inset
-
-, or 
-\begin_inset LatexCommand htmlurl
-name "ParaView"
-target "www.paraview.org"
-
-\end_inset
-
- mesh files for subsequent viewing.
- Turning the flag on generates large (distributed) files in the 
-\family typewriter
-LOCAL_PATH
-\family default
- directory.
- See Section\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "sec:Mesh-graphics"
-
-\end_inset
-
- for a discussion of mesh viewing features.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-LOCAL_PATH
-\family default
- Directory in which the databases generated by the mesher will be written.
- Generally one uses a directory on the local disk of the compute nodes,
- although on some machines these databases are written on a parallel (global)
- file system (see also the earlier discussion of the 
-\family typewriter
-LOCAL_PATH_IS_ALSO_GLOBAL
-\family default
- flag in Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Getting-Started"
-
-\end_inset
-
-).
- The mesher generates the necessary databases in parallel, one set for each
- of the 
-\begin_inset Formula $\nprocxi\times\nproceta$
-\end_inset
-
- slices that constitutes the mesh (see Figure\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "fig:For-parallel-computing"
-
-\end_inset
-
-).
- After the mesher finishes, you can log in to one of the compute nodes and
- view the contents of the 
-\family typewriter
-LOCAL_PATH
-\family default
- directory to see the (many) files generated by the mesher.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_INFO
-\family default
- This parameter specifies the interval at which basic information about
- a run is written to the file system (
-\family typewriter
-timestamp*
-\family default
- files in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory).
- If you have access to a fast machine, set 
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_INFO
-\family default
- to a relatively high value (e.g., at least 100, or even 1000 or more) to
- avoid writing output text files too often.
- This feature is not used at the time of meshing.
- One can set this parameter to a larger value than the number of time steps
- to avoid writing output during the run.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_SEISMOS
-\family default
- This parameter specifies the interval at which synthetic seismograms are
- written in the 
-\family typewriter
-LOCAL_PATH
-\family default
- directory.
- If a run crashes, you may still find usable (but shorter than requested)
- seismograms in this directory.
- On a fast machine set 
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_SEISMOS
-\family default
- to a relatively high value to avoid writing to the seismograms too often.
- This feature is not used at the time of meshing.
- 
-\end_layout
-
-\begin_layout Description
-
-\family typewriter
-PRINT_SOURCE_TIME_FUNCTION
-\family default
- Turn this flag on to print information about the source time function in
- the file 
-\family typewriter
-OUTPUT_FILES/plot_source_time_function.txt
-\family default
-.
- This feature is not used at the time of meshing.
- 
-\end_layout
-
-\begin_layout Standard
-Finally, you need to provide a file that tells MPI what compute nodes to
- use for the simulations.
- The file must have a number of entries (one entry per line) at least equal
- to the number of processors needed for the run.
- A sample file is provided in the file 
-\family typewriter
-mymachines
-\family default
-.
- This file is not used by the mesher or solver, but is required by the 
-\family typewriter
-go_mesher
-\family default
- and 
-\family typewriter
-go_solver
-\family default
- default job submission scripts.
- See Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Scheduler"
-
-\end_inset
-
- for information about running the code on a system with a scheduler, e.g.,
- LSF.
- 
-\end_layout
-
-\begin_layout Standard
-Now that you have set the appropriate parameters in the 
-\family typewriter
-Par_file
-\family default
- and have compiled the mesher, you are ready to launch it! This is most
- easily accomplished based upon the 
-\family typewriter
-go_mesher
-\family default
- script.
- When you run on a PC cluster, the script assumes that the nodes are named
- n001, n002, etc.
- If this is not the case, change the 
-\family typewriter
-tr -d `n'
-\family default
- line in the script.
- You may also need to edit the last command at the end of the script that
- invokes the 
-\family typewriter
-mpirun
-\family default
- command.
- See Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Scheduler"
-
-\end_inset
-
- for information about running the code on a system with a scheduler, e.g.,
- LSF.
-\end_layout
-
-\begin_layout Standard
-Mesher output is provided in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory in 
-\family typewriter
-output_mesher.txt
-\family default
-; this file provides lots of details about the mesh that was generated.
- Alternatively, output can be directed to the screen instead by uncommenting
- a line in 
-\family typewriter
-constants.h
-\family default
-: 
-\end_layout
-
-\begin_layout LyX-Code
-! uncomment this to write messages to the screen 
-\end_layout
-
-\begin_layout LyX-Code
-! integer, parameter :: IMAIN = ISTANDARD_OUTPUT
-\end_layout
-
-\begin_layout Standard
-Another file generated by the mesher is the header file 
-\family typewriter
-OUTPUT_FILES/values_from_mesher.h
-\family default
-.
- This file specifies a number of constants and flags needed by the solver.
- These values are passed statically to the solver for reasons of speed.
- Some useful statistics about the mesh are also provided in this file.
-\end_layout
-
-\begin_layout Standard
-For a given model, set of nodes, and set of parameters in 
-\family typewriter
-Par_file
-\family default
-, one only needs to run the mesher once and for all, even if one wants to
- run several simulations with different sources and/or receivers (the source
- and receiver information is used in the solver only).
-\end_layout
-
-\begin_layout Section
-Checking the MPI Buffers (Optional)
-\end_layout
-
-\begin_layout Standard
-The mesher writes MPI communication tables in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- subdirectory in the files 
-\family typewriter
-addressing.txt
-\family default
-, 
-\family typewriter
-list_messages_corners.txt
-\family default
- and 
-\family typewriter
-list_messages_faces.txt
-\family default
-, and MPI communication buffers to the local disks.
- Use the four serial codes 
-\end_layout
-
-\begin_layout LyX-Code
-
-\family typewriter
-check_buffers_2D.f90
-\end_layout
-
-\begin_layout LyX-Code
-
-\family typewriter
-check_buffers_1D.f90
-\end_layout
-
-\begin_layout Standard
-to check that all the MPI buffers created by the mesher have been generated
- correctly.
- For example, typing `
-\family typewriter
-make check_buffers_2D
-\family default
-' and then `
-\family typewriter
-xcheck_buffers_2D
-\family default
-' checks the communication buffers between faces common to the mesh slices.
- 
-\end_layout
-
-\begin_layout Quote
-Please note that running these codes is optional because no information
- needed by the solver is generated.
-\end_layout
-
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:quality"
-
-\end_inset
-
-Checking the Mesh Quality (Optional)
-\end_layout
-
-\begin_layout Standard
-The quality of the mesh may be inspected based upon the serial code 
-\family typewriter
-check_mesh_quality_AVS_DX.f90
-\family default
-.
- Type 
-\end_layout
-
-\begin_layout LyX-Code
-
-\family typewriter
-make check_mesh_quality_AVS_DX
-\end_layout
-
-\begin_layout Standard
-and then use 
-\end_layout
-
-\begin_layout LyX-Code
-
-\family typewriter
-xcheck_mesh_quality_AVS_DX
-\end_layout
-
-\begin_layout Standard
-to generate an AVS output file (
-\family typewriter
-\size small
-AVS_meshquality.inp
-\family default
-\size default
- in AVS UCD format) or OpenDX output file (
-\family typewriter
-\size small
-DX_meshquality.
-\newline
-dx
-\family default
-\size default
-) that can be used to investigate mesh quality, e.g, skewness of elements
- and a Gnuplot histogram (
-\family typewriter
-\size small
-mesh_quality_
-\newline
-histogram.txt
-\family default
-\size default
-) that can be plotted with gnuplot (type `
-\family typewriter
-\size small
-gnuplot plot_mesh_quality_histogram.gnu
-\family default
-\size default
-').
- The histogram is also printed to the screen.
- If you want to start designing your own meshes, this tool is useful for
- viewing your creations.
- You are striving for meshes with elements with `cube-like' dimensions,
- e.g., the mesh should contain no very elongated or skewed elements.
-\end_layout
-
-\begin_layout Standard
-Running this code is optional because no information needed by the solver
- is generated.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:Running-the-Solver"
-
-\end_inset
-
-Running the Solver 
-\family typewriter
-xspecfem3D
-\end_layout
-
-\begin_layout Standard
-Now that you have successfully run the mesher, you are ready to compile
- the solver.
- For reasons of speed, the solver uses static memory allocation.
- Therefore it needs to be recompiled (type `
-\family typewriter
-make clean
-\family default
-' and `
-\family typewriter
-make specfem3D
-\family default
-') every time one reruns the mesher.
- To compile the solver one needs a file generated by the mesher in the directory
- 
-\family typewriter
-OUTPUT_FILES
-\family default
- called 
-\family typewriter
-values_from_mesher.h
-\family default
-, which contains parameters describing the static size of the arrays as
- well as the setting of certain flags.
-\end_layout
-
-\begin_layout Standard
-The solver needs three input files in the 
-\family typewriter
-DATA
-\family default
- directory to run: the 
-\family typewriter
-Par_file
-\family default
- which was discussed in detail in Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Running-the-Mesher"
-
-\end_inset
-
-, the earthquake source parameter file 
-\family typewriter
-CMTSOLUTION
-\family default
-, and the stations file 
-\family typewriter
-STATIONS
-\family default
-.
- Most parameters in the 
-\family typewriter
-Par_file
-\family default
- should be set prior to running the mesher.
- Only the following parameters may be changed after running the mesher:
- 
-\end_layout
-
-\begin_layout Itemize
-the simulation type control parameters: 
-\family typewriter
-SIMULATION_TYPE
-\family default
- and 
-\family typewriter
-SAVE_FORWARD
-\end_layout
-
-\begin_layout Itemize
-the record length 
-\family typewriter
-RECORD_LENGTH_IN_MINUTES
-\end_layout
-
-\begin_layout Itemize
-the movie control parameters 
-\family typewriter
-MOVIE_SURFACE
-\family default
-, 
-\family typewriter
-MOVIE_VOLUME
-\family default
-, and 
-\family typewriter
-NTSTEPS_BETWEEN_FRAMES
-\end_layout
-
-\begin_layout Itemize
-the ShakeMap option 
-\family typewriter
-CREATE_SHAKEMAP
-\end_layout
-
-\begin_layout Itemize
-the output information parameters 
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_INFO
-\family default
- and 
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_
-\newline
-SEISMOS
-\end_layout
-
-\begin_layout Itemize
-the 
-\family typewriter
-PRINT_SOURCE_TIME_FUNCTION
-\family default
- flags
-\end_layout
-
-\begin_layout Standard
-Any other change to the 
-\family typewriter
-Par_file
-\family default
- implies rerunning both the mesher and the solver.
-\end_layout
-
-\begin_layout Standard
-For any particular earthquake, the 
-\family typewriter
-CMTSOLUTION
-\family default
- file that represents the point source may be obtained directly from the
- 
-\begin_inset LatexCommand htmlurl
-name "Harvard Centroid-Moment Tensor (CMT) web page"
-target "www.seismology.harvard.edu"
-
-\end_inset
-
-.
- It looks like this:
-\end_layout
-
-\begin_layout LyX-Code
-
-\size small
-\begin_inset Float figure
-placement H
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-
-\size small
-\begin_inset Graphics
-	filename figures/Hollywood_CMT.eps
-	width 100text%
-
-\end_inset
-
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "fig:CMTSOLUTION-file"
-
-\end_inset
-
-
-\family typewriter
-CMTSOLUTION
-\family default
- file based on the format from the Harvard CMT catalog.
- 
-\series bold
-M
-\series default
- is the moment tensor, 
-\begin_inset Formula $M_{0}$
-\end_inset
-
-
-\size small
- 
-\size default
-is the seismic moment, and 
-\begin_inset Formula $M_{w}$
-\end_inset
-
- is the moment magnitude.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The 
-\family typewriter
-CMTSOLUTION
-\family default
- should be edited in the following way: 
-\end_layout
-
-\begin_layout Itemize
-Set the 
-\family typewriter
-time shift
-\family default
- parameter equal to 
-\begin_inset Formula $0.0$
-\end_inset
-
- (the solver will not run otherwise.) The time shift parameter would simply
- apply an overall time shift to the synthetics, something that can be done
- in the post-processing (see Section 
-\begin_inset LatexCommand ref
-reference "sec:Process-data-and-syn"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Itemize
-For point-source simulations (see finite sources, page 
-\begin_inset LatexCommand pageref
-reference "To-simulate-a"
-
-\end_inset
-
-) we recommend setting the source half-duration parameter 
-\family typewriter
-half duration
-\family default
- equal to zero, which corresponds to simulating a step source-time function,
- i.e., a moment-rate function that is a delta function.
- If 
-\family typewriter
-half duration
-\family default
- is not set to zero, the code will use a Gaussian (i.e., a signal with a shape
- similar to a `smoothed triangle', as explained in 
-\begin_inset LatexCommand cite
-key "KoTr02a"
-
-\end_inset
-
- and shown in Fig\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "fig:gauss.vs.triangle"
-
-\end_inset
-
-) source-time function with half-width 
-\family typewriter
-half duration
-\family default
-.
- We prefer to run the solver with 
-\family typewriter
-half duration
-\family default
- set to zero and convolve the resulting synthetic seismograms in post-processing
- after the run, because this way it is easy to use a variety of source-time
- functions (see Section 
-\begin_inset LatexCommand ref
-reference "sec:Process-data-and-syn"
-
-\end_inset
-
-).
- 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-citet{KoTr02a}
-\end_layout
-
-\end_inset
-
- determined that the noise generated in the simulation by using a step source
- time function may be safely filtered out afterward based upon a convolution
- with the desired source time function and/or low-pass filtering.
- Use the serial code 
-\family typewriter
-convolve_source_timefunction.f90
-\family default
- and the script 
-\family typewriter
-convolve_source_timefunction.csh
-\family default
- for this purpose, or alternatively use signal-processing software packages
- such as 
-\begin_inset LatexCommand htmlurl
-name "SAC"
-target "www.llnl.gov/sac"
-
-\end_inset
-
-.
- Type
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-
-\family typewriter
-make convolve_source_timefunction
-\end_layout
-
-\begin_layout Standard
-to compile the code and then set the parameter 
-\family typewriter
-hdur
-\family default
- in 
-\family typewriter
-convolve_source_timefunction.csh
-\family default
- to the desired half-duration.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Itemize
-The zero time of the simulation corresponds to the center of the triangle/Gaussi
-an, or the centroid time of the earthquake.
- The start time of the simulation is 
-\begin_inset Formula $t=-1.5*\texttt{half duration}$
-\end_inset
-
- (the 1.5 is to make sure the moment rate function is very close to zero
- when starting the simulation).
- To convert to absolute time 
-\begin_inset Formula $t_{\mathrm{abs}}$
-\end_inset
-
-, set 
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-\begin_inset Formula $t_{\mathrm{abs}}=t_{\mathrm{pde}}+\texttt{time shift}+t_{\mathrm{synthetic}}$
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-where 
-\begin_inset Formula $t_{\mathrm{pde}}$
-\end_inset
-
- is the time given in the first line of the 
-\family typewriter
-CMTSOLUTION
-\family default
-, 
-\family typewriter
-time shift
-\family default
- is the corresponding value from the original 
-\family typewriter
-CMTSOLUTION
-\family default
- file and 
-\begin_inset Formula $t_{\mathrm{synthetic}}$
-\end_inset
-
- is the time in the first column of the output seismogram.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-\begin_inset Float figure
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-\begin_inset Graphics
-	filename /Users/sue/specfem3d/globe/USER_MANUAL/figures/gauss_vs_triangle_mod.eps
-	width 3in
-
-\end_inset
-
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Comparison of the shape of a triangle and the Gaussian function actually
- used.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "fig:gauss.vs.triangle"
-
-\end_inset
-
- 
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Centroid latitude and longitude should be provided in geographical coordinates.
- The code converts these coordinates to geocentric coordinates\InsetSpace ~
-
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-citep{DaTr98}
-\end_layout
-
-\end_inset
-
-.
- Of course you may provide your own source representations by designing
- your own 
-\family typewriter
-CMTSOLUTION
-\family default
- file.
- Just make sure that the resulting file adheres to the Harvard CMT conventions
- (see Appendix\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Coordinates"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "To-simulate-a"
-
-\end_inset
-
-To simulate a kinematic rupture, i.e., a finite-source event, represented
- in terms of 
-\begin_inset Formula $N_{\mathrm{sources}}$
-\end_inset
-
- point sources, provide a 
-\family typewriter
-CMTSOLUTION
-\family default
- file that has 
-\begin_inset Formula $N_{\mathrm{sources}}$
-\end_inset
-
- entries, one for each subevent (i.e., concatenate 
-\begin_inset Formula $N_{\mathrm{sources}}$
-\end_inset
-
- 
-\family typewriter
-CMTSOLUTION
-\family default
- files to a single 
-\family typewriter
-CMTSOLUTION
-\family default
- file).
- At least one entry (not necessarily the first) must have a zero 
-\family typewriter
-time shift
-\family default
-, and all the other entries must have non-negative 
-\family typewriter
-time shift
-\family default
-.
- Each subevent can have its own half duration, latitude, longitude, depth,
- and moment tensor (effectively, the local moment-density tensor).
-\end_layout
-
-\begin_layout Standard
-Note that the zero in the synthetics does NOT represent the hypocentral
- time or centroid time in general, but the timing of the 
-\shape italic
-center
-\shape default
- of the source triangle with zero 
-\family typewriter
-time shift
-\family default
- (Fig\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "fig:source_timing"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Standard
-Although it is convenient to think of each source as a triangle, in the
- simulation they are actually Gaussians (as they have better frequency character
-istics).
- The relationship between the triangle and the gaussian used is shown in
- Fig\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "fig:gauss.vs.triangle"
-
-\end_inset
-
-.
- For finite fault simulations it is usually not advisable to use a zero
- half duration and convolve afterwards, since the half duration is generally
- fixed by the finite fault model.
-\end_layout
-
-\begin_layout Standard
-
-\size small
-\begin_inset Float figure
-placement H
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-
-\size small
-\begin_inset Graphics
-	filename /Users/sue/specfem3d/globe/USER_MANUAL/figures/source_timing.eps
-	width 5in
-
-\end_inset
-
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Example of timing for three sources.
- The center of the first source triangle is defined to be time zero.
- Note that this is NOT in general the hypocentral time, or the start time
- of the source (marked as tstart).
- The parameter 
-\family typewriter
-time shift
-\family default
- in the 
-\family typewriter
-CMTSOLUTION
-\family default
- file would be t1(=0), t2, t3 in this case, and the parameter 
-\family typewriter
-half duration
-\family default
- would be hdur1, hdur2, hdur3 for the sources 1, 2, 3 respectively.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-
-\size small
-\begin_inset LatexCommand label
-name "fig:source_timing"
-
-\end_inset
-
- 
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-The solver can calculate seismograms at any number of stations for basically
- the same numerical cost, so the user is encouraged to include as many stations
- as conceivably useful in the 
-\family typewriter
-STATIONS
-\family default
- file, which looks like this: 
-\end_layout
-
-\begin_layout Standard
-
-\size small
-\begin_inset Float figure
-placement H
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-
-\size small
-\begin_inset Graphics
-	filename figures/STATIONS_basin_explained.eps
-
-\end_inset
-
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-Sample 
-\family typewriter
-STATIONS
-\family default
- file.
- Station latitude and longitude should be provided in geographical coordinates.
- The width of the station label should be no more than 32 characters (see
- 
-\family typewriter
-MAX_LENGTH_STATION_NAME
-\family default
- in the 
-\family typewriter
-constants.h
-\family default
- file), and the network label should be no more than 8 characters (see 
-\family typewriter
-MAX_LENGTH_NETWORK_NAME
-\family default
- in the 
-\family typewriter
-constants.h
-\family default
- file).
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-Each line represents one station in the following format: 
-\end_layout
-
-\begin_layout LyX-Code
-
-\size small
-Station Network Latitude (degrees) Longitude (degrees) Elevation (m) burial
- (m) 
-\end_layout
-
-\begin_layout Standard
-The mesher filters the list of stations in file 
-\family typewriter
-DATA/STATIONS
-\family default
- to exclude stations that are not located within the region given in the
- 
-\family typewriter
-Par_file
-\family default
- (between 
-\family typewriter
-LATITUDE_MIN
-\family default
- and 
-\family typewriter
-LATITUDE_MAX
-\family default
- and between 
-\family typewriter
-LONGITUDE_MIN
-\family default
- and 
-\family typewriter
-LONGITUDE_MAX
-\family default
-).
- The filtered file is called 
-\family typewriter
-DATA/STATIONS_FILTERED
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-Solver output is provided in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory in the 
-\family typewriter
-output_solver.txt
-\family default
- file.
- Output can be directed to the screen instead by uncommenting a line in
- 
-\family typewriter
-constants.h
-\family default
-: 
-\end_layout
-
-\begin_layout LyX-Code
-! uncomment this to write messages to the screen 
-\end_layout
-
-\begin_layout LyX-Code
-! integer, parameter :: IMAIN = ISTANDARD_OUTPUT 
-\end_layout
-
-\begin_layout Standard
-On PC clusters the seismogram files are generally written to the local disks
- (the path 
-\family typewriter
-LOCAL_PATH
-\family default
- in the 
-\family typewriter
-Par_file
-\family default
-) and need to be gathered at the end of the simulation.
-\end_layout
-
-\begin_layout Standard
-While the solver is running, its progress may be tracked by monitoring the
- `
-\family typewriter
-\size small
-timestamp*
-\family default
-\size default
-' files in the 
-\family typewriter
-\size small
-OUTPUT_FILES
-\family default
-\size default
- directory.
- These tiny files look something like this: 
-\end_layout
-
-\begin_layout LyX-Code
-Time step #          10000 
-\end_layout
-
-\begin_layout LyX-Code
-Time:     108.4890      seconds 
-\end_layout
-
-\begin_layout LyX-Code
-Elapsed time in seconds =    1153.28696703911 
-\end_layout
-
-\begin_layout LyX-Code
-Elapsed time in hh:mm:ss =     0 h 19 m 13 s 
-\end_layout
-
-\begin_layout LyX-Code
-Mean elapsed time per time step in seconds =     0.115328696703911 
-\end_layout
-
-\begin_layout LyX-Code
-Max norm displacement vector U in all slices (m) =    1.0789589E-02 
-\end_layout
-
-\begin_layout Standard
-The 
-\family typewriter
-\size small
-timestamp*
-\family default
-\size default
- files provide the 
-\family typewriter
-Mean elapsed time per time step in seconds
-\family default
-, which may be used to assess performance on various machines (assuming
- you are the only user on a node), as well as the 
-\family typewriter
-Max norm displacement vector U in all slices\InsetSpace ~
-(m)
-\family default
-.
- If something is wrong with the model, the mesh, or the source, you will
- see the code become unstable through exponentially growing values of the
- displacement and fluid potential with time, and ultimately the run will
- be terminated by the program.
- You can control the rate at which the timestamp files are written based
- upon the parameter 
-\family typewriter
-NTSTEP_BETWEEN_OUTPUT_INFO
-\family default
- in the 
-\family typewriter
-Par_file
-\family default
-.
-\end_layout
-
-\begin_layout Standard
-Having set the 
-\family typewriter
-Par_file
-\family default
- parameters, and having provided the 
-\family typewriter
-CMTSOLUTION
-\family default
- and 
-\family typewriter
-STATIONS
-\family default
- files, you are now ready to launch the solver! This is most easily accomplished
- based upon the 
-\family typewriter
-go_solver
-\family default
- script (See Chapter 
-\begin_inset LatexCommand ref
-reference "cha:Scheduler"
-
-\end_inset
-
- for information about running through a scheduler, e.g., LSF).
- You may need to edit the last command at the end of the script that invokes
- the 
-\family typewriter
-mpirun
-\family default
- command.
- The 
-\family typewriter
-runall
-\family default
- script compiles and runs both mesher and solver in sequence.
- This is a safe approach that ensures using the correct combination of mesher
- output and solver input.
-\end_layout
-
-\begin_layout Standard
-It is important to realize that the CPU and memory requirements of the solver
- are closely tied to choices about attenuation (
-\family typewriter
-ATTENUATION
-\family default
-) and the nature of the model (i.e., isotropic models are cheaper than anisotropic
- models).
- We encourage you to run a variety of simulations with various flags turned
- on or off to develop a sense for what is involved.
-\end_layout
-
-\begin_layout Standard
-For the same model, one can rerun the solver for different events by simply
- changing the 
-\family typewriter
-CMTSOLUTION
-\family default
- file, or for different stations by changing the 
-\family typewriter
-STATIONS
-\family default
- file.
- There is no need to rerun the mesher.
- Of course it is best to include as many stations as possible, since this
- does not add to the cost of the simulation.
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:Adjoint-Simulations"
-
-\end_inset
-
-Adjoint Simulations
-\end_layout
-
-\begin_layout Standard
-Adjoint simulations are generally performed for two distinct applications.
- First, they can be used for earthquake source inversions, especially earthquake
-s with large ruptures such as the Lander's earthquake 
-\begin_inset LatexCommand citep
-key "WaHe94"
-
-\end_inset
-
-.
- Second, they can be used to generate finite-frequency sensitivity kernels
- that are a critical part of tomographic inversions based upon 3D reference
- models 
-\begin_inset LatexCommand citep
-key "trompetal2005,Liu06a,Liu08"
-
-\end_inset
-
-.
- In either case, source parameter or velocity structure updates are sought
- to minimize a specific misfit function (e.g., waveform or traveltime differences)
-, and the adjoint simulation provides a means of computing the gradient
- of the misfit function and further reducing it in successive iterations.
- Applications and procedures pertaining to source studies and finite-frequency
- kernels are discussed in Sections\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-sources"
-
-\end_inset
-
- and 
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-finite"
-
-\end_inset
-
-, respectively.
- The two related parameters in the 
-\family typewriter
-Par_file
-\family default
- are 
-\family typewriter
-SIMULATION_TYPE
-\family default
- (1 or 2) and the 
-\family typewriter
-SAVE_FORWARD
-\family default
- (boolean).
-\end_layout
-
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:Adjoint-simulation-sources"
-
-\end_inset
-
-Adjoint Simulations for Sources
-\end_layout
-
-\begin_layout Standard
-In the case where a specific misfit function is minimized to invert for
- the earthquake source parameters, the gradient of the misfit function with
- respect to these source parameters can be computed by placing time-reversed
- seismograms at the receivers and using them as sources in an adjoint simulation
-, and then the value of the gradient is obtained from the adjoint seismograms
- recorded at the original earthquake location.
- 
-\end_layout
-
-\begin_layout Enumerate
-
-\series bold
-Prepare the adjoint sources
-\series default
- 
-\begin_inset LatexCommand label
-name "enu:Prepare-the-adjoint"
-
-\end_inset
-
-
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-First, run a regular forward simlation (
-\family typewriter
-SIMULATION_TYPE = 1
-\family default
- and 
-\family typewriter
-SAVE_FORWARD = .false.
-\family default
-).
- You can automatically set these two variables using the 
-\family typewriter
-\size small
-UTILS/change_simulation_type.pl
-\family default
-\size default
- script:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-UTILS/change_simulation_type.pl -f 
-\end_layout
-
-\begin_layout Standard
-
-\family roman
-and then collect the recorded seismograms at all the stations given in
-\family default
- 
-\family typewriter
-DATA/STATIONS
-\family roman
-.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Then select the stations for which you want to compute the time-reversed
- adjoint sources and run the adjoint simulation, and compile them into the
- 
-\family typewriter
-DATA/STATIONS_ADJOINT
-\family default
- file, which has the same format as the regular 
-\family typewriter
-DATA/STATIONS
-\family default
- file.
- 
-\end_layout
-
-\begin_deeper
-\begin_layout Itemize
-Depending on what type of misfit function is used for the source inversion,
- adjoint sources need to be computed from the original recorded seismograms
- for the selected stations and saved in the 
-\family typewriter
-SEM/
-\family default
- directory with the format 
-\family typewriter
-STA.NT.BH?.adj
-\family default
-, where 
-\family typewriter
-STA
-\family default
-, 
-\family typewriter
-NT
-\family default
- are the station name and network code given in the 
-\family typewriter
-DATA/STATIONS_ADJOINT
-\family default
- file, and 
-\family typewriter
-BH?
-\family default
- represents the component name of a particular adjoint seismogram.
- 
-\end_layout
-
-\begin_layout Itemize
-The adjoint seismograms are in the same format as the original seismogram
- (
-\family typewriter
-STA.NT.BH?.sem?
-\family default
-), with the same start time, time interval and record length.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Notice that even if you choose to time reverse only one component from one
- specific station, you still need to supply all three components because
- the code is expecting them (you can set the other two components to be
- zero).
-\end_layout
-
-\begin_layout Enumerate
-Also note that since time-reversal is done in the code itself, no explicit
- time-reversing is needed for the preparation of the adjoint sources, i.e.,
- the adjoint sources are in the same forward time sense as the original
- recorded seismograms.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Set the related parameters and run the adjoint simulation
-\series default
-
-\newline
-In the 
-\family typewriter
-DATA/Par_file
-\family default
-, set the two related parameters to be 
-\family typewriter
-SIMULATION_TYPE = 2
-\family default
- and 
-\family typewriter
-SAVE_FORWARD = .false.
-\family default
-.
- More conveniently, use the scripts 
-\family typewriter
-UTILS/change_simulation_type.pl
-\family default
- to modify the 
-\family typewriter
-Par_file
-\family default
- automatically (
-\family typewriter
-change_simulation_type.pl -a
-\family default
-).
- Then run the solver to launch the adjoint simulation.
-\end_layout
-
-\begin_layout Enumerate
-
-\series bold
-Collect the seismograms at the original source location
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-After the adjoint simulation has completed successfully, collect the seismograms
- from 
-\family typewriter
-LOCAL_PATH
-\family default
-.
- 
-\end_layout
-
-\begin_layout Itemize
-These adjoint seismograms are recorded at the locations of the original
- earthquake sources given by the 
-\family typewriter
-DATA/CMTSOLUTION
-\family default
- file, and have names of the form 
-\family typewriter
-S?????.NT.S??.sem
-\family default
- for the six-component strain tensor (
-\family typewriter
-SNN,SEE,SZZ,SNE,SNZ,SEZ
-\family default
-) at these locations, and 
-\family typewriter
-S?????.NT.BH?.sem
-\family default
- for the three-component displacements (
-\family typewriter
-BHN,BHE,BHZ
-\family default
-) recorded at these locations.
- 
-\end_layout
-
-\begin_layout Itemize
-
-\family typewriter
-S?????
-\family default
- denotes the source number; for example, if the original 
-\family typewriter
-CMTSOLUTION
-\family default
- provides only a point source, then the seismograms collected will start
- with 
-\family typewriter
-S00001
-\family default
-.
- 
-\end_layout
-
-\begin_layout Itemize
-These adjoint seismograms provide critical information for the computation
- of the gradient of the misfit function.
-\end_layout
-
-\end_deeper
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:Adjoint-simulation-finite"
-
-\end_inset
-
-Adjoint Simulations for Finite-Frequency Kernels (Kernel Simulation)
-\end_layout
-
-\begin_layout Standard
-Finite-frequency sensitivity kernels are computed in two successive simulations
- (please refer to 
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-citet{Liu06a}
-\end_layout
-
-\end_inset
-
- for details).
-\end_layout
-
-\begin_layout Enumerate
-
-\series bold
-Run a forward simulation with the state variables saved at the end of the
- simulation
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-Prepare the 
-\family typewriter
-\size small
-CMTSOLUTION
-\family default
-\size default
- and 
-\family typewriter
-\size small
-STATIONS
-\family default
-\size default
- files, set the parameters 
-\family typewriter
-\size small
-SIMULATION_TYPE
-\family default
- 
-\family typewriter
-=
-\family default
- 
-\family typewriter
-1
-\family default
-\size default
- and 
-\family typewriter
-\size small
-SAVE_FORWARD =
-\family default
- 
-\family typewriter
-.true.
-
-\family default
-\size default
- in the 
-\family typewriter
-Par_file
-\family default
- (
-\family typewriter
-change_simulation_type -F
-\family default
-), and run the solver.
- 
-\end_layout
-
-\begin_layout Itemize
-Notice that attenuation is not implemented yet for the computation of finite-fre
-quency kernels; therefore set 
-\family typewriter
-ATTENUATION = .false.
-
-\family default
- in the 
-\family typewriter
-Par_file
-\family default
-.
- 
-\end_layout
-
-\begin_layout Itemize
-We also suggest you modify the half duration of the 
-\family typewriter
-CMTSOLUTION
-\family default
- to be similar to the accuracy of the simulation (see Equation 
-\begin_inset LatexCommand ref
-reference "eq:shortest_period"
-
-\end_inset
-
-) to avoid too much high-frequency noise in the forward wavefield, although
- theoretically the high-frequency noise should be eliminated when convolved
- with an adjoint wavefield with the proper frequency content.
- 
-\end_layout
-
-\begin_layout Itemize
-This forward simulation differs from the regular simulations (
-\family typewriter
-\size small
-SIMULATION_TYPE
-\family default
- 
-\family typewriter
-=
-\family default
- 
-\family typewriter
-1
-\family default
-\size default
- and 
-\family typewriter
-\size small
-SAVE_FORWARD
-\family default
- 
-\family typewriter
-=
-\family default
- 
-\family typewriter
-.false.
-\family default
-\size default
-) described in the previous chapters in that the state variables for the
- last time step of the simulation, including wavefields of the displacement,
- velocity, acceleration, etc., are saved to the 
-\family typewriter
-LOCAL_PATH
-\family default
- to be used for the subsequent simulation.
- 
-\end_layout
-
-\begin_layout Itemize
-For regional simulations, the files recording the absorbing boundary contributio
-n are also written to the 
-\family typewriter
-LOCAL_PATH
-\family default
- when 
-\family typewriter
-SAVE_FORWARD = .true.
-\family default
-.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Prepare the adjoint sources
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-The adjoint sources need to be prepared the same way as described in the
- Section 
-\begin_inset LatexCommand ref
-reference "enu:Prepare-the-adjoint"
-
-\end_inset
-
-.
- 
-\end_layout
-
-\begin_layout Itemize
-In the case of travel-time finite-frequency kernel for one source-receiver
- pair, i.e., point source from the 
-\family typewriter
-CMTSOLUTION
-\family default
-, and one station in the 
-\family typewriter
-STATIONS_ADJOINT
-\family default
- list, we supply a sample program in 
-\family typewriter
-UTILS/xcut_velocity
-\family default
- to cut a certain portion of the original displacement seismograms and convert
- it into the proper adjoint source to compute the finite-frequency kernel.
- 
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-xcut_velocity t1 t2 ifile[0-5] E/N/Z-ascii-files [baz]
-\end_layout
-
-\begin_layout Standard
-where 
-\family typewriter
-t1
-\family default
- and 
-\family typewriter
-t2
-\family default
- are the start and end time of the portion you are interested in, 
-\family typewriter
-ifile
-\family default
- denotes the component of the seismograms to be used (0 for all three components
-, 1 for East, 2 for North, and 3 for vertical, 4 for transverse, and 5 for
- radial component), 
-\family typewriter
-E/N/Z-ascii-files
-\family default
- indicate the three-component displacement seismograms in the right order,
- and 
-\family typewriter
-baz
-\family default
- is the back-azimuth of the station.
- Note that 
-\family typewriter
-baz
-\family default
- is only supplied when 
-\family typewriter
-ifile
-\family default
- = 4 or 5.
-\end_layout
-
-\end_deeper
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Run the kernel simulation
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-With the successful forward simulation and the adjoint source ready in 
-\family typewriter
-SEM/
-\family default
-, set 
-\family typewriter
-SIMULATION_TYPE = 3
-\family default
- and 
-\family typewriter
-SAVE_FORWARD = .false.
-
-\family default
- in the 
-\family typewriter
-Par_file(change_simulation_type.pl -b),
-\family default
- and rerun the solver.
- 
-\end_layout
-
-\begin_layout Itemize
-The adjoint simulation is launched together with the back reconstruction
- of the original forward wavefield from the state variables saved from the
- previous forward simulation, and the finite-frequency kernels are computed
- by the interaction of the reconstructed forward wavefield and the adjoint
- wavefield.
- 
-\end_layout
-
-\begin_layout Itemize
-The back-reconstructed seismograms at the original station locations are
- saved to the 
-\family typewriter
-LOCAL_PATH
-\family default
- at the end of the kernel simulations, and can be collected to the local
- disk.
- 
-\end_layout
-
-\begin_layout Itemize
-These back-constructed seismograms can be compared with the time-reversed
- original seismograms to assess the accuracy of the backward reconstruction,
- and they should match very well.
- 
-\end_layout
-
-\begin_layout Itemize
-The arrays for density, P-wave speed and S-wave speed kernels are also saved
- in the 
-\family typewriter
-LOCAL_PATH
-\family default
- with the names 
-\family typewriter
-proc??????_rho(alpha,beta)_kernel.bin
-\family default
-, where 
-\family typewriter
-proc??????
-\family default
- represents the processor number, 
-\family typewriter
-rho(alpha,beta)
-\family default
- are the different types of kernels.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-In general, the three steps need to be run sequentially to assure proper
- access to the necessary files.
- If the simulations are run through some cluster scheduling system (e.g.,
- LSF), and the forward simulation and the subsequent kernel simulations
- cannot be assigned to the same set of computer nodes, the kernel simulation
- will not be able to access the database files saved by the forward simulation.
- Solutions for this dilemma are provided in Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Scheduler"
-
-\end_inset
-
-.
- Visualization of the finite-frequency kernels is discussed in Section\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "sec:Finite-Frequency-Kernels"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Chapter
-Graphics
-\end_layout
-
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:Mesh-graphics"
-
-\end_inset
-
-Meshes
-\end_layout
-
-\begin_layout Standard
-Use the serial code 
-\family typewriter
-combine_AVS_DX.f90
-\family default
- (type `
-\family typewriter
-make combine_AVS_DX
-\family default
-' and then `
-\family typewriter
-xcombine_AVS_DX
-\family default
-') to generate 
-\begin_inset LatexCommand htmlurl
-name "AVS"
-target "www.avs.com"
-
-\end_inset
-
- output files (in AVS UCD format) or 
-\begin_inset LatexCommand htmlurl
-name "OpenDX"
-target "www.opendx.org"
-
-\end_inset
-
- output files showing the mesh, the MPI partition (slices), the 
-\begin_inset Formula $\nchunks$
-\end_inset
-
- chunks, the source and receiver location, etc.
- Use the AVS UCD files 
-\family typewriter
-AVS_continent_boundaries.inp
-\family default
- and 
-\family typewriter
-AVS_plate_boundaries.inp
-\family default
- or the OpenDX files 
-\family typewriter
-DX_continent_boundaries.dx
-\family default
- and 
-\family typewriter
-DX_plate_boundaries.dx
-\family default
- for reference.
-\end_layout
-
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:Movies"
-
-\end_inset
-
-Movies
-\end_layout
-
-\begin_layout Standard
-To make a surface or volume movie of the simulation, set parameters 
-\family typewriter
-MOVIE_SURFACE
-\family default
-, 
-\family typewriter
-MOVIE_VOLUME
-\family default
-, and 
-\family typewriter
-NTSTEP_BETWEEN_FRAMES
-\family default
- in the 
-\family typewriter
-Par_file
-\family default
-.
- Turning on the movie flags, in particular 
-\family typewriter
-MOVIE_VOLUME
-\family default
-, produces large output files.
- 
-\family typewriter
-MOVIE_VOLUME
-\family default
- files are saved in the 
-\family typewriter
-LOCAL_PATH
-\family default
- directory, whereas 
-\family typewriter
-MOVIE_SURFACE
-\family default
- output files are saved in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory.
- We save the velocity field.
- The look of a movie is determined by the half-duration of the source.
- The half-duration should be large enough so that the movie does not contain
- frequencies that are not resolved by the mesh, i.e., it should not contain
- numerical noise.
- This can be accomplished by selecting a CMT 
-\family typewriter
-HALF_DURATION
-\family default
- > 1.1 
-\begin_inset Formula $\times$
-\end_inset
-
- smallest period (see figure 
-\begin_inset LatexCommand ref
-reference "fig:CMTSOLUTION-file"
-
-\end_inset
-
-).
- When 
-\family typewriter
-MOVIE_SURFACE
-\family default
- = .
-\family typewriter
-true.
-\family default
-, the half duration of each source in the 
-\family typewriter
-CMTSOLUTION
-\family default
- file is replaced by 
-\end_layout
-
-\begin_layout Quote
-\begin_inset Formula \[
-\sqrt{(}\mathrm{\mathtt{HALF\_DURATIO}\mathtt{N}^{2}}+\mathrm{\mathtt{HDUR\_MOVI}\mathtt{E}^{2}})\]
-
-\end_inset
-
-
-\series bold
-NOTE:
-\series default
- If 
-\family typewriter
-HDUR_MOVIE
-\family default
- is set to 0.0, the code will select the appropriate value of 1.1 
-\begin_inset Formula $\times$
-\end_inset
-
- smallest period.
- As usual, for a point source one can set 
-\family typewriter
-HALF_DURATION
-\family default
- in the 
-\family typewriter
-Par_file
-\family default
- to be 0.0 and 
-\family typewriter
-HDUR_MOVIE
-\family default
- = 0.0 to get the highest frequencies resolved by the simulation, but for
- a finite source one would keep all the 
-\family typewriter
-HALF_DURATIONs
-\family default
- as prescribed by the finite source model and set 
-\family typewriter
-HDUR_MOVIE
-\family default
- = 0.0.
-\end_layout
-
-\begin_layout Subsection
-Movie Surface
-\end_layout
-
-\begin_layout Standard
-When running 
-\family typewriter
-xspecfem3D
-\family default
- with the 
-\family typewriter
-MOVIE_SURFACE
-\family default
- flag turned on, the code outputs 
-\family typewriter
-moviedata??????
-\family default
- files in the 
-\family typewriter
-OUTPUT_FILES
-\family default
- directory.
- The files are in a fairly complicated binary format, but there are two
- programs provided to convert the output into more user friendly formats.
- The first one, 
-\family typewriter
-create_movie_AVS_DX.f90
-\family default
-, outputs data in ASCII, OpenDX, AVS, or ParaView format.
- Run the code from the source directory (type `
-\family typewriter
-make
-\family default
- 
-\family typewriter
-create_movie_AVS_DX
-\family default
-' first) to create an input file in your format of choice.
- The code will prompt the user for input parameters.
- The second program 
-\family typewriter
-create_movie_GMT.f90
-\family default
- outputs ascii xyz files, convenient for use with GMT.
- This code uses significantly less memory than 
-\family typewriter
-create_movie_AVS_DX.f90
-\family default
- and is therefore useful for high resolution runs.
- 
-\end_layout
-
-\begin_layout Standard
-The 
-\family typewriter
-SPECFEM3D
-\family default
- code is running in near real-time to produce animations of southern California
- earthquakes via the web; see 
-\begin_inset LatexCommand htmlurl
-name "Southern California ShakeMovie"
-target "www.shakemovie.caltech.edu"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Section
-\begin_inset LatexCommand label
-name "sec:Finite-Frequency-Kernels"
-
-\end_inset
-
-Finite-Frequency Kernels
-\end_layout
-
-\begin_layout Standard
-The finite-frequency kernels computed as explained in Section 
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-finite"
-
-\end_inset
-
- are saved in the 
-\family typewriter
-LOCAL_PATH
-\family default
- at the end of the simulation.
- Therefore, we first need to collect these files on the front end, combine
- them into one mesh file, and visualize them with some auxilliary programs.
-\end_layout
-
-\begin_layout Enumerate
-
-\series bold
-Create slice files
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-We will only discuss the case of one source-receiver pair, i.e., the so-called
- banana-doughnut kernels.
- Although it is possible to collect the kernel files from all slices on
- the front end, it usually takes up too much storage space (at least tens
- of gigabytes).
- Since the sensitivity kernels are the strongest along the source-receiver
- great circle path, it is sufficient to collect only the slices that are
- along or close to the great circle path.
- 
-\end_layout
-
-\begin_layout Standard
-A Perl script 
-\family typewriter
-UTILS/slice_number.pl
-\family default
- that calls MATLAB can help to figure out the slice numbers that lie along
- the great circle path (both the minor and major arcs), as well as the slice
- numbers required to produce a full picture of the inner core if your kernel
- also illuminates the inner core.
- 
-\end_layout
-
-\begin_layout Enumerate
-On machines where you have MATLAB access, copy the 
-\family typewriter
-CMTSOLUTION
-\family default
- file, 
-\family typewriter
-STATIONS_ADJOINT
-\family default
-, and 
-\family typewriter
-Par_file
-\family default
-, and run:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-
-\size small
-UTILS/slice_number.pl Par_file output_solver.txt slice_file
-\end_layout
-
-\begin_layout Standard
-
-\family roman
-which will generate a
-\family default
- 
-\family typewriter
-slices_file
-\family roman
-.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-For cases with multiple sources and multiple receivers, you need to provide
- a slice file before proceeding to the next step.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Collect the kernel files
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-After obtaining the slice files, you can collect the corresponding kernel
- files from the given slices.
- 
-\end_layout
-
-\begin_layout Enumerate
-You can use or modify the script 
-\family typewriter
-UTILS/copy_databases.pl
-\family default
- to accomplish this:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-
-\size small
-UTILS/copy_database.pl slice_file lsf_machine_file filename [jobid]
-\end_layout
-
-\begin_layout Standard
-
-\family roman
-where
-\family default
- 
-\family typewriter
-\size small
-lsf_machine_file
-\family roman
-\size default
- is the machine file generated by the LSF scheduler,
-\family default
- 
-\family typewriter
-\size small
-filename
-\family roman
-\size default
- is the kernel name (e.g.,
-\family default
- 
-\family typewriter
-\size small
-rho_kernel
-\family roman
-\size default
-,
-\family default
- 
-\family typewriter
-\size small
-alpha_kernel
-\family roman
-\size default
- and
-\family default
- 
-\family typewriter
-\size small
-beta_kernel
-\family roman
-\size default
-), and the optional
-\family default
- 
-\family typewriter
-\size small
-jobid
-\family roman
-\size default
- is the name of the subdirectory under
-\family default
- 
-\family typewriter
-\size small
-LOCAL_PATH
-\family roman
-\size default
- where all the kernel files are stored.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-After executing this script, all the necessary mesh topology files as well
- as the kernel array files are collected to the local directory of the front
- end.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Combine kernel files into one mesh file
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-We use an auxilliary program 
-\family typewriter
-combine_paraview_data.f90
-\family default
- to combine the kernel files from all slices into one mesh file.
- 
-\end_layout
-
-\begin_layout Enumerate
-Compile it in the global code directory:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-
-\size footnotesize
-make combine_paraview_data 
-\end_layout
-
-\begin_layout LyX-Code
-
-\size footnotesize
-xcombine_paraview_data slice_list filename input_dir output_dir high/low-resolut
-ion 
-\end_layout
-
-\begin_layout Standard
-
-\family roman
-where
-\family default
- 
-\family typewriter
-input_dir
-\family default
- 
-\family roman
-is the directory where all the individual kernel files are stored, and
-\family default
- 
-\family typewriter
-output_dir
-\family default
- 
-\family roman
-is where the mesh file will be written.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Use 1 for a high-resolution mesh, outputting all the GLL points to the mesh
- file, or use 0 for low resolution, outputting only the corner points of
- the elements to the mesh file.
- 
-\end_layout
-
-\begin_layout Enumerate
-The output mesh file will have the name 
-\family typewriter
-filename_rho(alpha,beta).mesh
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Convert mesh files into .vtu files
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-We next convert the 
-\family typewriter
-.mesh
-\family default
- file into the VTU (Unstructured grid file) format which can be viewed in
- ParaView, for example:
-\end_layout
-
-\begin_deeper
-\begin_layout LyX-Code
-UTILS/mesh2vtu.pl -i file.mesh -o file.vtu
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Notice that this Perl script uses a program 
-\family typewriter
-mesh2vtu
-\family default
- in the 
-\family typewriter
-UTILS/mesh2vtu
-\family default
- directory, which further uses the 
-\begin_inset LatexCommand htmlurl
-name "VTK"
-target "http://www.vtk.org/"
-
-\end_inset
-
- run-time library for its execution.
- Therefore, make sure you have them properly set in the script according
- to your system.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-Copy over the source and receiver .vtk file
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-In the case of a single source and a single receiver, the simulation also
- generates the 
-\family typewriter
-OUTPUT_FILES/sr.vtk
-\family default
- file to describe the source and receiver locations, which can also be viewed
- in Paraview in the next step.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-
-\series bold
-View the mesh in ParaView
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-Finally, we can view the mesh in 
-\begin_inset LatexCommand htmlurl
-name "ParaView"
-target "www.paraview.org"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Enumerate
-Open ParaView.
-\end_layout
-
-\begin_layout Enumerate
-From the top menu, 
-\family sans
-File
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
-
-\family sans
-Open data
-\family default
-, select 
-\family typewriter
-file.vtu
-\family default
-, and click the 
-\family sans
-Accept
-\family default
- button.
-\end_layout
-
-\begin_deeper
-\begin_layout Itemize
-If the mesh file is of moderate size, it shows up on the screen; otherwise,
- only the bounding box is shown.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-Click 
-\family sans
-Display Tab
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Display Style
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Representation
-\family default
- and select 
-\family sans
-wireframe of surface
-\family default
- to display it.
- 
-\end_layout
-
-\begin_layout Enumerate
-To create a cross-section of the volumetric mesh, choose 
-\family sans
-Filter
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-cut
-\family default
-, and under 
-\family sans
-Parameters Tab
-\family default
-, choose 
-\family sans
-Cut Function
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-plane
-\family default
-.
- 
-\end_layout
-
-\begin_layout Enumerate
-Fill in center and normal information given by the 
-\family typewriter
-global_slice_number.pl
-\family default
- script (either from the standard output or from 
-\family typewriter
-normal_plane.txt
-\family default
- file).
- 
-\end_layout
-
-\begin_layout Enumerate
-To change the color scale, go to 
-\family sans
-Display Tab
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Color
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Edit Color Map
-\family default
- and reselect lower and upper limits, or change the color scheme.
-\end_layout
-
-\begin_layout Enumerate
-Now load in the source and receiver location file by 
-\family sans
-File
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Open data
-\family default
-, select 
-\family typewriter
-sr.vt
-\family default
-k, and click the 
-\family sans
-Accept
-\family default
- button.
- Choose 
-\family sans
-Filter
-\family default
- 
-\begin_inset Formula $\rightarrow$
-\end_inset
-
- 
-\family sans
-Glyph
-\family default
-, and represent the points by `
-\family sans
-spheres
-\family default
-'.
-\end_layout
-
-\begin_layout Enumerate
-For more information about ParaView, see the 
-\begin_inset LatexCommand htmlurl
-name "ParaView Users Guide"
-target "www.paraview.org/files/v1.6/ParaViewUsersGuide.PDF"
-
-\end_inset
-
-.
-\end_layout
-
-\end_deeper
-\begin_layout Standard
-\begin_inset Float figure
-placement H
-wide false
-sideways false
-status open
-
-\begin_layout Standard
-\noindent
-\align center
-\begin_inset Graphics
-	filename figures/3D-S-Kernel.eps
-	scale 60
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset Caption
-
-\begin_layout Standard
-(a) Top Panel: Vertical source-receiver cross-section of the S-wave finite-frequ
-ency sensitivity kernel 
-\begin_inset Formula $K_{\beta}$
-\end_inset
-
- for station GSC at an epicentral distance of 176 km from the September
- 3, 2002, Yorba Linda earthquake.
- Lower Panel: Vertical source-receiver cross-section of the 3D S-wave velocity
- model used for the spectral-element simulations 
-\begin_inset LatexCommand citep
-key "KoLiTrSuStSh04"
-
-\end_inset
-
-.
- (b) The same as (a) but for station HEC at an epicentral distance of 165
- km 
-\begin_inset LatexCommand citep
-key "Liu06a"
-
-\end_inset
-
-.
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand label
-name "figure:P-wave-speed-finite-frequency"
-
-\end_inset
-
-
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:Scheduler"
-
-\end_inset
-
-Running through a Scheduler
-\end_layout
-
-\begin_layout Standard
-The code is usually run on large parallel machines, often PC clusters, most
- of which use schedulers, i.e., queuing or batch management systems to manage
- the running of jobs from a large number of users.
- The following considerations need to be taken into account when running
- on a system that uses a scheduler: 
-\end_layout
-
-\begin_layout Itemize
-The processors/nodes to be used for each run are assigned dynamically by
- the scheduler, based on availability.
- Therefore, in order for the mesher and the solver (or between successive
- runs of the solver) to have access to the same database files (if they
- are stored on hard drives local to the nodes on which the code is run),
- they must be launched in sequence as a single job.
- 
-\end_layout
-
-\begin_layout Itemize
-On some systems, the nodes to which running jobs are assigned are not configured
- for compilation.
- It may therefore be necessary to pre-compile both the mesher and the solver.
- A small program provided in the distribution called 
-\family typewriter
-\size small
-create_header_file.f90
-\family default
-\size default
- can be used to directly create 
-\family typewriter
-\size small
-OUTPUT_FILES/values_from_mesher.h
-\family default
-\size default
- using the information in the 
-\family typewriter
-\size small
-DATA/Par_file
-\family default
-\size default
- without having to run the mesher (type 
-\family typewriter
-\size small
-`make
-\family default
- 
-\family typewriter
-create_header_
-\newline
-file
-\family default
-\size default
-' to compile it and `
-\family typewriter
-\size small
-xcreate_header_file
-\family default
-\size default
-' to run it; refer to the sample scripts below).
- The solver can now be compiled as explained above.
- 
-\end_layout
-
-\begin_layout Itemize
-One feature of schedulers/queuing systems is that they allow submission
- of multiple jobs in a ``launch and forget'' mode.
- In order to take advantage of this property, care needs to be taken that
- output and intermediate files from separate jobs do not overwrite each
- other, or otherwise interfere with other running jobs.
- 
-\end_layout
-
-\begin_layout Standard
-We describe here in some detail a job submission procedure for the Caltech
- 1024-node cluster, CITerra, under the LSF scheduling system.
- We consider the submission of a regular forward simulation.
- The two main scripts are 
-\family typewriter
-\size small
-run_lsf.bash
-\family default
-\size default
-, which compiles the Fortran code and submits the job to the scheduler,
- and 
-\family typewriter
-\size small
-go_mesher_solver_lsf
-\newline
-.bash
-\family default
-\size default
-, which contains the instructions that make up the job itself.
- These scripts can be found in 
-\family typewriter
-\size small
-UTILS/
-\family default
-\size default
- directory and can straightforwardly be modified and adapted to meet more
- specific running needs.
- 
-\end_layout
-
-\begin_layout Section
-
-\family typewriter
-run_lsf.bash
-\end_layout
-
-\begin_layout Standard
-This script first sets the job queue to be `normal'.
- It then compiles the mesher and solver together, figures out the number
- of processors required for this simulation from the 
-\family typewriter
-DATA/Par_file
-\family default
-, and submits the LSF job.
-\end_layout
-
-\begin_layout LyX-Code
-#!/bin/bash
-\end_layout
-
-\begin_layout LyX-Code
-# use the normal queue unless otherwise directed queue="-q normal" 
-\end_layout
-
-\begin_layout LyX-Code
-if [ $# -eq 1 ]; then
-\end_layout
-
-\begin_layout LyX-Code
-        echo "Setting the queue to $1"
-\end_layout
-
-\begin_layout LyX-Code
-        queue="-q $1" 
-\end_layout
-
-\begin_layout LyX-Code
-fi
-\newline
-
-\newline
-# compile the mesher and the solver 
-\end_layout
-
-\begin_layout LyX-Code
-d=`date' echo "Starting compilation $d" 
-\end_layout
-
-\begin_layout LyX-Code
-make clean 
-\end_layout
-
-\begin_layout LyX-Code
-make meshfem3D 
-\end_layout
-
-\begin_layout LyX-Code
-make create_header_file 
-\end_layout
-
-\begin_layout LyX-Code
-xcreate_header_file 
-\end_layout
-
-\begin_layout LyX-Code
-make specfem3D 
-\end_layout
-
-\begin_layout LyX-Code
-d=`date' 
-\end_layout
-
-\begin_layout LyX-Code
-echo "Finished compilation $d"
-\newline
-
-\newline
-# compute total number of nodes needed 
-\end_layout
-
-\begin_layout LyX-Code
-NPROC_XI=`grep NPROC_XI DATA/Par_file | cut -c 34- ' 
-\end_layout
-
-\begin_layout LyX-Code
-NPROC_ETA=`grep NPROC_ETA DATA/Par_file | cut -c 34- ' 
-\newline
-
-\newline
-# total number of
- nodes is the product of the values read 
-\end_layout
-
-\begin_layout LyX-Code
-numnodes=$(( $NPROC_XI * $NPROC_ETA ))
-\newline
-
-\newline
-echo "Submitting job" 
-\end_layout
-
-\begin_layout LyX-Code
-bsub $queue -n $numnodes -W 60 -K <go_mesher_solver_lsf.bash 
-\end_layout
-
-\begin_layout Section
-
-\family typewriter
-go_mesher_solver_lsf.bash
-\end_layout
-
-\begin_layout Standard
-This script describes the job itself, including setup steps that can only
- be done once the scheduler has assigned a job-ID and a set of compute nodes
- to the job, the 
-\family typewriter
-run_lsf.bash
-\family default
- commands used to run the mesher and the solver, and calls to scripts that
- collect the output seismograms from the compute nodes and perform clean-up
- operations.
-\end_layout
-
-\begin_layout Enumerate
-First the script directs the scheduler to save its own output and output
- from 
-\family typewriter
-stdout
-\family default
- into 
-\family typewriter
-\size small
-OUTPUT_FILES/%J.o
-\family default
-\size default
-, where 
-\family typewriter
-%J
-\family default
- is short-hand for the job-ID; it also tells the scheduler what version
- of 
-\family typewriter
-mpich
-\family default
- to use (
-\family typewriter
-mpich_gm
-\family default
-) and how to name this job (
-\family typewriter
-go_mesher_solver_lsf
-\family default
-).
-\end_layout
-
-\begin_layout Enumerate
-The script then creates a list of the nodes allocated to this job by echoing
- the value of a dynamically set environment variable 
-\family typewriter
-LSB_MCPU_HOSTS
-\family default
- and parsing the output into a one-column list using the Perl script 
-\family typewriter
-UTILS/remap_lsf_machines.pl
-\family default
-.
- It then creates a set of scratch directories on these nodes (
-\family typewriter
-\size small
-/scratch/
-\newline
-$USER/DATABASES_MPI
-\family default
-\size default
-) to be used as the 
-\family typewriter
-LOCAL_PATH
-\family default
- for temporary storage of the database files.
- The scratch directories are created using 
-\family typewriter
-shmux
-\family default
-, a shell multiplexor that can execute the same commands on many hosts in
- parallel.
- 
-\family typewriter
-shmux
-\family default
- is available from 
-\begin_inset LatexCommand htmlurl
-name "Shmux"
-target "web.taranis.org/shmux/"
-
-\end_inset
-
-.
- Make sure that the 
-\family typewriter
-LOCAL_PATH
-\family default
- parameter in 
-\family typewriter
-DATA/Par_file
-\family default
- is also set properly.
-\end_layout
-
-\begin_layout Enumerate
-The next portion of the script launches the mesher and then the solver using
- 
-\family typewriter
-run_lsf.bash
-\family default
-.
-\end_layout
-
-\begin_layout Enumerate
-The final portion of the script collects the seismograms and performs clean
- up on the nodes, using the Perl scripts 
-\family typewriter
-collect_seismo_lsf_multi.pl
-\family default
- and 
-\family typewriter
-cleanmulti.pl
-\family default
-.
-\end_layout
-
-\begin_layout LyX-Code
-#!/bin/bash -v 
-\end_layout
-
-\begin_layout LyX-Code
-#BSUB -o OUTPUT_FILES/%J.o 
-\end_layout
-
-\begin_layout LyX-Code
-#BSUB -a mpich_gm 
-\end_layout
-
-\begin_layout LyX-Code
-#BSUB -J go_mesher_solver_lsf
-\newline
-
-\newline
-# set up local scratch directories
-\end_layout
-
-\begin_layout LyX-Code
-BASEMPIDIR=/scratch/$USER/DATABASES_MPI
-\end_layout
-
-\begin_layout LyX-Code
-mkdir -p OUTPUT_FILE
-\end_layout
-
-\begin_layout LyX-Code
-echo "$LSB_MCPU_HOSTS" > OUTPUT_FILES/lsf_machines 
-\end_layout
-
-\begin_layout LyX-Code
-echo "$LSB_JOBID" > OUTPUT_FILES/jobid
-\end_layout
-
-\begin_layout LyX-Code
-remap_lsf_machines.pl OUTPUT_FILES/lsf_machines >OUTPUT_FILES/machines
-\end_layout
-
-\begin_layout LyX-Code
-shmux -M50 -Sall -c "rm -r -f /scratch/$USER; 
-\backslash
-
-\end_layout
-
-\begin_layout LyX-Code
-      mkdir -p /scratch/$USER; mkdir -p $BASEMPIDIR" 
-\backslash
-
-\end_layout
-
-\begin_layout LyX-Code
-      - < OUTPUT_FILES/machines >/dev/null
-\newline
-
-\newline
-# run the specfem program
-\end_layout
-
-\begin_layout LyX-Code
-current_pwd=$PWD
-\end_layout
-
-\begin_layout LyX-Code
-run_lsf.bash --gm-no-shmem --gm-copy-env $current_pwd/xmeshfem3D
-\end_layout
-
-\begin_layout LyX-Code
-run_lsf.bash --gm-no-shmem --gm-copy-env $current_pwd/xspecfem3D
-\newline
-
-\newline
-# collect
- seismograms and clean up
-\end_layout
-
-\begin_layout LyX-Code
-mkdir -p SEM
-\end_layout
-
-\begin_layout LyX-Code
-cd SEM
-\end_layout
-
-\begin_layout LyX-Code
-collect_seismo.pl ../OUTPUT_FILES/lsf_machines
-\end_layout
-
-\begin_layout LyX-Code
-cleanbase.pl ../OUTPUT_FILES/machines
-\end_layout
-
-\begin_layout Chapter
-Post-Processing Scripts
-\end_layout
-
-\begin_layout Standard
-Several post-processing scripts/programs are provided in the 
-\family typewriter
-UTILS/
-\family default
- directory, and most of them need to be adjusted when used on different
- systems, for example, the path of the executable programs.
- Here we only list the available scripts and provide a brief description,
- and you can either refer to the related sections for detailed usage or,
- in a lot of cases, type the script/program name without arguments for its
- usage.
-\end_layout
-
-\begin_layout Section
-Collect Synthetic Seismograms
-\end_layout
-
-\begin_layout Standard
-The forward and adjoint simulations generate synthetic seismograms in the
- 
-\family typewriter
-LOCAL_PATH
-\family default
-.
- For the forward simulation, the files are named 
-\family typewriter
-STA.NT.BH?.semd
-\family default
- for two-column time series, or 
-\family typewriter
-STA.NT.BH?.semd.sac
-\family default
- for ASCII SAC format, where STA and NT are the station name and network
- code, and 
-\family typewriter
-BH?
-\family default
- stands for the component name.
- The adjont simulations generate synthetic seismograms with the name 
-\family typewriter
-S?????.NT.S??.sem
-\family default
- (refer to Section 
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-sources"
-
-\end_inset
-
- for details).
- The kernel simulations output the back-reconstructed synthetic seismogram
- in the name 
-\family typewriter
-STA.NT.BH?.semd
-\family default
-, mainly for the purpose of checking the accuracy of the reconstruction.
- Refer to Section 
-\begin_inset LatexCommand ref
-reference "sec:Adjoint-simulation-finite"
-
-\end_inset
-
- for further details.
- 
-\end_layout
-
-\begin_layout Standard
-To collect the synthetics onto the frontend, you can use the 
-\family typewriter
-UTILS/collect_seismo.pl
-\family default
- machines script:
-\end_layout
-
-\begin_layout LyX-Code
-collect_seismo.pl machines
-\end_layout
-
-\begin_layout Section
-Clean Local Database
-\end_layout
-
-\begin_layout Standard
-After all the simulations are done, the seismograms are collected, and the
- useful database files are copied to the frontend, you may need to clean
- the local scratch disk for the next simulation.
- This is especially important in the case of 1- or 2-chunk kernel simulation,
- where very large files are generated for the absorbing boundaries to help
- with the reconstruction of the regular forward wavefield.
- A sample script is provided in 
-\family typewriter
-UTILS/
-\family default
-:
-\end_layout
-
-\begin_layout LyX-Code
-cleanbase.pl machines
-\end_layout
-
-\begin_layout Section
-Process Data and Synthetics
-\begin_inset LatexCommand label
-name "sec:Process-data-and-syn"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-In many cases, the SEM synthetics are calculated and compared to data seismogram
-s recorded at seismic stations.
- Since the SEM synthetics are accurate for a certain frequency range, both
- the original data and the synthetics need to be processed before a comparison
- can be made.
- We generally use the following scripts:
-\end_layout
-
-\begin_layout Subsection
-
-\family typewriter
-process_trinet_data.pl
-\end_layout
-
-\begin_layout Standard
-This script cuts a given portion of the original data, filters it, transfers
- the data into a displacement record, and picks the first P and S arrivals.
- For more functionality, type `
-\family typewriter
-process_trinet_data.pl
-\family default
-' without any argument.
- An example of the usage of the script:
-\end_layout
-
-\begin_layout LyX-Code
-
-\size footnotesize
-process_trinet_data.pl -m CMTSOLUTION -l 0/180 -t 2/40 -i dir -p -x bp  9703873*.B
-H?.SAC
-\end_layout
-
-\begin_layout Standard
-which has cut all the sac files between 0 and 180 seconds, filtered them
- between 2 and 40 seconds, transfered them into displacement records using
- the polezero files in 
-\family typewriter
-dir
-\family default
- directory, picked the first P and S arrivals, and added suffix `
-\family typewriter
-bp
-\family default
-' to the file names.
-\end_layout
-
-\begin_layout Standard
-Note that all of the scripts in this section actually use the SAC and/or
- IASP91 to do the core operations; therefore make sure that the SAC and
- IASP91 packages are installed properly on your system, and that all the
- environment variables are set properly before running these scripts.
-\end_layout
-
-\begin_layout Subsection
-
-\family typewriter
-process_trinet_syn.pl
-\end_layout
-
-\begin_layout Standard
-This script converts the synthetic output from the SEM code from ASCII to
- SAC format, and performs similar operations as `
-\family typewriter
-process_trinet_data.pl
-\family default
-'.
- An example of the usage of the script:
-\end_layout
-
-\begin_layout LyX-Code
-
-\size footnotesize
-process_trinet_syn.pl -m CMTSOLUTION -a STATIONS -l 0/180 -t 2/40 -p -x bp
- syn/*.BH?.semd
-\end_layout
-
-\begin_layout Standard
-which will convert the synthetics into SAC format, add event and station
- information into the SAC headers, cut the SAC files between 0 and 180 seconds,
- filter them between 2 and 40 seconds, pick the first P and S arrivals,
- and add the suffix `
-\family typewriter
-bp
-\family default
-' to the file names.
-\end_layout
-
-\begin_layout Standard
-More options are available for this script, such as adding time shift to
- the origin time of the synthetics, convolving the synthetics with a triangular
- source time function with a given half duration, etc.
- Type 
-\family typewriter
-process_trinet_syn.pl
-\family default
- without any argument for a detailed usage.
-\end_layout
-
-\begin_layout Subsection
-
-\family typewriter
-rotate.pl
-\end_layout
-
-\begin_layout Standard
-The original data and synthetics have three components: vertical (BHZ),
- north (BHN) and east (BHE).
- However, for most seismology applications, transverse and radial components
- are also desirable.
- Therefore, we need to rotate the horizontal components of both the data
- and the synthetics to the transverse and radial direction, and 
-\family typewriter
-\size small
-rotate.pl
-\family default
-\size default
- can be used to accomplish this:
-\end_layout
-
-\begin_layout LyX-Code
-rotate.pl -l 0 -L 180 -d DATA/*.BHE.SAC.bp 
-\end_layout
-
-\begin_layout LyX-Code
-rotate.pl -l 0 -L 180 SEM/*.BHE.semd.sac.bp 
-\end_layout
-
-\begin_layout Standard
-where the first command performs rotation on the SAC data obtained through
- 
-\begin_inset LatexCommand htmlurl
-name "Seismogram Transfer Program (STP)"
-target "http://www.data.scec.org/STP/stp.html"
-
-\end_inset
-
-, while the second command rotates the processed SEM synthetics.
-\end_layout
-
-\begin_layout Section
-Plot Movie Snapshots and Synthetic Shakemaps
-\end_layout
-
-\begin_layout Subsection
-
-\family typewriter
-movie2gif.pl
-\end_layout
-
-\begin_layout Standard
-With the movie data saved in 
-\family typewriter
-OUTPUT_FILES/
-\family default
- at the end of a movie simulation (
-\family typewriter
-\size small
-MOVIE_SURFACE=.true.
-\family default
-\size default
-), you can run the 
-\family typewriter
-`create_movie_GMT
-\family default
-' code to convert these binary movie data into GMT xyz files for futher
- processing.
- A sample script 
-\family typewriter
-movie2gif.pl
-\family default
- is provided to do this conversion, and then plot the movie snapshots in
- GMT, for example:
-\end_layout
-
-\begin_layout LyX-Code
-movie2gif.pl -m CMTSOLUTION -g -f 1/40 -n -2 -p 
-\end_layout
-
-\begin_layout Standard
-which for the first through the 40th movie frame, converts the 
-\family typewriter
-moviedata
-\family default
- files into GMT xyz files, interpolates them using the 'nearneighbor' command
- in GMT, and plots them on a 2D topography map.
- Note that `
-\family typewriter
--2
-\family default
-' and `
-\family typewriter
--p
-\family default
-' are both optional.
-\end_layout
-
-\begin_layout Subsection
-
-\family typewriter
-plot_shakemap.pl
-\end_layout
-
-\begin_layout Standard
-With the shakemap data saved in 
-\family typewriter
-OUTPUT_FILES/
-\family default
- at the end of a shakemap simulation (
-\family typewriter
-CREATE_SHAKEMAP=.true.
-\family default
-), you can also run 
-\family typewriter
-`create_movie_GMT
-\family default
-' code to convert the binary shakemap data into GMT xyz files.
- A sample script 
-\family typewriter
-plot_shakemap.pl
-\family default
- is provided to do this conversion, and then plot the shakemaps in GMT,
- for example:
-\end_layout
-
-\begin_layout LyX-Code
-plot_shakemap.pl data_dir type(1,2,3) CMTSOLUTION 
-\end_layout
-
-\begin_layout Standard
-where 
-\family typewriter
-type=1
-\family default
- for a displacement shakemap, 
-\family typewriter
-2
-\family default
- for velocity, and 
-\family typewriter
-3
-\family default
- for acceleration.
-\end_layout
-
-\begin_layout Section
-Map Local Database
-\end_layout
-
-\begin_layout Standard
-A sample program 
-\family typewriter
-remap_database
-\family default
- is provided to map the local database from a set of machines to another
- set of machines.
- This is especially useful when you want to run mesher and solver, or different
- types of solvers separately through a scheduler (refer to Chapter\InsetSpace ~
-
-\begin_inset LatexCommand ref
-reference "cha:Scheduler"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout LyX-Code
-run_lsf.bash --gm-no-shmem --gm-copy-env remap_database old_machines 150
-\end_layout
-
-\begin_layout Standard
-where 
-\family typewriter
-old_machines
-\family default
- is the LSF machine file used in the previous simulation, and 
-\family typewriter
-150
-\family default
- is the number of processors in total.
-\end_layout
-
-\begin_layout Chapter*
-\begin_inset LatexCommand label
-name "cha:Bug-Reports-and"
-
-\end_inset
-
-Bug Reports and Suggestions for Improvements
-\end_layout
-
-\begin_layout Standard
-To report bugs or suggest improvements to the code, please send an e-mail
- to the 
-\begin_inset LatexCommand url
-name "CIG Computational Seismology Mailing List"
-target "cig-seismo at geodynamics.org"
-
-\end_inset
-
- or 
-\begin_inset LatexCommand url
-name "Jeroen Tromp"
-target "jtromp-AT-gps.caltech.edu"
-
-\end_inset
-
-, and/or use our online bug tracking system 
-\begin_inset LatexCommand htmlurl
-name "Roundup"
-target "www.geodynamics.org/roundup"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Chapter*
-Notes & Acknowledgments
-\end_layout
-
-\begin_layout Standard
-In order to keep the software package thread-safe in case a multithreaded
- implementation of MPI is used, developers should not add modules or common
- blocks to the source code but rather use regular subroutine arguments (which
- can be grouped in ``derived types'' if needed for clarity).
-\end_layout
-
-\begin_layout Standard
-The Gauss-Lobatto-Legendre subroutines in 
-\family typewriter
-gll_library.f90
-\family default
- are based in part on software libraries from Massachusetts Institute of
- Technology, Department of Mechanical Engineering, Cambridge, Massachusetts.
- The non-structured global numbering software was provided by Paul F.
- Fischer.
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand htmlurl
-name "OpenDX"
-target "http://www.opendx.org"
-
-\end_inset
-
- is open-source based on IBM Data Explorer, 
-\begin_inset LatexCommand htmlurl
-name "AVS"
-target "http://www.avs.com"
-
-\end_inset
-
- is a trademark of Advanced Visualization Systems, and 
-\begin_inset LatexCommand htmlurl
-name "ParaView"
-target "http://www.paraview.com"
-
-\end_inset
-
- is an open-source visualization platform.
- 
-\end_layout
-
-\begin_layout Standard
-The main developers of the 
-\family typewriter
-SPECFEM3D
-\family default
- source code are Dimitri Komatitsch, Jeroen Tromp, and Qinya Liu.
- The following individuals (listed in alphabetical order) have also contributed
- to the development of the source code: Min Chen, Vala Hjörleifsdóttir,
- Brian Savage, and Leif Strand.
- The following individuals (listed in alphabetical order) contributed to
- this manual: Min Chen, Vala Hjörleifsdóttir, Sue Kientz, Dimitri Komatitsch,
- Qinya Liu, Alessia Maggi, Brian Savage, Carl Tape, and Jeroen Tromp.
- The manual's cover graphic was created by Santiago Lombeyda from Caltech's
- 
-\begin_inset LatexCommand htmlurl
-name "Center for Advanced Computing Research (CACR)"
-target "http://www.cacr.caltech.edu/"
-
-\end_inset
-
-.
-\end_layout
-
-\begin_layout Standard
-Please e-mail your feedback, questions, comments, and suggestions to 
-\begin_inset LatexCommand url
-name "Jeroen Tromp"
-target "jtromp-AT-gps.caltech.edu"
-
-\end_inset
-
- or to the 
-\begin_inset LatexCommand url
-name "CIG Computational Seismology Mailing List"
-target "cig-seismo at geodynamics.org"
-
-\end_inset
-
-.
- 
-\end_layout
-
-\begin_layout Chapter*
-Copyright
-\end_layout
-
-\begin_layout Standard
-Main authors: Dimitri Komatitsch and Jeroen Tromp
-\end_layout
-
-\begin_layout Standard
-Seismological Laboratory, California Institute of Technology, U.S., and University
- of Pau, France
-\end_layout
-
-\begin_layout Standard
-© California Institute of Technology and University of Pau, November 2007
-\end_layout
-
-\begin_layout Standard
-This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation (see Appendix 
-\begin_inset LatexCommand ref
-reference "cha:License"
-
-\end_inset
-
-).
-\end_layout
-
-\begin_layout Standard
-\begin_inset LatexCommand bibtex
-bibfiles "bibliography"
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Chapter
-\start_of_appendix
-\begin_inset LatexCommand label
-name "cha:Coordinates"
-
-\end_inset
-
-Reference Frame Convention
-\end_layout
-
-\begin_layout Standard
-The code uses the following convention for the Cartesian reference frame:
- 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $x$
-\end_inset
-
- axis points East 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $y$
-\end_inset
-
- axis points North 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $z$
-\end_inset
-
- axis points up 
-\end_layout
-
-\begin_layout Standard
-Note that this convention is different from both the 
-\begin_inset LatexCommand citet
-key "AkRi80"
-
-\end_inset
-
- convention and the Harvard Centroid-Moment Tensor (CMT) convention.
- The Aki & Richards convention is 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $x$
-\end_inset
-
- axis points North 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $y$
-\end_inset
-
- axis points East 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $z$
-\end_inset
-
- axis points down 
-\end_layout
-
-\begin_layout Standard
-and the Harvard CMT convention is 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $x$
-\end_inset
-
- axis points South 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $y$
-\end_inset
-
- axis points East 
-\end_layout
-
-\begin_layout Itemize
-the 
-\begin_inset Formula $z$
-\end_inset
-
- axis points up 
-\end_layout
-
-\begin_layout Chapter
-\begin_inset LatexCommand label
-name "cha:License"
-
-\end_inset
-
-License 
-\end_layout
-
-\begin_layout Standard
-
-\series bold
-GNU GENERAL PUBLIC LICENSE Version 2, June 1991.
- Copyright (C) 1989, 1991 Free Software Foundation, Inc.
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-\series default
- 
-\newline
-
-\series medium
-Everyone is permitted to copy and distribute verbatim copies of this license
- document, but changing it is not allowed.
-\end_layout
-
-\begin_layout Section*
-Preamble
-\end_layout
-
-\begin_layout Standard
-The licenses for most software are designed to take away your freedom to
- share and change it.
- By contrast, the GNU General Public License is intended to guarantee your
- freedom to share and change free software -- to make sure the software
- is free for all its users.
- This General Public License applies to most of the Free Software Foundation's
- software and to any other program whose authors commit to using it.
- (Some other Free Software Foundation software is covered by the GNU Library
- General Public License instead.) You can apply it to your programs, too.
-\end_layout
-
-\begin_layout Standard
-When we speak of free software, we are referring to freedom, not price.
- Our General Public Licenses are designed to make sure that you have the
- freedom to distribute copies of free software (and charge for this service
- if you wish), that you receive source code or can get it if you want it,
- that you can change the software or use pieces of it in new free programs;
- and that you know you can do these things.
-\end_layout
-
-\begin_layout Standard
-To protect your rights, we need to make restrictions that forbid anyone
- to deny you these rights or to ask you to surrender the rights.
- These restrictions translate to certain responsibilities for you if you
- distribute copies of the software, or if you modify it.
-\end_layout
-
-\begin_layout Standard
-For example, if you distribute copies of such a program, whether gratis
- or for a fee, you must give the recipients all the rights that you have.
- You must make sure that they, too, receive or can get the source code.
- And you must show them these terms so they know their rights.
-\end_layout
-
-\begin_layout Standard
-We protect your rights with two steps:
-\end_layout
-
-\begin_layout Enumerate
-Copyright the software, and 
-\end_layout
-
-\begin_layout Enumerate
-Offer you this license which gives you legal permission to copy, distribute
- and/or modify the software.
-\end_layout
-
-\begin_layout Standard
-Also, for each author's protection and ours, we want to make certain that
- everyone understands that there is no warranty for this free software.
- If the software is modified by someone else and passed on, we want its
- recipients to know that what they have is not the original, so that any
- problems introduced by others will not reflect on the original authors'
- reputations.
-\end_layout
-
-\begin_layout Standard
-Finally, any free program is threatened constantly by software patents.
- We wish to avoid the danger that redistributors of a free program will
- individually obtain patent licenses, in effect making the program proprietary.
- To prevent this, we have made it clear that any patent must be licensed
- for everyone's free use or not licensed at all.
- 
-\end_layout
-
-\begin_layout Standard
-The precise terms and conditions for copying, distribution and modification
- follow.
-\end_layout
-
-\begin_layout Section*
-GNU GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION
- AND MODIFICATION 
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-begin{itemize}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-item[0.]
-\end_layout
-
-\end_inset
-
-This License applies to any program or other work which contains a notice
- placed by the copyright holder saying it may be distributed under the terms
- of this General Public License.
- The ``Program'' below refers to any such program or work, and a ``work
- based on the Program'' means either the Program or any derivative work
- under copyright law: that is to say, a work containing the Program or a
- portion of it, either verbatim or with modifications and/or translated
- into another language.
- (Hereinafter, translation is included without limitation in the term ``modifica
-tion.'') Each licensee is addressed as ``you.''
-\newline
-
-\newline
-Activities other than copying,
- distribution and modification are not covered by this License; they are
- outside its scope.
- The act of running the Program is not restricted, and the output from the
- Program is covered only if its contents constitute a work based on the
- Program (independent of having been made by running the Program).
- Whether that is true depends on what the Program does.
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-end{itemize}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Enumerate
-You may copy and distribute verbatim copies of the Program's source code
- as you receive it, in any medium, provided that you conspicuously and appropria
-tely publish on each copy an appropriate copyright notice and disclaimer
- of warranty; keep intact all the notices that refer to this License and
- to the absence of any warranty; and give any other recipients of the Program
- a copy of this License along with the Program.
- 
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-You may charge a fee for the physical act of transferring a copy, and you
- may at your option offer warranty protection in exchange for a fee.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-You may modify your copy or copies of the Program or any portion of it,
- thus forming a work based on the Program, and copy and distribute such
- modifications or work under the terms of Section 1 above, provided that
- you also meet all of these conditions: 
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-You must cause the modified files to carry prominent notices stating that
- you changed the files and the date of any change.
- 
-\end_layout
-
-\begin_layout Enumerate
-You must cause any work that you distribute or publish, that in whole or
- in part contains or is derived from the Program or any part thereof, to
- be licensed as a whole at no charge to all third parties under the terms
- of this License.
- 
-\end_layout
-
-\begin_layout Enumerate
-If the modified program normally reads commands interactively when run,
- you must cause it, when started running for such interactive use in the
- most ordinary way, to print or display an announcement including an appropriate
- copyright notice and a notice that there is no warranty (or else, saying
- that you provide a warranty) and that users may redistribute the program
- under these conditions, and telling the user how to view a copy of this
- License.
- (Exception: if the Program itself is interactive but does not normally
- print such an announcement, your work based on the Program is not required
- to print an announcement.) 
-\end_layout
-
-\begin_layout Standard
-These requirements apply to the modified work as a whole.
- If identifiable sections of that work are not derived from the Program,
- and can be reasonably considered independent and separate works in themselves,
- then this License, and its terms, do not apply to those sections when you
- distribute them as separate works.
- But when you distribute the same sections as part of a whole which is a
- work based on the Program, the distribution of the whole must be on the
- terms of this License, whose permissions for other licensees extend to
- the entire whole, and thus to each and every part regardless of who wrote
- it.
- 
-\end_layout
-
-\begin_layout Standard
-Thus, it is not the intent of this section to claim rights or contest your
- rights to work written entirely by you; rather, the intent is to exercise
- the right to control the distribution of derivative or collective works
- based on the Program.
- 
-\end_layout
-
-\begin_layout Standard
-In addition, mere aggregation of another work not based on the Program with
- the Program (or with a work based on the Program) on a volume of a storage
- or distribution medium does not bring the other work under the scope of
- this License.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-You may copy and distribute the Program (or a work based on it, under Section
- 2) in object code or executable form under the terms of Sections 1 and
- 2 above provided that you also do one of the following: 
-\end_layout
-
-\begin_deeper
-\begin_layout Enumerate
-Accompany it with the complete corresponding machine-readable source code,
- which must be distributed under the terms of Sections 1 and 2 above on
- a medium customarily used for software interchange; or, 
-\end_layout
-
-\begin_layout Enumerate
-Accompany it with a written offer, valid for at least three years, to give
- any third party, for a charge no more than your cost of physically performing
- source distribution, a complete machine-readable copy of the corresponding
- source code, to be distributed under the terms of Sections 1 and 2 above
- on a medium customarily used for software interchange; or, 
-\end_layout
-
-\begin_layout Enumerate
-Accompany it with the information you received as to the offer to distribute
- corresponding source code.
- (This alternative is allowed only for noncommercial distribution and only
- if you received the program in object code or executable form with such
- an offer, in accord with Subsection b above.) 
-\end_layout
-
-\begin_layout Standard
-The source code for a work means the preferred form of the work for making
- modifications to it.
- For an executable work, complete source code means all the source code
- for all modules it contains, plus any associated interface definition files,
- plus the scripts used to control compilation and installation of the executable.
- However, as a special exception, the source code distributed need not include
- anything that is normally distributed (in either source or binary form)
- with the major components (compiler, kernel, and so on) of the operating
- system on which the executable runs, unless that component itself accompanies
- the executable.
-\end_layout
-
-\begin_layout Standard
-If distribution of executable or object code is made by offering access
- to copy from a designated place, then offering equivalent access to copy
- the source code from the same place counts as distribution of the source
- code, even though third parties are not compelled to copy the source along
- with the object code.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-You may not copy, modify, sublicense, or distribute the Program except as
- expressly provided under this License.
- Any attempt otherwise to copy, modify, sublicense or distribute the Program
- is void, and will automatically terminate your rights under this License.
- However, parties who have received copies, or rights, from you under this
- License will not have their licenses terminated so long as such parties
- remain in full compliance.
- 
-\end_layout
-
-\begin_layout Enumerate
-You are not required to accept this License, since you have not signed it.
- However, nothing else grants you permission to modify or distribute the
- Program or its derivative works.
- These actions are prohibited by law if you do not accept this License.
- Therefore, by modifying or distributing the Program (or any work based
- on the Program), you indicate your acceptance of this License to do so,
- and all its terms and conditions for copying, distributing or modifying
- the Program or works based on it.
- 
-\end_layout
-
-\begin_layout Enumerate
-Each time you redistribute the Program (or any work based on the Program),
- the recipient automatically receives a license from the original licensor
- to copy, distribute or modify the Program subject to these terms and conditions.
- You may not impose any further restrictions on the recipients' exercise
- of the rights granted herein.
- You are not responsible for enforcing compliance by third parties to this
- License.
- 
-\end_layout
-
-\begin_layout Enumerate
-If, as a consequence of a court judgment or allegation of patent infringement
- or for any other reason (not limited to patent issues), conditions are
- imposed on you (whether by court order, agreement or otherwise) that contradict
- the conditions of this License, they do not excuse you from the conditions
- of this License.
- If you cannot distribute so as to satisfy simultaneously your obligations
- under this License and any other pertinent obligations, then as a consequence
- you may not distribute the Program at all.
- For example, if a patent license would not permit royalty-free redistribution
- of the Program by all those who receive copies directly or indirectly through
- you, then the only way you could satisfy both it and this License would
- be to refrain entirely from distribution of the Program.
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-If any portion of this section is held invalid or unenforceable under any
- particular circumstance, the balance of the section is intended to apply
- and the section as a whole is intended to apply in other circumstances.
-\end_layout
-
-\begin_layout Standard
-It is not the purpose of this section to induce you to infringe any patents
- or other property right claims or to contest validity of any such claims;
- this section has the sole purpose of protecting the integrity of the free
- software distribution system, which is implemented by public license practices.
- Many people have made generous contributions to the wide range of software
- distributed through that system in reliance on consistent application of
- that system; it is up to the author/donor to decide if he or she is willing
- to distribute software through any other system and a licensee cannot impose
- that choice.
- 
-\end_layout
-
-\begin_layout Standard
-This section is intended to make thoroughly clear what is believed to be
- a consequence of the rest of this License.
- 
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-If the distribution and/or use of the Program is restricted in certain countries
- either by patents or by copyrighted interfaces, the original copyright
- holder who places the Program under this License may add an explicit geographic
-al distribution limitation excluding those countries, so that distribution
- is permitted only in or among countries not thus excluded.
- In such case, this License incorporates the limitation as if written in
- the body of this License.
- 
-\end_layout
-
-\begin_layout Enumerate
-The Free Software Foundation may publish revised and/or new versions of
- the General Public License from time to time.
- Such new versions will be similar in spirit to the present version, but
- may differ in detail to address new problems or concerns.
- 
-\end_layout
-
-\begin_deeper
-\begin_layout Standard
-Each version is given a distinguishing version number.
- If the Program specifies a version number of this License which applies
- to it and ``any later version,'' you have the option of following the terms
- and conditions either of that version or of any later version published
- by the Free Software Foundation.
- If the Program does not specify a version number of this License, you may
- choose any version ever published by the Free Software Foundation.
-\end_layout
-
-\end_deeper
-\begin_layout Enumerate
-If you wish to incorporate parts of the Program into other free programs
- whose distribution conditions are different, write to the author to ask
- for permission.
- For software which is copyrighted by the Free Software Foundation, write
- to the Free Software Foundation; we sometimes make exceptions for this.
- Our decision will be guided by the two goals of preserving the free status
- of all derivatives of our free software and of promoting the sharing and
- reuse of software generally.
- 
-\end_layout
-
-\begin_layout Subsection*
-NO WARRANTY 
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-begin{itemize}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-item[11.]
-\end_layout
-
-\end_inset
-
-BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR
- THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
- EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER
- PARTIES PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER
- EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
- OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
- THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH
- YOU.
- SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY
- SERVICING, REPAIR OR CORRECTION.
- 
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-item[12.]
-\end_layout
-
-\end_inset
-
-IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL
- ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE
- THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING
- ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF
- THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS
- OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR
- THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
- EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY
- OF SUCH DAMAGES.
-\end_layout
-
-\begin_layout Standard
-\begin_inset ERT
-status collapsed
-
-\begin_layout Standard
-
-
-\backslash
-end{itemize}
-\end_layout
-
-\end_inset
-
-
-\end_layout
-
-\begin_layout Section*
-END OF TERMS AND CONDITIONS 
-\end_layout
-
-\begin_layout Subsection*
-How to Apply These Terms to Your New Programs
-\end_layout
-
-\begin_layout Standard
-If you develop a new program, and you want it to be of the greatest possible
- use to the public, the best way to achieve this is to make it free software
- which everyone can redistribute and change under these terms.
- 
-\end_layout
-
-\begin_layout Standard
-To do so, attach the following notices to the program.
- It is safest to attach them to the start of each source file to most effectivel
-y convey the exclusion of warranty; and each file should have at least the
- ``copyright'' line and a pointer to where the full notice is found.
- For example:
-\end_layout
-
-\begin_layout Quote
-One line to give the program's name and a brief idea of what it does.
- Copyright 
-\size footnotesize
-© (
-\size default
-year) (name of author) 
-\end_layout
-
-\begin_layout Quote
-This program is free software; you can redistribute it and/or modify it
- under the terms of the GNU General Public License as published by the Free
- Software Foundation; either version 2 of the License, or (at your option)
- any later version.
- 
-\end_layout
-
-\begin_layout Quote
-This program is distributed in the hope that it will be useful, but WITHOUT
- ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
- FOR A PARTICULAR PURPOSE.
- See the GNU General Public License for more details.
- 
-\end_layout
-
-\begin_layout Quote
-You should have received a copy of the GNU General Public License along
- with this program; if not, write to the Free Software Foundation, Inc.,
- 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 
-\end_layout
-
-\begin_layout Standard
-Also add information on how to contact you by electronic and paper mail.
- 
-\end_layout
-
-\begin_layout Standard
-If the program is interactive, make it output a short notice like this when
- it starts in an interactive mode: 
-\end_layout
-
-\begin_layout Quote
-Gnomovision version 69, Copyright © year name of author Gnomovision comes
- with ABSOLUTELY NO WARRANTY; for details type `show w'.
- This is free software, and you are welcome to redistribute it under certain
- conditions; type `show c' for details.
- 
-\end_layout
-
-\begin_layout Standard
-The hypothetical commands `show w' and `show c' should show the appropriate
- parts of the General Public License.
- Of course, the commands you use may be called something other than `show
- w' and `show c'; they could even be mouse-clicks or menu items -- whatever
- suits your program.
- 
-\end_layout
-
-\begin_layout Standard
-You should also get your employer (if you work as a programmer) or your
- school, if any, to sign a ``copyright disclaimer'' for the program, if
- necessary.
- Here is a sample; alter the names: 
-\end_layout
-
-\begin_layout Quote
-Yoyodyne, Inc., hereby disclaims all copyright interest in the program `Gnomovisi
-on' (which makes passes at compilers) written by James Hacker.
- 
-\end_layout
-
-\begin_layout Quote
-(signature of Ty Coon)
-\newline
-1 April 1989 
-\newline
-Ty Coon, President of Vice 
-\end_layout
-
-\begin_layout Standard
-This General Public License does not permit incorporating your program into
- proprietary programs.
- If your program is a subroutine library, you may consider it more useful
- to permit linking proprietary applications with the library.
- If this is what you want to do, use the GNU Library General Public License
- instead of this License.
-\end_layout
-
-\end_body
-\end_document

Modified: seismo/3D/SPECFEM3D_SESAME/trunk/compute_forces.f90
===================================================================
--- seismo/3D/SPECFEM3D_SESAME/trunk/compute_forces.f90	2009-01-22 21:32:01 UTC (rev 13921)
+++ seismo/3D/SPECFEM3D_SESAME/trunk/compute_forces.f90	2009-01-22 22:15:26 UTC (rev 13922)
@@ -205,9 +205,9 @@
 
 ! sum contributions from each element to the global mesh using indirect addressing
           iglob = ibool(i,j,k,ispec)
-          accel(1,iglob) = accel(1,iglob) - (fac1*newtempx1(i,j,k) + fac2*newtempx2(i,j,k) + fac3*newtempx3(i,j,k))
-          accel(2,iglob) = accel(2,iglob) - (fac1*newtempy1(i,j,k) + fac2*newtempy2(i,j,k) + fac3*newtempy3(i,j,k))
-          accel(3,iglob) = accel(3,iglob) - (fac1*newtempz1(i,j,k) + fac2*newtempz2(i,j,k) + fac3*newtempz3(i,j,k))
+          accel(1,iglob) = accel(1,iglob) - fac1*newtempx1(i,j,k) - fac2*newtempx2(i,j,k) - fac3*newtempx3(i,j,k)
+          accel(2,iglob) = accel(2,iglob) - fac1*newtempy1(i,j,k) - fac2*newtempy2(i,j,k) - fac3*newtempy3(i,j,k)
+          accel(3,iglob) = accel(3,iglob) - fac1*newtempz1(i,j,k) - fac2*newtempz2(i,j,k) - fac3*newtempz3(i,j,k)
 
         enddo
       enddo



More information about the CIG-COMMITS mailing list