Table of Contents

Adjoint Simulations

How to obtain finite sensitivity kernels

  1. Run a forward simulation:

    • SIMULATION_TYPE = 1

    • SAVE_FORWARD = .true.

    • seismotype = 1 (we need to save the displacement fields to later on derive the adjoint source. Note: if the user forgets it, the program corrects it when reading the proper SIMULATION_TYPE and SAVE_FORWARD combination and a warning message appears in the output file)

    Important output files (for example, for the elastic case, P-SV waves):

    • absorb_elastic_bottom*****.bin

    • absorb_elastic_left*****.bin

    • absorb_elastic_right*****.bin

    • absorb_elastic_top*****.bin

    • lastframe_elastic*****.bin

    • AA.S****.BXX.semd

    • AA.S****.BXZ.semd

  2. Define the adjoint source:

    • Use adj_seismogram.f90

    • Edit to update NSTEP, nrec, t0, deltat, and the position of the cut to pick any given phase if needed (tstart,tend), add the right number of stations, and put one component of the source to zero if needed.

    • The output files of adj_seismogram.f90 are AA.S****.BXX.adj and AA.S****.BXZ.adj, for P-SV waves (and AA.S****.BXY.adj, for SH (membrane) waves). Note that you will need these three files (AA.S****.BXX.adj, AA.S****.BXY.adj and AA.S****.BXZ.adj) to be present in the SEM/ directory together with the absorb_elastic_****.bin and lastframe_elastic.bin files to be read when running the adjoint simulation.

  3. Run the adjoint simulation:

    • Make sure that the adjoint source files absorbing boundaries and last frame files are in the OUTPUT_FILES/ directory.

    • SIMULATION_TYPE = 3

    • SAVE_FORWARD = .false.

    Output files (for example for the elastic case):

    • snapshot_rho_kappa_mu*****

    • snapshot_rhop_alpha_beta*****

    which are the primary moduli kernels and the phase velocities kernels respectively, in ascii format and at the local level, that is as “kernels(i,j,ispec)”.

Remarks about adjoint runs and solving inverse problems

SPECFEM2D can produce the gradient of the misfit function for a tomographic inversion, but options for using the gradient within an iterative inversion are left to the user (e.g., conjugate-gradient, steepest descent). The plan is to include some examples in the future.

The algorithm is simple:

  1. calculate the forward wave field $\mathbf{s}(x,t)$

  2. calculate the adjoint wave field $\mathbf{s}^\dagger(x,t)$

  3. calculate their interaction $\mathbf{s}(x,t) \cdot \mathbf{s}^\dagger(x,T-t)$ (these symbolic, temporal and spatial derivatives should be included)

  4. integrate the interactions, which is summation in the code.

That is all. Step 3 has some tricks in implementation, but which can be skipped by regular users.

If you look into SPECFEM2D, besides “rhop_ac_kl” and “rho_ac_kl”, there are more variables such as “kappa_ac_kl” and “rho_el_kl” etc. “rho” denotes density $\rho$ (“kappa” for bulk modulus $\kappa$ etc.), “ac” denotes acoustic (“el” for elastic), “kl” means kernel (and you may find “k” as well, which is the interaction at each time step, i.e., before doing time integration).

Caution

Please note that:

  • at the moment, adjoint simulations do not support anisotropy, attenuation, and viscous damping.

  • you will need AA.S****.BXX.adj, AA.S****.BXY.adj and AA.S****.BXZ.adj to be present in directory SEM/ even if you are just running an acoustic or poroelastic adjoint simulation.

  • AA.S****.BXX.adj is the only relevant component for an acoustic case.

  • AA.S****.BXX.adj and AA.S****.BXZ.adj are the only relevant components for a poroelastic case.


This documentation has been automatically generated by pandoc based on the User manual (LaTeX version) in folder doc/USER_MANUAL/ (Dec 20, 2023)