Dear all and Dr.Pieyre,<br><br>I have got two problems about the number of spectral elements in the vertical direction and TOPOGRAPHY in the DATA/Par-file, which were in course of running of meshfem3D and generate_databases, respectively.<br>


Here, I show my steps as follows:<br>1. using meshfem3D to get proc*_Database based on my four processing cores computer;<br>2. uploading proc*_Databases to DATABASES_MPI directory on TS10000 cluster;<br>3. making generate_databases and submitting xgenerate_databases by PBS script;<br>


<br>In the step 1, I modified the file Par_file in meshfem3D/DATA and interfaces.dat to build my model. Of course, files such as constants.h, interface2.dat and topo_bathy_final.dat were modified accordingly. I found that I couldn&#39;t modify the number of spectral elements in the vertical direction in file interfaces.dat, in which the original value of bottom layer and top layer was 11 and 4, respectively. If I modified the two parameters in interfaces.dat, NZ_DOUGLING_1, #NZ_BEGIN and #NZ_END were also modified to match the value in interfaces.dat. If the number of spectral elements in the vertical direction was changed, the executing of &quot;mpiexec -np 4 ./xmeshfem3D&quot; got SIGSEGV error. In case of no change of number of spectral elements in the vertical direction, the xmeshfem3D was executed normally.<br>


<br>In the step 3, if TOPTGRAPHY was changed from .false. to .true., the executing of xgenerate_databases got SIGSEGV error too. The error information is:<br>&quot;rank 2 in job 6  cnode06_48509   caused collective abort of all ranks<br>


  exit status of rank 2: killed by signal 11 <br>rank 0 in job 6  cnode06_48509   caused collective abort of all ranks<br>  exit status of rank 0: killed by signal 9&quot;.<br><br>In order to present more details about the two problems, the configuration files of meshfem3D and generate_databases are listed here, respectively. <br>

-----------------------------------------------meshfem3D-----------------------------------------------------------------<br>constants.h:<br><br>! constants.h.  Generated from <a href="http://constants.h.in" target="_blank">constants.h.in</a> by configure.<br>

<br>!<br>! solver in single or double precision depending on the machine (4 or 8 bytes)<br>!<br>! ALSO CHANGE FILE precision.h ACCORDINGLY<br>!<br>  integer, parameter :: SIZE_REAL = 4<br>  integer, parameter :: SIZE_DOUBLE = 8<br>

<br>! set to SIZE_REAL to run in single precision<br>! set to SIZE_DOUBLE to run in double precision (increases memory size by 2)<br>  integer, parameter :: CUSTOM_REAL = SIZE_REAL<br><br>!----------- parameters that can be changed by the user -----------<br>

<br>! set to .false.  if running on a Beowulf-type machine with local disks<br>! set to .true. if running on a shared-memory machine with common file system<br>! if running on a Beowulf, also modify name of nodes in filter_machine_file.f90<br>

  logical, parameter :: LOCAL_PATH_IS_ALSO_GLOBAL = .false.<br><br>! apply heuristic rule to modify doubling regions to balance angles<br>  logical, parameter :: APPLY_HEURISTIC_RULE = .true.<br><br>! input, output and main MPI I/O files<br>

  integer, parameter :: ISTANDARD_OUTPUT = 6<br>  integer, parameter :: IIN = 40,IOUT = 41<br>! uncomment this to write messages to a text file<br>  integer, parameter :: IMAIN = 42<br>! uncomment this to write messages to the screen<br>

! integer, parameter :: IMAIN = ISTANDARD_OUTPUT<br>! I/O unit for source and receiver vtk file<br>  integer, parameter :: IOVTK = 98<br>! I/O unit for interface file<br>  integer, parameter :: IIN_INTERFACES = 43<br><br>

! ignore variable name field (junk) at the beginning of each input line<br>  logical, parameter :: IGNORE_JUNK = .true.,DONT_IGNORE_JUNK = .false.<br><br>! minimum thickness in meters to include the effect of the oceans<br>

! to avoid taking into account spurious oscillations in topography model<br>!  double precision, parameter :: MINIMUM_THICKNESS_3D_OCEANS = 10.d0<br><br>! min and max density in the model<br>!  double precision, parameter :: DENSITY_MAX = 3000.d0<br>

!  double precision, parameter :: DENSITY_MIN = 2000.d0<br><br>! density of sea water<br>!  real(kind=CUSTOM_REAL), parameter :: RHO_OCEANS = 1020.0<br><br>! depth at which we start to honor the basement interface<br>!  double precision, parameter :: Z_THRESHOLD_HONOR_BASEMENT = -4700.d0<br>

<br>! ---------------------------------------------------------------------------------------<br>! LQY -- Following 3 variables stays here temporarily,<br>!        we need to move them to Par_file at a proper time<br>! ---------------------------------------------------------------------------------------<br>

! save moho mesh and compute Moho boundary kernels<br>!  logical, parameter :: SAVE_MOHO_MESH = .false.<br><br>!------------------------------------------------------<br>!----------- do not modify anything below -------------<br>

!------------------------------------------------------<br><br>! on some processors (e.g. Pentiums) it is necessary to suppress underflows<br>! by using a small initial field instead of zero<br>  logical, parameter :: FIX_UNDERFLOW_PROBLEM = .true.<br>

