This fork represents the status of repository SPECFEM3D_Cartesian_for_ASKI as of December 2016, when Florian Schumacher (@schumf) left the ASKI development team. It is not intended to be modified.
Extension package for ASKI: use SPECFEM3D_Cartesian for solving the seismic forward problem
SPECFEM3D_Cartesian for ASKI, as well as ASKI and some of its components, documentation and examples are available under terms of the GNU General Public License (version 2 or higher) via github. Please find contact addresses there, or visit http://www.rub.de/aski in case you want to get in touch with the authors. If you encounter any problems installing or using the software, it will be helpful to open (or add to) an "issues" topic at the respective repository on gitHub (e.g. here for the ASKI main package)
The main author is Florian Schumacher, Ruhr-University Bochum, Germany.
Read the manual for information on how to set parameters correctly and how to use SPECFEM3D_Cartesian as a forward solver for ASKI.
-
You require an installation of the ASKI main package:
git clone --depth 1 --branch master https://github.com/seismology-RUB/ASKI
The directory created by the git clone command will be referred to below as
ASKI/
-
You need a functioning installation of the SPECFEM3D_Cartesian code, including modifications for usage with ASKI:
- You can either use the basic extract from the SPECFEM3D_Cartesian master branch (by November 2015) that comes with this package in subdirectory specfem3d/
- or use your running installation of SPECFEM3D_Cartesian and extend it for usage with ASKI (see "Extend regular SPECFEM3D" below).
Also refer to the manual, sections 1.3, 1.4.
In both cases, you still must install this package (item "Installation" below).
-
You need basic experience in using the regular SPECFEM3D_Cartesian software!
You should clone the latest version of the master branch of the
gitHub repository
to the same directory where you have cloned the ASKI main package to (in the
ASKI documentation
exemplarily called /your/programs/
). That is, make sure that the git clone command
git clone --depth 1 --branch master https://github.com/seismology-RUB/SPECFEM3D_Cartesian_for_ASKI
creates the directory /your/programs/SPECFEM3D_Cartesian_for_ASKI
(also referred to
below simply as SPECFEM3D_Cartesian_for_ASKI/
) and ASKI was installed to directory
/your/programs/ASKI
(also referred to below simply as ASKI/
) .
You need to compile few more ASKI binaries:
-
in SPECFEM3D_Cartesian_for_ASKI/Makefile, set
COMPILER
appropriately, adjustFFLAGS
if required and set the variablesBLAS
,LAPACK
, just as you did for installing the ASKI main package -
Execute command
make all
from path
SPECFEM3D_Cartesian_for_ASKI/
.
After that, ASKI/bin/
should contain the new binaries.
If you have a regular SPECFEM3D_Cartesian installation which has the required functionality, you may modify your installation for usage with ASKI in the following way. This procedure was tested for SPECFEM3D_Cartesian (master branch by 7 Nov 2015), extended by two important modifications which were commited to the devel branch on 3 september 2015, or are about to be commited by the developers team:
- src/specfem3D/setup_sources_receivers.f90,
subroutine
setup_sources()
, line 180 :
removingUSE_FORCE_POINT_SOURCE .or.
from the if-clause, i.e. execute (re)definition oft0
only in case ofUSE_RICKER_TIME_FUNCTION == .true.
- src/specfem3D/compute_add_sources_viscoelastic.f90:
always call functioncomp_source_time_function_gauss()
with half durationhdur_gaussian(isource)
instead of fixed value of5.d0*DT
If your regular SPECFEM3D_Cartesian installation has this functionality, you can extend it for ASKI by the following 12 steps:
-
install SPECFEM3D_Cartesian on your system and make it run, gain experience in using it (below, the installation path is refered to as
specfem3d/
) -
copy file SPECFEM3D_Cartesian_for_ASKI/specfem3D_for_ASKI.f90 to
specfem3d/src/specfem3D/
-
replace file
specfem3d/src/generate_databases/model_external_values.f90
by SPECFEM3D_Cartesian_for_ASKI/model_external_values.f90 -
append content of file SPECFEM3D_Cartesian_for_ASKI/parallel_ASKI.f90 to file
specfem3d/src/shared/parallel.f90
-
append content of file SPECFEM3D_Cartesian_for_ASKI/specfem3D_par_ASKI.f90 to file
specfem3d/src/specfem3D/specfem3D_par.f90
-
in
specfem3d/src/specfem3D/rules.mk
:
add the following line into the definition ofspecfem3D_OBJECTS
(e.g. before line with$(EMPTY_MACRO)
)$O/specfem3D_for_ASKI.spec.o \
(be aware that the above line must start with an actual TAB character in order to conform to the GNU-make syntax)
-
in
specfem3d/src/specfem3D/prepare_timerun.F90
in subroutineprepare_timerun
:
add the following line at the end of the subroutine, before the statistics output is written to main output file by rank 0:call prepare_timerun_ASKI()
-
in
specfem3d/src/specfem3D/iterate_time.F90
in subroutineiterate_time
:
add the following line just before the "enddo" of the time loopcall write_ASKI_output()
-
in
specfem3d/src/specfem3D/finalize_simulation.f90
in subroutinefinalize_simulation
:
add the following line just before the main output file is closed at the end of the subroutinecall save_ASKI_output()
-
Set
USE_SOURCES_RECVS_Z = .true.
inspecfem3d/setup/constants.h
(or wherever your file constants.h is located). -
recompile all SPECFEM3D binaries by executing
make
in directory
specfem3d/
-
in order to produce ASKI output in SPECFEM3D simulations, copy file SPECFEM3D_Cartesian_for_ASKI/Par_file_ASKI to your respective
DATA/
path (which is e.g.specfem3d/EXAMPLES/my_example/DATA/
, orspecfem3d/DATA/
). This file must be adjusted for any specific simulation (just as all other parameter files), refer to the manual on how to use it.
Additionally, you may refer to the manual section 1.4 for details on extending a regular SPECFEM3D code copy for use with ASKI.