This bug only affects the Noise Inversion workflow.
During this workflow, forward arrays were not saved, leading to each forward simulation overwriting forward arrays
This results to one of the horizontal component (E, because code hardcodes E to run before N) adjoint simulations using the incorrect forward arrays, which creates incorrect kernels.
Does not affect ZZ kernels because the Z component forward and adjoint simulations occur concurrently
Does effect RR and TT kernels because N and E forward simulations must be run prior to N and E adjoint simulations, so all E component kernels (ER, ET) are incorrect.
Fix
During a Noise Inversion only, forward arrays are saved after N component and E component forward simulations
Correct forward arrays are imported to the solver directory during the corresponding adjoint simulations
This PR also contains some additional logging updates and internal structural changes to accommodate this fix.
Changelog
Main Fix
Solver defines filename wildcards for requisite forward array files that are used for adjoint simulations. These are used to save forward arrays during noise inversion workflow
Solver.forward_simulation() now has new parameter save_forward_arrays that User can use to specify location to save arrays relative to the solver working directory. Should not be required for other workflows
Solver.adjoint_simulation() now has the ability to load_forward_arrays by specifying path which should correspond to the forward simulation save_forward_arrays parameter.
Solver.adjoint_simulation() has the ability to del_loaded_forward_arrays to free up memory after adjoint simulation completes successfully
Misc.
Solver executables for each version of SPECFEM (2D/3D/3D_GLOBE) are now defined as internal variables in __init__ rather than at the top of each corresponding function, making it clearer and easier to overwrite
API Change: change default directory name path_data=='waveforms' (previously 'data') to avoid confusion with SPECFEM DATA/ directory and SeisFlows SFDATA/ directory.
Workflow.NoiseInversion class now check sfor correct SPECFEM parameter that mandates using forcesolutions
Work In Progress: Started writing machinery for generating combined adjoint kernel but this is incomplete and will throw a NotImplementedError
Preprocess modules now logs a 'completed' statement to make it clear that the process has finished successfully
Modified additional log messages for brevity or to stand out more in the main log file
Issue
Fix
Changelog
Main Fix
save_forward_arrays
that User can use to specify location to save arrays relative to the solver working directory. Should not be required for other workflowsload_forward_arrays
by specifying path which should correspond to the forward simulation save_forward_arrays parameter.del_loaded_forward_arrays
to free up memory after adjoint simulation completes successfullyMisc.
__init__
rather than at the top of each corresponding function, making it clearer and easier to overwritepath_data=='waveforms'
(previously 'data') to avoid confusion with SPECFEM DATA/ directory and SeisFlows SFDATA/ directory.