<br>! some useful constants<br>  double precision, parameter :: PI = 3.141592653589793d0<br>  double precision, parameter :: TWO_PI = 2.d0 * PI<br><br>! 3-D simulation<br>  integer, parameter :: NDIM = 3<br><br>! dimension of the boundaries of the slices<br>

  integer, parameter :: NDIM2D = 2<br><br>! number of nodes for 2D and 3D shape functions for hexahedra<br>! we use 8-node mesh bricks, which are more stable than 27-node elements<br>  integer, parameter :: NGNOD = 8, NGNOD2D = 4<br>

<br>! a few useful constants<br>  double precision, parameter :: ZERO = 0.d0,ONE = 1.d0,TWO = 2.d0,HALF = 0.5d0<br><br>  real(kind=CUSTOM_REAL), parameter :: &amp;<br>    ONE_THIRD   = 1._CUSTOM_REAL/3._CUSTOM_REAL, &amp;<br>

    FOUR_THIRDS = 4._CUSTOM_REAL/3._CUSTOM_REAL<br><br>! very large and very small values<br>  double precision, parameter :: HUGEVAL = 1.d+30,TINYVAL = 1.d-9<br><br>! very large real value declared independently of the machine<br>

  real(kind=CUSTOM_REAL), parameter :: HUGEVAL_SNGL = 1.e+30_CUSTOM_REAL<br><br>! very large integer value<br>  integer, parameter :: HUGEINT = 100000000<br><br>! define flag for elements<br>  integer, parameter :: IFLAG_ONE_LAYER_TOPOGRAPHY = 1<br>

  integer, parameter :: IFLAG_BASEMENT_TOPO = 2<br>  integer, parameter :: IFLAG_16km_BASEMENT = 3<br>  integer, parameter :: IFLAG_MOHO_16km = 4<br>  integer, parameter :: IFLAG_HALFSPACE_MOHO = 5<br><br>! define flag for regions for attenuation<br>

  integer, parameter :: NUM_REGIONS_ATTENUATION = 13<br><br>  integer, parameter :: IATTENUATION_SEDIMENTS_40 = 1<br>  integer, parameter :: IATTENUATION_SEDIMENTS_50 = 2<br>  integer, parameter :: IATTENUATION_SEDIMENTS_60 = 3<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_70 = 4<br>  integer, parameter :: IATTENUATION_SEDIMENTS_80 = 5<br>  integer, parameter :: IATTENUATION_SEDIMENTS_90 = 6<br>  integer, parameter :: IATTENUATION_SEDIMENTS_100 = 7<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_110 = 8<br>  integer, parameter :: IATTENUATION_SEDIMENTS_120 = 9<br>  integer, parameter :: IATTENUATION_SEDIMENTS_130 = 10<br>  integer, parameter :: IATTENUATION_SEDIMENTS_140 = 11<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_150 = 12<br>  integer, parameter :: IATTENUATION_BEDROCK = 13<br><br>! Olsen&#39;s constant for Q_mu = constant * v_s attenuation rule<br>  real, parameter :: OLSEN_ATTENUATION_RATIO = 0.05<br>

<br>! number of standard linear solids in parallel for attenuation<br>  integer, parameter :: N_SLS = 3<br><br>! flag for the four edges of each slice and for the bottom edge<br>  integer, parameter :: XI_MIN = 1<br>  integer, parameter :: XI_MAX = 2<br>

  integer, parameter :: ETA_MIN = 3<br>  integer, parameter :: ETA_MAX = 4<br>  integer, parameter :: BOTTOM = 5<br><br>! number of GLL points not set in the mesher, do not modify this value <br>  integer, parameter :: NGLLX = 2<br>

  integer, parameter :: NGLLY = NGLLX<br>  integer, parameter :: NGLLZ = NGLLX<br><br>! number of points per surface element<br>  integer, parameter :: NGLLSQUARE = NGLLX * NGLLY<br><br>! number of points per spectral element<br>

  integer, parameter :: NGLLCUBE = NGLLX * NGLLY * NGLLZ<br><br>! for vectorization of loops<br>  integer, parameter :: NGLLSQUARE_NDIM = NGLLSQUARE * NDIM<br>  integer, parameter :: NGLLCUBE_NDIM = NGLLCUBE * NDIM<br><br>

! flag for projection from latitude/longitude to UTM, and back<br>  integer, parameter :: ILONGLAT2UTM = 0, IUTM2LONGLAT = 1<br><br>! smallest real number on the Pentium and the SGI =  1.1754944E-38<br>! largest real number on the Pentium and the SGI  =  3.4028235E+38<br>

! small negligible initial value to avoid very slow underflow trapping<br>! but not too small to avoid trapping on velocity and acceleration in Newmark<br>  real(kind=CUSTOM_REAL), parameter :: VERYSMALLVAL = 1.E-24_CUSTOM_REAL<br>

<br>! displacement threshold above which we consider the code became unstable<br>  real(kind=CUSTOM_REAL), parameter :: STABILITY_THRESHOLD = 1.E+25_CUSTOM_REAL<br><br>! geometrical tolerance for boundary detection<br>  double precision, parameter :: SMALLVAL = 0.00001d0<br>

