Hotfix: Fixing incompatibility with updated SPECFEM2D parameter file #197
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Issue
An update to the SPECFEM2D parameter file (dev branch) broke the function that gets and sets velocity model parameters in the Par_file. Previously this function relied on looking for parameters above and below the model (since the model did not follow the standard key=val structure), however the parameter below the model changed so the function no longer worked. Anyways this was pretty hardcoded so was in need of an update.
Solution
Function has been updated to now look for file lines matching the structure of the SPECFEM2D velocity model. An internal function
_getidx_vel_model
was written to be used by both getter and setter. The SeisFlows command line tool as updated accordingly and this was tested on both master and devel branches of SPECFEM2D and retains the same behavior as before. This should work fine until SPECFEM decides to change the structure of those lines!Relevant Issues/PRs
#194 #196
ChangeLog
_getidx_vel_model
in order to read from the parameter file