[CIG-SEISMO] problem to read external velocity model

Alexis Bottero alexis.bottero at gmail.com
Wed Nov 21 14:58:49 PST 2018


Hi all,

Sorry for the delay. I don't know the option "legacy" of the Par_file, it
is not one of mine and it may take me quite a while to understand its
problem. However setting an arbitrary velocity model from an external file
is easy in specfem2d. It is described in the manual. You can use the option
TOMOGRAPHY_FILE that I have implemented and that you have to set like that
in the Par_file when you define the velocity model:

2 -1 9999 9999 9999 9999 9999 9999 9999 0 0 0 0 0 0

# external tomography file
TOMOGRAPHY_FILE                 = ./profile.xyz

The program understand that the velocity model number 2 has to be read in
the file profile.xyz as a regular grid. It will then deal with the
interpolation. You can set what you want in place of the 9999, it does not
matter.
The file profile.xyz has to be written under the following format:

  ! The xyz file TOMOGRAPHY_FILE that describe the tomography should be
located in the TOMOGRAPHY_PATH
  ! directory, set in the Par_file. The format of the file, as read from
define_external_model_from_xyz_file.f90 looks like :
  !
  ! ORIGIN_X ORIGIN_Z END_X END_Z
  ! SPACING_X SPACING_Z
  ! NX NZ
  ! VP_MIN VP_MAX VS_MIN VS_MAX RHO_MIN RHO_MAX
  ! x(1) z(1) vp vs rho
  ! x(2) z(1) vp vs rho
  ! ...
  ! x(NX) z(1) vp vs rho
  ! x(1) z(2) vp vs rho
  ! x(2) z(2) vp vs rho
  ! ...
  ! x(NX) z(2) vp vs rho
  ! x(1) z(3) vp vs rho
  ! ...
  ! ...
  ! x(NX) z(NZ) vp vs rho
  !
  ! Where :
  ! _x and z must be increasing
  ! _ORIGIN_X, END_X are, respectively, the coordinates of the initial and
final tomographic
  !  grid points along the x direction (in meters)
  ! _ORIGIN_Z, END_Z are, respectively, the coordinates of the initial and
final tomographic
  !  grid points along the z direction (in meters)
  ! _SPACING_X, SPACING_Z are the spacing between the tomographic grid
points along the x
  !  and z directions, respectively (in meters)
  ! _NX, NZ are the number of grid points along the spatial directions x
and z,
  !  respectively; NX is given by [(END_X - ORIGIN_X)/SPACING_X]+1; NZ is
the same as NX, but
  !  for z direction.
  ! _VP_MIN, VP_MAX, VS_MIN, VS_MAX, RHO_MIN, RHO_MAX are the minimum and
maximum values of
  !  the wave speed vp and vs (in m.s-1) and of the density rho (in
kg.m-3); these values
  !  could be the actual limits of the tomographic parameters in the grid
or the minimum
  !  and maximum values to which we force the cut of velocity and density
in the model.
  ! _After these first four lines, in the file file_name the tomographic
grid points are
  !  listed with the corresponding values of vp, vs and rho, scanning the
grid along the x
  !  coordinate (from ORIGIN_X to END_X with step of SPACING_X) for each
given z (from ORIGIN_Z
  !  to END_Z, with step of SPACING_Z).

I send you a working script writing such file for a 1D profile (velocity
depending just on depth). Read carefully all the comments but in particular
the lines containing "!!WARNING!!" that I have added for you.

run ./createTomographyFile.py and look at the file profile.xyz created.

If you have 2D variations vp, vs and rho will be 2D arrays, you will have
to modify that.

For the moment just one model can be read from an external file but it is
not very difficult to change that. Likewise viscoelastic parameters can not
vary with position for now.

Please keep me informed!

Cheers,

Alexis Bottero, PhD
Tel: +0033 6 95 17 00 97
Waves and imaging


Le mar. 20 nov. 2018 à 10:06, Pilar Sánchez <psanchez at ictja.csic.es> a
écrit :