<br>! do not use tags for MPI messages, use dummy tag instead<br>  integer, parameter :: itag = 0,itag2 = 0<br><br>! for the Gauss-Lobatto-Legendre points and weights<br>  double precision, parameter :: GAUSSALPHA = 0.d0,GAUSSBETA = 0.d0<br>

<br>! number of lines per source in CMTSOLUTION file<br>  integer, parameter :: NLINES_PER_CMTSOLUTION_SOURCE = 13<br><br>! number of iterations to solve the system for xi and eta<br>  integer, parameter :: NUM_ITER = 4<br>

<br>! size of topography and bathymetry file for Southern California<br><u>  integer, parameter :: NX_TOPO_SOCAL = 6001,NY_TOPO_SOCAL = 4001<br>  double precision, parameter :: ORIG_LAT_TOPO_SOCAL = 30.d0<br>  double precision, parameter :: ORIG_LONG_TOPO_SOCAL = 102.d0<br>

  double precision, parameter :: DEGREES_PER_CELL_TOPO_SOCAL = 2.d0 / 4000.d0<br>  character(len=100), parameter :: TOPO_FILE_SOCAL = &#39;DATA/la_topography/topo_bathy_final.dat&#39;</u><br><br>! size of Lupei Zhu&#39;s Moho map file for Southern California<br>

  integer, parameter :: NX_MOHO = 71,NY_MOHO = 51<br>  double precision, parameter :: ORIG_LAT_MOHO = 32.d0<br>  double precision, parameter :: ORIG_LONG_MOHO = -121.d0<br>  double precision, parameter :: DEGREES_PER_CELL_MOHO = 0.1d0<br>

<br>! size of basement map file<br>  integer, parameter :: NX_BASEMENT = 161,NY_BASEMENT = 144<br>  double precision, parameter :: ORIG_X_BASEMENT = 316000.<br>  double precision, parameter :: ORIG_Y_BASEMENT = 3655000.<br>

  double precision, parameter :: SPACING_X_BASEMENT = 1000.<br>  double precision, parameter :: SPACING_Y_BASEMENT = 1000.<br><br>!<br>! new Gocad Voxets Peter July 29, 2002 - high-res and medium-res blocks<br>!<br><br>! size of the medium-resolution Gocad voxet<br>

  integer, parameter :: NX_GOCAD_MR = 194, NY_GOCAD_MR = 196, NZ_GOCAD_MR = 100<br><br>  double precision, parameter :: ORIG_X_GOCAD_MR = 283000.<br>  double precision, parameter :: ORIG_Y_GOCAD_MR = 3655000.<br>  double precision, parameter :: ORIG_Z_GOCAD_MR = -15000.<br>

<br>  double precision, parameter :: SPACING_X_GOCAD_MR = 1000.<br>  double precision, parameter :: SPACING_Y_GOCAD_MR = 1000.<br>  double precision, parameter :: SPACING_Z_GOCAD_MR = 200.<br><br>! maximum size of model for tapering of transition between Hauksson and MR<br>

  double precision, parameter :: END_X_GOCAD_MR = ORIG_X_GOCAD_MR + SPACING_X_GOCAD_MR * (NX_GOCAD_MR - 1)<br>  double precision, parameter :: END_Y_GOCAD_MR = ORIG_Y_GOCAD_MR + SPACING_Y_GOCAD_MR * (NY_GOCAD_MR - 1)<br>
<br>
! size of the high-resolution Gocad voxet<br>  integer, parameter :: NX_GOCAD_HR = 185, NY_GOCAD_HR = 196, NZ_GOCAD_HR = 100<br><br>  double precision, parameter :: ORIG_X_GOCAD_HR = 371052.25<br>  double precision, parameter :: ORIG_Y_GOCAD_HR = 3725250.<br>

  double precision, parameter :: ORIG_Z_GOCAD_HR = -9500.<br><br>  double precision, parameter :: SPACING_X_GOCAD_HR = 250.<br>  double precision, parameter :: SPACING_Y_GOCAD_HR = 250.<br>  double precision, parameter :: SPACING_Z_GOCAD_HR = 100.<br>

<br>! maximum size of model for tapering of transition between HR and MR<br>  double precision, parameter :: END_X_GOCAD_HR = ORIG_X_GOCAD_HR + SPACING_X_GOCAD_HR * (NX_GOCAD_HR - 1)<br>  double precision, parameter :: END_Y_GOCAD_HR = ORIG_Y_GOCAD_HR + SPACING_Y_GOCAD_HR * (NY_GOCAD_HR - 1)<br>

