Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Hotfix: Fixing incompatibility with updated SPECFEM2D parameter file #197

Merged
merged 2 commits into from
Mar 1, 2024

Conversation

bch0w
Copy link
Member

@bch0w bch0w commented Mar 1, 2024

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

  • Updates SPECFEM tool to be more flexible with finding velocity models in SPECFEM2D Par_files by checking line structure rather than bounding parameters which caused this break
  • getpar_vel_model and setpar_vel_model now both call an internal function _getidx_vel_model in order to read from the parameter file
  • command line tool has been updated to retain the same behavior as previously

@bch0w bch0w merged commit 6afdd56 into master Mar 1, 2024
@bch0w bch0w deleted the hotfix-specfem2d_vel_model branch March 1, 2024 02:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant