Skip to Content

Run this example

Working directory and configuration

Run all commands from tests/toy_example_tele after building SpecFWAT:

cd tests/toy_example_tele

Use the full example parameter file. The relevant settings are:

TELE: TELE_TYPE: 1 SUPPRESS_STF: False SAVE_FK: True POSTPROC: INV_TYPE: [False, True, False] MODEL_UPDATE: OPT_METHOD: 2 ITER_START: 0 DO_LS: False

This excerpt selects teleseismic waveform difference, FK injection (the default), and fixed-step L-BFGS updates. The model is meshed with 8 MPI processes. The forward-data generation step uses the supplied per-event src_rec/STF_*.sac files. Waveform measurements estimate an STF from the observed and synthetic waveforms internally; that is a separate operation from generating the target observations.

Generate synthetic data

Run 00_forward.sh to generate synthetic teleseismic waveforms using the target model. The FK plane-wave boundary conditions are applied at the mesh boundaries for each event defined in src_rec/sources_tele.dat. The synthetic data is saved in the fwat_data folder.

00_forward.sh
#!/bin/bash set -e rm -rf OUTPUT_FILES mkdir -p DATABASES_MPI mkdir -p OUTPUT_FILES NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2 | cut -d \# -f 1` # Copy target model and run forward simulation cp target_model.h5 DATA/tomo_files/tomography_model.h5 mpirun -np $NPROC ../../bin/xfwat_mesh_databases -s tele mpirun -np $NPROC ../../bin/xfwat_fwd_measure_adj -m M00 -s tele -r 1

The -s tele flag activates the teleseismic mode in SpecFWAT, which reads FKmodel_* files from src_rec/ and injects plane-wave boundary conditions computed by the FK method. The source time function (STF) estimation is handled internally during the measurement step.

Conduct the inversion

Run 01_run_this_test.sh for 10 model updates (M00 through M09). If all updates complete, optimizing M09 produces optimize/model_M10.h5. Each iteration consists of meshing, forward simulation with measurement and adjoint source computation, post-processing, and model update.

01_run_this_test.sh
#!/bin/bash set -e rm -rf OUTPUT_FILES mkdir -p DATABASES_MPI mkdir -p OUTPUT_FILES NPROC=`grep ^NPROC DATA/Par_file | grep -v -E '^[[:space:]]*#' | cut -d = -f 2 | cut -d \# -f 1` # Run inversion for 10 iterations for it in `seq 0 9`; do model=`printf "M%02d" $it` if [ $it -eq 0 ]; then cp initial_model.h5 DATA/tomo_files/tomography_model.h5 fi mpirun -np $NPROC ../../bin/xfwat_mesh_databases -s tele mpirun -np $NPROC ../../bin/xfwat_fwd_measure_adj -m $model -s tele -r 3 mpirun -np $NPROC ../../bin/xfwat_post_proc -m $model mpirun -np $NPROC ../../bin/xfwat_optimize -m $model done

The -r 3 flag enables forward simulation, measurement, and adjoint simulation in a single call. Kernels from all 8 events are summed during post-processing (xfwat_post_proc) before the model is updated by the L-BFGS optimizer (xfwat_optimize).

See the source forward script , inversion script , and example parameters .

Last updated on