<br>! implement smooth transition between Hauksson, HR and MR Gocad blocks<br>  logical, parameter :: TAPER_GOCAD_TRANSITIONS = .true.<br><br>!  Salton Sea Gocad voxet<br>  integer, parameter :: GOCAD_ST_NU = 638, GOCAD_ST_NV = 219, GOCAD_ST_NW = 76<br>

  double precision, parameter :: GOCAD_ST_O_X = 720844.0, GOCAD_ST_O_Y = 3401799.250, &amp;<br>    GOCAD_ST_O_Z =      -6354.334<br>  double precision, parameter :: GOCAD_ST_U_X = -209197.89, GOCAD_ST_U_Y =  320741.71<br>

  double precision, parameter :: GOCAD_ST_V_X = 109670.74, GOCAD_ST_V_Y = 71530.72<br>  double precision, parameter :: GOCAD_ST_W_Z =  7666.334<br>  double precision, parameter :: GOCAD_ST_NO_DATA_VALUE = -99999<br><br>!<br>

!--- larger Hauksson model for entire So-Cal, 15 km resolution<br>!<br><br>! number of non-constant layers<br>  integer, parameter :: NLAYERS_HAUKSSON = 9<br>! depth of layers<br>  double precision, parameter :: Z_HAUKSSON_LAYER_1 =  -1000.d0<br>

  double precision, parameter :: Z_HAUKSSON_LAYER_2 =  -4000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_3 =  -6000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_4 = -10000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_5 = -15000.d0<br>

  double precision, parameter :: Z_HAUKSSON_LAYER_6 = -17000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_7 = -22000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_8 = -31000.d0<br>  double precision, parameter :: Z_HAUKSSON_LAYER_9 = -33000.d0<br>

<br>  integer, parameter :: NGRID_NEW_HAUKSSON = 201<br><br>! corners of new Hauksson&#39;s interpolated grid<br>  double precision, parameter :: UTM_X_ORIG_HAUKSSON = 122035.012d0<br>  double precision, parameter :: UTM_X_END_HAUKSSON  = 766968.628d0<br>

  double precision, parameter :: UTM_Y_ORIG_HAUKSSON = 3547232.986d0<br>  double precision, parameter :: UTM_Y_END_HAUKSSON  = 4098868.501d0<br><br>  double precision, parameter :: SPACING_UTM_X_HAUKSSON = (UTM_X_END_HAUKSSON - UTM_X_ORIG_HAUKSSON) / (NGRID_NEW_HAUKSSON-1.d0)<br>

  double precision, parameter :: SPACING_UTM_Y_HAUKSSON = (UTM_Y_END_HAUKSSON - UTM_Y_ORIG_HAUKSSON) / (NGRID_NEW_HAUKSSON-1.d0)<br><br>! layers in the So-Cal regional model<br>! DEPTH_MOHO_SOCAL = -35 km was based on Dreger and Helmberger (1990)<br>

! and is (July 2007) the preferred Moho depth for Dreger.<br>! The depth of 32 km is used in the standard processing (Wald et al., 1995)<br>! of SoCal events and is the value in the original Kanamori-Hadley (1975) model.<br>

  double precision, parameter :: DEPTH_5p5km_SOCAL = -5500.d0<br>  double precision, parameter :: DEPTH_16km_SOCAL = -16000.d0<br>  double precision, parameter :: DEPTH_MOHO_SOCAL = -32000.d0<br><br>! reference surface of the model before adding topography<br>

  double precision, parameter :: Z_SURFACE = 0.d0<br><br>! number of points in each AVS or OpenDX quadrangular cell for movies<br>  integer, parameter :: NGNOD2D_AVS_DX = 4<br><br>! magic ratio for heuristic rule<br>! this gives 120 degree angles in doubling<br>

! standard value 0.5 gives 135-135-90, which is not optimal<br>  double precision, parameter :: MAGIC_RATIO = 0.6056d0<br><br>! type of elements for heuristic rule<br>  integer, parameter :: ITYPE_UNUSUAL_1  = 1<br>  integer, parameter :: ITYPE_UNUSUAL_1p = 2<br>

  integer, parameter :: ITYPE_UNUSUAL_4  = 3<br>  integer, parameter :: ITYPE_UNUSUAL_4p = 4<br><br>! define number of spectral elements and points in basic symmetric mesh doubling superbrick<br>  integer, parameter :: NSPEC_DOUBLING_SUPERBRICK = 32<br>

  integer, parameter :: NGLOB_DOUBLING_SUPERBRICK = 67<br>  integer, parameter :: NSPEC_SUPERBRICK_1L = 28<br>  integer, parameter :: NGLOB_SUPERBRICK_1L = 58<br>  integer, parameter :: NGNOD_EIGHT_CORNERS = 8<br>------------------<br>

Par_file:<br># coordinates of mesh block in latitude/longitude and depth in km<br><u>LATITUDE_MIN                    = 31.d0<br>LATITUDE_MAX                    = 31.2d0<br>LONGITUDE_MIN                   = 103.1d0<br>LONGITUDE_MAX                   = 103.6d0<br>

DEPTH_BLOCK_KM                  = 30.d0<br>UTM_PROJECTION_ZONE             = 48<br>SUPPRESS_UTM_PROJECTION         = .false.<br></u><br># file that contains the interfaces of the model / mesh<br>INTERFACES_FILE                 = interfaces.dat<br>

<br># number of elements at the surface along edges of the mesh at the surface<br># (must be 8 * multiple of NPROC below if mesh is not regular and contains mesh doublings)<br># (must be multiple of NPROC below if mesh is regular)<br>

