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
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