adjtomo / seisflows

An automated workflow tool for full waveform inversion and adjoint tomography
http://seisflows.readthedocs.org
BSD 2-Clause "Simplified" License
172 stars 122 forks source link

Specfem2d's Par_file composition changed #196

Closed mnagaso closed 4 months ago

mnagaso commented 4 months ago

Hi @bch0w,

I've just tried to run the first example and noticed that there was a problem on reading model parameters from Par_file. This modification had been actually done by me for the changed Par_file of Specfem2D but it was actually just a deviation.

ref: https://github.com/SPECFEM/specfem2d/commit/1f8aba4ada63bdc23f30cbdc782dadd5988a0aef

So I re-modified to be back to the initial state of the code.

Thank you very much again for your support,

bch0w commented 4 months ago

Hi @mnagaso, good point, I think the conflict here is that the devel branch of SPECFEM2D has an updated parameter file which is causing some issue in this function

In the master branch the line following the velocity models is TOMOGRAPHY_FILE, https://github.com/SPECFEM/specfem2d/blob/98741db1a0c8082ca57364f5b17ea95df6cbf1c2/DATA/Par_file#L263-L269

whereas in the devel branch it is interfacesfile. https://github.com/SPECFEM/specfem2d/blob/32c78395c19151e8a7483b0703c6fc9d97b14491/DATA/Par_file#L295-L301

I think maybe we may need to just restructure this function to be more flexible as it's currently a bit too hardcoded for my liking. I have an idea in mind regarding validating on the structure of the velocity model line (rather than the next parameter), let me see if I can implement that.

bch0w commented 4 months ago

Hi @mnagaso, I think this should be fixed by #197 (master) and in the latest devel commits. Let me know if you run into any issue there!

mnagaso commented 4 months ago

Thank you very much ! @bch0w Yes I find your update which finds the model parameter lines by 15 successive numerical values. This is a much better way and strong against a reconstruction of Specfem's Par_file. I totally agree with this update.