<u>NEX_XI                          = 256<br>NEX_ETA                         = 256</u><br><br># number of MPI processors along xi and eta (can be different)<br>NPROC_XI                        = 2 <br>NPROC_ETA                       = 2<br>

<br># Regular/irregular mesh <br>USE_REGULAR_MESH                = .false.<br># Only for irregular meshes, number of doubling layers (1 or 2) and their position<br>NDOUBLINGS                      = 1<br># NZ_DOUGLING_1 is the parameter to set up if there is only one doubling layer <br>

<u>NZ_DOUGLING_1                   = 11 </u><br>NZ_DOUGLING_2                   = 0<br><br># create mesh files for visualisation or further checking<br>CREATE_ABAQUS_FILES             = .false.<br>CREATE_DX_FILES                 = .false.<br>

<br># anticipated time step for simulation (in order to check the stability condition)<br>DT                              = 0.01<br><br># path to store the databases files <br>LOCAL_PATH                      = OUTPUT_FILES<br>

<br># number of materials<br>NMATERIALS                      = 2  <br># define the different materials in the model as :<br># #material_id  #rho  #vp  #vs  #Q_flag  #anisotropy_flag #domain_id<br>#     Q_flag           : 0=no attenuation/1=IATTENUATION_SEDIMENTS_40, 2=..., 13=IATTENUATION_BEDROCK<br>

#     anisotropy_flag  : 0=no anisotropy/ 1,2,.. check with implementation in aniso_model.f90<br>#     domain_id        : 1=acoustic / 2=elastic / 3=poroelastic<br>1  1200  1500  750  1  0  2<br>2  1100  1600  800  3  0  2<br>

# 3  1000  1500  0    0  0  2<br># 4  1300  1400  700  2  0  3<br># number of regions <br>NREGIONS                        = 2             <br># define the different regions of the model as :<br>#NEX_XI_BEGIN  #NEX_XI_END  #NEX_ETA_BEGIN  #NEX_ETA_END  #NZ_BEGIN #NZ_END  #material_id<br>

1              64            1               64             <u>1         11</u>       1<br>1              64            1               64             <u>12        15 </u>      2<br>#1              64            1               64             1         4        1<br>

#1              64            1               64             5         5        2<br>#1              64            1               64             6         15       3<br>#14             25            7               19             7         10       4<br>

--------------------<br>interfaces.dat:<br># number of interfaces<br> 2<br>#<br># We describe each interface below, structured as a 2D-grid, with several parameters : <br># number of points along XI and ETA, minimal XI ETA coordinates <br>

# and spacing between points which must be constant.<br># Then the records contain the Z coordinates of the NXI x NETA points.<br>#<br># interface number 1 <br># SUPPRESS_UTM_PROJECTION  NXI  NETA LONG_MIN   LAT_MIN    SPACING_XI SPACING_ETA<br>

 .true.                    161  144  316000.d0  3655000.d0 20000.d0    20000.d0<br> interface1.dat<br># interface number 2 (topography, top of the mesh)<br> .false. 6001 4001 102.d0 30.d0 0.0005d0 0.0005d0<br> interface2.dat<br>

#<br># for each layer, we give the number of spectral elements in the vertical direction<br># layer number 1 (bottom layer)<br><u> 11</u><br># layer number 2 (top layer)<br> <u>4</u><br>------------------------------------------------------------------------------------------------------------------------------------------<br>

---------------------------------------------------generate_databases----------------------------------------------------------<br><span style="font-size: 10pt; line-height: 125%; color: red;"><span style="color: rgb(0, 0, 0);"></span><font color="#000000">
  constants.h<br><br>! constants.h.  Generated from <a href="http://constants.h.in" target="_blank">constants.h.in</a> by configure.<br><br>!<br>! solver in single or double precision depending on the machine (4 or 8 bytes)<br>
!<br>! ALSO CHANGE FILE precision.h ACCORDINGLY<br>
!<br>  integer, parameter :: SIZE_REAL = 4<br>  integer, parameter :: SIZE_DOUBLE = 8<br><br>! usually the size of integer and logical variables is the same as regular single-precision real variable<br>  integer, parameter :: SIZE_INTEGER = SIZE_REAL<br>

  integer, parameter :: SIZE_LOGICAL = SIZE_REAL<br><br>! set to SIZE_REAL to run in single precision<br>! set to SIZE_DOUBLE to run in double precision (increases memory size by 2)<br>  integer, parameter :: CUSTOM_REAL = SIZE_REAL<br>

<br>!----------- parameters that can be changed by the user -----------<br><br>! set to .false.  if running on a Beowulf-type machine with local disks<br>! set to .true. if running on a shared-memory machine with common file system<br>

! if running on a Beowulf, also modify name of nodes in filter_machine_file.f90<br>  logical, parameter :: LOCAL_PATH_IS_ALSO_GLOBAL = .false.<br><br>! adds/superimposes velocity model values from &#39;model_external_values.f90&#39;<br>

  logical, parameter :: USE_MODEL_EXTERNAL_VALUES = .false.<br><br>! use inlined products of Deville et al. (2002) to speedup the calculations to compute internal forces<br>  logical, parameter :: USE_DEVILLE_PRODUCTS = .true.<br>