> Hello Alexis,
>
> The files are just an example of the external model file that is needed
> when we choose the option "legacy" in the Par_file. We took them from the
> example folders. In the old version, the two first columns are the
> coordinates distributed in an easily understandable order. In the new
> version though, we don't understand the logic of the number series of the
> first two columns and then, we can't create the right external model file
> to run specfem. If you could explain it, that would be very helpful :)
>
> Thank you in advance,
>
> Regards,
>
> Pilar.
>
> El lun., 19 nov. 2018 a las 17:00, Alexis Bottero (<
> alexis.bottero at gmail.com>) escribió:
>
>> Hello all,
>> I did wrote this part of the code but I have not modified it for years.
>> Maybe someone else changed this... this is weird because everything worked
>> well! I will have a look. Can you please send me back the two files you
>> were mentionning in your previous mail. For some reasons I have never got
>> them.
>>
>> Thank you very much
>>
>> Alexis Bottero
>>
>>
>> Le lun. 19 nov. 2018 à 10:10, Obermann Anne Christine <
>> anne.obermann at sed.ethz.ch> a écrit :
>>
>>> Dear all,
>>> We have never received an answer and would still be very interested in
>>> it!!!
>>> Cheers,
>>> Anne
>>>
>>> On 12/09/18 19:19, "Dimitri Komatitsch" <komatitsch at lma.cnrs-mrs.fr>
>>> wrote:
>>>
>>>
>>>     Hi Anne and Pilar, Hi all,
>>>
>>>     Alexis Bottero (cc'ed) will know the answer, he defends his PhD
>>> tomorrow
>>>     :-) thus I guess he won't answer this week but next week should be
>>> OK.
>>>     Paul Cristini may also know, thus let me cc him as well.
>>>
>>>     Best wishes,
>>>     Dimitri.
>>>
>>>     On 09/12/2018 10:19 AM, Obermann  Anne Christine wrote:
>>>     > Dear Specfem developers,
>>>     >
>>>     > Using the new version of SPECFEM2D Cartesian 7.0, we encounter a
>>> problem
>>>     > reading an external velocity model.
>>>     >
>>>     > Attached, we send you two files, OLD_Model worked well with the
>>> older
>>>     > specfem releases (6.1) and the NEW_Model is an example we found
>>> for the
>>>     > new version on your site. The structure of the files is apparently
>>>     > different.
>>>     >
>>>     > We have trouble understanding the NEW_Model structure. The counter
>>> on
>>>     > the left is interrupted at several occasions (1:25, followed by 5
>>> etc).
>>>     > Could you please let us know what this column represents?
>>>     >
>>>     > Which option do we have to choose in the Par_file? (external or
>>> legacy?)
>>>     >
>>>     > Thank you very much!
>>>     >
>>>     > Anne and Pilar
>>>     >
>>>     > ————————————————————
>>>     >
>>>     > Dr. Anne Obermann
>>>     >
>>>     > Senior Researcher
>>>     >
>>>     > Swiss Seismological Service
>>>     >
>>>     > ETH, NO H63, Sonneggstrasse 5, CH-8092 Zurich
>>>     >
>>>     > Tel. +41446337647
>>>     >
>>>     > anne.obermann at sed.ethz.ch <mailto:anne.obermann at sed.ethz.ch>
>>>     >
>>>     >
>>>     >
>>>     > _______________________________________________
>>>     > CIG-SEISMO mailing list
>>>     > CIG-SEISMO at geodynamics.org
>>>     > http://lists.geodynamics.org/cgi-bin/mailman/listinfo/cig-seismo
>>>     >
>>>
>>>     --
>>>     Dimitri Komatitsch, CNRS Research Director (DR CNRS)
>>>     Laboratory of Mechanics and Acoustics, Marseille, France
>>>     http://komatitsch.free.fr
>>>
>>>
>>>
>
> --
> *Pilar Sánchez Sánchez-Pastor*
> PhD Student
> ICTJA-CSIC
> c/ Sole i Sabaris sn, 08028 - Barcelona
> Tel.: +34 93 409 54 10 Ext.: 262
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/cig-seismo/attachments/20181121/0c3147a8/attachment.html>


More information about the CIG-SEISMO mailing list