[CIG-SEISMO] need help with define_external_model.f90 in specfem2D

Alexis Bottero alexis.bottero at gmail.com
Mon Mar 20 06:01:25 PDT 2017


Hi Ignazio,
Sorry for the delay, I was in holidays. Doing what you want to do in
specfem2d is easy. To set an arbitrary velocity model you have to 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.

In your case vp, vs and rho will be 2D arrays, you have to modify that.

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

Please keep me informed!

Cheers,


Alexis Bottero, PhD student
Tel: +0033 6 95 17 00 97
Waves and imaging
Laboratoire de Mécanique et d'Acoustique de Marseille

2017-03-09 17:28 GMT+01:00 Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>:

>
> Hi Ignazio, Hi all,
>
> I think Alexis will know the answer because he actively uses SPECFEM2D,
> including for external models :-)
>
> Best wishes,
> Dimitri.
>
>
> On 03/09/2017 05:21 PM, ignazio damiani wrote:
>
>> Dear all,
>> I'm using specfem2D and I'm trying to assign an external velocity model.
>> The aim is to create a model with lateral variation of seismic wave
>> velocities and density.
>>  I'm trying to use define_external_model.f90 file but even though I
>> suppress the routine for the AK135F, the function doesn't work.
>> I always get the same error:
>>
>> External model: ak135-f
>>>  STOP wrong flag number
>>>
>>
>> This is what i'm doing:
>> firstly, i set in Par_file MODEL=external.
>> Secondly, in read_external_model.f90 i set: case ('external') call
>> define_external_model_dummy().
>>
>>> And finally in define_external_model.f90 i leave the subroutine as
>>> define_external_model_dummy(), i suppress the AK135F routine and i modify
>>> the number of material_element(ispec) based on my coordinates and region.
>>> What's wrong? because it remains the error.
>>>
>>
>> Thanks for your help.
>> Thanks Dimitri for the help and for giving me your email.
>>
>> Best regards
>>
>> Ignazio Damiani
>> --
>> Msc in Exploration and Applied Geophysics. Pisa. Italy
>>
>>
> --
> Dimitri Komatitsch, CNRS Research Director (DR CNRS)
> Laboratory of Mechanics and Acoustics, Marseille, France
> http://komatitsch.free.fr
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.geodynamics.org/pipermail/cig-seismo/attachments/20170320/858d1e7a/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: createTomographyFile.py
Type: text/x-python
Size: 3092 bytes
Desc: not available
URL: <http://lists.geodynamics.org/pipermail/cig-seismo/attachments/20170320/858d1e7a/attachment.py>


More information about the CIG-SEISMO mailing list