<br>! number of GLL points in each direction of an element (degree plus one)<br>  integer, parameter :: NGLLX = 5<br>  integer, parameter :: NGLLY = NGLLX<br>  integer, parameter :: NGLLZ = NGLLX<br><br>! number of points per surface element<br>

  integer, parameter :: NGLLSQUARE = NGLLX * NGLLY<br><br>! for optimized routines by Deville et al. (2002)<br>  integer, parameter :: m1 = NGLLX, m2 = NGLLX * NGLLY<br><br>! input, output and main MPI I/O files<br>  integer, parameter :: ISTANDARD_OUTPUT = 6<br>

  integer, parameter :: IIN = 40,IOUT = 41<br>! uncomment this to write messages to a text file<br>  integer, parameter :: IMAIN = 42<br>! uncomment this to write messages to the screen<br>! integer, parameter :: IMAIN = ISTANDARD_OUTPUT<br>

! I/O unit for source and receiver vtk file<br>  integer, parameter :: IOVTK = 98<br>! I/O unit for absorbing boundary snapshots<br>  integer, parameter :: IOABS = 31<br>  integer, parameter :: IOABS_AC = 32<br>! I/O unit for plotting source time function<br>

  integer, Parameter :: IOSTF = 71<br>  <br>! flag to print the details of source location<br>  logical, parameter :: SHOW_DETAILS_LOCATE_SOURCE = .false.<br><br>! maximum length of station and network name for receivers<br>

  integer, parameter :: MAX_LENGTH_STATION_NAME = 32<br>  integer, parameter :: MAX_LENGTH_NETWORK_NAME = 8<br><br>! number of sources to be gathered by MPI_Gather<br>  integer, parameter :: NGATHER_SOURCES = 10000<br><br>

! we mimic a triangle of half duration equal to half_duration_triangle<br>! using a Gaussian having a very close shape, as explained in Figure 4.2<br>! of the manual. This source decay rate to mimic an equivalent triangle<br>

! was found by trial and error<br>  double precision, parameter :: SOURCE_DECAY_MIMIC_TRIANGLE = 1.628d0<br><br>! decide if master process writes all the seismograms or if all processes do it in parallel<br>  logical, parameter :: WRITE_SEISMOGRAMS_BY_MASTER = .false.<br>

<br>! use directory OUTPUT_FILES/ for seismogram output  <br>  logical,parameter :: USE_OUTPUT_FILES_PATH = .true.<br><br>! absorb top surface <br>! (defined in mesh as &#39;free_surface_file&#39;)<br>  logical,parameter :: ABSORB_FREE_SURFACE = .false.<br>

<br>! absorb boundaries using a PML region <br>! (EXPERIMENTAL feature)<br>! (only acoustic domains supported...)<br>! (user parameters can be specified in PML_init.f90)<br>  logical,parameter :: ABSORB_USE_PML = .false.<br>

<br>! ---------------------------------------------------------------------------------------<br>! LQY -- Following 3 variables stays here temporarily,<br>!        we need to move them to Par_file at a proper time<br>! ---------------------------------------------------------------------------------------<br>

! save moho mesh and compute Moho boundary kernels<br>  logical, parameter :: SAVE_MOHO_MESH = .false.<br><br>! number of steps to save the state variables in the forward simulation,<br>! to be used in the backward reconstruction in the presence of attenuation<br>

  integer, parameter :: NSTEP_Q_SAVE = 200<br><br>! the scratch disk to save the state variables saved in the forward<br>! simulation, this can be a global scratch disk in case you run out of<br>! space on the local scratch disk<br>

  character(len=256), parameter :: LOCAL_PATH_Q = &#39;/home/lover/DATABASES_MPI_Q/&#39;<br><br>!------------------------------------------------------<br>! nlegoff -- Variables that should be read/computed elsewhere.<br>

!            Temporarily declared here.<br>!------------------------------------------------------<br><br>! no lagrange interpolation on seismograms (we take the value on one NGLL point)<br>  logical, parameter :: FASTER_RECEIVERS_POINTS_ONLY = .false.<br>

<br>! use a force source located exactly at a grid point instead of a CMTSOLUTION source<br>! this can be useful e.g. for oil industry foothills simulations or asteroid simulations<br>! in which the source is a vertical force, normal force, impact etc.<br>

  logical, parameter :: USE_FORCE_POINT_SOURCE = .false.<br>  double precision, parameter :: FACTOR_FORCE_SOURCE = 1.d10<br><br>! the receivers can be located inside the model <br>  logical, parameter :: RECVS_CAN_BE_BURIED_EXT_MESH = .true.<br>

  logical, parameter :: SOURCES_CAN_BE_BURIED_EXT_MESH = .true.<br><br>! the seismograms are normal to surface<br>! Z record corresponds to the normal, while E and N are two tangent vectors <br>! that completes an orthonormal.<br>

  logical, parameter :: EXT_MESH_RECV_NORMAL = .false.<br><br>! shakemaps and movies can not be generated during the same run. Mutually exclusive.<br>  logical, parameter :: EXTERNAL_MESH_MOVIE_SURFACE = .false.<br>  logical, parameter :: EXTERNAL_MESH_CREATE_SHAKEMAP = .false.<br>

<br>! plots VTK cross-section planes instead of model surface <br>! (EXPERIMENTAL feature)<br>! (requires EXTERNAL_MESH_MOVIE_SURFACE set to true)<br>  logical, parameter :: PLOT_CROSS_SECTIONS = .false.<br>  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_X = 67000.0<br>

  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Y = 65500.0<br>  real(kind=CUSTOM_REAL),parameter :: CROSS_SECTION_Z = -30000.0  <br><br>! plots GIF cross-section image <br>! (EXPERIMENTAL feature)<br>! (cross-section plane parameters can be specified in write_PNM_GIF_data.f90)<br>

  logical, parameter :: PNM_GIF_IMAGE = .false.<br><br>! number of nodes per element as provided by the external mesh<br>  integer, parameter :: ESIZE = 8<br><br>! geometry tolerance parameter to calculate number of independent grid points<br>

! sensitive to actual size of model, assumes reference sphere of radius 1<br>! this is an absolute value for normalized coordinates in the Earth<br>  double precision, parameter :: SMALLVAL_TOL = 1.d-10<br><br>!------------------------------------------------------<br>

!----------- do not modify anything below -------------<br>!------------------------------------------------------<br><br>! on some processors (e.g. Pentiums) it is necessary to suppress underflows<br>! by using a small initial field instead of zero<br>

  logical, parameter :: FIX_UNDERFLOW_PROBLEM = .true.<br><br>! some useful constants<br>  double precision, parameter :: PI = 3.141592653589793d0<br>  double precision, parameter :: TWO_PI = 2.d0 * PI<br><br>! 3-D simulation<br>

  integer, parameter :: NDIM = 3<br><br>! dimension of the boundaries of the slices<br>  integer, parameter :: NDIM2D = 2<br><br>! number of nodes for 2D and 3D shape functions for hexahedra<br>! we use 8-node mesh bricks, which are more stable than 27-node elements<br>

  integer, parameter :: NGNOD = 8, NGNOD2D = 4<br><br>! a few useful constants<br>  double precision, parameter :: ZERO = 0.d0,ONE = 1.d0,TWO = 2.d0,HALF = 0.5d0<br><br>  real(kind=CUSTOM_REAL), parameter :: &amp;<br>    ONE_THIRD   = 1._CUSTOM_REAL/3._CUSTOM_REAL, &amp;<br>

    FOUR_THIRDS = 4._CUSTOM_REAL/3._CUSTOM_REAL<br><br>! very large and very small values<br>  double precision, parameter :: HUGEVAL = 1.d+30,TINYVAL = 1.d-9<br><br>! very large real value declared independently of the machine<br>

  real(kind=CUSTOM_REAL), parameter :: HUGEVAL_SNGL = 1.e+30_CUSTOM_REAL<br>  real(kind=CUSTOM_REAL), parameter :: TINYVAL_SNGL = 1.e-25_CUSTOM_REAL<br><br>! very large integer value<br>  integer, parameter :: HUGEINT = 100000000<br>

<br>! define flag for regions for attenuation<br>  integer, parameter :: NUM_REGIONS_ATTENUATION = 13<br><br>  integer, parameter :: IATTENUATION_SEDIMENTS_40 = 1<br>  integer, parameter :: IATTENUATION_SEDIMENTS_50 = 2<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_60 = 3<br>  integer, parameter :: IATTENUATION_SEDIMENTS_70 = 4<br>  integer, parameter :: IATTENUATION_SEDIMENTS_80 = 5<br>  integer, parameter :: IATTENUATION_SEDIMENTS_90 = 6<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_100 = 7<br>  integer, parameter :: IATTENUATION_SEDIMENTS_110 = 8<br>  integer, parameter :: IATTENUATION_SEDIMENTS_120 = 9<br>  integer, parameter :: IATTENUATION_SEDIMENTS_130 = 10<br>

  integer, parameter :: IATTENUATION_SEDIMENTS_140 = 11<br>  integer, parameter :: IATTENUATION_SEDIMENTS_150 = 12<br>  integer, parameter :: IATTENUATION_BEDROCK = 13<br><br>! Olsen&#39;s constant for Q_mu = constant * v_s attenuation rule<br>

  real, parameter :: OLSEN_ATTENUATION_RATIO = 0.05<br><br>! number of standard linear solids in parallel for attenuation<br>  integer, parameter :: N_SLS = 3<br><br>! define flag for regions for anisotropy<br>  integer, parameter :: IANISOTROPY_MODEL1 = 1<br>

  integer, parameter :: IANISOTROPY_MODEL2 = 2  <br><br>! smallest real number on the Pentium and the SGI =  1.1754944E-38<br>! largest real number on the Pentium and the SGI  =  3.4028235E+38<br>! small negligible initial value to avoid very slow underflow trapping<br>

! but not too small to avoid trapping on velocity and acceleration in Newmark<br>  real(kind=CUSTOM_REAL), parameter :: VERYSMALLVAL = 1.E-24_CUSTOM_REAL<br><br>! displacement threshold above which we consider the code became unstable<br>

  real(kind=CUSTOM_REAL), parameter :: STABILITY_THRESHOLD = 1.E+25_CUSTOM_REAL<br><br>! geometrical tolerance for boundary detection<br>  double precision, parameter :: SMALLVAL = 0.00001d0<br><br>! do not use tags for MPI messages, use dummy tag instead<br>

  integer, parameter :: itag = 0,itag2 = 0<br><br>! for the Gauss-Lobatto-Legendre points and weights<br>  double precision, parameter :: GAUSSALPHA = 0.d0,GAUSSBETA = 0.d0<br><br>! number of lines per source in CMTSOLUTION file<br>

  integer, parameter :: NLINES_PER_CMTSOLUTION_SOURCE = 13<br><br>! number of iterations to solve the system for xi and eta<br>  integer, parameter :: NUM_ITER = 4<br><br>! size of topography and bathymetry file for Southern California<br>

! modify the follow data for my model<br> <u> integer, parameter :: NX_TOPO_SOCAL = 6001,NY_TOPO_SOCAL = 4001<br>  double precision, parameter :: ORIG_LAT_TOPO_SOCAL = 30.d0<br>  double precision, parameter :: ORIG_LONG_TOPO_SOCAL = 102.d0<br>

  double precision, parameter :: DEGREES_PER_CELL_TOPO_SOCAL = 2.d0 / 4000.d0<br>  character(len=100), parameter :: TOPO_FILE_SOCAL = &#39;DATA/la_topography/topo_bathy_final.dat&#39;</u><br><br>! ! size of topography and bathymetry file for Piero Basini&#39;s model<br>

!   integer, parameter :: NX_TOPO = 787, NY_TOPO = 793<br>!   double precision, parameter :: ORIG_LAT_TOPO = -102352.d0<br>!   double precision, parameter :: ORIG_LONG_TOPO = 729806.d0<br>! ! for Piero Basini&#39;s model this is the resolution in meters of the topo file<br>

!   double precision, parameter :: DEGREES_PER_CELL_TOPO = 250.d0<br>!   character(len=256), parameter :: TOPO_FILE = &#39;DATA/piero_model/dem_EV_UTM_regular_250_reordered.dat&#39;<br><br>! flag for projection from latitude/longitude to UTM, and back<br>

  integer, parameter :: ILONGLAT2UTM = 0, IUTM2LONGLAT = 1<br><br>! minimum thickness in meters to include the effect of the oceans <br>! to avoid taking into account spurious oscillations in topography model<br>  double precision, parameter :: MINIMUM_THICKNESS_3D_OCEANS = 10.d0<br>

! density of sea water <br>  real(kind=CUSTOM_REAL), parameter :: RHO_OCEANS = 1020.0<br><br>! material domain ids<br>  integer, parameter :: IDOMAIN_ACOUSTIC    = 1<br>  integer, parameter :: IDOMAIN_ELASTIC     = 2<br>
  integer, parameter :: IDOMAIN_POROELASTIC = 3<br>
--------------------------------------<br>Par_file:<br># forward or adjoint simulation<br>SIMULATION_TYPE                 = 1   # 1 = forward, 2 = adjoint, 3 = both simultaneously<br>SAVE_FORWARD                    = .false.<br>

<br># UTM projection parameters<br>UTM_PROJECTION_ZONE             = 48<br>SUPPRESS_UTM_PROJECTION         = .false.<br><br># number of MPI processors <br>NPROC                           = 4<br><br># time step parameters<br>

NSTEP                           = 1000<br>DT                              = 0.01d0<br><br># parameters describing the model<br>OCEANS                          = .false.<br><u>TOPOGRAPHY                      = .true.</u><br>

ATTENUATION                     = .false.<br>USE_OLSEN_ATTENUATION           = .false.<br>ANISOTROPY                      = .true.<br><br># absorbing boundary conditions for a regional simulation<br>ABSORBING_CONDITIONS            = .true.<br>

<br># save AVS or OpenDX movies<br>MOVIE_SURFACE                   = .false.<br>MOVIE_VOLUME                    = .false.<br>NTSTEP_BETWEEN_FRAMES           = 200<br>CREATE_SHAKEMAP                 = .true.<br>SAVE_DISPLACEMENT               = .true.<br>

USE_HIGHRES_FOR_MOVIES          = .false.<br>HDUR_MOVIE                      = 0.0<br><br># save AVS or OpenDX mesh files to check the mesh<br>SAVE_MESH_FILES                 = .true.<br><br># path to store the local database file on each node<br>

LOCAL_PATH                      = DATABASES_MPI<br><br># interval at which we output time step info and max of norm of displacement<br>NTSTEP_BETWEEN_OUTPUT_INFO      = 500<br><br># interval in time steps for writing of seismograms<br>

NTSTEP_BETWEEN_OUTPUT_SEISMOS   = 10000<br><br># print source time function<br>PRINT_SOURCE_TIME_FUNCTION      = .false.<br>--------------------------------------------------------------------------------------------------------------------------------------------<br>


</font></span><br>Finally, I thought a fully and detailed manual of SPECFEM_SESAME (or SPECFEM3D2.0) would contribute to understanding the codes.<br><br>Best regards,<br><br>Hu Yuanxin<br>2010-7-22<br>