diff --git a/CITATION.cff b/CITATION.cff
new file mode 100644
index 000000000..588be3318
--- /dev/null
+++ b/CITATION.cff
@@ -0,0 +1,105 @@
+cff-version: 1.2.0
+
+message: "If this software turns out to be helpful for your research, please cite both the article from preferred-citation and the software itself. More detailed citation suggestions can be found in the user manual."
+title: 'SPECFEM/specfem2d: SPECFEM2D v8.1.0'
+version: v8.1.0
+date-released: '2023-12-20'
+repository-code: https://github.com/SPECFEM/specfem2d/tree/v8.1.0
+url: "https://github.com/SPECFEM/specfem2d"
+type: software
+identifiers:
+ - type: doi
+ - value: 10.5281/zenodo.10415228
+license:
+- gpl-3.0-or-later
+
+authors:
+- family-names: Komatitsch
+ given-names: Dimitri
+- family-names: Tromp
+ given-names: Jeroen
+- family-names: Gharti
+ given-names: Hom Nath
+- family-names: Peter
+ given-names: Daniel
+- family-names: Valero Cano
+ given-names: Eduardo
+- family-names: Bachmann
+ given-names: Etienne
+- family-names: Bottero
+ given-names: Alexis
+- family-names: Brissaud
+ given-names: Quentin
+- family-names: Chow
+ given-names: Bryant
+- family-names: Cristini
+ given-names: Paul
+- family-names: Cui
+ given-names: Congyue
+- family-names: Gassmoeller
+ given-names: Rene
+- family-names: Gineste
+ given-names: Michael
+- family-names: Halpaap
+ given-names: Felix
+- family-names: Heien
+ given-names: Eric
+- family-names: Labarta
+ given-names: Jesus
+- family-names: Le Goff
+ given-names: Nicolas
+- family-names: Le Loher
+ given-names: Pieyre
+- family-names: Lefebvre
+ given-names: Matthieu
+- family-names: Liu
+ given-names: Qiancheng
+- family-names: Liu
+ given-names: Qinya
+- family-names: Liu
+ given-names: Youshan
+- family-names: Liu
+ given-names: Zhaolun
+- family-names: Luet
+ given-names: David
+- family-names: Martin
+ given-names: Roland
+- family-names: Matzen
+ given-names: Rene
+- family-names: Modrak
+ given-names: Ryan
+- family-names: Morency
+ given-names: Christina
+- family-names: Nagaso
+ given-names: Masaru
+- family-names: Rosenkrantz
+ given-names: Eric
+- family-names: Rusmanugroho
+ given-names: Herurisa
+- family-names: Sales de Andrade
+ given-names: Elliott
+- family-names: Tape
+ given-names: Carl
+- family-names: Vilotte
+ given-names: Jean-Pierre
+- family-names: Xie
+ given-names: Zhinan
+- family-names: Zhang
+ given-names: Zhendong
+
+
+preferred-citation:
+ type: article
+ authors:
+ - family-names: Komatitsch
+ given-names: Dimitri
+ - family-names: Vilotte
+ given-names: Jean-Pierre
+ title: "The spectral-element method: an efficient tool to simulate the seismic response of 2D and 3D geological structures"
+ journal: "Bull. seism. Soc. Am."
+ volume: 88
+ issue: 2
+ start: 368 # First page number
+ end: 392 # Last page number
+ year: 1998
+ doi: "10.1785/BSSA0880020368"
diff --git a/DATA/Par_file b/DATA/Par_file
index 0746c2422..0137c08c9 100644
--- a/DATA/Par_file
+++ b/DATA/Par_file
@@ -279,15 +279,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/Par_file b/EXAMPLES/BENCHIE_water_PVC/DATA/Par_file
index 21b460821..8c21ec6e9 100644
--- a/EXAMPLES/BENCHIE_water_PVC/DATA/Par_file
+++ b/EXAMPLES/BENCHIE_water_PVC/DATA/Par_file
@@ -278,15 +278,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/absorbing_cpml_file # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/absorbing_cpml_file b/EXAMPLES/BENCHIE_water_PVC/MESH/absorbing_cpml_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/absorbing_cpml_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/absorbing_cpml_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/absorbing_surface_file b/EXAMPLES/BENCHIE_water_PVC/MESH/absorbing_surface_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/absorbing_surface_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/absorbing_surface_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/free_surface_file b/EXAMPLES/BENCHIE_water_PVC/MESH/free_surface_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/free_surface_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/free_surface_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/materials_file b/EXAMPLES/BENCHIE_water_PVC/MESH/materials_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/materials_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/materials_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/mesh_file b/EXAMPLES/BENCHIE_water_PVC/MESH/mesh_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/mesh_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/mesh_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/DATA/nodes_coords_file b/EXAMPLES/BENCHIE_water_PVC/MESH/nodes_coords_file
similarity index 100%
rename from EXAMPLES/BENCHIE_water_PVC/DATA/nodes_coords_file
rename to EXAMPLES/BENCHIE_water_PVC/MESH/nodes_coords_file
diff --git a/EXAMPLES/BENCHIE_water_PVC/MESH/nummaterial_velocity_file b/EXAMPLES/BENCHIE_water_PVC/MESH/nummaterial_velocity_file
new file mode 100644
index 000000000..ef05430ee
--- /dev/null
+++ b/EXAMPLES/BENCHIE_water_PVC/MESH/nummaterial_velocity_file
@@ -0,0 +1,33 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 1412.d0 2260.d0 1050.d0 9999.0 9999.0 0
+1 2 1000.d0 1477.d0 0.d0 9999.0 9999.0 0
diff --git a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file
index b359f209e..15ac32f29 100644
--- a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file
+++ b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC/DATA/Par_file
@@ -263,6 +263,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file
index 152995868..b01de98e5 100644
--- a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file
+++ b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ACOUSTIC_ELASTIC/DATA/Par_file
@@ -264,6 +264,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file
index d8680e287..6754643aa 100644
--- a/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file
+++ b/EXAMPLES/BENCHMARK_CLAERBOUT_ADJOINT/ELASTIC/DATA/Par_file
@@ -263,6 +263,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file b/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file
index faeb32da7..0ba61498d 100644
--- a/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file
+++ b/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = MESH/Mesh_SqrCirc # file containing the mesh
-nodes_coords_file = MESH/Nodes_SqrCirc # file containing the nodes coordinates
-materials_file = MESH/Material_SqrCirc # file containing the material number for each element
-free_surface_file = MESH/Surf_free_SqrCirc # file containing the free surface
-axial_elements_file = dummy # file containing the axial elements if AXISYM is true
-absorbing_surface_file = MESH/Surf_abs_SqrCirc # file containing the absorbing surface
-acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
-absorbing_cpml_file = dummy # file containing the CPML element numbers
-tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/Mesh_SqrCirc # file containing the mesh
+nodes_coords_file = ./MESH/Nodes_SqrCirc # file containing the nodes coordinates
+materials_file = ./MESH/Material_SqrCirc # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/Surf_free_SqrCirc # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/Surf_abs_SqrCirc # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file.serial b/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file.serial
index 89d2ae7c2..0cdab013b 100644
--- a/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file.serial
+++ b/EXAMPLES/Gmsh_example_Stacey_MPI/DATA/Par_file.serial
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = MESH/Mesh_SqrCirc # file containing the mesh
-nodes_coords_file = MESH/Nodes_SqrCirc # file containing the nodes coordinates
-materials_file = MESH/Material_SqrCirc # file containing the material number for each element
-free_surface_file = MESH/Surf_free_SqrCirc # file containing the free surface
-axial_elements_file = dummy # file containing the axial elements if AXISYM is true
-absorbing_surface_file = MESH/Surf_abs_SqrCirc # file containing the absorbing surface
-acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
-absorbing_cpml_file = dummy # file containing the CPML element numbers
-tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/Mesh_SqrCirc # file containing the mesh
+nodes_coords_file = ./MESH/Nodes_SqrCirc # file containing the nodes coordinates
+materials_file = ./MESH/Material_SqrCirc # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/Surf_free_SqrCirc # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/Surf_abs_SqrCirc # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Gmsh_example_Stacey_MPI/MESH/nummaterial_velocity_file b/EXAMPLES/Gmsh_example_Stacey_MPI/MESH/nummaterial_velocity_file
new file mode 100644
index 000000000..d149aa0a0
--- /dev/null
+++ b/EXAMPLES/Gmsh_example_Stacey_MPI/MESH/nummaterial_velocity_file
@@ -0,0 +1,33 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+1 1 2000.d0 1680.d0 0.0d0 10.d0 10.d0 0
+1 2 1000.d0 1477.d0 0.0d0 10.d0 10.d0 0
diff --git a/EXAMPLES/Industrial_Format_SEP/DATA/Par_file b/EXAMPLES/Industrial_Format_SEP/DATA/Par_file
index 0889970bd..37d34d28c 100644
--- a/EXAMPLES/Industrial_Format_SEP/DATA/Par_file
+++ b/EXAMPLES/Industrial_Format_SEP/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh/mesh # file containing the mesh
-nodes_coords_file = ./mesh/nodes_coords # file containing the nodes coordinates
-materials_file = ./mesh/mat # file containing the material number for each element
-free_surface_file = ./mesh/surface_free # file containing the free surface
-axial_elements_file = ./mesh/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./mesh/surface_abs # file containing the absorbing surface
-acoustic_forcing_surface_file = ./mesh/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./mesh/Elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./mesh/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Industrial_Format_SEP/README b/EXAMPLES/Industrial_Format_SEP/README
index 5e27f095b..b5044fe46 100644
--- a/EXAMPLES/Industrial_Format_SEP/README
+++ b/EXAMPLES/Industrial_Format_SEP/README
@@ -1,7 +1,18 @@
+----------------------------------------------------------------------
+README
+----------------------------------------------------------------------
+
+This example reads in a Vp velocity model given in SEP (Stanford Exploration Project) file format
+and interpolates it onto a regular SPECFEM2D mesh to produce seismic traces.
+
1. modify interpolate.f90
mainly to change the location/names of your SEP/SU models
2. run interpolation:
- ./interpolate.bash
+ ./run_this_example.sh
+ The script will compile the interpolate.f90 file and run the xinterpolate binary.
+ This binary will call the mesher xmeshfem2D and solver xspecfem2D to first create and output the regular mesh,
+ then interpolate the velocities onto it and re-run the binaries to run a simulation using the
+ interpolated velocity model (in "legacy" format).
diff --git a/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_1 b/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_1
index 96805af58..27652276d 100644
--- a/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_1
+++ b/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_1
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh/mesh # file containing the mesh
-nodes_coords_file = ./mesh/nodes_coords # file containing the nodes coordinates
-materials_file = ./mesh/mat # file containing the material number for each element
-free_surface_file = ./mesh/surface_free # file containing the free surface
-axial_elements_file = ./mesh/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./mesh/surface_abs # file containing the absorbing surface
-acoustic_forcing_surface_file = ./mesh/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./mesh/Elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./mesh/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_2 b/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_2
index bf0dfb6ba..24d02bf99 100644
--- a/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_2
+++ b/EXAMPLES/Industrial_Format_SEP/REF_SEIS/Par_file.step_2
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh/mesh # file containing the mesh
-nodes_coords_file = ./mesh/nodes_coords # file containing the nodes coordinates
-materials_file = ./mesh/mat # file containing the material number for each element
-free_surface_file = ./mesh/surface_free # file containing the free surface
-axial_elements_file = ./mesh/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./mesh/surface_abs # file containing the absorbing surface
-acoustic_forcing_surface_file = ./mesh/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./mesh/Elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./mesh/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Industrial_Format_SEP/SEG_2D_SALT/SEP_manual.pdf b/EXAMPLES/Industrial_Format_SEP/SEG_2D_SALT/SEP_manual.pdf
new file mode 100644
index 000000000..0b35669fe
Binary files /dev/null and b/EXAMPLES/Industrial_Format_SEP/SEG_2D_SALT/SEP_manual.pdf differ
diff --git a/EXAMPLES/Industrial_Format_SEP/interpolate.f90 b/EXAMPLES/Industrial_Format_SEP/interpolate.f90
index 88908cf45..e985edee1 100644
--- a/EXAMPLES/Industrial_Format_SEP/interpolate.f90
+++ b/EXAMPLES/Industrial_Format_SEP/interpolate.f90
@@ -164,7 +164,8 @@ program main_interpolate
!write(*,*) trim(tmpstring)
write(system_command,*) 'sed -i "s/^xmin .*/',trim(tmpstring),'/" ./DATA/Par_file'
write (*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
write(numstring,*) OX+(NX-1)*DX
write(tmpstring,*) 'xmax =',trim(numstring)
@@ -172,7 +173,8 @@ program main_interpolate
!write(*,*) trim(tmpstring)
write(system_command,*) 'sed -i "s/^xmax .*/',trim(tmpstring),'/" ./DATA/Par_file'
write (*,*) trim(system_command)
- call system(system_command)
+ call execute_command_line(system_command,exitstat=ier)
+ if (ier /= 0) stop
write(numstring,*) (NX-1)/INTERPOLATION_POINTS
write(tmpstring,*) 'nx =',trim(numstring)
@@ -180,7 +182,8 @@ program main_interpolate
!write(*,*) trim(tmpstring)
write(system_command,*) 'sed -i "s/^nx .*/',trim(tmpstring),'/" ./DATA/Par_file'
write (*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
! nbregions
!call system('sed -i "$ d" ./DATA/Par_file')
@@ -192,7 +195,8 @@ program main_interpolate
! original Par_file line for regions to replace is: 1 20 1 20 1
write(system_command,*) 'sed -i "s/^1 20 .*/',trim(tmpstring),'/" ./DATA/Par_file'
write (*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
! number of processes
if (USER_INPUT) then
@@ -201,12 +205,14 @@ program main_interpolate
!write(*,*) trim(tmpstring)
write(system_command,*) 'sed -i "s/^NPROC .*/',trim(tmpstring),'/" ./DATA/Par_file'
write (*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
endif
print *
! backup Par_file
- call system('cp ./DATA/Par_file ./DATA/Par_file.org')
+ call execute_command_line('cp ./DATA/Par_file ./DATA/Par_file.org',exitstat=ier)
+ if (ier /= 0) stop
call sleep(1)
@@ -219,20 +225,32 @@ program main_interpolate
print *
! Par_file flags to create new mesh files
- call system('cp ./DATA/Par_file.org ./DATA/Par_file')
- call system('sed -i "s/^MODEL .*/MODEL = default/" ./DATA/Par_file')
- call system('sed -i "s/^SAVE_MODEL .*/SAVE_MODEL = legacy/" ./DATA/Par_file')
- call system('sed -i "s/^NSTEP .*/NSTEP = 5 /" ./DATA/Par_file')
- call system('cp ./DATA/Par_file ./OUTPUT_FILES/Par_file.step_1')
+ call execute_command_line('cp ./DATA/Par_file.org ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('sed -i "s/^MODEL .*/MODEL = default/" ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('sed -i "s/^SAVE_MODEL .*/SAVE_MODEL = legacy/" ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('sed -i "s/^NSTEP .*/NSTEP = 5 /" ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('cp ./DATA/Par_file ./OUTPUT_FILES/Par_file.step_1',exitstat=ier)
+ if (ier /= 0) stop
+
+ write(num,'(i2.2)') nproc
! runs mesher
print *,'call xmeshfem2d'
- call system('./bin/xmeshfem2D > OUTPUT_FILES/output_mesher.step_1.txt')
+ call execute_command_line('mpirun -np ' //num//' ./bin/xmeshfem2D > OUTPUT_FILES/output_mesher.step_1.txt',exitstat=ier)
+ if (ier /= 0) stop
! runs first forward simulation to generate new specfem files
print *,'call xspecfem2d'
- write(num,'(i2.2)') nproc
- call system('mpirun -np ' //num//' ./bin/xspecfem2D > OUTPUT_FILES/output_solver.step_1.txt')
+ call execute_command_line('mpirun -np ' //num//' ./bin/xspecfem2D > OUTPUT_FILES/output_solver.step_1.txt',exitstat=ier)
+ if (ier /= 0) stop
print *
print *, '************ Setting up new simulation ************ '
@@ -240,14 +258,22 @@ program main_interpolate
! now uses default specfem file format
! backup Par_file
- call system('cp ./DATA/Par_file.org ./DATA/Par_file')
- call system('sed -i "s/^MODEL .*/MODEL = legacy/" ./DATA/Par_file')
- call system('sed -i "s/^SAVE_MODEL .*/SAVE_MODEL = default/" ./DATA/Par_file')
- call system('cp ./DATA/Par_file ./OUTPUT_FILES/Par_file.step_2')
+ call execute_command_line('cp ./DATA/Par_file.org ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('sed -i "s/^MODEL .*/MODEL = legacy/" ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('sed -i "s/^SAVE_MODEL .*/SAVE_MODEL = default/" ./DATA/Par_file',exitstat=ier)
+ if (ier /= 0) stop
+
+ call execute_command_line('cp ./DATA/Par_file ./OUTPUT_FILES/Par_file.step_2',exitstat=ier)
+ if (ier /= 0) stop
! runs mesher
print *,'call xmeshfem2d'
- call system('./bin/xmeshfem2D')
+ call execute_command_line('mpirun -np ' //num//' ./bin/xmeshfem2D',exitstat=ier)
+ if (ier /= 0) stop
! scaling model values
if (SCALE_FROM_VP) then
@@ -286,7 +312,8 @@ program main_interpolate
! runs forward simulation
print *,'call xspecfem2d'
- call system('mpirun -np ' //num//' ./bin/xspecfem2D ')
+ call execute_command_line('mpirun -np ' //num//' ./bin/xspecfem2D ',exitstat=ier)
+ if (ier /= 0) stop
end program main_interpolate
@@ -621,10 +648,13 @@ subroutine interpolate_slowness_gll(vp,vs,rho,NX,NY,NZ,DX,DY,DZ,OX,OY,OZ,closest
print *, 'replacing model file'
write(system_command,*) 'mv -f ',trim(adjustl(input_file)),' ',trim(adjustl(input_file))//'.org'
write(*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
+
write(system_command,*) 'mv -f ',trim(adjustl(output_file)),' ',trim(adjustl(input_file))
write(*,*) trim(system_command)
- call system(trim(system_command))
+ call execute_command_line(trim(system_command),exitstat=ier)
+ if (ier /= 0) stop
enddo ! iproc
diff --git a/EXAMPLES/Industrial_Format_SEP/run_this_example.sh b/EXAMPLES/Industrial_Format_SEP/run_this_example.sh
index cd0342a98..26455b4e5 100755
--- a/EXAMPLES/Industrial_Format_SEP/run_this_example.sh
+++ b/EXAMPLES/Industrial_Format_SEP/run_this_example.sh
@@ -28,7 +28,7 @@ rm -rf OUTPUT_FILES/*
# links executables
mkdir -p bin
cd bin/
-rm -f xmeshfem2D xspecfem2D
+rm -f xmeshfem2D xspecfem2D xinterpolate
ln -s ../../../bin/xmeshfem2D
ln -s ../../../bin/xspecfem2D
cd ../
diff --git a/EXAMPLES/LuoYang_fluid_solid_kernel/DATA/Par_file b/EXAMPLES/LuoYang_fluid_solid_kernel/DATA/Par_file
index 716a7d386..de6be6c39 100644
--- a/EXAMPLES/LuoYang_fluid_solid_kernel/DATA/Par_file
+++ b/EXAMPLES/LuoYang_fluid_solid_kernel/DATA/Par_file
@@ -271,15 +271,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/DATA/Par_file b/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/DATA/Par_file
index cd6c60b2a..989ebb60d 100644
--- a/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/DATA/Par_file
+++ b/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/DATA/Par_file
@@ -17,7 +17,7 @@ NOISE_TOMOGRAPHY = 0
SAVE_FORWARD = .false.
# parameters concerning partitioning
-NPROC = 20 # number of processes
+NPROC = 2 # number of processes
# time step parameters
# total number of time steps
@@ -46,7 +46,7 @@ AXISYM = .false.
PARTITIONING_TYPE = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
# number of control nodes per element (4 or 9)
-NGNOD = 9
+NGNOD = 4
# creates/reads a binary database that allows to skip all time consuming setup steps in initialization
# 0 = does not read/create database
@@ -148,7 +148,7 @@ seismotype = 1 # several values can be chosen.
# every how many time steps we save the seismograms
# (costly, do not use a very small value; if you use a very large value that is larger than the total number
# of time steps of the run, the seismograms will automatically be saved once at the end of the run anyway)
-NTSTEP_BETWEEN_OUTPUT_SEISMOS = 1000
+NTSTEP_BETWEEN_OUTPUT_SEISMOS = 100000
# set to n to reduce the sampling rate of output seismograms by a factor of n
# defaults to 1, which means no down-sampling
@@ -162,7 +162,7 @@ USER_T0 = 0.0d0
# seismogram formats
save_ASCII_seismograms = .true. # save seismograms in ASCII format or not
-save_binary_seismograms_single = .true. # save seismograms in single precision binary format or not (can be used jointly with ASCII above to save both)
+save_binary_seismograms_single = .false. # save seismograms in single precision binary format or not (can be used jointly with ASCII above to save both)
save_binary_seismograms_double = .false. # save seismograms in double precision binary format or not (can be used jointly with both flags above to save all)
SU_FORMAT = .false. # output single precision binary seismograms in Seismic Unix format (adjoint traces will be read in the same format)
@@ -273,15 +273,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = Elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
@@ -290,7 +291,7 @@ tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing th
#-----------------------------------------------------------
# file containing interfaces for internal mesh
-interfacesfile = ./DATA/interfaces_simple_topo_curved.dat
+interfacesfile = interfaces_simple_topo_curved.dat
# geometry of the model (origin lower-left corner = 0,0) and mesh description
xmin = 0.d0 # abscissa of left side of the model
diff --git a/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/run_this_example.sh b/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/run_this_example.sh
index 3522e558c..97bdb4763 100755
--- a/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/run_this_example.sh
+++ b/EXAMPLES/Marmousi2_to_be_done_one_day_not_ready_yet/run_this_example.sh
@@ -1,18 +1,24 @@
-#!/bin/bash -eu
-#################################
-# USER PARAMETER
+#!/bin/bash
+#
+# script runs mesher and solver (in serial)
+# using this example setup
+#
-NPROC=20
+echo "running example: `date`"
+currentdir=`pwd`
-#################################
-
-echo "setting up example: `pwd`"
+# sets up directory structure in current example directoy
+echo
+echo "setting up example..."
echo
mkdir -p OUTPUT_FILES
-# cleanup
+
+# cleans output files
rm -rf OUTPUT_FILES/*
+cd $currentdir
+
# links executables
mkdir -p bin
cd bin/
@@ -21,21 +27,53 @@ ln -s ../../../bin/xmeshfem2D
ln -s ../../../bin/xspecfem2D
cd ../
-echo
-echo "running mesher..."
-echo
-./bin/xmeshfem2D
+# stores setup
+cp DATA/Par_file OUTPUT_FILES/
+cp DATA/SOURCE OUTPUT_FILES/
+
+# Get the number of processors
+NPROC=`grep ^NPROC DATA/Par_file | cut -d = -f 2 | cut -d \# -f 1 | tr -d ' '`
+
+# runs database generation
+if [ "$NPROC" -eq 1 ]; then
+ # This is a serial simulation
+ echo
+ echo "running mesher..."
+ echo
+ ./bin/xmeshfem2D
+else
+ # This is a MPI simulation
+ echo
+ echo "running mesher on $NPROC processors..."
+ echo
+ mpirun -np $NPROC ./bin/xmeshfem2D
+fi
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
-echo
-echo "running solver..."
-echo
-mpirun -np $NPROC ./bin/xspecfem2D
+# runs simulation
+if [ "$NPROC" -eq 1 ]; then
+ # This is a serial simulation
+ echo
+ echo "running solver..."
+ echo
+ ./bin/xspecfem2D
+else
+ # This is a MPI simulation
+ echo
+ echo "running solver on $NPROC processors..."
+ echo
+ mpirun -np $NPROC ./bin/xspecfem2D
+fi
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
+# stores output
+cp DATA/*SOURCE* DATA/*STATIONS* OUTPUT_FILES
+
echo
-echo "done"
+echo "see results in directory: OUTPUT_FILES/"
echo
+echo "done"
+echo `date`
diff --git a/EXAMPLES/README.md b/EXAMPLES/README.md
new file mode 100644
index 000000000..7f316075e
--- /dev/null
+++ b/EXAMPLES/README.md
@@ -0,0 +1,16 @@
+README
+======
+
+This directory contains a set of examples to familiarize yourself with different modeling setups and for testing purposes.
+
+Each example requires a `Par_file`, `SOURCE`, and either a file of interfaces OR an external mesh.
+The examples can be run in the current example directory, using the processing script:
+```
+./run_this_example.sh
+```
+
+If you're interested in how to setup and run a simple SPECFEM2D simulation,
+we suggest to look at the **simple_topography_and_also_a_simple_fluid_layer/** example.
+
+Please **consider submitting your own example** to this package!
+
diff --git a/EXAMPLES/README_EXAMPLES b/EXAMPLES/README_EXAMPLES
deleted file mode 100644
index 75fcef6fb..000000000
--- a/EXAMPLES/README_EXAMPLES
+++ /dev/null
@@ -1,14 +0,0 @@
-----------------------------------------------------------------------
-README
-----------------------------------------------------------------------
-
-This directory contains a set of examples for testing purposes.
-
-Each example requires a Par_file, SOURCE, and either a file of interfaces
-OR an external mesh. The examples can be run in the current example directory, using the
-processing script:
-
-./run_this_example.sh
-
-The default example is simple_topography_and_also_a_simple_fluid_layer.
-
diff --git a/EXAMPLES/Rayleigh_wave_no_crack/DATA/Par_file b/EXAMPLES/Rayleigh_wave_no_crack/DATA/Par_file
index d9032a529..a3db33576 100644
--- a/EXAMPLES/Rayleigh_wave_no_crack/DATA/Par_file
+++ b/EXAMPLES/Rayleigh_wave_no_crack/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/mesh/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/mesh/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/mesh/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/mesh/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Rayleigh_wave_no_crack_simpler_way_to_generate_the_wave/DATA/Par_file b/EXAMPLES/Rayleigh_wave_no_crack_simpler_way_to_generate_the_wave/DATA/Par_file
index dc6c391ec..ad79cbddb 100644
--- a/EXAMPLES/Rayleigh_wave_no_crack_simpler_way_to_generate_the_wave/DATA/Par_file
+++ b/EXAMPLES/Rayleigh_wave_no_crack_simpler_way_to_generate_the_wave/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Rayleigh_wave_with_crack/DATA/Par_file b/EXAMPLES/Rayleigh_wave_with_crack/DATA/Par_file
index 5b13ee071..0b834f108 100644
--- a/EXAMPLES/Rayleigh_wave_with_crack/DATA/Par_file
+++ b/EXAMPLES/Rayleigh_wave_with_crack/DATA/Par_file
@@ -272,15 +272,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/mesh/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/mesh/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/mesh/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/mesh/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_132rec_checker b/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_132rec_checker
index 7f9199998..f86f0568f 100644
--- a/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_132rec_checker
+++ b/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_132rec_checker
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_onerec b/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_onerec
index 4d9b24b33..ebbb8ebce 100644
--- a/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_onerec
+++ b/EXAMPLES/Tape2007/DATA/Par_file_Tape2007_onerec
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tape2007/REF_SEIS/Par_file b/EXAMPLES/Tape2007/REF_SEIS/Par_file
index 7f9199998..f86f0568f 100644
--- a/EXAMPLES/Tape2007/REF_SEIS/Par_file
+++ b/EXAMPLES/Tape2007/REF_SEIS/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tape2007_kernel/DATA/Par_file b/EXAMPLES/Tape2007_kernel/DATA/Par_file
index 93e1a421e..bc441d3b2 100644
--- a/EXAMPLES/Tape2007_kernel/DATA/Par_file
+++ b/EXAMPLES/Tape2007_kernel/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tromp2005/DATA/Par_file b/EXAMPLES/Tromp2005/DATA/Par_file
index 873113d1d..5676b5216 100644
--- a/EXAMPLES/Tromp2005/DATA/Par_file
+++ b/EXAMPLES/Tromp2005/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tromp2005/DATA/Par_file_Tromp2005_s100 b/EXAMPLES/Tromp2005/DATA/Par_file_Tromp2005_s100
index 2cd7be06a..48007a9e4 100644
--- a/EXAMPLES/Tromp2005/DATA/Par_file_Tromp2005_s100
+++ b/EXAMPLES/Tromp2005/DATA/Par_file_Tromp2005_s100
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/Tromp2005_kernel/DATA/Par_file b/EXAMPLES/Tromp2005_kernel/DATA/Par_file
index 9b3717dbe..8799083a6 100644
--- a/EXAMPLES/Tromp2005_kernel/DATA/Par_file
+++ b/EXAMPLES/Tromp2005_kernel/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file b/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file
index 9f149b294..c6f51027c 100644
--- a/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file
+++ b/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file
@@ -273,6 +273,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file_homogeneous_with_attenuation b/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file_homogeneous_with_attenuation
index 7c5914ada..39c74f39f 100644
--- a/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file_homogeneous_with_attenuation
+++ b/EXAMPLES/anisotropic_isotropic_model/DATA/Par_file_homogeneous_with_attenuation
@@ -278,6 +278,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/anisotropic_zinc_crystal/DATA/Par_file b/EXAMPLES/anisotropic_zinc_crystal/DATA/Par_file
index 39017db40..bf6842063 100644
--- a/EXAMPLES/anisotropic_zinc_crystal/DATA/Par_file
+++ b/EXAMPLES/anisotropic_zinc_crystal/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/DATA/Par_file b/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/DATA/Par_file
index 89297850d..7bc2c9606 100644
--- a/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/DATA/Par_file
+++ b/EXAMPLES/attenuation/viscoacoustic_attenuation_off_versus_analytical/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/DATA/Par_file b/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/DATA/Par_file
index b918a1bc1..28a562803 100644
--- a/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/DATA/Par_file
+++ b/EXAMPLES/attenuation/viscoacoustic_attenuation_on_versus_analytical/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_inside_an_element b/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_inside_an_element
index 701648efa..98e259f14 100644
--- a/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_inside_an_element
+++ b/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_inside_an_element
@@ -268,6 +268,7 @@ read_external_mesh = .false.
mesh_file = ./DATA/mesh_file # file containing the mesh
nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
materials_file = ./DATA/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
free_surface_file = ./DATA/free_surface_file # file containing the free surface
axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
diff --git a/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_shared_by_four_elements b/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_shared_by_four_elements
index a758010a1..6020fe615 100644
--- a/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_shared_by_four_elements
+++ b/EXAMPLES/attenuation/viscoelastic/DATA/Par_file_attenuation_2D_source_in_point_shared_by_four_elements
@@ -268,6 +268,7 @@ read_external_mesh = .false.
mesh_file = ./DATA/mesh_file # file containing the mesh
nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
materials_file = ./DATA/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
free_surface_file = ./DATA/free_surface_file # file containing the free surface
axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
diff --git a/EXAMPLES/axisymmetric_case_AXISYM_option/DATA/Par_file b/EXAMPLES/axisymmetric_case_AXISYM_option/DATA/Par_file
index 6ea25b5ba..4fb14b6b4 100644
--- a/EXAMPLES/axisymmetric_case_AXISYM_option/DATA/Par_file
+++ b/EXAMPLES/axisymmetric_case_AXISYM_option/DATA/Par_file
@@ -288,6 +288,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/axisymmetric_case_AXISYM_option/REF_SEIS/Par_file b/EXAMPLES/axisymmetric_case_AXISYM_option/REF_SEIS/Par_file
index 6ea25b5ba..4fb14b6b4 100644
--- a/EXAMPLES/axisymmetric_case_AXISYM_option/REF_SEIS/Par_file
+++ b/EXAMPLES/axisymmetric_case_AXISYM_option/REF_SEIS/Par_file
@@ -288,6 +288,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/canyon/DATA/Par_file b/EXAMPLES/canyon/DATA/Par_file
index 4d8790b95..9ec4e30cb 100644
--- a/EXAMPLES/canyon/DATA/Par_file
+++ b/EXAMPLES/canyon/DATA/Par_file
@@ -259,15 +259,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/mesh/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/mesh/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/mesh/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/mesh/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/canyon_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/canyon_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/canyon_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/canyon_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/canyon_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/canyon_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/canyon/DATA/mesh/canyon_absorbing_surface_file b/EXAMPLES/canyon/MESH/canyon_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/canyon/DATA/mesh/canyon_absorbing_surface_file
rename to EXAMPLES/canyon/MESH/canyon_absorbing_surface_file
diff --git a/EXAMPLES/canyon/DATA/mesh/canyon_free_surface_file b/EXAMPLES/canyon/MESH/canyon_free_surface_file
similarity index 100%
rename from EXAMPLES/canyon/DATA/mesh/canyon_free_surface_file
rename to EXAMPLES/canyon/MESH/canyon_free_surface_file
diff --git a/EXAMPLES/canyon/DATA/mesh/canyon_materials_file b/EXAMPLES/canyon/MESH/canyon_materials_file
similarity index 100%
rename from EXAMPLES/canyon/DATA/mesh/canyon_materials_file
rename to EXAMPLES/canyon/MESH/canyon_materials_file
diff --git a/EXAMPLES/canyon/DATA/mesh/canyon_mesh_file b/EXAMPLES/canyon/MESH/canyon_mesh_file
similarity index 100%
rename from EXAMPLES/canyon/DATA/mesh/canyon_mesh_file
rename to EXAMPLES/canyon/MESH/canyon_mesh_file
diff --git a/EXAMPLES/canyon/DATA/mesh/canyon_nodes_coords_file b/EXAMPLES/canyon/MESH/canyon_nodes_coords_file
similarity index 100%
rename from EXAMPLES/canyon/DATA/mesh/canyon_nodes_coords_file
rename to EXAMPLES/canyon/MESH/canyon_nodes_coords_file
diff --git a/EXAMPLES/canyon/MESH/canyon_nummaterial_velocity_file b/EXAMPLES/canyon/MESH/canyon_nummaterial_velocity_file
new file mode 100644
index 000000000..a884684e1
--- /dev/null
+++ b/EXAMPLES/canyon/MESH/canyon_nummaterial_velocity_file
@@ -0,0 +1,32 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 1.d0 2.d0 1.d0 9999.d0 9999.d0 0
diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
index 6a673b42b..e066abbe4 100644
--- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
+++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
index 76f2354cd..9e064730f 100644
--- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
+++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/REF_SEIS/Par_file b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/REF_SEIS/Par_file
index 6a673b42b..e066abbe4 100644
--- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/REF_SEIS/Par_file
+++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_elastic/REF_SEIS/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
index 499d1d45b..8ce5afc65 100644
--- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
+++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/REF_SEIS/Par_file b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/REF_SEIS/Par_file
index 499d1d45b..8ce5afc65 100644
--- a/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/REF_SEIS/Par_file
+++ b/EXAMPLES/check_absolute_amplitude_of_force_source_seismograms_viscoelastic/REF_SEIS/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
index 160050066..36eaeccfc 100644
--- a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
+++ b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_at_the_corner_between_several_spectral_elements
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
index 6a63a7157..0cb38dc34 100644
--- a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
+++ b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/DATA/Par_file_no_attenuation_2D_inside_a_given_spectral_element
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/REF_SEIS/Par_file b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/REF_SEIS/Par_file
index 160050066..36eaeccfc 100644
--- a/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/REF_SEIS/Par_file
+++ b/EXAMPLES/check_absolute_amplitude_of_pressure_source_seismograms_acoustic/REF_SEIS/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/fluid_solid/README b/EXAMPLES/fluid_solid/README
new file mode 100644
index 000000000..6c15cf6c2
--- /dev/null
+++ b/EXAMPLES/fluid_solid/README
@@ -0,0 +1,6 @@
+----------------------------------------------------------------------
+README
+----------------------------------------------------------------------
+
+In this folder we provide different fluid-solid examples from the 2000 Geophysics paper of Komatitsch, Barnes and Tromp.
+
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/DATA/Par_file b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/DATA/Par_file
index bf2ebee7e..c6e3e2204 100644
--- a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/DATA/Par_file
+++ b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/DATA/Par_file
@@ -260,15 +260,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh/mesh # file containing the mesh
-nodes_coords_file = ./mesh/nodes_coords # file containing the nodes coordinates
-materials_file = ./mesh/mat # file containing the material number for each element
-free_surface_file = ./mesh/surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./mesh/surface_abs # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords # file containing the nodes coordinates
+materials_file = ./MESH/mat # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/surface_free # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/surface_abs # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/absorbing_cpml_file # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/mat b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/mat
similarity index 100%
rename from EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/mat
rename to EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/mat
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/mesh b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/mesh
similarity index 100%
rename from EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/mesh
rename to EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/mesh
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/nodes_coords b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/nodes_coords
similarity index 100%
rename from EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/nodes_coords
rename to EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/nodes_coords
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/nummaterial_velocity_file b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/nummaterial_velocity_file
new file mode 100644
index 000000000..fb868687f
--- /dev/null
+++ b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/nummaterial_velocity_file
@@ -0,0 +1,33 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+1 1 1000.d0 1500.d0 0.0d0 10.d0 10.d0 0
+2 2 2500.d0 5000.d0 2500.0d0 10.d0 10.d0 0
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/surface_abs b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/surface_abs
similarity index 100%
rename from EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/surface_abs
rename to EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/surface_abs
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/surface_free b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/surface_free
similarity index 100%
rename from EXAMPLES/fluid_solid/fluid_solid_external_mesh/mesh/surface_free
rename to EXAMPLES/fluid_solid/fluid_solid_external_mesh/MESH/surface_free
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/README b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/README
index 056f59a2f..e8aeb35bd 100644
--- a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/README
+++ b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/README
@@ -6,6 +6,6 @@ This example creates an external mesh with fluid and solid domains, and topograp
To run the example, type:
- ./process.sh
+ ./run_this_example.sh
in this directory.
diff --git a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/run_this_example.sh b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/run_this_example.sh
index 96198b432..b8469a199 100755
--- a/EXAMPLES/fluid_solid/fluid_solid_external_mesh/run_this_example.sh
+++ b/EXAMPLES/fluid_solid/fluid_solid_external_mesh/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/DATA/Par_file b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/DATA/Par_file
index 47a6d4945..ed02074b2 100644
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/DATA/Par_file
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/DATA/Par_file
@@ -260,15 +260,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/README b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/README
index b8211cc76..078cdc99f 100644
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/README
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/README
@@ -6,7 +6,7 @@ This example creates the fluid-solid example with flat ocean bottom from the 200
To run the example, type:
- ./process.sh
+ ./run_this_example.sh
in this directory.
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/trace2an.dat b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/REF_ANALYTIC/trace2an.dat
similarity index 100%
rename from EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/trace2an.dat
rename to EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/REF_ANALYTIC/trace2an.dat
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/plotall_comparison_with_analytical_solution.gnu b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/plotall_comparison_with_analytical_solution.gnu
index 1c9f118b4..1f8155c9d 100644
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/plotall_comparison_with_analytical_solution.gnu
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/plotall_comparison_with_analytical_solution.gnu
@@ -19,9 +19,9 @@ set xrange [1.3:2.1]
amplitude_of_source = 44705882000.
-plot "OUTPUT_FILES/AA.S0040.BXX.semv" using ($1 + 0.104):(- amplitude_of_source * $2) title 'Ux SEM' w l lc 1, "trace2an.dat" using 1:2 title 'Ux analytical' w l lc 3
+plot "OUTPUT_FILES/AA.S0040.BXX.semv" using ($1 + 0.104):(- amplitude_of_source * $2) title 'Ux SEM' w l lc 1, "REF_ANALYTIC/trace2an.dat" using 1:2 title 'Ux analytical' w l lc 3
pause -1 "Hit any key..."
-plot "OUTPUT_FILES/AA.S0040.BXZ.semv" using ($1 + 0.104):(+ amplitude_of_source * $2) title 'Uz SEM' w l lc 1, "trace2an.dat" using 1:3 title 'Uz analytical' w l lc 3
+plot "OUTPUT_FILES/AA.S0040.BXZ.semv" using ($1 + 0.104):(+ amplitude_of_source * $2) title 'Uz SEM' w l lc 1, "REF_ANALYTIC/trace2an.dat" using 1:3 title 'Uz analytical' w l lc 3
pause -1 "Hit any key..."
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/run_this_example.sh b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/run_this_example.sh
index fa18a3c23..753d54ee5 100755
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/run_this_example.sh
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/DATA/Par_file b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/DATA/Par_file
index 2de82f19b..31bb32626 100644
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/DATA/Par_file
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/DATA/Par_file
@@ -260,15 +260,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/README b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/README
index b8211cc76..078cdc99f 100644
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/README
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/README
@@ -6,7 +6,7 @@ This example creates the fluid-solid example with flat ocean bottom from the 200
To run the example, type:
- ./process.sh
+ ./run_this_example.sh
in this directory.
diff --git a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/run_this_example.sh b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/run_this_example.sh
index fa18a3c23..753d54ee5 100755
--- a/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/run_this_example.sh
+++ b/EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/global_Earth_ak135f/DATA/Par_file b/EXAMPLES/global_Earth_ak135f/DATA/Par_file
index 9c99a8198..3c3fca3c5 100644
--- a/EXAMPLES/global_Earth_ak135f/DATA/Par_file
+++ b/EXAMPLES/global_Earth_ak135f/DATA/Par_file
@@ -271,15 +271,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_AK135F_NO_MUD # file containing the mesh
-nodes_coords_file = ./DATA/Nodes_AK135F_NO_MUD # file containing the nodes coordinates
-materials_file = ./DATA/Material_AK135F_NO_MUD # file containing the material number for each element
-free_surface_file = ./DATA/Surf_free_AK135F_NO_MUD # file containing the free surface
-axial_elements_file = ./DATA/Symmetry_axis_elements_AK135F_NO_MUD # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Surf_abs_AK135F_NO_MUD # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/Mesh_AK135F_NO_MUD # file containing the mesh
+nodes_coords_file = ./MESH/Nodes_AK135F_NO_MUD # file containing the nodes coordinates
+materials_file = ./MESH/Material_AK135F_NO_MUD # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/Nummaterial_velocity_file_NO_MUD # file containing the material properties for each material
+free_surface_file = ./MESH/Surf_free_AK135F_NO_MUD # file containing the free surface
+axial_elements_file = ./MESH/Symmetry_axis_elements_AK135F_NO_MUD # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/Surf_abs_AK135F_NO_MUD # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/global_Earth_ak135f/MESH/Nummaterial_velocity_file_NO_MUD b/EXAMPLES/global_Earth_ak135f/MESH/Nummaterial_velocity_file_NO_MUD
new file mode 100644
index 000000000..c514f000a
--- /dev/null
+++ b/EXAMPLES/global_Earth_ak135f/MESH/Nummaterial_velocity_file_NO_MUD
@@ -0,0 +1,35 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 3320.d0 8040.d0 4480.0d0 9999.d0 9999.d0 0
+2 2 4985.d0 12503.d0 6805.0d0 9999.d0 9999.d0 0
+1 3 11539.d0 9751.d0 0.0d0 9999.d0 9999.d0 0
+2 4 13004.d0 11256.d0 3663.0d0 9999.d0 9999.d0 0
diff --git a/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90 b/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90
index c433f0145..70093e496 100644
--- a/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90
+++ b/EXAMPLES/global_Earth_ak135f/create_mesh_AK135F_2D_with_central_cube_no_PML.F90
@@ -1174,10 +1174,10 @@ program generate_mesh
! write the mesh points
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Nodes_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Nodes_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
write(22) npoin
#else
- open(unit=22,file='DATA/Nodes_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Nodes_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
write(22,*) npoin
#endif
do ipoin = 1,npoin
@@ -1191,10 +1191,10 @@ program generate_mesh
! write the mesh elements
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Mesh_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Mesh_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
write(22) nspec
#else
- open(unit=22,file='DATA/Mesh_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Mesh_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
write(22,*) nspec
#endif
do ispec = 1,nspec
@@ -1208,9 +1208,9 @@ program generate_mesh
! write the material properties
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Material_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Material_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
#else
- open(unit=22,file='DATA/Material_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Material_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
#endif
do ispec = 1,nspec
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
@@ -1223,20 +1223,20 @@ program generate_mesh
! write empty file for the absorbing boundary
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Surf_abs_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Surf_abs_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
write(22) 0
#else
- open(unit=22,file='DATA/Surf_abs_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Surf_abs_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
write(22,*) 0
#endif
close(22)
! write empty file for the acoustic free surface boundary (since there is no acoustic free surface in the 1D Earth without oceans)
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Surf_free_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Surf_free_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
write(22) 0
#else
- open(unit=22,file='DATA/Surf_free_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Surf_free_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
write(22,*) 0
#endif
close(22)
@@ -1271,10 +1271,10 @@ program generate_mesh
! then save them to a file and also save the (only) edge that is in contact
#ifdef USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
- open(unit=22,file='DATA/Symmetry_axis_elements_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Symmetry_axis_elements_AK135F_NO_MUD',form='unformatted',status='unknown',action='write')
write(22) ispec_count
#else
- open(unit=22,file='DATA/Symmetry_axis_elements_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
+ open(unit=22,file='MESH/Symmetry_axis_elements_AK135F_NO_MUD',form='formatted',status='unknown',action='write')
write(22,*) ispec_count
#endif
diff --git a/EXAMPLES/global_Earth_ak135f/make_specific_mesher_for_2D_Earth.sh b/EXAMPLES/global_Earth_ak135f/make_specific_mesher_for_2D_Earth.sh
index 62d586cf6..eb689593c 100755
--- a/EXAMPLES/global_Earth_ak135f/make_specific_mesher_for_2D_Earth.sh
+++ b/EXAMPLES/global_Earth_ak135f/make_specific_mesher_for_2D_Earth.sh
@@ -17,6 +17,8 @@ rm -f bin/xcreate_mesh_files
# compile
$f90 $flags -o bin/xcreate_mesh_files create_mesh_AK135F_2D_with_central_cube_no_PML.F90
+mkdir -p MESH/
+
./bin/xcreate_mesh_files
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi
diff --git a/EXAMPLES/infinite_homogeneous_moment_tensor_vertical_dip_slip/DATA/Par_file b/EXAMPLES/infinite_homogeneous_moment_tensor_vertical_dip_slip/DATA/Par_file
index 5e5e86f6c..b6ca026ba 100644
--- a/EXAMPLES/infinite_homogeneous_moment_tensor_vertical_dip_slip/DATA/Par_file
+++ b/EXAMPLES/infinite_homogeneous_moment_tensor_vertical_dip_slip/DATA/Par_file
@@ -259,15 +259,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/infinite_homogeneous_plane_wave/DATA/Par_file b/EXAMPLES/infinite_homogeneous_plane_wave/DATA/Par_file
index 2f6c95fd0..d896753c8 100644
--- a/EXAMPLES/infinite_homogeneous_plane_wave/DATA/Par_file
+++ b/EXAMPLES/infinite_homogeneous_plane_wave/DATA/Par_file
@@ -265,15 +265,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/initial_mode_LDDRK/DATA/Par_file b/EXAMPLES/initial_mode_LDDRK/DATA/Par_file
index 16eec6d90..c85aa12f5 100644
--- a/EXAMPLES/initial_mode_LDDRK/DATA/Par_file
+++ b/EXAMPLES/initial_mode_LDDRK/DATA/Par_file
@@ -260,15 +260,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/initial_plane_wave_with_free_surface/DATA/Par_file b/EXAMPLES/initial_plane_wave_with_free_surface/DATA/Par_file
index c52307f7f..be23eacc3 100644
--- a/EXAMPLES/initial_plane_wave_with_free_surface/DATA/Par_file
+++ b/EXAMPLES/initial_plane_wave_with_free_surface/DATA/Par_file
@@ -259,15 +259,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_elements # file containing the mesh
-nodes_coords_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_nodes # file containing the nodes coordinates
-materials_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_material # file containing the material number for each element
-free_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_free # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/ice_water_rock_1D/ice_water_rock_1D_surface_absorb # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/moving_sources_acoustic/DATA/Par_file b/EXAMPLES/moving_sources_acoustic/DATA/Par_file
index fb9057bdb..48bccee17 100644
--- a/EXAMPLES/moving_sources_acoustic/DATA/Par_file
+++ b/EXAMPLES/moving_sources_acoustic/DATA/Par_file
@@ -262,6 +262,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/noise_uniform/DATA/Par_file b/EXAMPLES/noise_uniform/DATA/Par_file
index dd0cd2ebd..1848484f2 100644
--- a/EXAMPLES/noise_uniform/DATA/Par_file
+++ b/EXAMPLES/noise_uniform/DATA/Par_file
@@ -277,15 +277,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/noise_uniform/REF_SEIS/Par_file b/EXAMPLES/noise_uniform/REF_SEIS/Par_file
index dd0cd2ebd..1848484f2 100644
--- a/EXAMPLES/noise_uniform/REF_SEIS/Par_file
+++ b/EXAMPLES/noise_uniform/REF_SEIS/Par_file
@@ -277,15 +277,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/paper_axisymmetry_example/Par_file b/EXAMPLES/paper_axisymmetry_example/DATA/Par_file
similarity index 95%
rename from EXAMPLES/paper_axisymmetry_example/Par_file
rename to EXAMPLES/paper_axisymmetry_example/DATA/Par_file
index 2cf8d0767..011c6c234 100644
--- a/EXAMPLES/paper_axisymmetry_example/Par_file
+++ b/EXAMPLES/paper_axisymmetry_example/DATA/Par_file
@@ -17,7 +17,7 @@ NOISE_TOMOGRAPHY = 0
SAVE_FORWARD = .false.
# parameters concerning partitioning
-NPROC = 16 # number of processes
+NPROC = 8 # number of processes
# time step parameters
# total number of time steps
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = MESH_SMALL/mesh_file # file containing the mesh
-nodes_coords_file = MESH_SMALL/nodes_coords_file # file containing the nodes coordinates
-materials_file = MESH_SMALL/materials_file # file containing the material number for each element
-free_surface_file = MESH_SMALL/free_surface_file # file containing the free surface
-axial_elements_file = MESH_SMALL/elements_axis # file containing the axial elements if AXISYM is true
-absorbing_surface_file = MESH_SMALL/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA_PML/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = MESH_SMALL/elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = MESH_SMALL/mesh_file # file containing the mesh
+nodes_coords_file = MESH_SMALL/nodes_coords_file # file containing the nodes coordinates
+materials_file = MESH_SMALL/materials_file # file containing the material number for each element
+nummaterial_velocity_file = MESH_SMALL/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = MESH_SMALL/free_surface_file # file containing the free surface
+axial_elements_file = MESH_SMALL/elements_axis # file containing the axial elements if AXISYM is true
+absorbing_surface_file = MESH_SMALL/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = MESH_SMALL/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = MESH_SMALL/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = MESH_SMALL/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/paper_axisymmetry_example/SOURCE b/EXAMPLES/paper_axisymmetry_example/DATA/SOURCE
similarity index 100%
rename from EXAMPLES/paper_axisymmetry_example/SOURCE
rename to EXAMPLES/paper_axisymmetry_example/DATA/SOURCE
diff --git a/EXAMPLES/paper_axisymmetry_example/MESH_SMALL/nummaterial_velocity_file b/EXAMPLES/paper_axisymmetry_example/MESH_SMALL/nummaterial_velocity_file
new file mode 100644
index 000000000..eb91fbc8e
--- /dev/null
+++ b/EXAMPLES/paper_axisymmetry_example/MESH_SMALL/nummaterial_velocity_file
@@ -0,0 +1,33 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 2400.d0 1200.0d0 136.43763536114344 136.43763536114344 0
+1 2 1000.d0 1500.d0 0.0d0 9999.0 9999.0 0
diff --git a/EXAMPLES/paper_axisymmetry_example/README b/EXAMPLES/paper_axisymmetry_example/README
index 8a1d92434..3d0c3caed 100644
--- a/EXAMPLES/paper_axisymmetry_example/README
+++ b/EXAMPLES/paper_axisymmetry_example/README
@@ -53,6 +53,6 @@ To speed up the results the calculation are made at low resolution, you can obta
If you change the number of receivers you will have to change the factor at the beginning of the script in make_comparison.sh
It is just a multiplying factor that set the reference.
-To clean this directory : rm -rf DATA/ OUTPUT_FILES/ x* *~
+To clean this directory : rm -rf OUTPUT_FILES/ x* *~
If you have any questions feel free to contact me : alexis dot bottero at gmail doT com
diff --git a/EXAMPLES/paper_axisymmetry_example/TLcomsol.txt b/EXAMPLES/paper_axisymmetry_example/REF_COMSOL/TLcomsol.txt
similarity index 100%
rename from EXAMPLES/paper_axisymmetry_example/TLcomsol.txt
rename to EXAMPLES/paper_axisymmetry_example/REF_COMSOL/TLcomsol.txt
diff --git a/EXAMPLES/paper_axisymmetry_example/make_comparison.sh b/EXAMPLES/paper_axisymmetry_example/make_comparison.sh
index 1c77453e5..25178f27a 100755
--- a/EXAMPLES/paper_axisymmetry_example/make_comparison.sh
+++ b/EXAMPLES/paper_axisymmetry_example/make_comparison.sh
@@ -15,7 +15,7 @@ factor=0.00000000000055 # TODO change that to obtain a good fit, it is just a mu
#/home/bottero/bin/mpiexec -n 12 python ./computeTLmpi.py OUTPUT_FILES/ --freq 5.0 --NdownSampled 4 --outputPath OUTPUT_FILES/lossesGOOD --noplot
# Convert kilometers to meters:
-awk '{ print $1/1000," ",$2}' TLcomsol.txt > TLcomsolKM.txt
+awk '{ print $1/1000," ",$2}' REF_COMSOL/TLcomsol.txt > REF_COMSOL/TLcomsolKM.txt
# Scale amplitudes:
./processAmplitudes.py OUTPUT_FILES/lossesGOODampl --ref $factor --noplot
@@ -24,4 +24,4 @@ awk '{ print $1/1000," ",$2}' TLcomsol.txt > TLcomsolKM.txt
awk '{ print $1-0.03386," ",-$2}' rotvars_Jensen_2007_Figure7a.txt > rotvars_Jensen_2007_Figure7a2.txt
# Plot comparison
-../../utils/Visualization/plot.py rotvars_Jensen_2007_Figure7a2.txt TLcomsolKM.txt OUTPUT_FILES/lossesGOODamplLosses --hold -w 3 --fontsize 16 --xlabel "Range (km)" --ylabel "Transmission losses (dB)" --invert_yaxis -l 'ROTVARS','COMSOL','Spectral elements' -c 0,0,0.8+0,0.8,0+0.8,0,0
+../../utils/Visualization/plot.py rotvars_Jensen_2007_Figure7a2.txt REF_COMSOL/TLcomsolKM.txt OUTPUT_FILES/lossesGOODamplLosses --hold -w 3 --fontsize 16 --xlabel "Range (km)" --ylabel "Transmission losses (dB)" --invert_yaxis -l 'ROTVARS','COMSOL','Spectral elements' -c 0,0,0.8+0,0.8,0+0.8,0,0
diff --git a/EXAMPLES/paper_axisymmetry_example/make_mesh.sh b/EXAMPLES/paper_axisymmetry_example/make_mesh.sh
index 6b56640cf..9a0dedcba 100755
--- a/EXAMPLES/paper_axisymmetry_example/make_mesh.sh
+++ b/EXAMPLES/paper_axisymmetry_example/make_mesh.sh
@@ -20,23 +20,25 @@
# mesh_file = MESH_SMALL/mesh_file # file containing the mesh
# nodes_coords_file = MESH_SMALL/nodes_coords_file # file containing the nodes coordinates
# materials_file = MESH_SMALL/materials_file # file containing the material number for each element
+# nummaterial_velocity_file = MESH_SMALL/nummaterial_velocity_file # file containing the material properties for each material
# free_surface_file = MESH_SMALL/free_surface_file # file containing the free surface
# axial_elements_file = MESH_SMALL/elements_axis # file containing the axial elements if AXISYM is true
# absorbing_surface_file = MESH_SMALL/absorbing_surface_file # file containing the absorbing surface
-# acoustic_forcing_surface_file = ./DATA_PML/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+# acoustic_forcing_surface_file = MESH_SMALL/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
# CPML_element_file = MESH_SMALL/elements_cpml_list # file containing the CPML element numbers
-# tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+# tangential_detection_curve_file = MESH_SMALL/courbe_eros_nodes # file containing the curve delimiting the velocity model
#
# Has to be changed to:
# mesh_file = MESH/mesh_file # file containing the mesh
# nodes_coords_file = MESH/nodes_coords_file # file containing the nodes coordinates
# materials_file = MESH/materials_file # file containing the material number for each element
+# nummaterial_velocity_file = MESH/nummaterial_velocity_file # file containing the material properties for each material
# free_surface_file = MESH/free_surface_file # file containing the free surface
# axial_elements_file = MESH/elements_axis # file containing the axial elements if AXISYM is true
# absorbing_surface_file = MESH/absorbing_surface_file # file containing the absorbing surface
-# acoustic_forcing_surface_file = ./DATA_PML/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+# acoustic_forcing_surface_file = MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
# CPML_element_file = MESH/elements_cpml_list # file containing the CPML element numbers
-# tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+# tangential_detection_curve_file = MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#
PATH_TO_CUBIT=/opt/Trelis-15.0/bin/trelis # TODO update that line: path to cubit executable
@@ -57,7 +59,7 @@ echo "Making mesh ..."
$PATH_TO_CUBIT -nographics -batch ./JensenMesh.py # >> /dev/null 2>&1
-echo "Done! Mesh files has been written in directory MESH"
+echo "Done! Mesh files has been written in directory MESH/"
rm -rf history* free_surface_file materials_file mesh_file nodes_coords_file elements_cpml_list absorbing_surface_file
diff --git a/EXAMPLES/paper_axisymmetry_example/run_this_example.sh b/EXAMPLES/paper_axisymmetry_example/run_this_example.sh
index 25ba14dff..06ded9b10 100755
--- a/EXAMPLES/paper_axisymmetry_example/run_this_example.sh
+++ b/EXAMPLES/paper_axisymmetry_example/run_this_example.sh
@@ -14,16 +14,10 @@ echo " Setting up the simulation..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# Clean output files
-rm -rf OUTPUT_FILES/* DATA/*
+rm -rf OUTPUT_FILES/*
-# Sets up local DATA/ directory
-cd DATA/
-ln -s ../Par_file Par_file
-ln -s ../SOURCE SOURCE
-cd ../
# Compiles executables in root directory
cd ../../
@@ -49,18 +43,32 @@ cp DATA/SOURCE OUTPUT_FILES/
# Get the number of processors
NPROC=`grep NPROC DATA/Par_file | cut -d = -f 2 | cut -d \# -f 1 | tr -d ' '`
-# Run database generation
-echo
-echo " Running mesher..."
-echo
-./bin/xmeshfem2D
+# runs database generation
+if [ "$NPROC" -eq 1 ]; then
+ # This is a serial simulation
+ echo
+ echo "running mesher..."
+ echo
+ ./bin/xmeshfem2D
+else
+ # This is a MPI simulation
+ echo
+ echo "running mesher on $NPROC processors..."
+ echo
+ mpirun -np $NPROC ./bin/xmeshfem2D
+fi
+# checks exit code
+if [[ $? -ne 0 ]]; then exit 1; fi
-if [ "$NPROC" -eq 1 ]; then # This is a serial simulation
+# runs simulation
+if [ "$NPROC" -eq 1 ]; then
+ # This is a serial simulation
echo
echo " Running solver..."
echo
./bin/xspecfem2D
-else # This is a MPI simulation
+else
+ # This is a MPI simulation
echo
echo " Running solver on $NPROC processors..."
echo
diff --git a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/Pekeris_waveguide/DATA/Par_file b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/Pekeris_waveguide/DATA/Par_file
index b1346dc4e..2845cb75b 100644
--- a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/Pekeris_waveguide/DATA/Par_file
+++ b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/Pekeris_waveguide/DATA/Par_file
@@ -263,6 +263,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_free_bottom_surface/DATA/Par_file b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_free_bottom_surface/DATA/Par_file
index d7ca4dcb3..a6e5f4e88 100644
--- a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_free_bottom_surface/DATA/Par_file
+++ b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_free_bottom_surface/DATA/Par_file
@@ -262,6 +262,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_rigid_bottom_surface/DATA/Par_file b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_rigid_bottom_surface/DATA/Par_file
index a55c55390..9eec14083 100644
--- a/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_rigid_bottom_surface/DATA/Par_file
+++ b/EXAMPLES/perfect_idealized_oceanic_guide_in_underwater_acoustics/with_rigid_bottom_surface/DATA/Par_file
@@ -271,6 +271,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/poroelastic_acoustic/DATA/Par_file b/EXAMPLES/poroelastic_acoustic/DATA/Par_file
index 8ce7c8cc6..becc79f66 100644
--- a/EXAMPLES/poroelastic_acoustic/DATA/Par_file
+++ b/EXAMPLES/poroelastic_acoustic/DATA/Par_file
@@ -284,6 +284,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/poroelastic_semi_infinite_homogeneous/DATA/Par_file b/EXAMPLES/poroelastic_semi_infinite_homogeneous/DATA/Par_file
index 1e9b6e584..124bc60d9 100644
--- a/EXAMPLES/poroelastic_semi_infinite_homogeneous/DATA/Par_file
+++ b/EXAMPLES/poroelastic_semi_infinite_homogeneous/DATA/Par_file
@@ -271,6 +271,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py b/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py
index 1e6678e18..3d9eb8d1e 100755
--- a/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py
+++ b/EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py
@@ -383,7 +383,8 @@ def write_template_file(parameters,tmp_file,verbose=False):
f.write( "%s\n" % comment )
# for slightly different output format
- external_model_parameter = ['mesh_file','nodes_coords_file','materials_file','free_surface_file', \
+ external_model_parameter = ['mesh_file','nodes_coords_file','materials_file', \
+ 'nummaterial_velocity_file','free_surface_file', \
'axial_elements_file','absorbing_surface_file','acoustic_forcing_surface_file', \
'absorbing_cpml_file','tangential_detection_curve_file']
@@ -393,8 +394,8 @@ def write_template_file(parameters,tmp_file,verbose=False):
if appendix:
# special section with appendix comment moved further to the right
if name in external_model_parameter:
- if len(value) <= 25:
- f.write( "%s = %s %s\n" % (name.ljust(max_name_length),value.ljust(25),appendix) )
+ if len(value) <= 39:
+ f.write( "%s = %s %s\n" % (name.ljust(max_name_length),value.ljust(39),appendix) )
else:
f.write( "%s = %s %s\n" % (name.ljust(max_name_length),value,appendix) )
else:
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/Par_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/Par_file
index 6b8c5f26c..d7eb07f1c 100644
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/Par_file
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/Par_file
@@ -259,15 +259,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/modelY1_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/modelY1_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/modelY1_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/modelY1_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/modelY1_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/modelY1_elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/modelY1_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/modelY1_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/modelY1_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/modelY1_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/modelY1_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/modelY1_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/modelY1_elements_CPML_list # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_PML_inner_edge_for_plane_wave_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_PML_inner_edge_for_plane_wave_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_PML_inner_edge_for_plane_wave_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_PML_inner_edge_for_plane_wave_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_absorbing_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_absorbing_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_elements_CPML_list b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_elements_CPML_list
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_elements_CPML_list
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_elements_CPML_list
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_free_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_free_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_free_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_materials_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_materials_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_materials_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_mesh_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_mesh_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_mesh_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_nodes_coords_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/DATA/modelY1_nodes_coords_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_nodes_coords_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_nummaterial_velocity_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_nummaterial_velocity_file
new file mode 100644
index 000000000..196429873
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/MESH/modelY1_nummaterial_velocity_file
@@ -0,0 +1,32 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 3500.d0 2000.d0 9999 9999 0
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/run_this_example.sh b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/run_this_example.sh
index 13bf5ddd7..461840030 100755
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/run_this_example.sh
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_homogeneous/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/Par_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/Par_file
index 3313ad1d0..7f378de15 100644
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/Par_file
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/Par_file
@@ -266,15 +266,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/modelY1_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/modelY1_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/modelY1_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/modelY1_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/modelY1_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/modelY1_elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/modelY1_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/modelY1_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/modelY1_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/modelY1_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/modelY1_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/modelY1_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/modelY1_elements_CPML_list # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_PML_inner_edge_for_plane_wave_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_PML_inner_edge_for_plane_wave_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_PML_inner_edge_for_plane_wave_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_PML_inner_edge_for_plane_wave_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_absorbing_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_absorbing_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_elements_CPML_list b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_elements_CPML_list
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_elements_CPML_list
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_elements_CPML_list
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_free_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_free_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_free_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_ACIS_ascii_format.sat b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_ACIS_ascii_format.sat
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_ACIS_ascii_format.sat
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_ACIS_ascii_format.sat
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_IGES_ascii_format.iges b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_IGES_ascii_format.iges
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_IGES_ascii_format.iges
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_IGES_ascii_format.iges
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_STL_ascii_format.txt b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_STL_ascii_format.txt
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_geometry_STL_ascii_format.txt
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_geometry_STL_ascii_format.txt
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_materials_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_materials_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_materials_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_mesh_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_mesh_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_mesh_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_nodes_coords_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/DATA/modelY1_nodes_coords_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_nodes_coords_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file
new file mode 100644
index 000000000..d455b07f2
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file
@@ -0,0 +1,39 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 4000.d0 2300.d0 9999 9999 0
+2 2 1800.d0 3000.d0 1500.d0 9999 9999 0
+2 3 2000.d0 3500.d0 2000.d0 9999 9999 0
+2 4 1800.d0 2700.d0 1300.d0 9999 9999 0
+1 5 1000.d0 1500.d0 0.d0 9999 9999 0
+2 6 1800.d0 2500.d0 1000.d0 9999 9999 0
+2 7 1600.d0 2200.d0 800.d0 9999 9999 0
+2 8 1600.d0 5000.d0 3000.d0 9999 9999 0
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/run_this_example.sh b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/run_this_example.sh
index 13bf5ddd7..461840030 100755
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/run_this_example.sh
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_fluid_solid/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/Par_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/Par_file
index bd98c7d35..0cdc97f8a 100644
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/Par_file
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/Par_file
@@ -265,15 +265,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/modelY1_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/modelY1_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/modelY1_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/modelY1_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/modelY1_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/modelY1_elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/modelY1_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/modelY1_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/modelY1_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/modelY1_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/modelY1_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/modelY1_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/modelY1_elements_CPML_list # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_PML_inner_edge_for_plane_wave_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_PML_inner_edge_for_plane_wave_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_PML_inner_edge_for_plane_wave_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_PML_inner_edge_for_plane_wave_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_absorbing_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_absorbing_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_elements_CPML_list b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_elements_CPML_list
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_elements_CPML_list
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_elements_CPML_list
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_free_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_free_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_free_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_materials_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_materials_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_materials_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_mesh_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_mesh_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_mesh_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_nodes_coords_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/DATA/modelY1_nodes_coords_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_nodes_coords_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_nummaterial_velocity_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_nummaterial_velocity_file
new file mode 100644
index 000000000..1c9ceb515
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/MESH/modelY1_nummaterial_velocity_file
@@ -0,0 +1,38 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 4000.d0 2300.d0 9999 9999 0
+2 2 1800.d0 3000.d0 1500.d0 9999 9999 0
+2 3 2000.d0 3500.d0 2000.d0 9999 9999 0
+2 4 1800.d0 2700.d0 1300.d0 9999 9999 0
+2 5 1600.d0 5000.d0 3000.d0 9999 9999 0
+2 6 1800.d0 2500.d0 1000.d0 9999 9999 0
+2 7 1600.d0 2200.d0 800.d0 9999 9999 0
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/run_this_example.sh b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/run_this_example.sh
index 13bf5ddd7..461840030 100755
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/run_this_example.sh
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/CPML_normal_solid_only/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/README b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/README
new file mode 100644
index 000000000..adafc1ac9
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/README
@@ -0,0 +1,9 @@
+-----------------------------------------
+README
+-----------------------------------------
+
+This folder provides different examples using an external mesh. The mesh was created by Cubit/Trelis with an included salt dome.
+The examples show how to setup and use such an external mesh with and without PML elements.
+
+
+(originally added by Dimitri Komatitsch, Nov. 2012)
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/Par_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/Par_file
index 36f350183..8e4bbcff3 100644
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/Par_file
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/Par_file
@@ -259,15 +259,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/modelY1_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/modelY1_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/modelY1_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/modelY1_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/modelY1_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/modelY1_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/modelY1_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/modelY1_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/modelY1_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/modelY1_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/modelY1_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_absorbing_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_absorbing_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_free_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_free_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_free_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_materials_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_materials_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_materials_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_mesh_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_mesh_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_mesh_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_nodes_coords_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/DATA/modelY1_nodes_coords_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_nodes_coords_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_nummaterial_velocity_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_nummaterial_velocity_file
new file mode 100644
index 000000000..196429873
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/MESH/modelY1_nummaterial_velocity_file
@@ -0,0 +1,32 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 3500.d0 2000.d0 9999 9999 0
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/run_this_example.sh b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/run_this_example.sh
index 13bf5ddd7..461840030 100755
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/run_this_example.sh
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_homogeneous/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/Par_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/Par_file
index fd334a922..bac36cd8b 100644
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/Par_file
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/Par_file
@@ -266,15 +266,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/modelY1_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/modelY1_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/modelY1_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/modelY1_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/modelY1_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/modelY1_mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/modelY1_nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/modelY1_materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/modelY1_nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/modelY1_free_surface_file # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/modelY1_absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_absorbing_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_absorbing_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_free_surface_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_free_surface_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_free_surface_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_materials_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_materials_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_materials_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_mesh_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_mesh_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_mesh_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_nodes_coords_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/DATA/modelY1_nodes_coords_file
rename to EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_nodes_coords_file
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file
new file mode 100644
index 000000000..d455b07f2
--- /dev/null
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/MESH/modelY1_nummaterial_velocity_file
@@ -0,0 +1,39 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+2 1 2000.d0 4000.d0 2300.d0 9999 9999 0
+2 2 1800.d0 3000.d0 1500.d0 9999 9999 0
+2 3 2000.d0 3500.d0 2000.d0 9999 9999 0
+2 4 1800.d0 2700.d0 1300.d0 9999 9999 0
+1 5 1000.d0 1500.d0 0.d0 9999 9999 0
+2 6 1800.d0 2500.d0 1000.d0 9999 9999 0
+2 7 1600.d0 2200.d0 800.d0 9999 9999 0
+2 8 1600.d0 5000.d0 3000.d0 9999 9999 0
diff --git a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/run_this_example.sh b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/run_this_example.sh
index 13bf5ddd7..461840030 100755
--- a/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/run_this_example.sh
+++ b/EXAMPLES/salt_dome_CUBIT_mesh_from_Ronan_Madec/Stacey_normal_fluid_solid/run_this_example.sh
@@ -17,7 +17,6 @@ echo " setting up example..."
echo
mkdir -p OUTPUT_FILES
-mkdir -p DATA
# cleans output files
rm -rf OUTPUT_FILES/*
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file
index 153d3b105..3149f43df 100644
--- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh_file # file containing the mesh
-nodes_coords_file = ./nodes_coords_file # file containing the nodes coordinates
-materials_file = ./materials_file # file containing the material number for each element
-free_surface_file = ./free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_adj b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_adj
index 592e31074..015bec084 100644
--- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_adj
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_adj
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh_file # file containing the mesh
-nodes_coords_file = ./nodes_coords_file # file containing the nodes coordinates
-materials_file = ./materials_file # file containing the material number for each element
-free_surface_file = ./free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_fwd b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_fwd
index 19e01e626..383fadc97 100644
--- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_fwd
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_fwd
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh_file # file containing the mesh
-nodes_coords_file = ./nodes_coords_file # file containing the nodes coordinates
-materials_file = ./materials_file # file containing the material number for each element
-free_surface_file = ./free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_kernel b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_kernel
index 213b2faf0..a69a74cae 100644
--- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_kernel
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_kernel
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh_file # file containing the mesh
-nodes_coords_file = ./nodes_coords_file # file containing the nodes coordinates
-materials_file = ./materials_file # file containing the material number for each element
-free_surface_file = ./free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_save_forward b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_save_forward
index 4bce5db76..15be27998 100644
--- a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_save_forward
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/DATA/Par_file_save_forward
@@ -269,15 +269,16 @@ read_external_mesh = .true.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./mesh_file # file containing the mesh
-nodes_coords_file = ./nodes_coords_file # file containing the nodes coordinates
-materials_file = ./materials_file # file containing the material number for each element
-free_surface_file = ./free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./elements_cpml_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = ./MESH/mesh_file # file containing the mesh
+nodes_coords_file = ./MESH/nodes_coords_file # file containing the nodes coordinates
+materials_file = ./MESH/materials_file # file containing the material number for each element
+nummaterial_velocity_file = ./MESH/nummaterial_velocity_file # file containing the material properties for each material
+free_surface_file = ./MESH/free_surface_file # file containing the free surface
+axial_elements_file = ./MESH/axial_elements_file # file containing the axial elements if AXISYM is true
+absorbing_surface_file = ./MESH/absorbing_surface_file # file containing the absorbing surface
+acoustic_forcing_surface_file = ./MESH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
+absorbing_cpml_file = ./MESH/elements_cpml_list # file containing the CPML element numbers
+tangential_detection_curve_file = ./MESH/courbe_eros_nodes # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/absorbing_surface_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/absorbing_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/absorbing_surface_file
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/absorbing_surface_file
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/elements_cpml_list b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/elements_cpml_list
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/elements_cpml_list
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/elements_cpml_list
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/free_surface_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/free_surface_file
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/free_surface_file
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/free_surface_file
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/materials_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/materials_file
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/materials_file
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/materials_file
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/mesh_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/mesh_file
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/mesh_file
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/mesh_file
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/nodes_coords_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/nodes_coords_file
similarity index 100%
rename from EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/nodes_coords_file
rename to EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/nodes_coords_file
diff --git a/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/nummaterial_velocity_file b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/nummaterial_velocity_file
new file mode 100644
index 000000000..5b734c5b0
--- /dev/null
+++ b/EXAMPLES/salt_dome_Vadim/specfem2d_run_input_files_and_scripts/MESH/nummaterial_velocity_file
@@ -0,0 +1,33 @@
+# nummaterial_velocity_file
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+1 1 1000.d0 1500.d0 0.0d0 9999.d0 9999.d0 0
+2 -1 2000.d0 2000.d0 1176.0d0 9999.d0 9999.d0 0
diff --git a/EXAMPLES/semi_infinite_homogeneous/DATA/Par_file b/EXAMPLES/semi_infinite_homogeneous/DATA/Par_file
index 5d2ff87c9..3aab6c4b9 100644
--- a/EXAMPLES/semi_infinite_homogeneous/DATA/Par_file
+++ b/EXAMPLES/semi_infinite_homogeneous/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/DATA/Par_file b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/DATA/Par_file
index deb79853e..6e3d857c4 100644
--- a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/DATA/Par_file
+++ b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/DATA/Par_file
@@ -279,15 +279,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_KERNEL/Par_file b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_KERNEL/Par_file
index 8288ce7a6..a063dd93f 100644
--- a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_KERNEL/Par_file
+++ b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_KERNEL/Par_file
@@ -279,15 +279,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_SEIS/Par_file b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_SEIS/Par_file
index deb79853e..6e3d857c4 100644
--- a/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_SEIS/Par_file
+++ b/EXAMPLES/simple_topography_and_also_a_simple_fluid_layer/REF_SEIS/Par_file
@@ -279,15 +279,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/materials_file # file containing the material number for each element
-free_surface_file = ./DATA/free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/thermocline/DATA/Par_file b/EXAMPLES/thermocline/DATA/Par_file
index 1210a821b..6673a67b4 100644
--- a/EXAMPLES/thermocline/DATA/Par_file
+++ b/EXAMPLES/thermocline/DATA/Par_file
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/tomographic_ocean_model/DATA/Par_file b/EXAMPLES/tomographic_ocean_model/DATA/Par_file
index d1d62a44f..eaf1e842a 100644
--- a/EXAMPLES/tomographic_ocean_model/DATA/Par_file
+++ b/EXAMPLES/tomographic_ocean_model/DATA/Par_file
@@ -281,6 +281,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/tomographic_ocean_model/REF_SEIS/Par_file b/EXAMPLES/tomographic_ocean_model/REF_SEIS/Par_file
index d1d62a44f..eaf1e842a 100644
--- a/EXAMPLES/tomographic_ocean_model/REF_SEIS/Par_file
+++ b/EXAMPLES/tomographic_ocean_model/REF_SEIS/Par_file
@@ -281,6 +281,7 @@ read_external_mesh = .false.
mesh_file = dummy # file containing the mesh
nodes_coords_file = dummy # file containing the nodes coordinates
materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
free_surface_file = dummy # file containing the free surface
axial_elements_file = dummy # file containing the axial elements if AXISYM is true
absorbing_surface_file = dummy # file containing the absorbing surface
diff --git a/EXAMPLES/tomographic_ocean_model/run_this_example.sh b/EXAMPLES/tomographic_ocean_model/run_this_example.sh
index 3ae1b6361..b26bef3f1 100755
--- a/EXAMPLES/tomographic_ocean_model/run_this_example.sh
+++ b/EXAMPLES/tomographic_ocean_model/run_this_example.sh
@@ -27,7 +27,7 @@ cd ../
# scripts
if [ ! -e createTomographyFile.py ]; then
- ln -s ../../utils/createTomographyFile.py
+ ln -s ../../utils/scripts/createTomographyFile.py
fi
if [ ! -e plot_model_from_gll_or_binary_file.py ]; then
ln -s ../../utils/Visualization/plot_model_from_gll_or_binary_file.py
diff --git a/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/Par_file_fluid_solid b/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/Par_file_fluid_solid
index 1293e9d0a..8a3ae4f02 100644
--- a/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/Par_file_fluid_solid
+++ b/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/Par_file_fluid_solid
@@ -275,15 +275,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/the_same_bug_appears_from_the_right_PML/Par_file_fluid_solid b/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/the_same_bug_appears_from_the_right_PML/Par_file_fluid_solid
index 1293e9d0a..8a3ae4f02 100644
--- a/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/the_same_bug_appears_from_the_right_PML/Par_file_fluid_solid
+++ b/EXAMPLES/unresolved_bugs/bugPMLs_1_extra_phase_coming_back_from_the_left_PML/the_same_bug_appears_from_the_right_PML/Par_file_fluid_solid
@@ -275,15 +275,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/EXAMPLES/unresolved_bugs/bugPMLs_2_weak_instability_in_long_times/DATA/Par_file b/EXAMPLES/unresolved_bugs/bugPMLs_2_weak_instability_in_long_times/DATA/Par_file
index ffbd1a324..e4ecb6698 100644
--- a/EXAMPLES/unresolved_bugs/bugPMLs_2_weak_instability_in_long_times/DATA/Par_file
+++ b/EXAMPLES/unresolved_bugs/bugPMLs_2_weak_instability_in_long_times/DATA/Par_file
@@ -270,15 +270,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = ./DATA/absorbing_cpml_file # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/config.guess b/config.guess
index 35d50dbed..f6d217a49 100755
--- a/config.guess
+++ b/config.guess
@@ -1,14 +1,14 @@
#! /bin/sh
# Attempt to guess a canonical system name.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2024 Free Software Foundation, Inc.
-timestamp='2012-06-10'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
+
+timestamp='2024-01-01'
# This file is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful, but
@@ -17,33 +17,39 @@ timestamp='2012-06-10'
# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see .
+# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
-
-
-# Originally written by Per Bothner. Please send patches (context
-# diff format) to and include a ChangeLog
-# entry.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
#
-# This script attempts to guess a canonical system name similar to
-# config.sub. If it succeeds, it prints the system name on stdout, and
-# exits with 0. Otherwise, it exits with 1.
+# Originally written by Per Bothner; maintained since 2000 by Ben Elliston.
#
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.guess
+#
+# Please send patches to .
+
+
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
Usage: $0 [OPTION]
-Output the configuration name of the system \`$me' is run on.
+Output the configuration name of the system '$me' is run on.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -54,15 +60,13 @@ version="\
GNU config.guess ($timestamp)
Originally written by Per Bothner.
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
-Try \`$me --help' for more information."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -90,57 +94,109 @@ if test $# != 0; then
exit 1
fi
-trap 'exit 1' 1 2 15
+# Just in case it came from the environment.
+GUESS=
# CC_FOR_BUILD -- compiler used by this script. Note that the use of a
# compiler to aid in system detection is discouraged as it requires
# temporary files to be created and, as you can see below, it is a
# headache to deal with in a portable fashion.
-# Historically, `CC_FOR_BUILD' used to be named `HOST_CC'. We still
-# use `HOST_CC' if defined, but it is deprecated.
+# Historically, 'CC_FOR_BUILD' used to be named 'HOST_CC'. We still
+# use 'HOST_CC' if defined, but it is deprecated.
# Portable tmp directory creation inspired by the Autoconf team.
-set_cc_for_build='
-trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && exit \$exitcode" 0 ;
-trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
-: ${TMPDIR=/tmp} ;
- { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
- { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
- { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
- { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
-dummy=$tmp/dummy ;
-tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
-case $CC_FOR_BUILD,$HOST_CC,$CC in
- ,,) echo "int x;" > $dummy.c ;
- for c in cc gcc c89 c99 ; do
- if ($c -c -o $dummy.o $dummy.c) >/dev/null 2>&1 ; then
- CC_FOR_BUILD="$c"; break ;
- fi ;
- done ;
- if test x"$CC_FOR_BUILD" = x ; then
- CC_FOR_BUILD=no_compiler_found ;
- fi
- ;;
- ,,*) CC_FOR_BUILD=$CC ;;
- ,*,*) CC_FOR_BUILD=$HOST_CC ;;
-esac ; set_cc_for_build= ;'
+tmp=
+# shellcheck disable=SC2172
+trap 'test -z "$tmp" || rm -fr "$tmp"' 0 1 2 13 15
+
+set_cc_for_build() {
+ # prevent multiple calls if $tmp is already set
+ test "$tmp" && return 0
+ : "${TMPDIR=/tmp}"
+ # shellcheck disable=SC2039,SC3028
+ { tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
+ { test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir "$tmp" 2>/dev/null) ; } ||
+ { tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir "$tmp" 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
+ { echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; }
+ dummy=$tmp/dummy
+ case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
+ ,,) echo "int x;" > "$dummy.c"
+ for driver in cc gcc c89 c99 ; do
+ if ($driver -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
+ CC_FOR_BUILD=$driver
+ break
+ fi
+ done
+ if test x"$CC_FOR_BUILD" = x ; then
+ CC_FOR_BUILD=no_compiler_found
+ fi
+ ;;
+ ,,*) CC_FOR_BUILD=$CC ;;
+ ,*,*) CC_FOR_BUILD=$HOST_CC ;;
+ esac
+}
# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
# (ghazi@noc.rutgers.edu 1994-08-24)
-if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+if test -f /.attbin/uname ; then
PATH=$PATH:/.attbin ; export PATH
fi
UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
-UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+case $UNAME_SYSTEM in
+Linux|GNU|GNU/*)
+ LIBC=unknown
+
+ set_cc_for_build
+ cat <<-EOF > "$dummy.c"
+ #if defined(__ANDROID__)
+ LIBC=android
+ #else
+ #include
+ #if defined(__UCLIBC__)
+ LIBC=uclibc
+ #elif defined(__dietlibc__)
+ LIBC=dietlibc
+ #elif defined(__GLIBC__)
+ LIBC=gnu
+ #elif defined(__LLVM_LIBC__)
+ LIBC=llvm
+ #else
+ #include
+ /* First heuristic to detect musl libc. */
+ #ifdef __DEFINED_va_list
+ LIBC=musl
+ #endif
+ #endif
+ #endif
+ EOF
+ cc_set_libc=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^LIBC' | sed 's, ,,g'`
+ eval "$cc_set_libc"
+
+ # Second heuristic to detect musl libc.
+ if [ "$LIBC" = unknown ] &&
+ command -v ldd >/dev/null &&
+ ldd --version 2>&1 | grep -q ^musl; then
+ LIBC=musl
+ fi
+
+ # If the system lacks a compiler, then just pick glibc.
+ # We could probably try harder.
+ if [ "$LIBC" = unknown ]; then
+ LIBC=gnu
+ fi
+ ;;
+esac
+
# Note: order is significant - the case branches are not exclusive.
-case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+case $UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION in
*:NetBSD:*:*)
# NetBSD (nbsd) targets should (where applicable) match one or
# more of the tuples: *-*-netbsdelf*, *-*-netbsdaout*,
@@ -152,22 +208,32 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#
# Note: NetBSD doesn't particularly care about the vendor
# portion of the name. We always set it to "unknown".
- sysctl="sysctl -n hw.machine_arch"
- UNAME_MACHINE_ARCH=`(/sbin/$sysctl 2>/dev/null || \
- /usr/sbin/$sysctl 2>/dev/null || echo unknown)`
- case "${UNAME_MACHINE_ARCH}" in
+ UNAME_MACHINE_ARCH=`(uname -p 2>/dev/null || \
+ /sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ /usr/sbin/sysctl -n hw.machine_arch 2>/dev/null || \
+ echo unknown)`
+ case $UNAME_MACHINE_ARCH in
+ aarch64eb) machine=aarch64_be-unknown ;;
armeb) machine=armeb-unknown ;;
arm*) machine=arm-unknown ;;
sh3el) machine=shl-unknown ;;
sh3eb) machine=sh-unknown ;;
sh5el) machine=sh5le-unknown ;;
- *) machine=${UNAME_MACHINE_ARCH}-unknown ;;
+ earmv*)
+ arch=`echo "$UNAME_MACHINE_ARCH" | sed -e 's,^e\(armv[0-9]\).*$,\1,'`
+ endian=`echo "$UNAME_MACHINE_ARCH" | sed -ne 's,^.*\(eb\)$,\1,p'`
+ machine=${arch}${endian}-unknown
+ ;;
+ *) machine=$UNAME_MACHINE_ARCH-unknown ;;
esac
# The Operating System including object format, if it has switched
- # to ELF recently, or will in the future.
- case "${UNAME_MACHINE_ARCH}" in
+ # to ELF recently (or will in the future) and ABI.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ os=netbsdelf
+ ;;
arm*|i386|m68k|ns32k|sh3*|sparc|vax)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ELF__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ELF__
then
@@ -182,41 +248,80 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
os=netbsd
;;
esac
+ # Determine ABI tags.
+ case $UNAME_MACHINE_ARCH in
+ earm*)
+ expr='s/^earmv[0-9]/-eabi/;s/eb$//'
+ abi=`echo "$UNAME_MACHINE_ARCH" | sed -e "$expr"`
+ ;;
+ esac
# The OS release
# Debian GNU/NetBSD machines have a different userland, and
# thus, need a distinct triplet. However, they do not need
# kernel version information, so it can be replaced with a
# suitable tag, in the style of linux-gnu.
- case "${UNAME_VERSION}" in
+ case $UNAME_VERSION in
Debian*)
release='-gnu'
;;
*)
- release=`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ release=`echo "$UNAME_RELEASE" | sed -e 's/[-_].*//' | cut -d. -f1,2`
;;
esac
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
# contains redundant information, the shorter form:
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
- echo "${machine}-${os}${release}"
- exit ;;
+ GUESS=$machine-${os}${release}${abi-}
+ ;;
+ *:Bitrig:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-bitrig$UNAME_RELEASE
+ ;;
*:OpenBSD:*:*)
UNAME_MACHINE_ARCH=`arch | sed 's/OpenBSD.//'`
- echo ${UNAME_MACHINE_ARCH}-unknown-openbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE_ARCH-unknown-openbsd$UNAME_RELEASE
+ ;;
+ *:SecBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/SecBSD.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-secbsd$UNAME_RELEASE
+ ;;
+ *:LibertyBSD:*:*)
+ UNAME_MACHINE_ARCH=`arch | sed 's/^.*BSD\.//'`
+ GUESS=$UNAME_MACHINE_ARCH-unknown-libertybsd$UNAME_RELEASE
+ ;;
+ *:MidnightBSD:*:*)
+ GUESS=$UNAME_MACHINE-unknown-midnightbsd$UNAME_RELEASE
+ ;;
*:ekkoBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-ekkobsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-ekkobsd$UNAME_RELEASE
+ ;;
*:SolidBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-solidbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-solidbsd$UNAME_RELEASE
+ ;;
+ *:OS108:*:*)
+ GUESS=$UNAME_MACHINE-unknown-os108_$UNAME_RELEASE
+ ;;
macppc:MirBSD:*:*)
- echo powerpc-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-mirbsd$UNAME_RELEASE
+ ;;
*:MirBSD:*:*)
- echo ${UNAME_MACHINE}-unknown-mirbsd${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-mirbsd$UNAME_RELEASE
+ ;;
+ *:Sortix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-sortix
+ ;;
+ *:Twizzler:*:*)
+ GUESS=$UNAME_MACHINE-unknown-twizzler
+ ;;
+ *:Redox:*:*)
+ GUESS=$UNAME_MACHINE-unknown-redox
+ ;;
+ mips:OSF1:*.*)
+ GUESS=mips-dec-osf1
+ ;;
alpha:OSF1:*:*)
+ # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
+ trap '' 0
case $UNAME_RELEASE in
*4.0)
UNAME_RELEASE=`/usr/sbin/sizer -v | awk '{print $3}'`
@@ -230,163 +335,158 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# covers most systems running today. This code pipes the CPU
# types through head -n 1, so we only detect the type of CPU 0.
ALPHA_CPU_TYPE=`/usr/sbin/psrinfo -v | sed -n -e 's/^ The alpha \(.*\) processor.*$/\1/p' | head -n 1`
- case "$ALPHA_CPU_TYPE" in
+ case $ALPHA_CPU_TYPE in
"EV4 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV4.5 (21064)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"LCA4 (21066/21068)")
- UNAME_MACHINE="alpha" ;;
+ UNAME_MACHINE=alpha ;;
"EV5 (21164)")
- UNAME_MACHINE="alphaev5" ;;
+ UNAME_MACHINE=alphaev5 ;;
"EV5.6 (21164A)")
- UNAME_MACHINE="alphaev56" ;;
+ UNAME_MACHINE=alphaev56 ;;
"EV5.6 (21164PC)")
- UNAME_MACHINE="alphapca56" ;;
+ UNAME_MACHINE=alphapca56 ;;
"EV5.7 (21164PC)")
- UNAME_MACHINE="alphapca57" ;;
+ UNAME_MACHINE=alphapca57 ;;
"EV6 (21264)")
- UNAME_MACHINE="alphaev6" ;;
+ UNAME_MACHINE=alphaev6 ;;
"EV6.7 (21264A)")
- UNAME_MACHINE="alphaev67" ;;
+ UNAME_MACHINE=alphaev67 ;;
"EV6.8CB (21264C)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8AL (21264B)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.8CX (21264D)")
- UNAME_MACHINE="alphaev68" ;;
+ UNAME_MACHINE=alphaev68 ;;
"EV6.9A (21264/EV69A)")
- UNAME_MACHINE="alphaev69" ;;
+ UNAME_MACHINE=alphaev69 ;;
"EV7 (21364)")
- UNAME_MACHINE="alphaev7" ;;
+ UNAME_MACHINE=alphaev7 ;;
"EV7.9 (21364A)")
- UNAME_MACHINE="alphaev79" ;;
+ UNAME_MACHINE=alphaev79 ;;
esac
# A Pn.n version is a patched version.
# A Vn.n version is a released version.
# A Tn.n version is a released field test version.
# A Xn.n version is an unreleased experimental baselevel.
# 1.2 uses "1.2" for uname -r.
- echo ${UNAME_MACHINE}-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^[PVTX]//' | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- # Reset EXIT trap before exiting to avoid spurious non-zero exit code.
- exitcode=$?
- trap '' 0
- exit $exitcode ;;
- Alpha\ *:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # Should we change UNAME_MACHINE based on the output of uname instead
- # of the specific Alpha model?
- echo alpha-pc-interix
- exit ;;
- 21064:Windows_NT:50:3)
- echo alpha-dec-winnt3.5
- exit ;;
+ OSF_REL=`echo "$UNAME_RELEASE" | sed -e 's/^[PVTX]//' | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ GUESS=$UNAME_MACHINE-dec-osf$OSF_REL
+ ;;
Amiga*:UNIX_System_V:4.0:*)
- echo m68k-unknown-sysv4
- exit ;;
+ GUESS=m68k-unknown-sysv4
+ ;;
*:[Aa]miga[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-amigaos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-amigaos
+ ;;
*:[Mm]orph[Oo][Ss]:*:*)
- echo ${UNAME_MACHINE}-unknown-morphos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-morphos
+ ;;
*:OS/390:*:*)
- echo i370-ibm-openedition
- exit ;;
+ GUESS=i370-ibm-openedition
+ ;;
*:z/VM:*:*)
- echo s390-ibm-zvmoe
- exit ;;
+ GUESS=s390-ibm-zvmoe
+ ;;
*:OS400:*:*)
- echo powerpc-ibm-os400
- exit ;;
+ GUESS=powerpc-ibm-os400
+ ;;
arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
- echo arm-acorn-riscix${UNAME_RELEASE}
- exit ;;
- arm:riscos:*:*|arm:RISCOS:*:*)
- echo arm-unknown-riscos
- exit ;;
+ GUESS=arm-acorn-riscix$UNAME_RELEASE
+ ;;
+ arm*:riscos:*:*|arm*:RISCOS:*:*)
+ GUESS=arm-unknown-riscos
+ ;;
SR2?01:HI-UX/MPP:*:* | SR8000:HI-UX/MPP:*:*)
- echo hppa1.1-hitachi-hiuxmpp
- exit ;;
+ GUESS=hppa1.1-hitachi-hiuxmpp
+ ;;
Pyramid*:OSx*:*:* | MIS*:OSx*:*:* | MIS*:SMP_DC-OSx*:*:*)
# akee@wpdis03.wpafb.af.mil (Earle F. Ake) contributed MIS and NILE.
- if test "`(/bin/universe) 2>/dev/null`" = att ; then
- echo pyramid-pyramid-sysv3
- else
- echo pyramid-pyramid-bsd
- fi
- exit ;;
+ case `(/bin/universe) 2>/dev/null` in
+ att) GUESS=pyramid-pyramid-sysv3 ;;
+ *) GUESS=pyramid-pyramid-bsd ;;
+ esac
+ ;;
NILE*:*:*:dcosx)
- echo pyramid-pyramid-svr4
- exit ;;
+ GUESS=pyramid-pyramid-svr4
+ ;;
DRS?6000:unix:4.0:6*)
- echo sparc-icl-nx6
- exit ;;
+ GUESS=sparc-icl-nx6
+ ;;
DRS?6000:UNIX_SV:4.2*:7* | DRS?6000:isis:4.2*:7*)
case `/usr/bin/uname -p` in
- sparc) echo sparc-icl-nx7; exit ;;
- esac ;;
+ sparc) GUESS=sparc-icl-nx7 ;;
+ esac
+ ;;
s390x:SunOS:*:*)
- echo ${UNAME_MACHINE}-ibm-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$UNAME_MACHINE-ibm-solaris2$SUN_REL
+ ;;
sun4H:SunOS:5.*:*)
- echo sparc-hal-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-hal-solaris2$SUN_REL
+ ;;
sun4*:SunOS:5.*:* | tadpole*:SunOS:5.*:*)
- echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris2$SUN_REL
+ ;;
i86pc:AuroraUX:5.*:* | i86xen:AuroraUX:5.*:*)
- echo i386-pc-auroraux${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-auroraux$UNAME_RELEASE
+ ;;
i86pc:SunOS:5.*:* | i86xen:SunOS:5.*:*)
- eval $set_cc_for_build
- SUN_ARCH="i386"
+ set_cc_for_build
+ SUN_ARCH=i386
# If there is a compiler, see if it is configured for 64-bit objects.
# Note that the Sun cc does not turn __LP64__ into 1 like gcc does.
# This test works for both compilers.
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
if (echo '#ifdef __amd64'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
+ (CCOPTS="" $CC_FOR_BUILD -m64 -E - 2>/dev/null) | \
grep IS_64BIT_ARCH >/dev/null
then
- SUN_ARCH="x86_64"
+ SUN_ARCH=x86_64
fi
fi
- echo ${SUN_ARCH}-pc-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=$SUN_ARCH-pc-solaris2$SUN_REL
+ ;;
sun4*:SunOS:6*:*)
# According to config.sub, this is the proper way to canonicalize
# SunOS6. Hard to guess exactly what SunOS6 will be like, but
# it's likely to be more like Solaris than SunOS4.
- echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=sparc-sun-solaris3$SUN_REL
+ ;;
sun4*:SunOS:*:*)
- case "`/usr/bin/arch -k`" in
+ case `/usr/bin/arch -k` in
Series*|S4*)
UNAME_RELEASE=`uname -v`
;;
esac
- # Japanese Language versions have a version number like `4.1.3-JL'.
- echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
- exit ;;
+ # Japanese Language versions have a version number like '4.1.3-JL'.
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/'`
+ GUESS=sparc-sun-sunos$SUN_REL
+ ;;
sun3*:SunOS:*:*)
- echo m68k-sun-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
+ ;;
sun*:*:4.2BSD:*)
UNAME_RELEASE=`(sed 1q /etc/motd | awk '{print substr($5,1,3)}') 2>/dev/null`
- test "x${UNAME_RELEASE}" = "x" && UNAME_RELEASE=3
- case "`/bin/arch`" in
+ test "x$UNAME_RELEASE" = x && UNAME_RELEASE=3
+ case `/bin/arch` in
sun3)
- echo m68k-sun-sunos${UNAME_RELEASE}
+ GUESS=m68k-sun-sunos$UNAME_RELEASE
;;
sun4)
- echo sparc-sun-sunos${UNAME_RELEASE}
+ GUESS=sparc-sun-sunos$UNAME_RELEASE
;;
esac
- exit ;;
+ ;;
aushp:SunOS:*:*)
- echo sparc-auspex-sunos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-auspex-sunos$UNAME_RELEASE
+ ;;
# The situation for MiNT is a little confusing. The machine name
# can be virtually everything (everything which is not
# "atarist" or "atariste" at least should have a processor
@@ -396,44 +496,44 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
# MiNT. But MiNT is downward compatible to TOS, so this should
# be no problem.
atarist[e]:*MiNT:*:* | atarist[e]:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
atari*:*MiNT:*:* | atari*:*mint:*:* | atarist[e]:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
*falcon*:*MiNT:*:* | *falcon*:*mint:*:* | *falcon*:*TOS:*:*)
- echo m68k-atari-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-atari-mint$UNAME_RELEASE
+ ;;
milan*:*MiNT:*:* | milan*:*mint:*:* | *milan*:*TOS:*:*)
- echo m68k-milan-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-milan-mint$UNAME_RELEASE
+ ;;
hades*:*MiNT:*:* | hades*:*mint:*:* | *hades*:*TOS:*:*)
- echo m68k-hades-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-hades-mint$UNAME_RELEASE
+ ;;
*:*MiNT:*:* | *:*mint:*:* | *:*TOS:*:*)
- echo m68k-unknown-mint${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-mint$UNAME_RELEASE
+ ;;
m68k:machten:*:*)
- echo m68k-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-machten$UNAME_RELEASE
+ ;;
powerpc:machten:*:*)
- echo powerpc-apple-machten${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-machten$UNAME_RELEASE
+ ;;
RISC*:Mach:*:*)
- echo mips-dec-mach_bsd4.3
- exit ;;
+ GUESS=mips-dec-mach_bsd4.3
+ ;;
RISC*:ULTRIX:*:*)
- echo mips-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dec-ultrix$UNAME_RELEASE
+ ;;
VAX*:ULTRIX*:*:*)
- echo vax-dec-ultrix${UNAME_RELEASE}
- exit ;;
+ GUESS=vax-dec-ultrix$UNAME_RELEASE
+ ;;
2020:CLIX:*:* | 2430:CLIX:*:*)
- echo clipper-intergraph-clix${UNAME_RELEASE}
- exit ;;
+ GUESS=clipper-intergraph-clix$UNAME_RELEASE
+ ;;
mips:*:*:UMIPS | mips:*:*:RISCos)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#ifdef __cplusplus
#include /* for printf() prototype */
int main (int argc, char *argv[]) {
@@ -442,95 +542,96 @@ case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
#endif
#if defined (host_mips) && defined (MIPSEB)
#if defined (SYSTYPE_SYSV)
- printf ("mips-mips-riscos%ssysv\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssysv\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_SVR4)
- printf ("mips-mips-riscos%ssvr4\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%ssvr4\\n", argv[1]); exit (0);
#endif
#if defined (SYSTYPE_BSD43) || defined(SYSTYPE_BSD)
- printf ("mips-mips-riscos%sbsd\n", argv[1]); exit (0);
+ printf ("mips-mips-riscos%sbsd\\n", argv[1]); exit (0);
#endif
#endif
exit (-1);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c &&
- dummyarg=`echo "${UNAME_RELEASE}" | sed -n 's/\([0-9]*\).*/\1/p'` &&
- SYSTEM_NAME=`$dummy $dummyarg` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" &&
+ dummyarg=`echo "$UNAME_RELEASE" | sed -n 's/\([0-9]*\).*/\1/p'` &&
+ SYSTEM_NAME=`"$dummy" "$dummyarg"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo mips-mips-riscos${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-mips-riscos$UNAME_RELEASE
+ ;;
Motorola:PowerMAX_OS:*:*)
- echo powerpc-motorola-powermax
- exit ;;
+ GUESS=powerpc-motorola-powermax
+ ;;
Motorola:*:4.3:PL8-*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:*:*:PowerMAX_OS | Synergy:PowerMAX_OS:*:*)
- echo powerpc-harris-powermax
- exit ;;
+ GUESS=powerpc-harris-powermax
+ ;;
Night_Hawk:Power_UNIX:*:*)
- echo powerpc-harris-powerunix
- exit ;;
+ GUESS=powerpc-harris-powerunix
+ ;;
m88k:CX/UX:7*:*)
- echo m88k-harris-cxux7
- exit ;;
+ GUESS=m88k-harris-cxux7
+ ;;
m88k:*:4*:R4*)
- echo m88k-motorola-sysv4
- exit ;;
+ GUESS=m88k-motorola-sysv4
+ ;;
m88k:*:3*:R3*)
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
AViiON:dgux:*:*)
# DG/UX returns AViiON for all architectures
UNAME_PROCESSOR=`/usr/bin/uname -p`
- if [ $UNAME_PROCESSOR = mc88100 ] || [ $UNAME_PROCESSOR = mc88110 ]
+ if test "$UNAME_PROCESSOR" = mc88100 || test "$UNAME_PROCESSOR" = mc88110
then
- if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx ] || \
- [ ${TARGET_BINARY_INTERFACE}x = x ]
+ if test "$TARGET_BINARY_INTERFACE"x = m88kdguxelfx || \
+ test "$TARGET_BINARY_INTERFACE"x = x
then
- echo m88k-dg-dgux${UNAME_RELEASE}
+ GUESS=m88k-dg-dgux$UNAME_RELEASE
else
- echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ GUESS=m88k-dg-dguxbcs$UNAME_RELEASE
fi
else
- echo i586-dg-dgux${UNAME_RELEASE}
+ GUESS=i586-dg-dgux$UNAME_RELEASE
fi
- exit ;;
+ ;;
M88*:DolphinOS:*:*) # DolphinOS (SVR3)
- echo m88k-dolphin-sysv3
- exit ;;
+ GUESS=m88k-dolphin-sysv3
+ ;;
M88*:*:R3*:*)
# Delta 88k system running SVR3
- echo m88k-motorola-sysv3
- exit ;;
+ GUESS=m88k-motorola-sysv3
+ ;;
XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
- echo m88k-tektronix-sysv3
- exit ;;
+ GUESS=m88k-tektronix-sysv3
+ ;;
Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
- echo m68k-tektronix-bsd
- exit ;;
+ GUESS=m68k-tektronix-bsd
+ ;;
*:IRIX*:*:*)
- echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
- exit ;;
+ IRIX_REL=`echo "$UNAME_RELEASE" | sed -e 's/-/_/g'`
+ GUESS=mips-sgi-irix$IRIX_REL
+ ;;
????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
- echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
- exit ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ GUESS=romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ ;; # Note that: echo "'`uname -s`'" gives 'AIX '
i*86:AIX:*:*)
- echo i386-ibm-aix
- exit ;;
+ GUESS=i386-ibm-aix
+ ;;
ia64:AIX:*:*)
- if [ -x /usr/bin/oslevel ] ; then
+ if test -x /usr/bin/oslevel ; then
IBM_REV=`/usr/bin/oslevel`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${UNAME_MACHINE}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-aix$IBM_REV
+ ;;
*:AIX:2:3)
if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include
main()
@@ -541,76 +642,77 @@ EOF
exit(0);
}
EOF
- if $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy`
+ if $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"`
then
- echo "$SYSTEM_NAME"
+ GUESS=$SYSTEM_NAME
else
- echo rs6000-ibm-aix3.2.5
+ GUESS=rs6000-ibm-aix3.2.5
fi
elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
- echo rs6000-ibm-aix3.2.4
+ GUESS=rs6000-ibm-aix3.2.4
else
- echo rs6000-ibm-aix3.2
+ GUESS=rs6000-ibm-aix3.2
fi
- exit ;;
+ ;;
*:AIX:*:[4567])
IBM_CPU_ID=`/usr/sbin/lsdev -C -c processor -S available | sed 1q | awk '{ print $1 }'`
- if /usr/sbin/lsattr -El ${IBM_CPU_ID} | grep ' POWER' >/dev/null 2>&1; then
+ if /usr/sbin/lsattr -El "$IBM_CPU_ID" | grep ' POWER' >/dev/null 2>&1; then
IBM_ARCH=rs6000
else
IBM_ARCH=powerpc
fi
- if [ -x /usr/bin/oslevel ] ; then
- IBM_REV=`/usr/bin/oslevel`
+ if test -x /usr/bin/lslpp ; then
+ IBM_REV=`/usr/bin/lslpp -Lqc bos.rte.libc | \
+ awk -F: '{ print $3 }' | sed s/[0-9]*$/0/`
else
- IBM_REV=${UNAME_VERSION}.${UNAME_RELEASE}
+ IBM_REV=$UNAME_VERSION.$UNAME_RELEASE
fi
- echo ${IBM_ARCH}-ibm-aix${IBM_REV}
- exit ;;
+ GUESS=$IBM_ARCH-ibm-aix$IBM_REV
+ ;;
*:AIX:*:*)
- echo rs6000-ibm-aix
- exit ;;
- ibmrt:4.4BSD:*|romp-ibm:BSD:*)
- echo romp-ibm-bsd4.4
- exit ;;
+ GUESS=rs6000-ibm-aix
+ ;;
+ ibmrt:4.4BSD:*|romp-ibm:4.4BSD:*)
+ GUESS=romp-ibm-bsd4.4
+ ;;
ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC BSD and
- echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
- exit ;; # report: romp-ibm BSD 4.3
+ GUESS=romp-ibm-bsd$UNAME_RELEASE # 4.3 with uname added to
+ ;; # report: romp-ibm BSD 4.3
*:BOSX:*:*)
- echo rs6000-bull-bosx
- exit ;;
+ GUESS=rs6000-bull-bosx
+ ;;
DPX/2?00:B.O.S.:*:*)
- echo m68k-bull-sysv3
- exit ;;
+ GUESS=m68k-bull-sysv3
+ ;;
9000/[34]??:4.3bsd:1.*:*)
- echo m68k-hp-bsd
- exit ;;
+ GUESS=m68k-hp-bsd
+ ;;
hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
- echo m68k-hp-bsd4.4
- exit ;;
+ GUESS=m68k-hp-bsd4.4
+ ;;
9000/[34678]??:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- case "${UNAME_MACHINE}" in
- 9000/31? ) HP_ARCH=m68000 ;;
- 9000/[34]?? ) HP_ARCH=m68k ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ case $UNAME_MACHINE in
+ 9000/31?) HP_ARCH=m68000 ;;
+ 9000/[34]??) HP_ARCH=m68k ;;
9000/[678][0-9][0-9])
- if [ -x /usr/bin/getconf ]; then
+ if test -x /usr/bin/getconf; then
sc_cpu_version=`/usr/bin/getconf SC_CPU_VERSION 2>/dev/null`
sc_kernel_bits=`/usr/bin/getconf SC_KERNEL_BITS 2>/dev/null`
- case "${sc_cpu_version}" in
- 523) HP_ARCH="hppa1.0" ;; # CPU_PA_RISC1_0
- 528) HP_ARCH="hppa1.1" ;; # CPU_PA_RISC1_1
+ case $sc_cpu_version in
+ 523) HP_ARCH=hppa1.0 ;; # CPU_PA_RISC1_0
+ 528) HP_ARCH=hppa1.1 ;; # CPU_PA_RISC1_1
532) # CPU_PA_RISC2_0
- case "${sc_kernel_bits}" in
- 32) HP_ARCH="hppa2.0n" ;;
- 64) HP_ARCH="hppa2.0w" ;;
- '') HP_ARCH="hppa2.0" ;; # HP-UX 10.20
+ case $sc_kernel_bits in
+ 32) HP_ARCH=hppa2.0n ;;
+ 64) HP_ARCH=hppa2.0w ;;
+ '') HP_ARCH=hppa2.0 ;; # HP-UX 10.20
esac ;;
esac
fi
- if [ "${HP_ARCH}" = "" ]; then
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ if test "$HP_ARCH" = ""; then
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#define _HPUX_SOURCE
#include
@@ -643,13 +745,13 @@ EOF
exit (0);
}
EOF
- (CCOPTS= $CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null) && HP_ARCH=`$dummy`
+ (CCOPTS="" $CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null) && HP_ARCH=`"$dummy"`
test -z "$HP_ARCH" && HP_ARCH=hppa
fi ;;
esac
- if [ ${HP_ARCH} = "hppa2.0w" ]
+ if test "$HP_ARCH" = hppa2.0w
then
- eval $set_cc_for_build
+ set_cc_for_build
# hppa2.0w-hp-hpux* has a 64-bit kernel and a compiler generating
# 32-bit code. hppa64-hp-hpux* has the same kernel and a compiler
@@ -660,23 +762,23 @@ EOF
# $ CC_FOR_BUILD="cc +DA2.0w" ./config.guess
# => hppa64-hp-hpux11.23
- if echo __LP64__ | (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) |
+ if echo __LP64__ | (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) |
grep -q __LP64__
then
- HP_ARCH="hppa2.0w"
+ HP_ARCH=hppa2.0w
else
- HP_ARCH="hppa64"
+ HP_ARCH=hppa64
fi
fi
- echo ${HP_ARCH}-hp-hpux${HPUX_REV}
- exit ;;
+ GUESS=$HP_ARCH-hp-hpux$HPUX_REV
+ ;;
ia64:HP-UX:*:*)
- HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
- echo ia64-hp-hpux${HPUX_REV}
- exit ;;
+ HPUX_REV=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*.[0B]*//'`
+ GUESS=ia64-hp-hpux$HPUX_REV
+ ;;
3050*:HI-UX:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ sed 's/^ //' << EOF > "$dummy.c"
#include
int
main ()
@@ -701,38 +803,38 @@ EOF
exit (0);
}
EOF
- $CC_FOR_BUILD -o $dummy $dummy.c && SYSTEM_NAME=`$dummy` &&
+ $CC_FOR_BUILD -o "$dummy" "$dummy.c" && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
- echo unknown-hitachi-hiuxwe2
- exit ;;
- 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:* )
- echo hppa1.1-hp-bsd
- exit ;;
+ GUESS=unknown-hitachi-hiuxwe2
+ ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?[79]:4.3bsd:*:*)
+ GUESS=hppa1.1-hp-bsd
+ ;;
9000/8??:4.3bsd:*:*)
- echo hppa1.0-hp-bsd
- exit ;;
+ GUESS=hppa1.0-hp-bsd
+ ;;
*9??*:MPE/iX:*:* | *3000*:MPE/iX:*:*)
- echo hppa1.0-hp-mpeix
- exit ;;
- hp7??:OSF1:*:* | hp8?[79]:OSF1:*:* )
- echo hppa1.1-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-mpeix
+ ;;
+ hp7??:OSF1:*:* | hp8?[79]:OSF1:*:*)
+ GUESS=hppa1.1-hp-osf
+ ;;
hp8??:OSF1:*:*)
- echo hppa1.0-hp-osf
- exit ;;
+ GUESS=hppa1.0-hp-osf
+ ;;
i*86:OSF1:*:*)
- if [ -x /usr/sbin/sysversion ] ; then
- echo ${UNAME_MACHINE}-unknown-osf1mk
+ if test -x /usr/sbin/sysversion ; then
+ GUESS=$UNAME_MACHINE-unknown-osf1mk
else
- echo ${UNAME_MACHINE}-unknown-osf1
+ GUESS=$UNAME_MACHINE-unknown-osf1
fi
- exit ;;
+ ;;
parisc*:Lites*:*:*)
- echo hppa1.1-hp-lites
- exit ;;
+ GUESS=hppa1.1-hp-lites
+ ;;
C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
- echo c1-convex-bsd
- exit ;;
+ GUESS=c1-convex-bsd
+ ;;
C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
if getsysinfo -f scalar_acc
then echo c32-convex-bsd
@@ -740,136 +842,174 @@ EOF
fi
exit ;;
C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
- echo c34-convex-bsd
- exit ;;
+ GUESS=c34-convex-bsd
+ ;;
C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
- echo c38-convex-bsd
- exit ;;
+ GUESS=c38-convex-bsd
+ ;;
C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
- echo c4-convex-bsd
- exit ;;
+ GUESS=c4-convex-bsd
+ ;;
CRAY*Y-MP:*:*:*)
- echo ymp-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=ymp-cray-unicos$CRAY_REL
+ ;;
CRAY*[A-Z]90:*:*:*)
- echo ${UNAME_MACHINE}-cray-unicos${UNAME_RELEASE} \
+ echo "$UNAME_MACHINE"-cray-unicos"$UNAME_RELEASE" \
| sed -e 's/CRAY.*\([A-Z]90\)/\1/' \
-e y/ABCDEFGHIJKLMNOPQRSTUVWXYZ/abcdefghijklmnopqrstuvwxyz/ \
-e 's/\.[^.]*$/.X/'
exit ;;
CRAY*TS:*:*:*)
- echo t90-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=t90-cray-unicos$CRAY_REL
+ ;;
CRAY*T3E:*:*:*)
- echo alphaev5-cray-unicosmk${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=alphaev5-cray-unicosmk$CRAY_REL
+ ;;
CRAY*SV1:*:*:*)
- echo sv1-cray-unicos${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=sv1-cray-unicos$CRAY_REL
+ ;;
*:UNICOS/mp:*:*)
- echo craynv-cray-unicosmp${UNAME_RELEASE} | sed -e 's/\.[^.]*$/.X/'
- exit ;;
+ CRAY_REL=`echo "$UNAME_RELEASE" | sed -e 's/\.[^.]*$/.X/'`
+ GUESS=craynv-cray-unicosmp$CRAY_REL
+ ;;
F30[01]:UNIX_System_V:*:* | F700:UNIX_System_V:*:*)
- FUJITSU_PROC=`uname -m | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz'`
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | sed -e 's/ /_/'`
- echo "${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_PROC=`uname -m | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz`
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | sed -e 's/ /_/'`
+ GUESS=${FUJITSU_PROC}-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
5000:UNIX_System_V:4.*:*)
- FUJITSU_SYS=`uname -p | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/\///'`
- FUJITSU_REL=`echo ${UNAME_RELEASE} | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz' | sed -e 's/ /_/'`
- echo "sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}"
- exit ;;
+ FUJITSU_SYS=`uname -p | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/\///'`
+ FUJITSU_REL=`echo "$UNAME_RELEASE" | tr ABCDEFGHIJKLMNOPQRSTUVWXYZ abcdefghijklmnopqrstuvwxyz | sed -e 's/ /_/'`
+ GUESS=sparc-fujitsu-${FUJITSU_SYS}${FUJITSU_REL}
+ ;;
i*86:BSD/386:*:* | i*86:BSD/OS:*:* | *:Ascend\ Embedded/OS:*:*)
- echo ${UNAME_MACHINE}-pc-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-bsdi$UNAME_RELEASE
+ ;;
sparc*:BSD/OS:*:*)
- echo sparc-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-bsdi$UNAME_RELEASE
+ ;;
*:BSD/OS:*:*)
- echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-bsdi$UNAME_RELEASE
+ ;;
+ arm:FreeBSD:*:*)
+ UNAME_PROCESSOR=`uname -p`
+ set_cc_for_build
+ if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
+ | grep -q __ARM_PCS_VFP
+ then
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabi
+ else
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL-gnueabihf
+ fi
+ ;;
*:FreeBSD:*:*)
- UNAME_PROCESSOR=`/usr/bin/uname -p`
- case ${UNAME_PROCESSOR} in
+ UNAME_PROCESSOR=`uname -p`
+ case $UNAME_PROCESSOR in
amd64)
- echo x86_64-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
- *)
- echo ${UNAME_PROCESSOR}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'` ;;
+ UNAME_PROCESSOR=x86_64 ;;
+ i386)
+ UNAME_PROCESSOR=i586 ;;
esac
- exit ;;
+ FREEBSD_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_PROCESSOR-unknown-freebsd$FREEBSD_REL
+ ;;
i*:CYGWIN*:*)
- echo ${UNAME_MACHINE}-pc-cygwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-cygwin
+ ;;
+ *:MINGW64*:*)
+ GUESS=$UNAME_MACHINE-pc-mingw64
+ ;;
*:MINGW*:*)
- echo ${UNAME_MACHINE}-pc-mingw32
- exit ;;
- i*:MSYS*:*)
- echo ${UNAME_MACHINE}-pc-msys
- exit ;;
- i*:windows32*:*)
- # uname -m includes "-pc" on this system.
- echo ${UNAME_MACHINE}-mingw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-mingw32
+ ;;
+ *:MSYS*:*)
+ GUESS=$UNAME_MACHINE-pc-msys
+ ;;
i*:PW*:*)
- echo ${UNAME_MACHINE}-pc-pw32
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-pw32
+ ;;
+ *:SerenityOS:*:*)
+ GUESS=$UNAME_MACHINE-pc-serenity
+ ;;
*:Interix*:*)
- case ${UNAME_MACHINE} in
+ case $UNAME_MACHINE in
x86)
- echo i586-pc-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=i586-pc-interix$UNAME_RELEASE
+ ;;
authenticamd | genuineintel | EM64T)
- echo x86_64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=x86_64-unknown-interix$UNAME_RELEASE
+ ;;
IA64)
- echo ia64-unknown-interix${UNAME_RELEASE}
- exit ;;
+ GUESS=ia64-unknown-interix$UNAME_RELEASE
+ ;;
esac ;;
- [345]86:Windows_95:* | [345]86:Windows_98:* | [345]86:Windows_NT:*)
- echo i${UNAME_MACHINE}-pc-mks
- exit ;;
- 8664:Windows_NT:*)
- echo x86_64-pc-mks
- exit ;;
- i*:Windows_NT*:* | Pentium*:Windows_NT*:*)
- # How do we know it's Interix rather than the generic POSIX subsystem?
- # It also conflicts with pre-2.0 versions of AT&T UWIN. Should we
- # UNAME_MACHINE based on the output of uname instead of i386?
- echo i586-pc-interix
- exit ;;
i*:UWIN*:*)
- echo ${UNAME_MACHINE}-pc-uwin
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-uwin
+ ;;
amd64:CYGWIN*:*:* | x86_64:CYGWIN*:*:*)
- echo x86_64-unknown-cygwin
- exit ;;
- p*:CYGWIN*:*)
- echo powerpcle-unknown-cygwin
- exit ;;
+ GUESS=x86_64-pc-cygwin
+ ;;
prep*:SunOS:5.*:*)
- echo powerpcle-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
- exit ;;
+ SUN_REL=`echo "$UNAME_RELEASE" | sed -e 's/[^.]*//'`
+ GUESS=powerpcle-unknown-solaris2$SUN_REL
+ ;;
*:GNU:*:*)
# the GNU system
- echo `echo ${UNAME_MACHINE}|sed -e 's,[-/].*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
- exit ;;
+ GNU_ARCH=`echo "$UNAME_MACHINE" | sed -e 's,[-/].*$,,'`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's,/.*$,,'`
+ GUESS=$GNU_ARCH-unknown-$LIBC$GNU_REL
+ ;;
*:GNU/*:*:*)
# other systems with GNU libc and userland
- echo ${UNAME_MACHINE}-unknown-`echo ${UNAME_SYSTEM} | sed 's,^[^/]*/,,' | tr '[A-Z]' '[a-z]'``echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`-gnu
- exit ;;
- i*86:Minix:*:*)
- echo ${UNAME_MACHINE}-pc-minix
- exit ;;
+ GNU_SYS=`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"`
+ GNU_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-$GNU_SYS$GNU_REL-$LIBC
+ ;;
+ x86_64:[Mm]anagarm:*:*|i?86:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-pc-managarm-mlibc"
+ ;;
+ *:[Mm]anagarm:*:*)
+ GUESS="$UNAME_MACHINE-unknown-managarm-mlibc"
+ ;;
+ *:Minix:*:*)
+ GUESS=$UNAME_MACHINE-unknown-minix
+ ;;
aarch64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ set_cc_for_build
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __ARM_EABI__
+ #ifdef __ARM_PCS_VFP
+ ABI=eabihf
+ #else
+ ABI=eabi
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ eabi | eabihf) CPU=armv8l; LIBCABI=$LIBC$ABI ;;
+ esac
+ fi
+ GUESS=$CPU-unknown-linux-$LIBCABI
+ ;;
aarch64_be:Linux:*:*)
UNAME_MACHINE=aarch64_be
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
alpha:Linux:*:*)
- case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' < /proc/cpuinfo` in
+ case `sed -n '/^cpu model/s/^.*: \(.*\)/\1/p' /proc/cpuinfo 2>/dev/null` in
EV5) UNAME_MACHINE=alphaev5 ;;
EV56) UNAME_MACHINE=alphaev56 ;;
PCA56) UNAME_MACHINE=alphapca56 ;;
@@ -879,171 +1019,246 @@ EOF
EV68*) UNAME_MACHINE=alphaev68 ;;
esac
objdump --private-headers /bin/sh | grep -q ld.so.1
- if test "$?" = 0 ; then LIBC="libc1" ; else LIBC="" ; fi
- echo ${UNAME_MACHINE}-unknown-linux-gnu${LIBC}
- exit ;;
+ if test "$?" = 0 ; then LIBC=gnulibc1 ; fi
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ arc:Linux:*:* | arceb:Linux:*:* | arc32:Linux:*:* | arc64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
arm*:Linux:*:*)
- eval $set_cc_for_build
+ set_cc_for_build
if echo __ARM_EABI__ | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_EABI__
then
- echo ${UNAME_MACHINE}-unknown-linux-gnu
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
else
if echo __ARM_PCS_VFP | $CC_FOR_BUILD -E - 2>/dev/null \
| grep -q __ARM_PCS_VFP
then
- echo ${UNAME_MACHINE}-unknown-linux-gnueabi
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabi
else
- echo ${UNAME_MACHINE}-unknown-linux-gnueabihf
+ GUESS=$UNAME_MACHINE-unknown-linux-${LIBC}eabihf
fi
fi
- exit ;;
+ ;;
avr32*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
cris:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
crisv32:Linux:*:*)
- echo ${UNAME_MACHINE}-axis-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-axis-linux-$LIBC
+ ;;
+ e2k:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
frv:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
hexagon:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:Linux:*:*)
- LIBC=gnu
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
- #ifdef __dietlibc__
- LIBC=dietlibc
- #endif
-EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^LIBC'`
- echo "${UNAME_MACHINE}-pc-linux-${LIBC}"
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-linux-$LIBC
+ ;;
ia64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ k1om:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ kvx:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ kvx:cos:*:*)
+ GUESS=$UNAME_MACHINE-unknown-cos
+ ;;
+ kvx:mbr:*:*)
+ GUESS=$UNAME_MACHINE-unknown-mbr
+ ;;
+ loongarch32:Linux:*:* | loongarch64:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m32r*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
m68*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
mips:Linux:*:* | mips64:Linux:*:*)
- eval $set_cc_for_build
- sed 's/^ //' << EOF >$dummy.c
+ set_cc_for_build
+ IS_GLIBC=0
+ test x"${LIBC}" = xgnu && IS_GLIBC=1
+ sed 's/^ //' << EOF > "$dummy.c"
#undef CPU
- #undef ${UNAME_MACHINE}
- #undef ${UNAME_MACHINE}el
+ #undef mips
+ #undef mipsel
+ #undef mips64
+ #undef mips64el
+ #if ${IS_GLIBC} && defined(_ABI64)
+ LIBCABI=gnuabi64
+ #else
+ #if ${IS_GLIBC} && defined(_ABIN32)
+ LIBCABI=gnuabin32
+ #else
+ LIBCABI=${LIBC}
+ #endif
+ #endif
+
+ #if ${IS_GLIBC} && defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa64r6
+ #else
+ #if ${IS_GLIBC} && !defined(__mips64) && defined(__mips_isa_rev) && __mips_isa_rev>=6
+ CPU=mipsisa32r6
+ #else
+ #if defined(__mips64)
+ CPU=mips64
+ #else
+ CPU=mips
+ #endif
+ #endif
+ #endif
+
#if defined(__MIPSEL__) || defined(__MIPSEL) || defined(_MIPSEL) || defined(MIPSEL)
- CPU=${UNAME_MACHINE}el
+ MIPS_ENDIAN=el
#else
#if defined(__MIPSEB__) || defined(__MIPSEB) || defined(_MIPSEB) || defined(MIPSEB)
- CPU=${UNAME_MACHINE}
+ MIPS_ENDIAN=
#else
- CPU=
+ MIPS_ENDIAN=
#endif
#endif
EOF
- eval `$CC_FOR_BUILD -E $dummy.c 2>/dev/null | grep '^CPU'`
- test x"${CPU}" != x && { echo "${CPU}-unknown-linux-gnu"; exit; }
+ cc_set_vars=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^CPU\|^MIPS_ENDIAN\|^LIBCABI'`
+ eval "$cc_set_vars"
+ test "x$CPU" != x && { echo "$CPU${MIPS_ENDIAN}-unknown-linux-$LIBCABI"; exit; }
+ ;;
+ mips64el:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
+ openrisc*:Linux:*:*)
+ GUESS=or1k-unknown-linux-$LIBC
+ ;;
+ or32:Linux:*:* | or1k*:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
;;
- or32:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
padre:Linux:*:*)
- echo sparc-unknown-linux-gnu
- exit ;;
+ GUESS=sparc-unknown-linux-$LIBC
+ ;;
parisc64:Linux:*:* | hppa64:Linux:*:*)
- echo hppa64-unknown-linux-gnu
- exit ;;
+ GUESS=hppa64-unknown-linux-$LIBC
+ ;;
parisc:Linux:*:* | hppa:Linux:*:*)
# Look for CPU level
case `grep '^cpu[^a-z]*:' /proc/cpuinfo 2>/dev/null | cut -d' ' -f2` in
- PA7*) echo hppa1.1-unknown-linux-gnu ;;
- PA8*) echo hppa2.0-unknown-linux-gnu ;;
- *) echo hppa-unknown-linux-gnu ;;
+ PA7*) GUESS=hppa1.1-unknown-linux-$LIBC ;;
+ PA8*) GUESS=hppa2.0-unknown-linux-$LIBC ;;
+ *) GUESS=hppa-unknown-linux-$LIBC ;;
esac
- exit ;;
+ ;;
ppc64:Linux:*:*)
- echo powerpc64-unknown-linux-gnu
- exit ;;
- ppc64le:Linux:*:*)
- echo powerpc64le-unknown-linux-gnu
- exit ;;
+ GUESS=powerpc64-unknown-linux-$LIBC
+ ;;
ppc:Linux:*:*)
- echo powerpc-unknown-linux-gnu
- exit ;;
+ GUESS=powerpc-unknown-linux-$LIBC
+ ;;
+ ppc64le:Linux:*:*)
+ GUESS=powerpc64le-unknown-linux-$LIBC
+ ;;
+ ppcle:Linux:*:*)
+ GUESS=powerpcle-unknown-linux-$LIBC
+ ;;
+ riscv32:Linux:*:* | riscv32be:Linux:*:* | riscv64:Linux:*:* | riscv64be:Linux:*:*)
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
s390:Linux:*:* | s390x:Linux:*:*)
- echo ${UNAME_MACHINE}-ibm-linux
- exit ;;
+ GUESS=$UNAME_MACHINE-ibm-linux-$LIBC
+ ;;
sh64*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sh*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
sparc:Linux:*:* | sparc64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
tile*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
vax:Linux:*:*)
- echo ${UNAME_MACHINE}-dec-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-dec-linux-$LIBC
+ ;;
x86_64:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ set_cc_for_build
+ CPU=$UNAME_MACHINE
+ LIBCABI=$LIBC
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ ABI=64
+ sed 's/^ //' << EOF > "$dummy.c"
+ #ifdef __i386__
+ ABI=x86
+ #else
+ #ifdef __ILP32__
+ ABI=x32
+ #endif
+ #endif
+EOF
+ cc_set_abi=`$CC_FOR_BUILD -E "$dummy.c" 2>/dev/null | grep '^ABI' | sed 's, ,,g'`
+ eval "$cc_set_abi"
+ case $ABI in
+ x86) CPU=i686 ;;
+ x32) LIBCABI=${LIBC}x32 ;;
+ esac
+ fi
+ GUESS=$CPU-pc-linux-$LIBCABI
+ ;;
xtensa*:Linux:*:*)
- echo ${UNAME_MACHINE}-unknown-linux-gnu
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-linux-$LIBC
+ ;;
i*86:DYNIX/ptx:4*:*)
# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there.
# earlier versions are messed up and put the nodename in both
# sysname and nodename.
- echo i386-sequent-sysv4
- exit ;;
+ GUESS=i386-sequent-sysv4
+ ;;
i*86:UNIX_SV:4.2MP:2.*)
# Unixware is an offshoot of SVR4, but it has its own version
# number series starting with 2...
# I am not positive that other SVR4 systems won't match this,
# I just have to hope. -- rms.
# Use sysv4.2uw... so that sysv4* matches it.
- echo ${UNAME_MACHINE}-pc-sysv4.2uw${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-sysv4.2uw$UNAME_VERSION
+ ;;
i*86:OS/2:*:*)
- # If we were able to find `uname', then EMX Unix compatibility
+ # If we were able to find 'uname', then EMX Unix compatibility
# is probably installed.
- echo ${UNAME_MACHINE}-pc-os2-emx
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-os2-emx
+ ;;
i*86:XTS-300:*:STOP)
- echo ${UNAME_MACHINE}-unknown-stop
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-stop
+ ;;
i*86:atheos:*:*)
- echo ${UNAME_MACHINE}-unknown-atheos
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-atheos
+ ;;
i*86:syllable:*:*)
- echo ${UNAME_MACHINE}-pc-syllable
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-syllable
+ ;;
i*86:LynxOS:2.*:* | i*86:LynxOS:3.[01]*:* | i*86:LynxOS:4.[02]*:*)
- echo i386-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-unknown-lynxos$UNAME_RELEASE
+ ;;
i*86:*DOS:*:*)
- echo ${UNAME_MACHINE}-pc-msdosdjgpp
- exit ;;
- i*86:*:4.*:* | i*86:SYSTEM_V:4.*:*)
- UNAME_REL=`echo ${UNAME_RELEASE} | sed 's/\/MP$//'`
+ GUESS=$UNAME_MACHINE-pc-msdosdjgpp
+ ;;
+ i*86:*:4.*:*)
+ UNAME_REL=`echo "$UNAME_RELEASE" | sed 's/\/MP$//'`
if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
- echo ${UNAME_MACHINE}-univel-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-univel-sysv$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv${UNAME_REL}
+ GUESS=$UNAME_MACHINE-pc-sysv$UNAME_REL
fi
- exit ;;
+ ;;
i*86:*:5:[678]*)
# UnixWare 7.x, OpenUNIX and OpenServer 6.
case `/bin/uname -X | grep "^Machine"` in
@@ -1051,12 +1266,12 @@ EOF
*Pentium) UNAME_MACHINE=i586 ;;
*Pent*|*Celeron) UNAME_MACHINE=i686 ;;
esac
- echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-sysv${UNAME_RELEASE}${UNAME_SYSTEM}${UNAME_VERSION}
+ ;;
i*86:*:3.2:*)
if test -f /usr/options/cb.name; then
UNAME_REL=`sed -n 's/.*Version //p' /dev/null >/dev/null ; then
UNAME_REL=`(/bin/uname -X|grep Release|sed -e 's/.*= //')`
(/bin/uname -X|grep i80486 >/dev/null) && UNAME_MACHINE=i486
@@ -1066,43 +1281,43 @@ EOF
&& UNAME_MACHINE=i686
(/bin/uname -X|grep '^Machine.*Pentium Pro' >/dev/null) \
&& UNAME_MACHINE=i686
- echo ${UNAME_MACHINE}-pc-sco$UNAME_REL
+ GUESS=$UNAME_MACHINE-pc-sco$UNAME_REL
else
- echo ${UNAME_MACHINE}-pc-sysv32
+ GUESS=$UNAME_MACHINE-pc-sysv32
fi
- exit ;;
+ ;;
pc:*:*:*)
# Left here for compatibility:
# uname -m prints for DJGPP always 'pc', but it prints nothing about
# the processor, so we play safe by assuming i586.
# Note: whatever this is, it MUST be the same as what config.sub
- # prints for the "djgpp" host, or else GDB configury will decide that
+ # prints for the "djgpp" host, or else GDB configure will decide that
# this is a cross-build.
- echo i586-pc-msdosdjgpp
- exit ;;
+ GUESS=i586-pc-msdosdjgpp
+ ;;
Intel:Mach:3*:*)
- echo i386-pc-mach3
- exit ;;
+ GUESS=i386-pc-mach3
+ ;;
paragon:*:*:*)
- echo i860-intel-osf1
- exit ;;
+ GUESS=i860-intel-osf1
+ ;;
i860:*:4.*:*) # i860-SVR4
if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
- echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ GUESS=i860-stardent-sysv$UNAME_RELEASE # Stardent Vistra i860-SVR4
else # Add other i860-SVR4 vendors below as they are discovered.
- echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ GUESS=i860-unknown-sysv$UNAME_RELEASE # Unknown i860-SVR4
fi
- exit ;;
+ ;;
mini*:CTIX:SYS*5:*)
# "miniframe"
- echo m68010-convergent-sysv
- exit ;;
+ GUESS=m68010-convergent-sysv
+ ;;
mc68k:UNIX:SYSTEM5:3.51m)
- echo m68k-convergent-sysv
- exit ;;
+ GUESS=m68k-convergent-sysv
+ ;;
M680?0:D-NIX:5.3:*)
- echo m68k-diab-dnix
- exit ;;
+ GUESS=m68k-diab-dnix
+ ;;
M68*:*:R3V[5678]*:*)
test -r /sysV68 && { echo 'm68k-motorola-sysv'; exit; } ;;
3[345]??:*:4.0:3.0 | 3[34]??A:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0 | 3[34]??/*:*:4.0:3.0 | 4400:*:4.0:3.0 | 4850:*:4.0:3.0 | SKA40:*:4.0:3.0 | SDS2:*:4.0:3.0 | SHG2:*:4.0:3.0 | S7501*:*:4.0:3.0)
@@ -1110,9 +1325,9 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
&& { echo i486-ncr-sysv4; exit; } ;;
@@ -1121,226 +1336,290 @@ EOF
test -r /etc/.relid \
&& OS_REL=.`sed -n 's/[^ ]* [^ ]* \([0-9][0-9]\).*/\1/p' < /etc/.relid`
/bin/uname -p 2>/dev/null | grep 86 >/dev/null \
- && { echo i486-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i486-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep entium >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; }
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; }
/bin/uname -p 2>/dev/null | /bin/grep pteron >/dev/null \
- && { echo i586-ncr-sysv4.3${OS_REL}; exit; } ;;
+ && { echo i586-ncr-sysv4.3"$OS_REL"; exit; } ;;
m68*:LynxOS:2.*:* | m68*:LynxOS:3.0*:*)
- echo m68k-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-unknown-lynxos$UNAME_RELEASE
+ ;;
mc68030:UNIX_System_V:4.*:*)
- echo m68k-atari-sysv4
- exit ;;
+ GUESS=m68k-atari-sysv4
+ ;;
TSUNAMI:LynxOS:2.*:*)
- echo sparc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=sparc-unknown-lynxos$UNAME_RELEASE
+ ;;
rs6000:LynxOS:2.*:*)
- echo rs6000-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=rs6000-unknown-lynxos$UNAME_RELEASE
+ ;;
PowerPC:LynxOS:2.*:* | PowerPC:LynxOS:3.[01]*:* | PowerPC:LynxOS:4.[02]*:*)
- echo powerpc-unknown-lynxos${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-unknown-lynxos$UNAME_RELEASE
+ ;;
SM[BE]S:UNIX_SV:*:*)
- echo mips-dde-sysv${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-dde-sysv$UNAME_RELEASE
+ ;;
RM*:ReliantUNIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
RM*:SINIX-*:*:*)
- echo mips-sni-sysv4
- exit ;;
+ GUESS=mips-sni-sysv4
+ ;;
*:SINIX-*:*:*)
if uname -p 2>/dev/null >/dev/null ; then
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- echo ${UNAME_MACHINE}-sni-sysv4
+ GUESS=$UNAME_MACHINE-sni-sysv4
else
- echo ns32k-sni-sysv
+ GUESS=ns32k-sni-sysv
fi
- exit ;;
- PENTIUM:*:4.0*:*) # Unisys `ClearPath HMP IX 4000' SVR4/MP effort
+ ;;
+ PENTIUM:*:4.0*:*) # Unisys 'ClearPath HMP IX 4000' SVR4/MP effort
# says
- echo i586-unisys-sysv4
- exit ;;
+ GUESS=i586-unisys-sysv4
+ ;;
*:UNIX_System_V:4*:FTX*)
# From Gerald Hewes .
# How about differentiating between stratus architectures? -djm
- echo hppa1.1-stratus-sysv4
- exit ;;
+ GUESS=hppa1.1-stratus-sysv4
+ ;;
*:*:*:FTX*)
# From seanf@swdc.stratus.com.
- echo i860-stratus-sysv4
- exit ;;
+ GUESS=i860-stratus-sysv4
+ ;;
i*86:VOS:*:*)
# From Paul.Green@stratus.com.
- echo ${UNAME_MACHINE}-stratus-vos
- exit ;;
+ GUESS=$UNAME_MACHINE-stratus-vos
+ ;;
*:VOS:*:*)
# From Paul.Green@stratus.com.
- echo hppa1.1-stratus-vos
- exit ;;
+ GUESS=hppa1.1-stratus-vos
+ ;;
mc68*:A/UX:*:*)
- echo m68k-apple-aux${UNAME_RELEASE}
- exit ;;
+ GUESS=m68k-apple-aux$UNAME_RELEASE
+ ;;
news*:NEWS-OS:6*:*)
- echo mips-sony-newsos6
- exit ;;
+ GUESS=mips-sony-newsos6
+ ;;
R[34]000:*System_V*:*:* | R4000:UNIX_SYSV:*:* | R*000:UNIX_SV:*:*)
- if [ -d /usr/nec ]; then
- echo mips-nec-sysv${UNAME_RELEASE}
+ if test -d /usr/nec; then
+ GUESS=mips-nec-sysv$UNAME_RELEASE
else
- echo mips-unknown-sysv${UNAME_RELEASE}
+ GUESS=mips-unknown-sysv$UNAME_RELEASE
fi
- exit ;;
+ ;;
BeBox:BeOS:*:*) # BeOS running on hardware made by Be, PPC only.
- echo powerpc-be-beos
- exit ;;
+ GUESS=powerpc-be-beos
+ ;;
BeMac:BeOS:*:*) # BeOS running on Mac or Mac clone, PPC only.
- echo powerpc-apple-beos
- exit ;;
+ GUESS=powerpc-apple-beos
+ ;;
BePC:BeOS:*:*) # BeOS running on Intel PC compatible.
- echo i586-pc-beos
- exit ;;
+ GUESS=i586-pc-beos
+ ;;
BePC:Haiku:*:*) # Haiku running on Intel PC compatible.
- echo i586-pc-haiku
- exit ;;
+ GUESS=i586-pc-haiku
+ ;;
+ ppc:Haiku:*:*) # Haiku running on Apple PowerPC
+ GUESS=powerpc-apple-haiku
+ ;;
+ *:Haiku:*:*) # Haiku modern gcc (not bound by BeOS compat)
+ GUESS=$UNAME_MACHINE-unknown-haiku
+ ;;
SX-4:SUPER-UX:*:*)
- echo sx4-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx4-nec-superux$UNAME_RELEASE
+ ;;
SX-5:SUPER-UX:*:*)
- echo sx5-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx5-nec-superux$UNAME_RELEASE
+ ;;
SX-6:SUPER-UX:*:*)
- echo sx6-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx6-nec-superux$UNAME_RELEASE
+ ;;
SX-7:SUPER-UX:*:*)
- echo sx7-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx7-nec-superux$UNAME_RELEASE
+ ;;
SX-8:SUPER-UX:*:*)
- echo sx8-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8-nec-superux$UNAME_RELEASE
+ ;;
SX-8R:SUPER-UX:*:*)
- echo sx8r-nec-superux${UNAME_RELEASE}
- exit ;;
+ GUESS=sx8r-nec-superux$UNAME_RELEASE
+ ;;
+ SX-ACE:SUPER-UX:*:*)
+ GUESS=sxace-nec-superux$UNAME_RELEASE
+ ;;
Power*:Rhapsody:*:*)
- echo powerpc-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=powerpc-apple-rhapsody$UNAME_RELEASE
+ ;;
*:Rhapsody:*:*)
- echo ${UNAME_MACHINE}-apple-rhapsody${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-apple-rhapsody$UNAME_RELEASE
+ ;;
+ arm64:Darwin:*:*)
+ GUESS=aarch64-apple-darwin$UNAME_RELEASE
+ ;;
*:Darwin:*:*)
- UNAME_PROCESSOR=`uname -p` || UNAME_PROCESSOR=unknown
+ UNAME_PROCESSOR=`uname -p`
case $UNAME_PROCESSOR in
- i386)
- eval $set_cc_for_build
- if [ "$CC_FOR_BUILD" != 'no_compiler_found' ]; then
- if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
- (CCOPTS= $CC_FOR_BUILD -E - 2>/dev/null) | \
- grep IS_64BIT_ARCH >/dev/null
- then
- UNAME_PROCESSOR="x86_64"
- fi
- fi ;;
unknown) UNAME_PROCESSOR=powerpc ;;
esac
- echo ${UNAME_PROCESSOR}-apple-darwin${UNAME_RELEASE}
- exit ;;
+ if command -v xcode-select > /dev/null 2> /dev/null && \
+ ! xcode-select --print-path > /dev/null 2> /dev/null ; then
+ # Avoid executing cc if there is no toolchain installed as
+ # cc will be a stub that puts up a graphical alert
+ # prompting the user to install developer tools.
+ CC_FOR_BUILD=no_compiler_found
+ else
+ set_cc_for_build
+ fi
+ if test "$CC_FOR_BUILD" != no_compiler_found; then
+ if (echo '#ifdef __LP64__'; echo IS_64BIT_ARCH; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_64BIT_ARCH >/dev/null
+ then
+ case $UNAME_PROCESSOR in
+ i386) UNAME_PROCESSOR=x86_64 ;;
+ powerpc) UNAME_PROCESSOR=powerpc64 ;;
+ esac
+ fi
+ # On 10.4-10.6 one might compile for PowerPC via gcc -arch ppc
+ if (echo '#ifdef __POWERPC__'; echo IS_PPC; echo '#endif') | \
+ (CCOPTS="" $CC_FOR_BUILD -E - 2>/dev/null) | \
+ grep IS_PPC >/dev/null
+ then
+ UNAME_PROCESSOR=powerpc
+ fi
+ elif test "$UNAME_PROCESSOR" = i386 ; then
+ # uname -m returns i386 or x86_64
+ UNAME_PROCESSOR=$UNAME_MACHINE
+ fi
+ GUESS=$UNAME_PROCESSOR-apple-darwin$UNAME_RELEASE
+ ;;
*:procnto*:*:* | *:QNX:[0123456789]*:*)
UNAME_PROCESSOR=`uname -p`
- if test "$UNAME_PROCESSOR" = "x86"; then
+ if test "$UNAME_PROCESSOR" = x86; then
UNAME_PROCESSOR=i386
UNAME_MACHINE=pc
fi
- echo ${UNAME_PROCESSOR}-${UNAME_MACHINE}-nto-qnx${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_PROCESSOR-$UNAME_MACHINE-nto-qnx$UNAME_RELEASE
+ ;;
*:QNX:*:4*)
- echo i386-pc-qnx
- exit ;;
- NEO-?:NONSTOP_KERNEL:*:*)
- echo neo-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=i386-pc-qnx
+ ;;
+ NEO-*:NONSTOP_KERNEL:*:*)
+ GUESS=neo-tandem-nsk$UNAME_RELEASE
+ ;;
NSE-*:NONSTOP_KERNEL:*:*)
- echo nse-tandem-nsk${UNAME_RELEASE}
- exit ;;
- NSR-?:NONSTOP_KERNEL:*:*)
- echo nsr-tandem-nsk${UNAME_RELEASE}
- exit ;;
+ GUESS=nse-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSR-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsr-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSV-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsv-tandem-nsk$UNAME_RELEASE
+ ;;
+ NSX-*:NONSTOP_KERNEL:*:*)
+ GUESS=nsx-tandem-nsk$UNAME_RELEASE
+ ;;
*:NonStop-UX:*:*)
- echo mips-compaq-nonstopux
- exit ;;
+ GUESS=mips-compaq-nonstopux
+ ;;
BS2000:POSIX*:*:*)
- echo bs2000-siemens-sysv
- exit ;;
+ GUESS=bs2000-siemens-sysv
+ ;;
DS/*:UNIX_System_V:*:*)
- echo ${UNAME_MACHINE}-${UNAME_SYSTEM}-${UNAME_RELEASE}
- exit ;;
+ GUESS=$UNAME_MACHINE-$UNAME_SYSTEM-$UNAME_RELEASE
+ ;;
*:Plan9:*:*)
# "uname -m" is not consistent, so use $cputype instead. 386
# is converted to i386 for consistency with other x86
# operating systems.
- if test "$cputype" = "386"; then
+ if test "${cputype-}" = 386; then
UNAME_MACHINE=i386
- else
- UNAME_MACHINE="$cputype"
+ elif test "x${cputype-}" != x; then
+ UNAME_MACHINE=$cputype
fi
- echo ${UNAME_MACHINE}-unknown-plan9
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-plan9
+ ;;
*:TOPS-10:*:*)
- echo pdp10-unknown-tops10
- exit ;;
+ GUESS=pdp10-unknown-tops10
+ ;;
*:TENEX:*:*)
- echo pdp10-unknown-tenex
- exit ;;
+ GUESS=pdp10-unknown-tenex
+ ;;
KS10:TOPS-20:*:* | KL10:TOPS-20:*:* | TYPE4:TOPS-20:*:*)
- echo pdp10-dec-tops20
- exit ;;
+ GUESS=pdp10-dec-tops20
+ ;;
XKL-1:TOPS-20:*:* | TYPE5:TOPS-20:*:*)
- echo pdp10-xkl-tops20
- exit ;;
+ GUESS=pdp10-xkl-tops20
+ ;;
*:TOPS-20:*:*)
- echo pdp10-unknown-tops20
- exit ;;
+ GUESS=pdp10-unknown-tops20
+ ;;
*:ITS:*:*)
- echo pdp10-unknown-its
- exit ;;
+ GUESS=pdp10-unknown-its
+ ;;
SEI:*:*:SEIUX)
- echo mips-sei-seiux${UNAME_RELEASE}
- exit ;;
+ GUESS=mips-sei-seiux$UNAME_RELEASE
+ ;;
*:DragonFly:*:*)
- echo ${UNAME_MACHINE}-unknown-dragonfly`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
- exit ;;
+ DRAGONFLY_REL=`echo "$UNAME_RELEASE" | sed -e 's/[-(].*//'`
+ GUESS=$UNAME_MACHINE-unknown-dragonfly$DRAGONFLY_REL
+ ;;
*:*VMS:*:*)
UNAME_MACHINE=`(uname -p) 2>/dev/null`
- case "${UNAME_MACHINE}" in
- A*) echo alpha-dec-vms ; exit ;;
- I*) echo ia64-dec-vms ; exit ;;
- V*) echo vax-dec-vms ; exit ;;
+ case $UNAME_MACHINE in
+ A*) GUESS=alpha-dec-vms ;;
+ I*) GUESS=ia64-dec-vms ;;
+ V*) GUESS=vax-dec-vms ;;
esac ;;
*:XENIX:*:SysV)
- echo i386-pc-xenix
- exit ;;
+ GUESS=i386-pc-xenix
+ ;;
i*86:skyos:*:*)
- echo ${UNAME_MACHINE}-pc-skyos`echo ${UNAME_RELEASE}` | sed -e 's/ .*$//'
- exit ;;
+ SKYOS_REL=`echo "$UNAME_RELEASE" | sed -e 's/ .*$//'`
+ GUESS=$UNAME_MACHINE-pc-skyos$SKYOS_REL
+ ;;
i*86:rdos:*:*)
- echo ${UNAME_MACHINE}-pc-rdos
- exit ;;
- i*86:AROS:*:*)
- echo ${UNAME_MACHINE}-pc-aros
- exit ;;
+ GUESS=$UNAME_MACHINE-pc-rdos
+ ;;
+ i*86:Fiwix:*:*)
+ GUESS=$UNAME_MACHINE-pc-fiwix
+ ;;
+ *:AROS:*:*)
+ GUESS=$UNAME_MACHINE-unknown-aros
+ ;;
x86_64:VMkernel:*:*)
- echo ${UNAME_MACHINE}-unknown-esx
- exit ;;
+ GUESS=$UNAME_MACHINE-unknown-esx
+ ;;
+ amd64:Isilon\ OneFS:*:*)
+ GUESS=x86_64-unknown-onefs
+ ;;
+ *:Unleashed:*:*)
+ GUESS=$UNAME_MACHINE-unknown-unleashed$UNAME_RELEASE
+ ;;
+ *:Ironclad:*:*)
+ GUESS=$UNAME_MACHINE-unknown-ironclad
+ ;;
esac
-#echo '(No uname command or uname output not recognized.)' 1>&2
-#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+# Do we have a guess based on uname results?
+if test "x$GUESS" != x; then
+ echo "$GUESS"
+ exit
+fi
-eval $set_cc_for_build
-cat >$dummy.c < "$dummy.c" <
-# include
+#include
+#include
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined (vax) || defined (__vax) || defined (__vax__) || defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#include
+#if defined(_SIZE_T_) || defined(SIGLOST)
+#include
+#endif
+#endif
#endif
main ()
{
@@ -1353,22 +1632,14 @@ main ()
#include
printf ("m68k-sony-newsos%s\n",
#ifdef NEWSOS4
- "4"
+ "4"
#else
- ""
+ ""
#endif
- ); exit (0);
+ ); exit (0);
#endif
#endif
-#if defined (__arm) && defined (__acorn) && defined (__unix)
- printf ("arm-acorn-riscix\n"); exit (0);
-#endif
-
-#if defined (hp300) && !defined (hpux)
- printf ("m68k-hp-bsd\n"); exit (0);
-#endif
-
#if defined (NeXT)
#if !defined (__ARCHITECTURE__)
#define __ARCHITECTURE__ "m68k"
@@ -1408,39 +1679,54 @@ main ()
#endif
#if defined (_SEQUENT_)
- struct utsname un;
-
- uname(&un);
-
- if (strncmp(un.version, "V2", 2) == 0) {
- printf ("i386-sequent-ptx2\n"); exit (0);
- }
- if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
- printf ("i386-sequent-ptx1\n"); exit (0);
- }
- printf ("i386-sequent-ptx\n"); exit (0);
+ struct utsname un;
+ uname(&un);
+ if (strncmp(un.version, "V2", 2) == 0) {
+ printf ("i386-sequent-ptx2\n"); exit (0);
+ }
+ if (strncmp(un.version, "V1", 2) == 0) { /* XXX is V1 correct? */
+ printf ("i386-sequent-ptx1\n"); exit (0);
+ }
+ printf ("i386-sequent-ptx\n"); exit (0);
#endif
#if defined (vax)
-# if !defined (ultrix)
-# include
-# if defined (BSD)
-# if BSD == 43
- printf ("vax-dec-bsd4.3\n"); exit (0);
-# else
-# if BSD == 199006
- printf ("vax-dec-bsd4.3reno\n"); exit (0);
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# endif
-# else
- printf ("vax-dec-bsd\n"); exit (0);
-# endif
-# else
- printf ("vax-dec-ultrix\n"); exit (0);
-# endif
+#if !defined (ultrix)
+#include
+#if defined (BSD)
+#if BSD == 43
+ printf ("vax-dec-bsd4.3\n"); exit (0);
+#else
+#if BSD == 199006
+ printf ("vax-dec-bsd4.3reno\n"); exit (0);
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#endif
+#else
+ printf ("vax-dec-bsd\n"); exit (0);
+#endif
+#else
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname un;
+ uname (&un);
+ printf ("vax-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+#endif
+#if defined(ultrix) || defined(_ultrix) || defined(__ultrix) || defined(__ultrix__)
+#if defined(mips) || defined(__mips) || defined(__mips__) || defined(MIPS) || defined(__MIPS__)
+#if defined(_SIZE_T_) || defined(SIGLOST)
+ struct utsname *un;
+ uname (&un);
+ printf ("mips-dec-ultrix%s\n", un.release); exit (0);
+#else
+ printf ("mips-dec-ultrix\n"); exit (0);
+#endif
+#endif
#endif
#if defined (alliant) && defined (i860)
@@ -1451,54 +1737,46 @@ main ()
}
EOF
-$CC_FOR_BUILD -o $dummy $dummy.c 2>/dev/null && SYSTEM_NAME=`$dummy` &&
+$CC_FOR_BUILD -o "$dummy" "$dummy.c" 2>/dev/null && SYSTEM_NAME=`"$dummy"` &&
{ echo "$SYSTEM_NAME"; exit; }
# Apollos put the system type in the environment.
+test -d /usr/apollo && { echo "$ISP-apollo-$SYSTYPE"; exit; }
-test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit; }
+echo "$0: unable to guess system type" >&2
-# Convex versions that predate uname can use getsysinfo(1)
+case $UNAME_MACHINE:$UNAME_SYSTEM in
+ mips:Linux | mips64:Linux)
+ # If we got here on MIPS GNU/Linux, output extra information.
+ cat >&2 <&2 < in order to provide the needed
-information to handle your system.
+our_year=`echo $timestamp | sed 's,-.*,,'`
+thisyear=`date +%Y`
+# shellcheck disable=SC2003
+script_age=`expr "$thisyear" - "$our_year"`
+if test "$script_age" -lt 3 ; then
+ cat >&2 </dev/null`
/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null`
/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null`
-UNAME_MACHINE = ${UNAME_MACHINE}
-UNAME_RELEASE = ${UNAME_RELEASE}
-UNAME_SYSTEM = ${UNAME_SYSTEM}
-UNAME_VERSION = ${UNAME_VERSION}
+UNAME_MACHINE = "$UNAME_MACHINE"
+UNAME_RELEASE = "$UNAME_RELEASE"
+UNAME_SYSTEM = "$UNAME_SYSTEM"
+UNAME_VERSION = "$UNAME_VERSION"
EOF
+fi
exit 1
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/config.sub b/config.sub
index f328f0d94..2c6a07ab3 100755
--- a/config.sub
+++ b/config.sub
@@ -1,36 +1,33 @@
#! /bin/sh
# Configuration validation subroutine script.
-# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999,
-# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010,
-# 2011, 2012 Free Software Foundation, Inc.
+# Copyright 1992-2024 Free Software Foundation, Inc.
-timestamp='2012-04-18'
+# shellcheck disable=SC2006,SC2268 # see below for rationale
-# This file is (in principle) common to ALL GNU software.
-# The presence of a machine in this file suggests that SOME GNU software
-# can handle that machine. It does not imply ALL GNU software can.
-#
-# This file is free software; you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation; either version 3 of the License, or
+timestamp='2024-01-01'
+
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
-# This program is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
#
# You should have received a copy of the GNU General Public License
-# along with this program; if not, see .
+# along with this program; if not, see .
#
# As a special exception to the GNU General Public License, if you
# distribute this file as part of a program that contains a
# configuration script generated by Autoconf, you may include it under
-# the same distribution terms that you use for the rest of that program.
+# the same distribution terms that you use for the rest of that
+# program. This Exception is an additional permission under section 7
+# of the GNU General Public License, version 3 ("GPLv3").
-# Please send patches to . Submit a context
-# diff and a properly formatted GNU ChangeLog entry.
+# Please send patches to .
#
# Configuration subroutine to validate and canonicalize a configuration type.
# Supply the specified configuration type as an argument.
@@ -38,7 +35,7 @@ timestamp='2012-04-18'
# Otherwise, we print the canonical config type on stdout and succeed.
# You can get the latest version of this script from:
-# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD
+# https://git.savannah.gnu.org/cgit/config.git/plain/config.sub
# This file is supposed to be the same for all GNU packages
# and recognize all the CPU types, system types and aliases
@@ -55,15 +52,21 @@ timestamp='2012-04-18'
# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM
# It is wrong to echo any other type of specification.
+# The "shellcheck disable" line above the timestamp inhibits complaints
+# about features and limitations of the classic Bourne shell that were
+# superseded or lifted in POSIX. However, this script identifies a wide
+# variety of pre-POSIX systems that do not have POSIX shells at all, and
+# even some reasonably current systems (Solaris 10 as case-in-point) still
+# have a pre-POSIX /bin/sh.
+
me=`echo "$0" | sed -e 's,.*/,,'`
usage="\
-Usage: $0 [OPTION] CPU-MFR-OPSYS
- $0 [OPTION] ALIAS
+Usage: $0 [OPTION] CPU-MFR-OPSYS or ALIAS
Canonicalize a configuration name.
-Operation modes:
+Options:
-h, --help print this help, then exit
-t, --time-stamp print date of last modification, then exit
-v, --version print version number, then exit
@@ -73,15 +76,13 @@ Report bugs and patches to ."
version="\
GNU config.sub ($timestamp)
-Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000,
-2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012
-Free Software Foundation, Inc.
+Copyright 1992-2024 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE."
help="
-Try \`$me --help' for more information."
+Try '$me --help' for more information."
# Parse command line
while test $# -gt 0 ; do
@@ -97,12 +98,12 @@ while test $# -gt 0 ; do
- ) # Use stdin as input.
break ;;
-* )
- echo "$me: invalid option $1$help"
+ echo "$me: invalid option $1$help" >&2
exit 1 ;;
*local*)
# First pass through any local machine types.
- echo $1
+ echo "$1"
exit ;;
* )
@@ -118,1196 +119,1167 @@ case $# in
exit 1;;
esac
-# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any).
-# Here we must recognize all the valid KERNEL-OS combinations.
-maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'`
-case $maybe_os in
- nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \
- linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \
- knetbsd*-gnu* | netbsd*-gnu* | \
- kopensolaris*-gnu* | \
- storm-chaos* | os2-emx* | rtmk-nova*)
- os=-$maybe_os
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`
- ;;
- android-linux)
- os=-linux-android
- basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'`-unknown
- ;;
- *)
- basic_machine=`echo $1 | sed 's/-[^-]*$//'`
- if [ $basic_machine != $1 ]
- then os=`echo $1 | sed 's/.*-/-/'`
- else os=; fi
- ;;
-esac
+# Split fields of configuration type
+# shellcheck disable=SC2162
+saved_IFS=$IFS
+IFS="-" read field1 field2 field3 field4 <&2
+ exit 1
;;
- -ptx*)
- basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ *-*-*-*)
+ basic_machine=$field1-$field2
+ basic_os=$field3-$field4
;;
- -windowsnt*)
- os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ *-*-*)
+ # Ambiguous whether COMPANY is present, or skipped and KERNEL-OS is two
+ # parts
+ maybe_os=$field2-$field3
+ case $maybe_os in
+ nto-qnx* | linux-* | uclinux-uclibc* \
+ | uclinux-gnu* | kfreebsd*-gnu* | knetbsd*-gnu* | netbsd*-gnu* \
+ | netbsd*-eabi* | kopensolaris*-gnu* | cloudabi*-eabi* \
+ | storm-chaos* | os2-emx* | rtmk-nova* | managarm-* \
+ | windows-* )
+ basic_machine=$field1
+ basic_os=$maybe_os
+ ;;
+ android-linux)
+ basic_machine=$field1-unknown
+ basic_os=linux-android
+ ;;
+ *)
+ basic_machine=$field1-$field2
+ basic_os=$field3
+ ;;
+ esac
;;
- -psos*)
- os=-psos
+ *-*)
+ # A lone config we happen to match not fitting any pattern
+ case $field1-$field2 in
+ decstation-3100)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ *-*)
+ # Second component is usually, but not always the OS
+ case $field2 in
+ # Prevent following clause from handling this valid os
+ sun*os*)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ zephyr*)
+ basic_machine=$field1-unknown
+ basic_os=$field2
+ ;;
+ # Manufacturers
+ dec* | mips* | sequent* | encore* | pc533* | sgi* | sony* \
+ | att* | 7300* | 3300* | delta* | motorola* | sun[234]* \
+ | unicom* | ibm* | next | hp | isi* | apollo | altos* \
+ | convergent* | ncr* | news | 32* | 3600* | 3100* \
+ | hitachi* | c[123]* | convex* | sun | crds | omron* | dg \
+ | ultra | tti* | harris | dolphin | highlevel | gould \
+ | cbm | ns | masscomp | apple | axis | knuth | cray \
+ | microblaze* | sim | cisco \
+ | oki | wec | wrs | winbond)
+ basic_machine=$field1-$field2
+ basic_os=
+ ;;
+ *)
+ basic_machine=$field1
+ basic_os=$field2
+ ;;
+ esac
+ ;;
+ esac
;;
- -mint | -mint[0-9]*)
- basic_machine=m68k-atari
- os=-mint
+ *)
+ # Convert single-component short-hands not valid as part of
+ # multi-component configurations.
+ case $field1 in
+ 386bsd)
+ basic_machine=i386-pc
+ basic_os=bsd
+ ;;
+ a29khif)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ adobe68k)
+ basic_machine=m68010-adobe
+ basic_os=scout
+ ;;
+ alliant)
+ basic_machine=fx80-alliant
+ basic_os=
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ basic_os=
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ basic_os=bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ basic_os=sysv
+ ;;
+ amiga)
+ basic_machine=m68k-unknown
+ basic_os=
+ ;;
+ amigaos | amigados)
+ basic_machine=m68k-unknown
+ basic_os=amigaos
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-unknown
+ basic_os=sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ basic_os=sysv
+ ;;
+ apollo68bsd)
+ basic_machine=m68k-apollo
+ basic_os=bsd
+ ;;
+ aros)
+ basic_machine=i386-pc
+ basic_os=aros
+ ;;
+ aux)
+ basic_machine=m68k-apple
+ basic_os=aux
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ basic_os=dynix
+ ;;
+ blackfin)
+ basic_machine=bfin-unknown
+ basic_os=linux
+ ;;
+ cegcc)
+ basic_machine=arm-unknown
+ basic_os=cegcc
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ basic_os=bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ basic_os=bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ basic_os=bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ basic_os=bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ basic_os=bsd
+ ;;
+ cray)
+ basic_machine=j90-cray
+ basic_os=unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ basic_os=
+ ;;
+ da30)
+ basic_machine=m68k-da30
+ basic_os=
+ ;;
+ decstation | pmax | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ basic_os=
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ basic_os=sysv3
+ ;;
+ dicos)
+ basic_machine=i686-pc
+ basic_os=dicos
+ ;;
+ djgpp)
+ basic_machine=i586-pc
+ basic_os=msdosdjgpp
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ basic_os=ebmon
+ ;;
+ es1800 | OSE68k | ose68k | ose | OSE)
+ basic_machine=m68k-ericsson
+ basic_os=ose
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ basic_os=sysv
+ ;;
+ go32)
+ basic_machine=i386-pc
+ basic_os=go32
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ basic_os=hms
+ ;;
+ h8300xray)
+ basic_machine=h8300-hitachi
+ basic_os=xray
+ ;;
+ h8500hms)
+ basic_machine=h8500-hitachi
+ basic_os=hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ basic_os=sysv3
+ ;;
+ hp300 | hp300hpux)
+ basic_machine=m68k-hp
+ basic_os=hpux
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ basic_os=bsd
+ ;;
+ hppaosf)
+ basic_machine=hppa1.1-hp
+ basic_os=osf
+ ;;
+ hppro)
+ basic_machine=hppa1.1-hp
+ basic_os=proelf
+ ;;
+ i386mach)
+ basic_machine=i386-mach
+ basic_os=mach
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ basic_os=sysv
+ ;;
+ m68knommu)
+ basic_machine=m68k-unknown
+ basic_os=linux
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ basic_os=sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ basic_os=sysv
+ ;;
+ mingw64)
+ basic_machine=x86_64-pc
+ basic_os=mingw64
+ ;;
+ mingw32)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ mingw32ce)
+ basic_machine=arm-unknown
+ basic_os=mingw32ce
+ ;;
+ monitor)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ morphos)
+ basic_machine=powerpc-unknown
+ basic_os=morphos
+ ;;
+ moxiebox)
+ basic_machine=moxie-unknown
+ basic_os=moxiebox
+ ;;
+ msdos)
+ basic_machine=i386-pc
+ basic_os=msdos
+ ;;
+ msys)
+ basic_machine=i686-pc
+ basic_os=msys
+ ;;
+ mvs)
+ basic_machine=i370-ibm
+ basic_os=mvs
+ ;;
+ nacl)
+ basic_machine=le32-unknown
+ basic_os=nacl
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ basic_os=sysv4
+ ;;
+ netbsd386)
+ basic_machine=i386-pc
+ basic_os=netbsd
+ ;;
+ netwinder)
+ basic_machine=armv4l-rebel
+ basic_os=linux
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ basic_os=newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ basic_os=newsos
+ ;;
+ necv70)
+ basic_machine=v70-nec
+ basic_os=sysv
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ basic_os=cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ basic_os=cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ basic_os=nindy
+ ;;
+ mon960)
+ basic_machine=i960-intel
+ basic_os=mon960
+ ;;
+ nonstopux)
+ basic_machine=mips-compaq
+ basic_os=nonstopux
+ ;;
+ os400)
+ basic_machine=powerpc-ibm
+ basic_os=os400
+ ;;
+ OSE68000 | ose68000)
+ basic_machine=m68000-ericsson
+ basic_os=ose
+ ;;
+ os68k)
+ basic_machine=m68k-none
+ basic_os=os68k
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ basic_os=osf
+ ;;
+ parisc)
+ basic_machine=hppa-unknown
+ basic_os=linux
+ ;;
+ psp)
+ basic_machine=mipsallegrexel-sony
+ basic_os=psp
+ ;;
+ pw32)
+ basic_machine=i586-unknown
+ basic_os=pw32
+ ;;
+ rdos | rdos64)
+ basic_machine=x86_64-pc
+ basic_os=rdos
+ ;;
+ rdos32)
+ basic_machine=i386-pc
+ basic_os=rdos
+ ;;
+ rom68k)
+ basic_machine=m68k-rom68k
+ basic_os=coff
+ ;;
+ sa29200)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ sei)
+ basic_machine=mips-sei
+ basic_os=seiux
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ basic_os=
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ basic_os=sysv2
+ ;;
+ st2000)
+ basic_machine=m68k-tandem
+ basic_os=
+ ;;
+ stratus)
+ basic_machine=i860-stratus
+ basic_os=sysv4
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ basic_os=
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ basic_os=sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ basic_os=sunos4
+ ;;
+ sun3)
+ basic_machine=m68k-sun
+ basic_os=
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ basic_os=sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ basic_os=sunos4
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ basic_os=
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ basic_os=sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ basic_os=sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ basic_os=solaris2
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ basic_os=
+ ;;
+ sv1)
+ basic_machine=sv1-cray
+ basic_os=unicos
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ basic_os=dynix
+ ;;
+ t3e)
+ basic_machine=alphaev5-cray
+ basic_os=unicos
+ ;;
+ t90)
+ basic_machine=t90-cray
+ basic_os=unicos
+ ;;
+ toad1)
+ basic_machine=pdp10-xkl
+ basic_os=tops20
+ ;;
+ tpf)
+ basic_machine=s390x-ibm
+ basic_os=tpf
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ basic_os=udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ basic_os=sym1
+ ;;
+ v810 | necv810)
+ basic_machine=v810-nec
+ basic_os=none
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ basic_os=sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ basic_os=vms
+ ;;
+ vsta)
+ basic_machine=i386-pc
+ basic_os=vsta
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ basic_os=vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ basic_os=vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ basic_os=vxworks
+ ;;
+ xbox)
+ basic_machine=i686-pc
+ basic_os=mingw32
+ ;;
+ ymp)
+ basic_machine=ymp-cray
+ basic_os=unicos
+ ;;
+ *)
+ basic_machine=$1
+ basic_os=
+ ;;
+ esac
;;
esac
-# Decode aliases for certain CPU-COMPANY combinations.
+# Decode 1-component or ad-hoc basic machines
case $basic_machine in
- # Recognize the basic CPU types without company name.
- # Some are omitted here because they have special meanings below.
- 1750a | 580 \
- | a29k \
- | aarch64 | aarch64_be \
- | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \
- | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \
- | am33_2.0 \
- | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \
- | be32 | be64 \
- | bfin \
- | c4x | clipper \
- | d10v | d30v | dlx | dsp16xx \
- | epiphany \
- | fido | fr30 | frv \
- | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
- | hexagon \
- | i370 | i860 | i960 | ia64 \
- | ip2k | iq2000 \
- | le32 | le64 \
- | lm32 \
- | m32c | m32r | m32rle | m68000 | m68k | m88k \
- | maxq | mb | microblaze | mcore | mep | metag \
- | mips | mipsbe | mipseb | mipsel | mipsle \
- | mips16 \
- | mips64 | mips64el \
- | mips64octeon | mips64octeonel \
- | mips64orion | mips64orionel \
- | mips64r5900 | mips64r5900el \
- | mips64vr | mips64vrel \
- | mips64vr4100 | mips64vr4100el \
- | mips64vr4300 | mips64vr4300el \
- | mips64vr5000 | mips64vr5000el \
- | mips64vr5900 | mips64vr5900el \
- | mipsisa32 | mipsisa32el \
- | mipsisa32r2 | mipsisa32r2el \
- | mipsisa64 | mipsisa64el \
- | mipsisa64r2 | mipsisa64r2el \
- | mipsisa64sb1 | mipsisa64sb1el \
- | mipsisa64sr71k | mipsisa64sr71kel \
- | mipstx39 | mipstx39el \
- | mn10200 | mn10300 \
- | moxie \
- | mt \
- | msp430 \
- | nds32 | nds32le | nds32be \
- | nios | nios2 \
- | ns16k | ns32k \
- | open8 \
- | or32 \
- | pdp10 | pdp11 | pj | pjl \
- | powerpc | powerpc64 | powerpc64le | powerpcle \
- | pyramid \
- | rl78 | rx \
- | score \
- | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \
- | sh64 | sh64le \
- | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \
- | sparcv8 | sparcv9 | sparcv9b | sparcv9v \
- | spu \
- | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \
- | ubicom32 \
- | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \
- | we32k \
- | x86 | xc16x | xstormy16 | xtensa \
- | z8k | z80)
- basic_machine=$basic_machine-unknown
- ;;
- c54x)
- basic_machine=tic54x-unknown
- ;;
- c55x)
- basic_machine=tic55x-unknown
- ;;
- c6x)
- basic_machine=tic6x-unknown
- ;;
- m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x | picochip)
- basic_machine=$basic_machine-unknown
- os=-none
- ;;
- m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k)
- ;;
- ms1)
- basic_machine=mt-unknown
+ # Here we handle the default manufacturer of certain CPU types. It is in
+ # some cases the only manufacturer, in others, it is the most popular.
+ w89k)
+ cpu=hppa1.1
+ vendor=winbond
;;
-
- strongarm | thumb | xscale)
- basic_machine=arm-unknown
+ op50n)
+ cpu=hppa1.1
+ vendor=oki
;;
- xgate)
- basic_machine=$basic_machine-unknown
- os=-none
+ op60c)
+ cpu=hppa1.1
+ vendor=oki
;;
- xscaleeb)
- basic_machine=armeb-unknown
+ ibm*)
+ cpu=i370
+ vendor=ibm
;;
-
- xscaleel)
- basic_machine=armel-unknown
+ orion105)
+ cpu=clipper
+ vendor=highlevel
;;
-
- # We use `pc' rather than `unknown'
- # because (1) that's what they normally are, and
- # (2) the word "unknown" tends to confuse beginning users.
- i*86 | x86_64)
- basic_machine=$basic_machine-pc
- ;;
- # Object if more than one company name word.
- *-*-*)
- echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
- exit 1
+ mac | mpw | mac-mpw)
+ cpu=m68k
+ vendor=apple
;;
- # Recognize the basic CPU types with company name.
- 580-* \
- | a29k-* \
- | aarch64-* | aarch64_be-* \
- | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \
- | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \
- | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \
- | arm-* | armbe-* | armle-* | armeb-* | armv*-* \
- | avr-* | avr32-* \
- | be32-* | be64-* \
- | bfin-* | bs2000-* \
- | c[123]* | c30-* | [cjt]90-* | c4x-* \
- | clipper-* | craynv-* | cydra-* \
- | d10v-* | d30v-* | dlx-* \
- | elxsi-* \
- | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \
- | h8300-* | h8500-* \
- | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \
- | hexagon-* \
- | i*86-* | i860-* | i960-* | ia64-* \
- | ip2k-* | iq2000-* \
- | le32-* | le64-* \
- | lm32-* \
- | m32c-* | m32r-* | m32rle-* \
- | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \
- | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \
- | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \
- | mips16-* \
- | mips64-* | mips64el-* \
- | mips64octeon-* | mips64octeonel-* \
- | mips64orion-* | mips64orionel-* \
- | mips64r5900-* | mips64r5900el-* \
- | mips64vr-* | mips64vrel-* \
- | mips64vr4100-* | mips64vr4100el-* \
- | mips64vr4300-* | mips64vr4300el-* \
- | mips64vr5000-* | mips64vr5000el-* \
- | mips64vr5900-* | mips64vr5900el-* \
- | mipsisa32-* | mipsisa32el-* \
- | mipsisa32r2-* | mipsisa32r2el-* \
- | mipsisa64-* | mipsisa64el-* \
- | mipsisa64r2-* | mipsisa64r2el-* \
- | mipsisa64sb1-* | mipsisa64sb1el-* \
- | mipsisa64sr71k-* | mipsisa64sr71kel-* \
- | mipstx39-* | mipstx39el-* \
- | mmix-* \
- | mt-* \
- | msp430-* \
- | nds32-* | nds32le-* | nds32be-* \
- | nios-* | nios2-* \
- | none-* | np1-* | ns16k-* | ns32k-* \
- | open8-* \
- | orion-* \
- | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \
- | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \
- | pyramid-* \
- | rl78-* | romp-* | rs6000-* | rx-* \
- | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \
- | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \
- | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \
- | sparclite-* \
- | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \
- | tahoe-* \
- | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \
- | tile*-* \
- | tron-* \
- | ubicom32-* \
- | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \
- | vax-* \
- | we32k-* \
- | x86-* | x86_64-* | xc16x-* | xps100-* \
- | xstormy16-* | xtensa*-* \
- | ymp-* \
- | z8k-* | z80-*)
- ;;
- # Recognize the basic CPU types without company name, with glob match.
- xtensa*)
- basic_machine=$basic_machine-unknown
+ pmac | pmac-mpw)
+ cpu=powerpc
+ vendor=apple
;;
+
# Recognize the various machine names and aliases which stand
# for a CPU type and a company and sometimes even an OS.
- 386bsd)
- basic_machine=i386-unknown
- os=-bsd
- ;;
3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
- basic_machine=m68000-att
+ cpu=m68000
+ vendor=att
;;
3b*)
- basic_machine=we32k-att
- ;;
- a29khif)
- basic_machine=a29k-amd
- os=-udi
- ;;
- abacus)
- basic_machine=abacus-unknown
- ;;
- adobe68k)
- basic_machine=m68010-adobe
- os=-scout
- ;;
- alliant | fx80)
- basic_machine=fx80-alliant
- ;;
- altos | altos3068)
- basic_machine=m68k-altos
- ;;
- am29k)
- basic_machine=a29k-none
- os=-bsd
- ;;
- amd64)
- basic_machine=x86_64-pc
- ;;
- amd64-*)
- basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- amdahl)
- basic_machine=580-amdahl
- os=-sysv
- ;;
- amiga | amiga-*)
- basic_machine=m68k-unknown
- ;;
- amigaos | amigados)
- basic_machine=m68k-unknown
- os=-amigaos
- ;;
- amigaunix | amix)
- basic_machine=m68k-unknown
- os=-sysv4
- ;;
- apollo68)
- basic_machine=m68k-apollo
- os=-sysv
- ;;
- apollo68bsd)
- basic_machine=m68k-apollo
- os=-bsd
- ;;
- aros)
- basic_machine=i386-pc
- os=-aros
- ;;
- aux)
- basic_machine=m68k-apple
- os=-aux
- ;;
- balance)
- basic_machine=ns32k-sequent
- os=-dynix
- ;;
- blackfin)
- basic_machine=bfin-unknown
- os=-linux
- ;;
- blackfin-*)
- basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=we32k
+ vendor=att
;;
bluegene*)
- basic_machine=powerpc-ibm
- os=-cnk
- ;;
- c54x-*)
- basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c55x-*)
- basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c6x-*)
- basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- c90)
- basic_machine=c90-cray
- os=-unicos
- ;;
- cegcc)
- basic_machine=arm-unknown
- os=-cegcc
- ;;
- convex-c1)
- basic_machine=c1-convex
- os=-bsd
- ;;
- convex-c2)
- basic_machine=c2-convex
- os=-bsd
- ;;
- convex-c32)
- basic_machine=c32-convex
- os=-bsd
- ;;
- convex-c34)
- basic_machine=c34-convex
- os=-bsd
- ;;
- convex-c38)
- basic_machine=c38-convex
- os=-bsd
- ;;
- cray | j90)
- basic_machine=j90-cray
- os=-unicos
- ;;
- craynv)
- basic_machine=craynv-cray
- os=-unicosmp
- ;;
- cr16 | cr16-*)
- basic_machine=cr16-unknown
- os=-elf
- ;;
- crds | unos)
- basic_machine=m68k-crds
- ;;
- crisv32 | crisv32-* | etraxfs*)
- basic_machine=crisv32-axis
- ;;
- cris | cris-* | etrax*)
- basic_machine=cris-axis
- ;;
- crx)
- basic_machine=crx-unknown
- os=-elf
- ;;
- da30 | da30-*)
- basic_machine=m68k-da30
- ;;
- decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
- basic_machine=mips-dec
+ cpu=powerpc
+ vendor=ibm
+ basic_os=cnk
;;
decsystem10* | dec10*)
- basic_machine=pdp10-dec
- os=-tops10
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops10
;;
decsystem20* | dec20*)
- basic_machine=pdp10-dec
- os=-tops20
+ cpu=pdp10
+ vendor=dec
+ basic_os=tops20
;;
delta | 3300 | motorola-3300 | motorola-delta \
| 3300-motorola | delta-motorola)
- basic_machine=m68k-motorola
- ;;
- delta88)
- basic_machine=m88k-motorola
- os=-sysv3
- ;;
- dicos)
- basic_machine=i686-pc
- os=-dicos
+ cpu=m68k
+ vendor=motorola
;;
- djgpp)
- basic_machine=i586-pc
- os=-msdosdjgpp
- ;;
- dpx20 | dpx20-*)
- basic_machine=rs6000-bull
- os=-bosx
- ;;
- dpx2* | dpx2*-bull)
- basic_machine=m68k-bull
- os=-sysv3
- ;;
- ebmon29k)
- basic_machine=a29k-amd
- os=-ebmon
- ;;
- elxsi)
- basic_machine=elxsi-elxsi
- os=-bsd
+ dpx2*)
+ cpu=m68k
+ vendor=bull
+ basic_os=sysv3
;;
encore | umax | mmax)
- basic_machine=ns32k-encore
+ cpu=ns32k
+ vendor=encore
;;
- es1800 | OSE68k | ose68k | ose | OSE)
- basic_machine=m68k-ericsson
- os=-ose
+ elxsi)
+ cpu=elxsi
+ vendor=elxsi
+ basic_os=${basic_os:-bsd}
;;
fx2800)
- basic_machine=i860-alliant
+ cpu=i860
+ vendor=alliant
;;
genix)
- basic_machine=ns32k-ns
- ;;
- gmicro)
- basic_machine=tron-gmicro
- os=-sysv
- ;;
- go32)
- basic_machine=i386-pc
- os=-go32
+ cpu=ns32k
+ vendor=ns
;;
h3050r* | hiux*)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- h8300hms)
- basic_machine=h8300-hitachi
- os=-hms
- ;;
- h8300xray)
- basic_machine=h8300-hitachi
- os=-xray
- ;;
- h8500hms)
- basic_machine=h8500-hitachi
- os=-hms
- ;;
- harris)
- basic_machine=m88k-harris
- os=-sysv3
- ;;
- hp300-*)
- basic_machine=m68k-hp
- ;;
- hp300bsd)
- basic_machine=m68k-hp
- os=-bsd
- ;;
- hp300hpux)
- basic_machine=m68k-hp
- os=-hpux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
hp3k9[0-9][0-9] | hp9[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k2[0-9][0-9] | hp9k31[0-9])
- basic_machine=m68000-hp
+ cpu=m68000
+ vendor=hp
;;
hp9k3[2-9][0-9])
- basic_machine=m68k-hp
+ cpu=m68k
+ vendor=hp
;;
hp9k6[0-9][0-9] | hp6[0-9][0-9])
- basic_machine=hppa1.0-hp
+ cpu=hppa1.0
+ vendor=hp
;;
hp9k7[0-79][0-9] | hp7[0-79][0-9])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k78[0-9] | hp78[0-9])
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893)
# FIXME: really hppa2.0-hp
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][13679] | hp8[0-9][13679])
- basic_machine=hppa1.1-hp
+ cpu=hppa1.1
+ vendor=hp
;;
hp9k8[0-9][0-9] | hp8[0-9][0-9])
- basic_machine=hppa1.0-hp
- ;;
- hppa-next)
- os=-nextstep3
- ;;
- hppaosf)
- basic_machine=hppa1.1-hp
- os=-osf
- ;;
- hppro)
- basic_machine=hppa1.1-hp
- os=-proelf
- ;;
- i370-ibm* | ibm*)
- basic_machine=i370-ibm
+ cpu=hppa1.0
+ vendor=hp
;;
i*86v32)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv32
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv32
;;
i*86v4*)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv4
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv4
;;
i*86v)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-sysv
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=sysv
;;
i*86sol2)
- basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'`
- os=-solaris2
+ cpu=`echo "$1" | sed -e 's/86.*/86/'`
+ vendor=pc
+ basic_os=solaris2
;;
- i386mach)
- basic_machine=i386-mach
- os=-mach
- ;;
- i386-vsta | vsta)
- basic_machine=i386-unknown
- os=-vsta
+ j90 | j90-cray)
+ cpu=j90
+ vendor=cray
+ basic_os=${basic_os:-unicos}
;;
iris | iris4d)
- basic_machine=mips-sgi
- case $os in
- -irix*)
+ cpu=mips
+ vendor=sgi
+ case $basic_os in
+ irix*)
;;
*)
- os=-irix4
+ basic_os=irix4
;;
esac
;;
- isi68 | isi)
- basic_machine=m68k-isi
- os=-sysv
- ;;
- m68knommu)
- basic_machine=m68k-unknown
- os=-linux
- ;;
- m68knommu-*)
- basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
- ;;
- m88k-omron*)
- basic_machine=m88k-omron
- ;;
- magnum | m3230)
- basic_machine=mips-mips
- os=-sysv
- ;;
- merlin)
- basic_machine=ns32k-utek
- os=-sysv
- ;;
- microblaze)
- basic_machine=microblaze-xilinx
- ;;
- mingw32)
- basic_machine=i386-pc
- os=-mingw32
- ;;
- mingw32ce)
- basic_machine=arm-unknown
- os=-mingw32ce
- ;;
miniframe)
- basic_machine=m68000-convergent
- ;;
- *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*)
- basic_machine=m68k-atari
- os=-mint
- ;;
- mips3*-*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
- ;;
- mips3*)
- basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
- ;;
- monitor)
- basic_machine=m68k-rom68k
- os=-coff
- ;;
- morphos)
- basic_machine=powerpc-unknown
- os=-morphos
- ;;
- msdos)
- basic_machine=i386-pc
- os=-msdos
- ;;
- ms1-*)
- basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'`
- ;;
- msys)
- basic_machine=i386-pc
- os=-msys
- ;;
- mvs)
- basic_machine=i370-ibm
- os=-mvs
+ cpu=m68000
+ vendor=convergent
;;
- nacl)
- basic_machine=le32-unknown
- os=-nacl
- ;;
- ncr3000)
- basic_machine=i486-ncr
- os=-sysv4
- ;;
- netbsd386)
- basic_machine=i386-unknown
- os=-netbsd
- ;;
- netwinder)
- basic_machine=armv4l-rebel
- os=-linux
- ;;
- news | news700 | news800 | news900)
- basic_machine=m68k-sony
- os=-newsos
- ;;
- news1000)
- basic_machine=m68030-sony
- os=-newsos
+ *mint | mint[0-9]* | *MiNT | *MiNT[0-9]*)
+ cpu=m68k
+ vendor=atari
+ basic_os=mint
;;
news-3600 | risc-news)
- basic_machine=mips-sony
- os=-newsos
- ;;
- necv70)
- basic_machine=v70-nec
- os=-sysv
- ;;
- next | m*-next )
- basic_machine=m68k-next
- case $os in
- -nextstep* )
+ cpu=mips
+ vendor=sony
+ basic_os=newsos
+ ;;
+ next | m*-next)
+ cpu=m68k
+ vendor=next
+ case $basic_os in
+ openstep*)
+ ;;
+ nextstep*)
;;
- -ns2*)
- os=-nextstep2
+ ns2*)
+ basic_os=nextstep2
;;
*)
- os=-nextstep3
+ basic_os=nextstep3
;;
esac
;;
- nh3000)
- basic_machine=m68k-harris
- os=-cxux
- ;;
- nh[45]000)
- basic_machine=m88k-harris
- os=-cxux
- ;;
- nindy960)
- basic_machine=i960-intel
- os=-nindy
- ;;
- mon960)
- basic_machine=i960-intel
- os=-mon960
- ;;
- nonstopux)
- basic_machine=mips-compaq
- os=-nonstopux
- ;;
np1)
- basic_machine=np1-gould
- ;;
- neo-tandem)
- basic_machine=neo-tandem
- ;;
- nse-tandem)
- basic_machine=nse-tandem
- ;;
- nsr-tandem)
- basic_machine=nsr-tandem
+ cpu=np1
+ vendor=gould
;;
op50n-* | op60c-*)
- basic_machine=hppa1.1-oki
- os=-proelf
- ;;
- openrisc | openrisc-*)
- basic_machine=or32-unknown
- ;;
- os400)
- basic_machine=powerpc-ibm
- os=-os400
- ;;
- OSE68000 | ose68000)
- basic_machine=m68000-ericsson
- os=-ose
- ;;
- os68k)
- basic_machine=m68k-none
- os=-os68k
+ cpu=hppa1.1
+ vendor=oki
+ basic_os=proelf
;;
pa-hitachi)
- basic_machine=hppa1.1-hitachi
- os=-hiuxwe2
- ;;
- paragon)
- basic_machine=i860-intel
- os=-osf
- ;;
- parisc)
- basic_machine=hppa-unknown
- os=-linux
- ;;
- parisc-*)
- basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'`
- os=-linux
+ cpu=hppa1.1
+ vendor=hitachi
+ basic_os=hiuxwe2
;;
pbd)
- basic_machine=sparc-tti
+ cpu=sparc
+ vendor=tti
;;
pbb)
- basic_machine=m68k-tti
- ;;
- pc532 | pc532-*)
- basic_machine=ns32k-pc532
- ;;
- pc98)
- basic_machine=i386-pc
- ;;
- pc98-*)
- basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium | p5 | k5 | k6 | nexgen | viac3)
- basic_machine=i586-pc
- ;;
- pentiumpro | p6 | 6x86 | athlon | athlon_*)
- basic_machine=i686-pc
- ;;
- pentiumii | pentium2 | pentiumiii | pentium3)
- basic_machine=i686-pc
+ cpu=m68k
+ vendor=tti
;;
- pentium4)
- basic_machine=i786-pc
- ;;
- pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*)
- basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumpro-* | p6-* | 6x86-* | athlon-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*)
- basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- pentium4-*)
- basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'`
+ pc532)
+ cpu=ns32k
+ vendor=pc532
;;
pn)
- basic_machine=pn-gould
- ;;
- power) basic_machine=power-ibm
- ;;
- ppc | ppcbe) basic_machine=powerpc-unknown
- ;;
- ppc-* | ppcbe-*)
- basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ cpu=pn
+ vendor=gould
;;
- ppcle | powerpclittle | ppc-le | powerpc-little)
- basic_machine=powerpcle-unknown
- ;;
- ppcle-* | powerpclittle-*)
- basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64) basic_machine=powerpc64-unknown
- ;;
- ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'`
- ;;
- ppc64le | powerpc64little | ppc64-le | powerpc64-little)
- basic_machine=powerpc64le-unknown
- ;;
- ppc64le-* | powerpc64little-*)
- basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'`
+ power)
+ cpu=power
+ vendor=ibm
;;
ps2)
- basic_machine=i386-ibm
- ;;
- pw32)
- basic_machine=i586-unknown
- os=-pw32
- ;;
- rdos)
- basic_machine=i386-pc
- os=-rdos
- ;;
- rom68k)
- basic_machine=m68k-rom68k
- os=-coff
+ cpu=i386
+ vendor=ibm
;;
rm[46]00)
- basic_machine=mips-siemens
+ cpu=mips
+ vendor=siemens
;;
rtpc | rtpc-*)
- basic_machine=romp-ibm
- ;;
- s390 | s390-*)
- basic_machine=s390-ibm
- ;;
- s390x | s390x-*)
- basic_machine=s390x-ibm
+ cpu=romp
+ vendor=ibm
;;
- sa29200)
- basic_machine=a29k-amd
- os=-udi
- ;;
- sb1)
- basic_machine=mipsisa64sb1-unknown
+ sde)
+ cpu=mipsisa32
+ vendor=sde
+ basic_os=${basic_os:-elf}
;;
- sb1el)
- basic_machine=mipsisa64sb1el-unknown
+ simso-wrs)
+ cpu=sparclite
+ vendor=wrs
+ basic_os=vxworks
;;
- sde)
- basic_machine=mipsisa32-sde
- os=-elf
+ tower | tower-32)
+ cpu=m68k
+ vendor=ncr
;;
- sei)
- basic_machine=mips-sei
- os=-seiux
+ vpp*|vx|vx-*)
+ cpu=f301
+ vendor=fujitsu
;;
- sequent)
- basic_machine=i386-sequent
+ w65)
+ cpu=w65
+ vendor=wdc
;;
- sh)
- basic_machine=sh-hitachi
- os=-hms
+ w89k-*)
+ cpu=hppa1.1
+ vendor=winbond
+ basic_os=proelf
;;
- sh5el)
- basic_machine=sh5le-unknown
+ none)
+ cpu=none
+ vendor=none
;;
- sh64)
- basic_machine=sh64-unknown
+ leon|leon[3-9])
+ cpu=sparc
+ vendor=$basic_machine
;;
- sparclite-wrs | simso-wrs)
- basic_machine=sparclite-wrs
- os=-vxworks
+ leon-*|leon[3-9]-*)
+ cpu=sparc
+ vendor=`echo "$basic_machine" | sed 's/-.*//'`
;;
- sps7)
- basic_machine=m68k-bull
- os=-sysv2
+
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read cpu vendor <&2
- exit 1
+ # Recognize the canonical CPU types that are allowed with any
+ # company name.
+ case $cpu in
+ 1750a | 580 \
+ | a29k \
+ | aarch64 | aarch64_be | aarch64c | arm64ec \
+ | abacus \
+ | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] \
+ | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] \
+ | alphapca5[67] | alpha64pca5[67] \
+ | am33_2.0 \
+ | amdgcn \
+ | arc | arceb | arc32 | arc64 \
+ | arm | arm[lb]e | arme[lb] | armv* \
+ | avr | avr32 \
+ | asmjs \
+ | ba \
+ | be32 | be64 \
+ | bfin | bpf | bs2000 \
+ | c[123]* | c30 | [cjt]90 | c4x \
+ | c8051 | clipper | craynv | csky | cydra \
+ | d10v | d30v | dlx | dsp16xx \
+ | e2k | elxsi | epiphany \
+ | f30[01] | f700 | fido | fr30 | frv | ft32 | fx80 \
+ | javascript \
+ | h8300 | h8500 \
+ | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \
+ | hexagon \
+ | i370 | i*86 | i860 | i960 | ia16 | ia64 \
+ | ip2k | iq2000 \
+ | k1om \
+ | kvx \
+ | le32 | le64 \
+ | lm32 \
+ | loongarch32 | loongarch64 \
+ | m32c | m32r | m32rle \
+ | m5200 | m68000 | m680[012346]0 | m68360 | m683?2 | m68k \
+ | m6811 | m68hc11 | m6812 | m68hc12 | m68hcs12x \
+ | m88110 | m88k | maxq | mb | mcore | mep | metag \
+ | microblaze | microblazeel \
+ | mips* \
+ | mmix \
+ | mn10200 | mn10300 \
+ | moxie \
+ | mt \
+ | msp430 \
+ | nanomips* \
+ | nds32 | nds32le | nds32be \
+ | nfp \
+ | nios | nios2 | nios2eb | nios2el \
+ | none | np1 | ns16k | ns32k | nvptx \
+ | open8 \
+ | or1k* \
+ | or32 \
+ | orion \
+ | picochip \
+ | pdp10 | pdp11 | pj | pjl | pn | power \
+ | powerpc | powerpc64 | powerpc64le | powerpcle | powerpcspe \
+ | pru \
+ | pyramid \
+ | riscv | riscv32 | riscv32be | riscv64 | riscv64be \
+ | rl78 | romp | rs6000 | rx \
+ | s390 | s390x \
+ | score \
+ | sh | shl \
+ | sh[1234] | sh[24]a | sh[24]ae[lb] | sh[23]e | she[lb] | sh[lb]e \
+ | sh[1234]e[lb] | sh[12345][lb]e | sh[23]ele | sh64 | sh64le \
+ | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet \
+ | sparclite \
+ | sparcv8 | sparcv9 | sparcv9b | sparcv9v | sv1 | sx* \
+ | spu \
+ | tahoe \
+ | thumbv7* \
+ | tic30 | tic4x | tic54x | tic55x | tic6x | tic80 \
+ | tron \
+ | ubicom32 \
+ | v70 | v850 | v850e | v850e1 | v850es | v850e2 | v850e2v3 \
+ | vax \
+ | vc4 \
+ | visium \
+ | w65 \
+ | wasm32 | wasm64 \
+ | we32k \
+ | x86 | x86_64 | xc16x | xgate | xps100 \
+ | xstormy16 | xtensa* \
+ | ymp \
+ | z8k | z80)
+ ;;
+
+ *)
+ echo "Invalid configuration '$1': machine '$cpu-$vendor' not recognized" 1>&2
+ exit 1
+ ;;
+ esac
;;
esac
# Here we canonicalize certain aliases for manufacturers.
-case $basic_machine in
- *-digital*)
- basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+case $vendor in
+ digital*)
+ vendor=dec
;;
- *-commodore*)
- basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ commodore*)
+ vendor=cbm
;;
*)
;;
@@ -1315,203 +1287,226 @@ esac
# Decode manufacturer-specific aliases for certain operating systems.
-if [ x"$os" != x"" ]
+if test x"$basic_os" != x
then
+
+# First recognize some ad-hoc cases, or perhaps split kernel-os, or else just
+# set os.
+obj=
+case $basic_os in
+ gnu/linux*)
+ kernel=linux
+ os=`echo "$basic_os" | sed -e 's|gnu/linux|gnu|'`
+ ;;
+ os2-emx)
+ kernel=os2
+ os=`echo "$basic_os" | sed -e 's|os2-emx|emx|'`
+ ;;
+ nto-qnx*)
+ kernel=nto
+ os=`echo "$basic_os" | sed -e 's|nto-qnx|qnx|'`
+ ;;
+ *-*)
+ # shellcheck disable=SC2162
+ saved_IFS=$IFS
+ IFS="-" read kernel os <&2
- exit 1
+ # No normalization, but not necessarily accepted, that comes below.
;;
esac
+
else
# Here we handle the default operating systems that come with various machines.
@@ -1524,258 +1519,452 @@ else
# will signal an error saying that MANUFACTURER isn't an operating
# system, and we'll never get to this point.
-case $basic_machine in
+kernel=
+obj=
+case $cpu-$vendor in
score-*)
- os=-elf
+ os=
+ obj=elf
;;
spu-*)
- os=-elf
+ os=
+ obj=elf
;;
*-acorn)
- os=-riscix1.2
+ os=riscix1.2
;;
arm*-rebel)
- os=-linux
+ kernel=linux
+ os=gnu
;;
arm*-semi)
- os=-aout
+ os=
+ obj=aout
;;
c4x-* | tic4x-*)
- os=-coff
+ os=
+ obj=coff
+ ;;
+ c8051-*)
+ os=
+ obj=elf
+ ;;
+ clipper-intergraph)
+ os=clix
;;
hexagon-*)
- os=-elf
+ os=
+ obj=elf
;;
tic54x-*)
- os=-coff
+ os=
+ obj=coff
;;
tic55x-*)
- os=-coff
+ os=
+ obj=coff
;;
tic6x-*)
- os=-coff
+ os=
+ obj=coff
;;
# This must come before the *-dec entry.
pdp10-*)
- os=-tops20
+ os=tops20
;;
pdp11-*)
- os=-none
+ os=none
;;
*-dec | vax-*)
- os=-ultrix4.2
+ os=ultrix4.2
;;
m68*-apollo)
- os=-domain
+ os=domain
;;
i386-sun)
- os=-sunos4.0.2
+ os=sunos4.0.2
;;
m68000-sun)
- os=-sunos3
+ os=sunos3
;;
m68*-cisco)
- os=-aout
+ os=
+ obj=aout
;;
mep-*)
- os=-elf
+ os=
+ obj=elf
;;
mips*-cisco)
- os=-elf
+ os=
+ obj=elf
;;
- mips*-*)
- os=-elf
+ mips*-*|nanomips*-*)
+ os=
+ obj=elf
;;
or32-*)
- os=-coff
+ os=
+ obj=coff
;;
*-tti) # must be before sparc entry or we get the wrong os.
- os=-sysv3
+ os=sysv3
;;
sparc-* | *-sun)
- os=-sunos4.1.1
+ os=sunos4.1.1
;;
- *-be)
- os=-beos
+ pru-*)
+ os=
+ obj=elf
;;
- *-haiku)
- os=-haiku
+ *-be)
+ os=beos
;;
*-ibm)
- os=-aix
+ os=aix
;;
*-knuth)
- os=-mmixware
+ os=mmixware
;;
*-wec)
- os=-proelf
+ os=proelf
;;
*-winbond)
- os=-proelf
+ os=proelf
;;
*-oki)
- os=-proelf
+ os=proelf
;;
*-hp)
- os=-hpux
+ os=hpux
;;
*-hitachi)
- os=-hiux
+ os=hiux
;;
i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
- os=-sysv
+ os=sysv
;;
*-cbm)
- os=-amigaos
+ os=amigaos
;;
*-dg)
- os=-dgux
+ os=dgux
;;
*-dolphin)
- os=-sysv3
+ os=sysv3
;;
m68k-ccur)
- os=-rtu
+ os=rtu
;;
m88k-omron*)
- os=-luna
+ os=luna
;;
- *-next )
- os=-nextstep
+ *-next)
+ os=nextstep
;;
*-sequent)
- os=-ptx
+ os=ptx
;;
*-crds)
- os=-unos
+ os=unos
;;
*-ns)
- os=-genix
+ os=genix
;;
i370-*)
- os=-mvs
- ;;
- *-next)
- os=-nextstep3
+ os=mvs
;;
*-gould)
- os=-sysv
+ os=sysv
;;
*-highlevel)
- os=-bsd
+ os=bsd
;;
*-encore)
- os=-bsd
+ os=bsd
;;
*-sgi)
- os=-irix
+ os=irix
;;
*-siemens)
- os=-sysv4
+ os=sysv4
;;
*-masscomp)
- os=-rtu
+ os=rtu
;;
f30[01]-fujitsu | f700-fujitsu)
- os=-uxpv
+ os=uxpv
;;
*-rom68k)
- os=-coff
+ os=
+ obj=coff
;;
*-*bug)
- os=-coff
+ os=
+ obj=coff
;;
*-apple)
- os=-macos
+ os=macos
;;
*-atari*)
- os=-mint
+ os=mint
+ ;;
+ *-wrs)
+ os=vxworks
;;
*)
- os=-none
+ os=none
;;
esac
+
fi
+# Now, validate our (potentially fixed-up) individual pieces (OS, OBJ).
+
+case $os in
+ # Sometimes we do "kernel-libc", so those need to count as OSes.
+ llvm* | musl* | newlib* | relibc* | uclibc*)
+ ;;
+ # Likewise for "kernel-abi"
+ eabi* | gnueabi*)
+ ;;
+ # VxWorks passes extra cpu info in the 4th filed.
+ simlinux | simwindows | spe)
+ ;;
+ # See `case $cpu-$os` validation below
+ ghcjs)
+ ;;
+ # Now accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST end in a * to match a version number.
+ gnu* | android* | bsd* | mach* | minix* | genix* | ultrix* | irix* \
+ | *vms* | esix* | aix* | cnk* | sunos | sunos[34]* \
+ | hpux* | unos* | osf* | luna* | dgux* | auroraux* | solaris* \
+ | sym* | plan9* | psp* | sim* | xray* | os68k* | v88r* \
+ | hiux* | abug | nacl* | netware* | windows* \
+ | os9* | macos* | osx* | ios* | tvos* | watchos* \
+ | mpw* | magic* | mmixware* | mon960* | lnews* \
+ | amigaos* | amigados* | msdos* | newsos* | unicos* | aof* \
+ | aos* | aros* | cloudabi* | sortix* | twizzler* \
+ | nindy* | vxsim* | vxworks* | ebmon* | hms* | mvs* \
+ | clix* | riscos* | uniplus* | iris* | isc* | rtu* | xenix* \
+ | mirbsd* | netbsd* | dicos* | openedition* | ose* \
+ | bitrig* | openbsd* | secbsd* | solidbsd* | libertybsd* | os108* \
+ | ekkobsd* | freebsd* | riscix* | lynxos* | os400* \
+ | bosx* | nextstep* | cxux* | oabi* \
+ | ptx* | ecoff* | winnt* | domain* | vsta* \
+ | udi* | lites* | ieee* | go32* | aux* | hcos* \
+ | chorusrdb* | cegcc* | glidix* | serenity* \
+ | cygwin* | msys* | moss* | proelf* | rtems* \
+ | midipix* | mingw32* | mingw64* | mint* \
+ | uxpv* | beos* | mpeix* | udk* | moxiebox* \
+ | interix* | uwin* | mks* | rhapsody* | darwin* \
+ | openstep* | oskit* | conix* | pw32* | nonstopux* \
+ | storm-chaos* | tops10* | tenex* | tops20* | its* \
+ | os2* | vos* | palmos* | uclinux* | nucleus* | morphos* \
+ | scout* | superux* | sysv* | rtmk* | tpf* | windiss* \
+ | powermax* | dnix* | nx6 | nx7 | sei* | dragonfly* \
+ | skyos* | haiku* | rdos* | toppers* | drops* | es* \
+ | onefs* | tirtos* | phoenix* | fuchsia* | redox* | bme* \
+ | midnightbsd* | amdhsa* | unleashed* | emscripten* | wasi* \
+ | nsk* | powerunix* | genode* | zvmoe* | qnx* | emx* | zephyr* \
+ | fiwix* | mlibc* | cos* | mbr* | ironclad* )
+ ;;
+ # This one is extra strict with allowed versions
+ sco3.2v2 | sco3.2v[4-9]* | sco5v6*)
+ # Don't forget version if it is 3.2v4 or newer.
+ ;;
+ # This refers to builds using the UEFI calling convention
+ # (which depends on the architecture) and PE file format.
+ # Note that this is both a different calling convention and
+ # different file format than that of GNU-EFI
+ # (x86_64-w64-mingw32).
+ uefi)
+ ;;
+ none)
+ ;;
+ kernel* | msvc* )
+ # Restricted further below
+ ;;
+ '')
+ if test x"$obj" = x
+ then
+ echo "Invalid configuration '$1': Blank OS only allowed with explicit machine code file format" 1>&2
+ fi
+ ;;
+ *)
+ echo "Invalid configuration '$1': OS '$os' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+case $obj in
+ aout* | coff* | elf* | pe*)
+ ;;
+ '')
+ # empty is fine
+ ;;
+ *)
+ echo "Invalid configuration '$1': Machine code format '$obj' not recognized" 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we handle the constraint that a (synthetic) cpu and os are
+# valid only in combination with each other and nowhere else.
+case $cpu-$os in
+ # The "javascript-unknown-ghcjs" triple is used by GHC; we
+ # accept it here in order to tolerate that, but reject any
+ # variations.
+ javascript-ghcjs)
+ ;;
+ javascript-* | *-ghcjs)
+ echo "Invalid configuration '$1': cpu '$cpu' is not valid with os '$os$obj'" 1>&2
+ exit 1
+ ;;
+esac
+
+# As a final step for OS-related things, validate the OS-kernel combination
+# (given a valid OS), if there is a kernel.
+case $kernel-$os-$obj in
+ linux-gnu*- | linux-android*- | linux-dietlibc*- | linux-llvm*- \
+ | linux-mlibc*- | linux-musl*- | linux-newlib*- \
+ | linux-relibc*- | linux-uclibc*- )
+ ;;
+ uclinux-uclibc*- )
+ ;;
+ managarm-mlibc*- | managarm-kernel*- )
+ ;;
+ windows*-msvc*-)
+ ;;
+ -dietlibc*- | -llvm*- | -mlibc*- | -musl*- | -newlib*- | -relibc*- \
+ | -uclibc*- )
+ # These are just libc implementations, not actual OSes, and thus
+ # require a kernel.
+ echo "Invalid configuration '$1': libc '$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ -kernel*- )
+ echo "Invalid configuration '$1': '$os' needs explicit kernel." 1>&2
+ exit 1
+ ;;
+ *-kernel*- )
+ echo "Invalid configuration '$1': '$kernel' does not support '$os'." 1>&2
+ exit 1
+ ;;
+ *-msvc*- )
+ echo "Invalid configuration '$1': '$os' needs 'windows'." 1>&2
+ exit 1
+ ;;
+ kfreebsd*-gnu*- | kopensolaris*-gnu*-)
+ ;;
+ vxworks-simlinux- | vxworks-simwindows- | vxworks-spe-)
+ ;;
+ nto-qnx*-)
+ ;;
+ os2-emx-)
+ ;;
+ *-eabi*- | *-gnueabi*-)
+ ;;
+ none--*)
+ # None (no kernel, i.e. freestanding / bare metal),
+ # can be paired with an machine code file format
+ ;;
+ -*-)
+ # Blank kernel with real OS is always fine.
+ ;;
+ --*)
+ # Blank kernel and OS with real machine code file format is always fine.
+ ;;
+ *-*-*)
+ echo "Invalid configuration '$1': Kernel '$kernel' not known to work with OS '$os'." 1>&2
+ exit 1
+ ;;
+esac
+
# Here we handle the case where we know the os, and the CPU type, but not the
# manufacturer. We pick the logical manufacturer.
-vendor=unknown
-case $basic_machine in
- *-unknown)
- case $os in
- -riscix*)
+case $vendor in
+ unknown)
+ case $cpu-$os in
+ *-riscix*)
vendor=acorn
;;
- -sunos*)
+ *-sunos*)
vendor=sun
;;
- -cnk*|-aix*)
+ *-cnk* | *-aix*)
vendor=ibm
;;
- -beos*)
+ *-beos*)
vendor=be
;;
- -hpux*)
+ *-hpux*)
vendor=hp
;;
- -mpeix*)
+ *-mpeix*)
vendor=hp
;;
- -hiux*)
+ *-hiux*)
vendor=hitachi
;;
- -unos*)
+ *-unos*)
vendor=crds
;;
- -dgux*)
+ *-dgux*)
vendor=dg
;;
- -luna*)
+ *-luna*)
vendor=omron
;;
- -genix*)
+ *-genix*)
vendor=ns
;;
- -mvs* | -opened*)
+ *-clix*)
+ vendor=intergraph
+ ;;
+ *-mvs* | *-opened*)
+ vendor=ibm
+ ;;
+ *-os400*)
vendor=ibm
;;
- -os400*)
+ s390-* | s390x-*)
vendor=ibm
;;
- -ptx*)
+ *-ptx*)
vendor=sequent
;;
- -tpf*)
+ *-tpf*)
vendor=ibm
;;
- -vxsim* | -vxworks* | -windiss*)
+ *-vxsim* | *-vxworks* | *-windiss*)
vendor=wrs
;;
- -aux*)
+ *-aux*)
vendor=apple
;;
- -hms*)
+ *-hms*)
vendor=hitachi
;;
- -mpw* | -macos*)
+ *-mpw* | *-macos*)
vendor=apple
;;
- -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*)
+ *-*mint | *-mint[0-9]* | *-*MiNT | *-MiNT[0-9]*)
vendor=atari
;;
- -vos*)
+ *-vos*)
vendor=stratus
;;
esac
- basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
;;
esac
-echo $basic_machine$os
+echo "$cpu-$vendor${kernel:+-$kernel}${os:+-$os}${obj:+-$obj}"
exit
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "timestamp='"
# time-stamp-format: "%:y-%02m-%02d"
# time-stamp-end: "'"
diff --git a/doc/USER_MANUAL/03_mesh_generation.tex b/doc/USER_MANUAL/03_mesh_generation.tex
index 8cb7001b1..49f673d06 100644
--- a/doc/USER_MANUAL/03_mesh_generation.tex
+++ b/doc/USER_MANUAL/03_mesh_generation.tex
@@ -119,6 +119,8 @@ \section*{Notes about \texttt{DATA/Par\_file} parameters}
\item[{\texttt{materials\_file}}] is the number of the material for every element : an integer ranging from 1 to \texttt{nbmodels} on each line.
+ \item[{\texttt{nummaterial\_velocity\_file}}] specifies the material properties for each material of the \texttt{nbmodels} defined in the materials file. The material specification follows a format slightly different than the \texttt{nbmodels} section in the \texttt{Par\_file}, but identical to the SPECFEM3D\_Cartesian version where you can find more informations about it. Also, examples of such \texttt{nummaterial\_velocity\_file} files can be found in the \texttt{EXAMPLES/} folder and the format is described in more detail therein in the header of the files.
+
\item[{\texttt{free\_surface\_file}}] is the file describing the edges forming the acoustic free surface: number of edges on the first line, then on each line: number of the element, number of nodes forming the free surface (1 for a point, 2 for an edge), the nodes forming the free surface for this element. If you do not want any free surface, just put 0 on the first line; you then get a rigid surface instead.
\item[{\texttt{axial\_elements\_file}}] is the file describing the axial elements in the case of an axisymmetric simulation. See Section~\ref{sec:axisym}.
diff --git a/doc/USER_MANUAL/manual_SPECFEM2D.pdf b/doc/USER_MANUAL/manual_SPECFEM2D.pdf
index bcd5cf572..a55433b17 100644
Binary files a/doc/USER_MANUAL/manual_SPECFEM2D.pdf and b/doc/USER_MANUAL/manual_SPECFEM2D.pdf differ
diff --git a/install-sh b/install-sh
index 377bb8687..7c56c9c01 100755
--- a/install-sh
+++ b/install-sh
@@ -1,7 +1,7 @@
#!/bin/sh
# install - install a program, script, or datafile
-scriptversion=2011-11-20.07; # UTC
+scriptversion=2023-11-23.18; # UTC
# This originates from X11R5 (mit/util/scripts/install.sh), which was
# later released in X11R6 (xc/config/util/install.sh) with the
@@ -41,19 +41,15 @@ scriptversion=2011-11-20.07; # UTC
# This script is compatible with the BSD install script, but was written
# from scratch.
+tab=' '
nl='
'
-IFS=" "" $nl"
+IFS=" $tab$nl"
-# set DOITPROG to echo to test this script
+# Set DOITPROG to "echo" to test this script.
-# Don't use :- since 4.3BSD and earlier shells don't like it.
doit=${DOITPROG-}
-if test -z "$doit"; then
- doit_exec=exec
-else
- doit_exec=$doit
-fi
+doit_exec=${doit:-exec}
# Put in absolute file names if you don't have them in your path;
# or use environment vars.
@@ -68,22 +64,16 @@ mvprog=${MVPROG-mv}
rmprog=${RMPROG-rm}
stripprog=${STRIPPROG-strip}
-posix_glob='?'
-initialize_posix_glob='
- test "$posix_glob" != "?" || {
- if (set -f) 2>/dev/null; then
- posix_glob=
- else
- posix_glob=:
- fi
- }
-'
-
posix_mkdir=
# Desired mode of installed file.
mode=0755
+# Create dirs (including intermediate dirs) using mode 755.
+# This is like GNU 'install' as of coreutils 8.32 (2020).
+mkdir_umask=22
+
+backupsuffix=
chgrpcmd=
chmodcmd=$chmodprog
chowncmd=
@@ -97,7 +87,7 @@ dir_arg=
dst_arg=
copy_on_change=false
-no_target_directory=
+is_target_a_directory=possibly
usage="\
Usage: $0 [OPTION]... [-T] SRCFILE DSTFILE
@@ -114,19 +104,29 @@ Options:
--version display version info and exit.
-c (ignored)
- -C install only if different (preserve the last data modification time)
+ -C install only if different (preserve data modification time)
-d create directories instead of installing files.
-g GROUP $chgrpprog installed files to GROUP.
-m MODE $chmodprog installed files to MODE.
-o USER $chownprog installed files to USER.
+ -p pass -p to $cpprog.
-s $stripprog installed files.
+ -S SUFFIX attempt to back up existing files, with suffix SUFFIX.
-t DIRECTORY install into DIRECTORY.
-T report an error if DSTFILE is a directory.
Environment variables override the default commands:
CHGRPPROG CHMODPROG CHOWNPROG CMPPROG CPPROG MKDIRPROG MVPROG
RMPROG STRIPPROG
-"
+
+By default, rm is invoked with -f; when overridden with RMPROG,
+it's up to you to specify -f if you want it.
+
+If -S is not specified, no backups are attempted.
+
+Report bugs to .
+GNU Automake home page: .
+General help using GNU software: ."
while test $# -ne 0; do
case $1 in
@@ -137,46 +137,62 @@ while test $# -ne 0; do
-d) dir_arg=true;;
-g) chgrpcmd="$chgrpprog $2"
- shift;;
+ shift;;
--help) echo "$usage"; exit $?;;
-m) mode=$2
- case $mode in
- *' '* | *' '* | *'
-'* | *'*'* | *'?'* | *'['*)
- echo "$0: invalid mode: $mode" >&2
- exit 1;;
- esac
- shift;;
+ case $mode in
+ *' '* | *"$tab"* | *"$nl"* | *'*'* | *'?'* | *'['*)
+ echo "$0: invalid mode: $mode" >&2
+ exit 1;;
+ esac
+ shift;;
-o) chowncmd="$chownprog $2"
- shift;;
+ shift;;
+
+ -p) cpprog="$cpprog -p";;
-s) stripcmd=$stripprog;;
- -t) dst_arg=$2
- # Protect names problematic for 'test' and other utilities.
- case $dst_arg in
- -* | [=\(\)!]) dst_arg=./$dst_arg;;
- esac
- shift;;
+ -S) backupsuffix="$2"
+ shift;;
- -T) no_target_directory=true;;
+ -t)
+ is_target_a_directory=always
+ dst_arg=$2
+ # Protect names problematic for 'test' and other utilities.
+ case $dst_arg in
+ -* | [=\(\)!]) dst_arg=./$dst_arg;;
+ esac
+ shift;;
+
+ -T) is_target_a_directory=never;;
--version) echo "$0 $scriptversion"; exit $?;;
- --) shift
- break;;
+ --) shift
+ break;;
- -*) echo "$0: invalid option: $1" >&2
- exit 1;;
+ -*) echo "$0: invalid option: $1" >&2
+ exit 1;;
*) break;;
esac
shift
done
+# We allow the use of options -d and -T together, by making -d
+# take the precedence; this is for compatibility with GNU install.
+
+if test -n "$dir_arg"; then
+ if test -n "$dst_arg"; then
+ echo "$0: target directory not allowed when installing a directory." >&2
+ exit 1
+ fi
+fi
+
if test $# -ne 0 && test -z "$dir_arg$dst_arg"; then
# When -d is used, all remaining arguments are directories to create.
# When -t is used, the destination is already specified.
@@ -207,6 +223,15 @@ if test $# -eq 0; then
exit 0
fi
+if test -z "$dir_arg"; then
+ if test $# -gt 1 || test "$is_target_a_directory" = always; then
+ if test ! -d "$dst_arg"; then
+ echo "$0: $dst_arg: Is not a directory." >&2
+ exit 1
+ fi
+ fi
+fi
+
if test -z "$dir_arg"; then
do_exit='(exit $ret); exit $ret'
trap "ret=129; $do_exit" 1
@@ -223,16 +248,16 @@ if test -z "$dir_arg"; then
*[0-7])
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw='% 200'
+ u_plus_rw='% 200'
fi
cp_umask=`expr '(' 777 - $mode % 1000 ')' $u_plus_rw`;;
*)
if test -z "$stripcmd"; then
- u_plus_rw=
+ u_plus_rw=
else
- u_plus_rw=,u+rw
+ u_plus_rw=,u+rw
fi
cp_umask=$mode$u_plus_rw;;
esac
@@ -250,6 +275,10 @@ do
dstdir=$dst
test -d "$dstdir"
dstdir_status=$?
+ # Don't chown directories that already exist.
+ if test $dstdir_status = 0; then
+ chowncmd=""
+ fi
else
# Waiting for this to be detected by the "$cpprog $src $dsttmp" command
@@ -266,178 +295,148 @@ do
fi
dst=$dst_arg
- # If destination is a directory, append the input filename; won't work
- # if double slashes aren't ignored.
+ # If destination is a directory, append the input filename.
if test -d "$dst"; then
- if test -n "$no_target_directory"; then
- echo "$0: $dst_arg: Is a directory" >&2
- exit 1
+ if test "$is_target_a_directory" = never; then
+ echo "$0: $dst_arg: Is a directory" >&2
+ exit 1
fi
dstdir=$dst
- dst=$dstdir/`basename "$src"`
+ dstbase=`basename "$src"`
+ case $dst in
+ */) dst=$dst$dstbase;;
+ *) dst=$dst/$dstbase;;
+ esac
dstdir_status=0
else
- # Prefer dirname, but fall back on a substitute if dirname fails.
- dstdir=`
- (dirname "$dst") 2>/dev/null ||
- expr X"$dst" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \
- X"$dst" : 'X\(//\)[^/]' \| \
- X"$dst" : 'X\(//\)$' \| \
- X"$dst" : 'X\(/\)' \| . 2>/dev/null ||
- echo X"$dst" |
- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{
- s//\1/
- q
- }
- /^X\(\/\/\)[^/].*/{
- s//\1/
- q
- }
- /^X\(\/\/\)$/{
- s//\1/
- q
- }
- /^X\(\/\).*/{
- s//\1/
- q
- }
- s/.*/./; q'
- `
-
+ dstdir=`dirname "$dst"`
test -d "$dstdir"
dstdir_status=$?
fi
fi
+ case $dstdir in
+ */) dstdirslash=$dstdir;;
+ *) dstdirslash=$dstdir/;;
+ esac
+
obsolete_mkdir_used=false
if test $dstdir_status != 0; then
case $posix_mkdir in
'')
- # Create intermediate dirs using mode 755 as modified by the umask.
- # This is like FreeBSD 'install' as of 1997-10-28.
- umask=`umask`
- case $stripcmd.$umask in
- # Optimize common cases.
- *[2367][2367]) mkdir_umask=$umask;;
- .*0[02][02] | .[02][02] | .[02]) mkdir_umask=22;;
-
- *[0-7])
- mkdir_umask=`expr $umask + 22 \
- - $umask % 100 % 40 + $umask % 20 \
- - $umask % 10 % 4 + $umask % 2
- `;;
- *) mkdir_umask=$umask,go-w;;
- esac
-
- # With -d, create the new directory with the user-specified mode.
- # Otherwise, rely on $mkdir_umask.
- if test -n "$dir_arg"; then
- mkdir_mode=-m$mode
+ # With -d, create the new directory with the user-specified mode.
+ # Otherwise, rely on $mkdir_umask.
+ if test -n "$dir_arg"; then
+ mkdir_mode=-m$mode
+ else
+ mkdir_mode=
+ fi
+
+ posix_mkdir=false
+ # The $RANDOM variable is not portable (e.g., dash). Use it
+ # here however when possible just to lower collision chance.
+ tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
+
+ trap '
+ ret=$?
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir" 2>/dev/null
+ exit $ret
+ ' 0
+
+ # Because "mkdir -p" follows existing symlinks and we likely work
+ # directly in world-writeable /tmp, make sure that the '$tmpdir'
+ # directory is successfully created first before we actually test
+ # 'mkdir -p'.
+ if (umask $mkdir_umask &&
+ $mkdirprog $mkdir_mode "$tmpdir" &&
+ exec $mkdirprog $mkdir_mode -p -- "$tmpdir/a/b") >/dev/null 2>&1
+ then
+ if test -z "$dir_arg" || {
+ # Check for POSIX incompatibilities with -m.
+ # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
+ # other-writable bit of parent directory when it shouldn't.
+ # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
+ test_tmpdir="$tmpdir/a"
+ ls_ld_tmpdir=`ls -ld "$test_tmpdir"`
+ case $ls_ld_tmpdir in
+ d????-?r-*) different_mode=700;;
+ d????-?--*) different_mode=755;;
+ *) false;;
+ esac &&
+ $mkdirprog -m$different_mode -p -- "$test_tmpdir" && {
+ ls_ld_tmpdir_1=`ls -ld "$test_tmpdir"`
+ test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
+ }
+ }
+ then posix_mkdir=:
+ fi
+ rmdir "$tmpdir/a/b" "$tmpdir/a" "$tmpdir"
else
- mkdir_mode=
+ # Remove any dirs left behind by ancient mkdir implementations.
+ rmdir ./$mkdir_mode ./-p ./-- "$tmpdir" 2>/dev/null
fi
-
- posix_mkdir=false
- case $umask in
- *[123567][0-7][0-7])
- # POSIX mkdir -p sets u+wx bits regardless of umask, which
- # is incompatible with FreeBSD 'install' when (umask & 300) != 0.
- ;;
- *)
- tmpdir=${TMPDIR-/tmp}/ins$RANDOM-$$
- trap 'ret=$?; rmdir "$tmpdir/d" "$tmpdir" 2>/dev/null; exit $ret' 0
-
- if (umask $mkdir_umask &&
- exec $mkdirprog $mkdir_mode -p -- "$tmpdir/d") >/dev/null 2>&1
- then
- if test -z "$dir_arg" || {
- # Check for POSIX incompatibilities with -m.
- # HP-UX 11.23 and IRIX 6.5 mkdir -m -p sets group- or
- # other-writable bit of parent directory when it shouldn't.
- # FreeBSD 6.1 mkdir -m -p sets mode of existing directory.
- ls_ld_tmpdir=`ls -ld "$tmpdir"`
- case $ls_ld_tmpdir in
- d????-?r-*) different_mode=700;;
- d????-?--*) different_mode=755;;
- *) false;;
- esac &&
- $mkdirprog -m$different_mode -p -- "$tmpdir" && {
- ls_ld_tmpdir_1=`ls -ld "$tmpdir"`
- test "$ls_ld_tmpdir" = "$ls_ld_tmpdir_1"
- }
- }
- then posix_mkdir=:
- fi
- rmdir "$tmpdir/d" "$tmpdir"
- else
- # Remove any dirs left behind by ancient mkdir implementations.
- rmdir ./$mkdir_mode ./-p ./-- 2>/dev/null
- fi
- trap '' 0;;
- esac;;
+ trap '' 0;;
esac
if
$posix_mkdir && (
- umask $mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
+ umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir"
)
then :
else
- # The umask is ridiculous, or mkdir does not conform to POSIX,
+ # mkdir does not conform to POSIX,
# or it failed possibly due to a race condition. Create the
# directory the slow way, step by step, checking for races as we go.
case $dstdir in
- /*) prefix='/';;
- [-=\(\)!]*) prefix='./';;
- *) prefix='';;
+ /*) prefix='/';;
+ [-=\(\)!]*) prefix='./';;
+ *) prefix='';;
esac
- eval "$initialize_posix_glob"
-
oIFS=$IFS
IFS=/
- $posix_glob set -f
+ set -f
set fnord $dstdir
shift
- $posix_glob set +f
+ set +f
IFS=$oIFS
prefixes=
for d
do
- test X"$d" = X && continue
-
- prefix=$prefix$d
- if test -d "$prefix"; then
- prefixes=
- else
- if $posix_mkdir; then
- (umask=$mkdir_umask &&
- $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
- # Don't fail if two instances are running concurrently.
- test -d "$prefix" || exit 1
- else
- case $prefix in
- *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
- *) qprefix=$prefix;;
- esac
- prefixes="$prefixes '$qprefix'"
- fi
- fi
- prefix=$prefix/
+ test X"$d" = X && continue
+
+ prefix=$prefix$d
+ if test -d "$prefix"; then
+ prefixes=
+ else
+ if $posix_mkdir; then
+ (umask $mkdir_umask &&
+ $doit_exec $mkdirprog $mkdir_mode -p -- "$dstdir") && break
+ # Don't fail if two instances are running concurrently.
+ test -d "$prefix" || exit 1
+ else
+ case $prefix in
+ *\'*) qprefix=`echo "$prefix" | sed "s/'/'\\\\\\\\''/g"`;;
+ *) qprefix=$prefix;;
+ esac
+ prefixes="$prefixes '$qprefix'"
+ fi
+ fi
+ prefix=$prefix/
done
if test -n "$prefixes"; then
- # Don't fail if two instances are running concurrently.
- (umask $mkdir_umask &&
- eval "\$doit_exec \$mkdirprog $prefixes") ||
- test -d "$dstdir" || exit 1
- obsolete_mkdir_used=true
+ # Don't fail if two instances are running concurrently.
+ (umask $mkdir_umask &&
+ eval "\$doit_exec \$mkdirprog $prefixes") ||
+ test -d "$dstdir" || exit 1
+ obsolete_mkdir_used=true
fi
fi
fi
@@ -450,14 +449,25 @@ do
else
# Make a couple of temp file names in the proper directory.
- dsttmp=$dstdir/_inst.$$_
- rmtmp=$dstdir/_rm.$$_
+ dsttmp=${dstdirslash}_inst.$$_
+ rmtmp=${dstdirslash}_rm.$$_
# Trap to clean up those temp files at exit.
trap 'ret=$?; rm -f "$dsttmp" "$rmtmp" && exit $ret' 0
# Copy the file name to the temp name.
- (umask $cp_umask && $doit_exec $cpprog "$src" "$dsttmp") &&
+ (umask $cp_umask &&
+ { test -z "$stripcmd" || {
+ # Create $dsttmp read-write so that cp doesn't create it read-only,
+ # which would cause strip to fail.
+ if test -z "$doit"; then
+ : >"$dsttmp" # No need to fork-exec 'touch'.
+ else
+ $doit touch "$dsttmp"
+ fi
+ }
+ } &&
+ $doit_exec $cpprog "$src" "$dsttmp") &&
# and set any options; do chmod last to preserve setuid bits.
#
@@ -472,20 +482,24 @@ do
# If -C, don't bother to copy if it wouldn't change the file.
if $copy_on_change &&
- old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
- new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
-
- eval "$initialize_posix_glob" &&
- $posix_glob set -f &&
+ old=`LC_ALL=C ls -dlL "$dst" 2>/dev/null` &&
+ new=`LC_ALL=C ls -dlL "$dsttmp" 2>/dev/null` &&
+ set -f &&
set X $old && old=:$2:$4:$5:$6 &&
set X $new && new=:$2:$4:$5:$6 &&
- $posix_glob set +f &&
-
+ set +f &&
test "$old" = "$new" &&
$cmpprog "$dst" "$dsttmp" >/dev/null 2>&1
then
rm -f "$dsttmp"
else
+ # If $backupsuffix is set, and the file being installed
+ # already exists, attempt a backup. Don't worry if it fails,
+ # e.g., if mv doesn't support -f.
+ if test -n "$backupsuffix" && test -f "$dst"; then
+ $doit $mvcmd -f "$dst" "$dst$backupsuffix" 2>/dev/null
+ fi
+
# Rename the file to the real destination.
$doit $mvcmd -f "$dsttmp" "$dst" 2>/dev/null ||
@@ -493,24 +507,24 @@ do
# to itself, or perhaps because mv is so ancient that it does not
# support -f.
{
- # Now remove or move aside any old file at destination location.
- # We try this two ways since rm can't unlink itself on some
- # systems and the destination file might be busy for other
- # reasons. In this case, the final cleanup might fail but the new
- # file should still install successfully.
- {
- test ! -f "$dst" ||
- $doit $rmcmd -f "$dst" 2>/dev/null ||
- { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
- { $doit $rmcmd -f "$rmtmp" 2>/dev/null; :; }
- } ||
- { echo "$0: cannot unlink or rename $dst" >&2
- (exit 1); exit 1
- }
- } &&
-
- # Now rename the file to the real destination.
- $doit $mvcmd "$dsttmp" "$dst"
+ # Now remove or move aside any old file at destination location.
+ # We try this two ways since rm can't unlink itself on some
+ # systems and the destination file might be busy for other
+ # reasons. In this case, the final cleanup might fail but the new
+ # file should still install successfully.
+ {
+ test ! -f "$dst" ||
+ $doit $rmcmd "$dst" 2>/dev/null ||
+ { $doit $mvcmd -f "$dst" "$rmtmp" 2>/dev/null &&
+ { $doit $rmcmd "$rmtmp" 2>/dev/null; :; }
+ } ||
+ { echo "$0: cannot unlink or rename $dst" >&2
+ (exit 1); exit 1
+ }
+ } &&
+
+ # Now rename the file to the real destination.
+ $doit $mvcmd "$dsttmp" "$dst"
}
fi || exit 1
@@ -519,9 +533,9 @@ do
done
# Local variables:
-# eval: (add-hook 'write-file-hooks 'time-stamp)
+# eval: (add-hook 'before-save-hook 'time-stamp)
# time-stamp-start: "scriptversion="
# time-stamp-format: "%:y-%02m-%02d.%02H"
-# time-stamp-time-zone: "UTC"
+# time-stamp-time-zone: "UTC0"
# time-stamp-end: "; # UTC"
# End:
diff --git a/src/gpu/prepare_constants_cuda.h b/src/gpu/prepare_constants_cuda.h
index 54e2ba5cb..95ebf4e24 100644
--- a/src/gpu/prepare_constants_cuda.h
+++ b/src/gpu/prepare_constants_cuda.h
@@ -124,7 +124,7 @@ void setConst_hprime_xx(realw* array,Mesh* mp)
if (err != cudaSuccess)
{
fprintf(stderr, "Error in setConst_hprime_xx: %s\n", cudaGetErrorString(err));
- fprintf(stderr, "The problem is maybe -arch sm_13 instead of -arch sm_11 in the Makefile, please doublecheck\n");
+ fprintf(stderr, "The problem is maybe that the architecture specified in the Makefile (-gencode=arch=compute_**,code=\"sm_**,compute_**\") doesn't fit your card, please doublecheck\n");
exit(1);
}
@@ -147,7 +147,6 @@ void setConst_hprime_xx(realw* array,Mesh* mp)
// if (err != cudaSuccess)
// {
// fprintf(stderr, "Error in setConst_hprime_zz: %s\n", cudaGetErrorString(err));
-// fprintf(stderr, "The problem is maybe -arch sm_13 instead of -arch sm_11 in the Makefile, please doublecheck\n");
// exit(1);
// }
diff --git a/src/meshfem2D/meshfem2D.F90 b/src/meshfem2D/meshfem2D.F90
index 647205ed0..e4be1ef72 100644
--- a/src/meshfem2D/meshfem2D.F90
+++ b/src/meshfem2D/meshfem2D.F90
@@ -101,7 +101,7 @@ program meshfem2D
! ***
! reads in parameters in DATA/Par_file
BROADCAST_AFTER_READ = .false.
- call read_parameter_file(.true.,BROADCAST_AFTER_READ)
+ call read_parameter_file(BROADCAST_AFTER_READ)
! reads in additional files for mesh elements
if (read_external_mesh) then
@@ -111,6 +111,9 @@ program meshfem2D
write(IMAIN,*) 'Mesh from external meshing:'
call flush_IMAIN()
+ ! reads material definitions in external file
+ call read_external_material_properties(nummaterial_velocity_file)
+
! reads in mesh
call read_external_mesh_file(mesh_file, remove_min_to_start_at_zero, NGNOD)
@@ -124,6 +127,41 @@ program meshfem2D
write(IMAIN,*) 'Mesh from internal meshing:'
call flush_IMAIN()
+ ! re-opens file Par_file
+ call open_parameter_file()
+
+ ! reads material definitions
+ call read_material_table()
+
+ ! mesher reads in internal region table for setting up mesh elements
+ ! reads interface definitions from interface file (we need to have nxread & nzread value for checking regions)
+ call read_interfaces_file()
+
+ ! internal meshing
+ nx_elem_internal = nxread
+ nz_elem_internal = nzread
+
+ ! setup mesh array
+ ! multiply by 2 if elements have 9 nodes
+ if (NGNOD == 9) then
+ nx_elem_internal = nx_elem_internal * 2
+ nz_elem_internal = nz_elem_internal * 2
+ nz_layer(:) = nz_layer(:) * 2
+ endif
+
+ ! total number of elements
+ nelmnts = nxread * nzread
+
+ ! reads material regions defined in Par_file
+ call read_regions()
+
+ ! closes file Par_file
+ call close_parameter_file()
+
+ ! user output
+ write(IMAIN,*) 'creating mesh from internal meshing:'
+ call flush_IMAIN()
+
allocate(elmnts(0:NGNOD*nelmnts-1),stat=ier)
if (ier /= 0) call stop_the_code('Error allocating array elmnts')
elmnts(:) = 0
diff --git a/src/meshfem2D/read_external_mesh_files.F90 b/src/meshfem2D/read_external_mesh_files.F90
index 8984f2a7f..8136197c9 100644
--- a/src/meshfem2D/read_external_mesh_files.F90
+++ b/src/meshfem2D/read_external_mesh_files.F90
@@ -34,6 +34,352 @@
! in the case of very large meshes, this option can be useful to switch from ASCII to binary for the mesh files
! #define USE_BINARY_FOR_EXTERNAL_MESH_DATABASE
+ !-----------------------------------------------
+ ! Read the material properties from nummaterial_velocity_file
+ !-----------------------------------------------
+
+ subroutine read_external_material_properties(filename)
+
+! reads in material definitions, e.g., in MESH/nummaterial_velocity_file
+
+ use constants, only: myrank,IMAIN,IIN,MAX_STRING_LEN,TINYVAL,ATTENUATION_COMP_MAXIMUM, &
+ ISOTROPIC_MATERIAL,POROELASTIC_MATERIAL
+
+ ! material properties
+ use shared_parameters, only: nbmodels,icodemat, &
+ cp,cs, &
+ QKappa,Qmu, &
+ rho_s_read,rho_f_read, &
+ phi_read,tortuosity_read, &
+ permxx_read,permxz_read,permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read, &
+ eta_f_read,mu_fr_read, &
+ compaction_grad
+
+ implicit none
+
+ character(len=MAX_STRING_LEN), intent(in) :: filename
+
+ ! local parameters
+ ! elastic parameters
+ double precision :: vp_val,vs_val,rho_val,qkappa_val,qmu_val,comp_grad
+ ! poroelastic parameters
+ double precision :: rhos_val,rhof_val,phi_val,tort_val, &
+ kxx_val,kxz_val,kzz_val,kappas_val,kappaf_val,kappafr_val,eta_val,mufr_val
+ ! line read
+ double precision :: val0read,val1read,val2read,val3read,val4read, &
+ val5read,val6read,val7read,val8read,val9read,val10read,val11read,val12read
+
+ integer :: number_of_materials_defined_by_tomo_file
+ integer :: i,ier,idummy
+ integer :: count_def_mat,count_undef_mat
+ integer :: imat,idomain_id,aniso_flag
+
+ character(len=MAX_STRING_LEN) :: line
+ character(len=128) :: undef_mat_prop(4)
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' Reading materials from external material properties file: ',trim(filename)
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ ! file input
+ open(unit=IIN, file=trim(filename), form='formatted' , status='old', action='read',iostat=ier)
+ if (ier /= 0) then
+ print *,'Error opening file: ',trim(filename)
+ call stop_the_code('Error opening external material properties file (nummaterial_velocity_file)')
+ endif
+
+! reads material definitions
+!
+! note: format of nummaterial_velocity_file must be
+!
+! #(1)material_domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_kappa #(7)Q_mu #(8)anisotropy_flag
+!
+! where
+! material_domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+! material_id : number of material/volume
+! rho : density
+! vp : P-velocity
+! vs : S-velocity
+! Q_kappa : 9999 = no Q_kappa attenuation
+! Q_mu : 9999 = no Q_mu attenuation
+! anisotropy_flag : 0=no anisotropy/ 1,2,.. check with implementation in aniso_model.f90
+!
+! Note that when poroelastic material, this file is a dummy except for material_domain_id & material_id,
+! and that poroelastic materials are actually read from nummaterial_poroelastic_file, because CUBIT
+! cannot support more than 10 attributes
+ count_def_mat = 0
+ count_undef_mat = 0
+
+ ! counts materials (defined/undefined)
+ ier = 0
+ do while (ier == 0)
+ ! note: format #material_domain_id #material_id #...
+ read(IIN,'(A)',iostat=ier) line
+ if (ier /= 0) exit
+
+ ! skip empty/comment lines
+ line = adjustl(line) ! suppress leading white spaces, if any
+ if (len_trim(line) == 0) cycle
+ if (line(1:1) == '#' .or. line(1:1) == '!') cycle
+
+ read(line,*,iostat=ier) idummy,imat
+ if (ier /= 0) exit
+
+ !debug
+ !print *, ' num_mat = ',imat
+
+ ! checks non-zero material id
+ if (imat == 0) stop 'Error in nummaterial_velocity_file: material id 0 found. Material ids must be non-zero.'
+ if (imat > 0) then
+ ! positive materials_id: velocity values will be defined
+ count_def_mat = count_def_mat + 1
+ else
+ ! negative materials_id: undefined material properties yet
+ count_undef_mat = count_undef_mat + 1
+ endif
+ enddo
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' defined = ',count_def_mat, 'undefined = ',count_undef_mat
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ ! sets number of materials
+ ! total number of materials in file
+ nbmodels = count_def_mat + count_undef_mat
+
+ ! allocate and initialize material properties arrays
+ call initialize_material_properties()
+
+ ! reads in material properties
+ rewind(IIN,iostat=ier)
+ if (ier /= 0) stop 'Error rewinding nummaterial_velocity_file'
+
+ ! note: entries in nummaterial_velocity_file can be an unsorted list of all
+ ! defined materials (material_id > 0) and undefined materials (material_id < 0)
+ number_of_materials_defined_by_tomo_file = 0
+
+ do i = 1,nbmodels
+ ! reads lines until it reaches a material
+ call read_next_line(IIN,.false.,line)
+
+ ! gets material id
+ read(line,*,iostat=ier) idomain_id,imat
+ if (ier /= 0) stop 'Error reading in materials in nummaterial_velocity_file'
+
+ ! checks domain id
+ if (idomain_id < 1 .or. idomain_id > 3) then
+ print *,'Error: nummaterial_velocity_file found invalid domain id ',idomain_id
+ print *,' line: ',trim(line)
+ print *,' idomain_id must be 1 == acoustic, 2 == elastic or 3 == poroelastic domains'
+ print *,'Please also check formatting of the material property lines to align with:'
+ print *,' acoustic/elastic'
+ print *,' #domain_id #material_id #rho #vp #vs #Qkappa #Qmu #aniso_flag'
+ print *,' poroelastic'
+ print *,' #domain_id #material_id #rhos #rhof #phi #c #kxx #kxz #kzz #Ks #Kf #Kfr #etaf #mufr #Qmu'
+ print *,' tomo'
+ print *,' #domain_id #material_id(negative) tomography elastic tomography_filename positive_identifier'
+ call stop_the_code('Invalid domain id for material in nummaterial_velocity_file')
+ endif
+
+ ! reads in material properties
+ if (imat > 0) then
+ ! defined material
+ if (idomain_id == 1 .or. idomain_id == 2) then
+ ! acoustic/elastic material
+ ! format:
+ !#domain_id #material_id #rho #vp #vs #Qkappa #Qmu #aniso_flag_or_compaction_gradient
+ read(line,*,iostat=ier) idomain_id,imat,val0read,val1read,val2read,val3read,val4read,val5read
+ if (ier /= 0) stop 'Error reading nummaterial_velocity_file, please check if it has the required format...'
+
+ rho_val = val0read
+ vp_val = val1read
+ vs_val = val2read
+ qkappa_val = val3read
+ qmu_val = val4read
+
+ aniso_flag = int(val5read)
+ comp_grad = val5read
+
+ else if (idomain_id == 3) then
+ ! poroelastic material
+ ! format:
+ !#domain_id #material_id rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu
+ read(line,*,iostat=ier) idomain_id,imat,val0read,val1read,val2read,val3read,val4read,val5read, &
+ val6read,val7read,val8read,val9read,val10read,val11read,val12read
+ if (ier /= 0) stop 'Error reading nummaterial_velocity_file, please check if it has the required format...'
+
+ rhos_val = val0read
+ rhof_val = val1read
+
+ phi_val = val2read
+ tort_val = val3read
+
+ kxx_val = val4read
+ kxz_val = val5read
+ kzz_val = val6read
+
+ kappas_val = val7read
+ kappaf_val = val8read
+ kappafr_val = val9read
+
+ eta_val = val10read
+ mufr_val = val11read
+ qmu_val = val12read
+ endif
+
+ ! sanity check: Q factor cannot be equal to zero, thus convert to 9999 to indicate no attenuation
+ ! if users have used 0 to indicate that instead
+ if (qkappa_val <= 0.000001) qkappa_val = 9999.d0
+ if (qmu_val <= 0.000001) qmu_val = 9999.d0
+
+ ! checks material_id bounds
+ if (imat < 1 .or. imat > count_def_mat) &
+ stop "Error in nummaterial_velocity_file: material id invalid for defined materials."
+
+ ! check that the S-wave velocity is zero if the material is acoustic
+ if (idomain_id == 1 .and. vs_val >= 0.0001) &
+ stop 'Error in nummaterial_velocity_file: acoustic material defined with a non-zero shear-wave velocity Vs.'
+
+ ! check that the S-wave velocity is not zero if the material is elastic
+ if (idomain_id == 2 .and. vs_val <= 0.0001) &
+ stop 'Error in nummaterial_velocity_file: (visco)elastic material defined with a zero shear-wave velocity Vs.'
+
+ ! checks material id
+ if (imat < 1 .or. imat > nbmodels) call stop_the_code('Wrong material number!')
+
+ ! set material type for arrays
+ ! (nummaterial_velocity_file only supports isotropic materials for now)
+ if (idomain_id == 1 .or. idomain_id == 2) then
+ ! acoustic/elastic
+ ! isotropic materials
+ icodemat(i) = ISOTROPIC_MATERIAL
+ rho_s_read(i) = rho_val ! density
+ cp(i) = vp_val ! Vp
+ cs(i) = vs_val ! Vs
+ compaction_grad(i) = comp_grad ! compaction gradient (for Marmousi2)
+ QKappa(i) = qkappa_val ! bulk attenuation
+ Qmu(i) = qmu_val ! shear attenuation
+
+ ! for Cs we use a less restrictive test because acoustic media have Cs exactly equal to zero
+ if (rho_s_read(i) <= 0.00000001d0 .or. cp(i) <= 0.00000001d0 .or. cs(i) < 0.d0) then
+ write(*,*) 'rho,cp,cs=',rho_s_read(i),cp(i),cs(i)
+ call stop_the_code('negative value of velocity or density')
+ endif
+ if (QKappa(i) <= 0.00000001d0 .or. Qmu(i) <= 0.00000001d0) then
+ call stop_the_code('non-positive value of QKappa or Qmu')
+ endif
+
+ ! phi_read is used to determine element type
+ if (abs(cs(i)) > TINYVAL) then
+ phi_read(i) = 0.d0 ! elastic
+ else
+ phi_read(i) = 1.d0 ! acoustic
+ endif
+
+ else if (idomain_id == 3) then
+ ! poroelastic materials
+ icodemat(i) = POROELASTIC_MATERIAL
+ rho_s_read(i) = rhos_val
+ rho_f_read(i) = rhof_val
+ phi_read(i) = phi_val
+ tortuosity_read(i) = tort_val
+ permxx_read(i) = kxx_val
+ permxz_read(i) = kxz_val
+ permzz_read(i) = kzz_val
+ kappa_s_read(i) = kappas_val
+ kappa_f_read(i) = kappaf_val
+ kappa_fr_read(i) = kappafr_val
+ eta_f_read(i) = eta_val
+ mu_fr_read(i) = mufr_val
+ Qmu(i) = qmu_val
+
+ if (rho_s_read(i) <= 0.d0 .or. rho_f_read(i) <= 0.d0) &
+ call stop_the_code('Invalid poroelastic material: non-positive value of density')
+ if (phi_read(i) <= 0.d0 .or. tortuosity_read(i) <= 0.d0) &
+ call stop_the_code('Invalid poroelastic material: non-positive value of porosity or tortuosity')
+ if (kappa_s_read(i) <= 0.d0 .or. kappa_f_read(i) <= 0.d0 .or. kappa_fr_read(i) <= 0.d0 .or. mu_fr_read(i) <= 0.d0) &
+ call stop_the_code('Invalid poroelastic material: non-positive value of modulus')
+ if (Qmu(i) <= 0.00000001d0) &
+ call stop_the_code('Invalid poroelastic material: non-positive value of Qmu')
+
+ endif
+
+ else if (imat < 0) then
+ ! undefined material (e.g., tomography material)
+ ! tomographic material
+ ! format:
+ ! #domain_id #material_id(negative) tomography elastic tomography_filename positive_identifier'
+ ! line will have 6 arguments, e.g.: 2 -1 tomography elastic tomography_model.xyz 1
+ read(line,*,iostat=ier) idomain_id,imat,undef_mat_prop(1),undef_mat_prop(2),undef_mat_prop(3),idummy
+ if (ier /= 0) stop 'Error reading nummaterial_velocity_file, please check if tomography material has the required format...'
+
+ ! checks domain id
+ if (idomain_id /= 1 .and. idomain_id /= 2) then
+ print *,'Error: nummaterial_velocity_file found invalid domain id ',idomain_id
+ print *,' line: ',trim(line)
+ print *,' idomain_id must be 1 == acoustic or 2 == elastic for tomography material'
+ print *,'Please also check formatting of the material property lines to align with:'
+ print *,' acoustic/elastic'
+ print *,' #domain_id #material_id #rho #vp #vs #Qkappa #Qmu #aniso_flag'
+ print *,' poroelastic'
+ print *,' #domain_id #material_id #rhos #rhof #phi #c #kxx #kxz #kzz #Ks #Kf #Kfr #etaf #mufr #Qmu'
+ print *,' tomo'
+ print *,' #domain_id #material_id(negative) tomography elastic tomography_filename positive_identifier'
+ call stop_the_code('Invalid domain id for tomographic material, must be 1 == acoustic or 2 == elastic')
+ endif
+
+ ! Assign dummy values for now (they will be read by the solver). Vs must be == 0 for acoustic media anyway
+ rho_s_read(i) = -1.0d0
+ cp(i) = -1.0d0
+ if (idomain_id == 1) then
+ ! acoustic has vs==0
+ cs(i) = 0.d0
+ else if (idomain_id == 2) then
+ ! elastic has vs > 0
+ cs(i) = 1.d0
+ else
+ call stop_the_code('Invalid domain id for tomographic material, must be 1 == acoustic or 2 == elastic')
+ endif
+
+ QKappa(i) = -1.0d0
+ Qmu(i) = -1.0d0
+
+ ! phi_read is used to determine element type
+ if (abs(cs(i)) > TINYVAL) then
+ phi_read(i) = 0.d0 ! elastic
+ else
+ phi_read(i) = 1.d0 ! acoustic
+ endif
+
+ ! counter
+ number_of_materials_defined_by_tomo_file = number_of_materials_defined_by_tomo_file + 1
+
+ if (number_of_materials_defined_by_tomo_file > 1) &
+ call stop_the_code( &
+'Just one material can be defined by a tomo file for now')
+
+ else
+ call stop_the_code('Error reading material properties, some materials have zero material index')
+ endif
+
+ enddo
+
+ close(IIN)
+
+ ! user output
+ call print_materials_info()
+
+ end subroutine read_external_material_properties
+
+!
+!---------------------------------------------------------------------------------------
+!
+
!-----------------------------------------------
! Read the mesh and storing it in array 'elmnts' (which is allocated here).
! 'remove_min_to_start_at_zero' is used to have the numbering of the nodes starting at '0'.
diff --git a/src/meshfem2D/save_databases.f90 b/src/meshfem2D/save_databases.f90
index c2cb08b7a..143b79067 100644
--- a/src/meshfem2D/save_databases.f90
+++ b/src/meshfem2D/save_databases.f90
@@ -462,13 +462,13 @@ subroutine save_databases_materials()
if (indic == ISOTROPIC_MATERIAL) then
! isotropic elastic/acoustic
- val0 = rho_s_read(i)
- val1 = cp(i)
- val2 = cs(i)
- val3 = comp_g(i)
+ val0 = rho_s_read(i) ! density
+ val1 = cp(i) ! Vp
+ val2 = cs(i) ! Vs
+ val3 = compaction_grad(i) ! compaction gradient
val4 = 0.d0
- val5 = QKappa(i)
- val6 = Qmu(i)
+ val5 = QKappa(i) ! bulk attenuation
+ val6 = Qmu(i) ! shear attenuation
val7 = 0.d0
val8 = 0.d0
val9 = 0.d0
diff --git a/src/shared/read_material_table.f90 b/src/shared/read_material_table.f90
index a162515e5..03d5d8f58 100644
--- a/src/shared/read_material_table.f90
+++ b/src/shared/read_material_table.f90
@@ -38,13 +38,15 @@ subroutine read_material_table()
use constants, only: IMAIN,TINYVAL,ISOTROPIC_MATERIAL,ANISOTROPIC_MATERIAL,POROELASTIC_MATERIAL, &
ATTENUATION_COMP_MAXIMUM
- use shared_parameters, only: AXISYM,nbmodels,icodemat,cp,cs, &
- aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12, &
- comp_g,QKappa,Qmu, &
- rho_s_read,rho_f_read, &
- phi_read,tortuosity_read, &
- permxx_read,permxz_read,permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read, &
- eta_f_read,mu_fr_read
+ use shared_parameters, only: nbmodels,icodemat, &
+ cp,cs, &
+ aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12, &
+ QKappa,Qmu, &
+ rho_s_read,rho_f_read, &
+ phi_read,tortuosity_read, &
+ permxx_read,permxz_read,permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read, &
+ eta_f_read,mu_fr_read, &
+ compaction_grad
implicit none
@@ -63,76 +65,8 @@ subroutine read_material_table()
! check
if (reread_nbmodels /= nbmodels) call stop_the_code('Invalid reread value of nbmodels in reading material table')
- ! safety check
- if (nbmodels <= 0) call stop_the_code('Non-positive number of materials not allowed!')
-
- ! allocates material tables
- allocate(icodemat(nbmodels))
- allocate(cp(nbmodels))
- allocate(cs(nbmodels))
-
- allocate(aniso3(nbmodels))
- allocate(aniso4(nbmodels))
- allocate(aniso5(nbmodels))
- allocate(aniso6(nbmodels))
- allocate(aniso7(nbmodels))
- allocate(aniso8(nbmodels))
- allocate(aniso9(nbmodels))
- allocate(aniso10(nbmodels))
- allocate(aniso11(nbmodels))
- allocate(aniso12(nbmodels))
-
- allocate(comp_g(nbmodels))
- allocate(QKappa(nbmodels))
- allocate(Qmu(nbmodels))
-
- allocate(rho_s_read(nbmodels))
- allocate(rho_f_read(nbmodels))
-
- allocate( phi_read(nbmodels), &
- tortuosity_read(nbmodels), &
- permxx_read(nbmodels), &
- permxz_read(nbmodels), &
- permzz_read(nbmodels), &
- kappa_s_read(nbmodels), &
- kappa_f_read(nbmodels), &
- kappa_fr_read(nbmodels), &
- eta_f_read(nbmodels), &
- mu_fr_read(nbmodels))
-
- ! initializes material properties
- icodemat(:) = 0
-
- cp(:) = 0.d0
- cs(:) = 0.d0
-
- aniso3(:) = 0.d0
- aniso4(:) = 0.d0
- aniso5(:) = 0.d0
- aniso6(:) = 0.d0
- aniso7(:) = 0.d0
- aniso8(:) = 0.d0
- aniso9(:) = 0.d0
- aniso10(:) = 0.d0
- aniso11(:) = 0.d0
-
- comp_g(:) = 0.0d0
- QKappa(:) = ATTENUATION_COMP_MAXIMUM
- Qmu(:) = ATTENUATION_COMP_MAXIMUM
-
- rho_s_read(:) = 0.d0
- rho_f_read(:) = 0.d0
-
- phi_read(:) = 0.d0
- tortuosity_read(:) = 0.d0
- permxx_read(:) = 0.d0
- permxz_read(:) = 0.d0
- permzz_read(:) = 0.d0
- kappa_s_read(:) = 0.d0
- kappa_f_read(:) = 0.d0
- kappa_fr_read(:) = 0.d0
- eta_f_read(:) = 0.d0
- mu_fr_read(:) = 0.d0
+ ! allocates and initializes material arrays
+ call initialize_material_properties()
number_of_materials_defined_by_tomo_file = 0
@@ -145,6 +79,9 @@ subroutine read_material_table()
! anisotropic (in AXISYM) - model_number 2 rho c11 c13 c15 c33 c35 c55 c12 c23 c25 c22 QKappa Qmu
! poroelastic - model_number 3 rhos rhof phi c kxx kxz kzz Ks Kf Kfr etaf mufr Qmu
! tomo - model_number -1 0 0 A 0 0 0 0 0 0 0 0 0 0
+ !
+ ! and specially for Marmousi2-type models with a compaction gradient k
+ ! elastic - model_number 1 rho Vp Vs k 0 QKappa Qmu 0 0 0 0 0 0
call read_material_parameters_p(i,icodematread, &
val0read,val1read,val2read,val3read, &
@@ -158,12 +95,12 @@ subroutine read_material_table()
! sets material properties
if (icodemat(i) == ISOTROPIC_MATERIAL) then
! isotropic materials
- rho_s_read(i) = val0read
- cp(i) = val1read
- cs(i) = val2read
- comp_g(i) = val3read
- QKappa(i) = val5read
- Qmu(i) = val6read
+ rho_s_read(i) = val0read ! density
+ cp(i) = val1read ! Vp
+ cs(i) = val2read ! Vs
+ compaction_grad(i) = val3read ! compaction gradient (for Marmousi2)
+ QKappa(i) = val5read ! bulk attenuation
+ Qmu(i) = val6read ! shear attenuation
! for Cs we use a less restrictive test because acoustic media have Cs exactly equal to zero
if (rho_s_read(i) <= 0.00000001d0 .or. cp(i) <= 0.00000001d0 .or. cs(i) < 0.d0) then
@@ -176,6 +113,8 @@ subroutine read_material_table()
aniso3(i) = val3read
aniso4(i) = val4read
+
+ ! phi_read is used to determine element type
if (abs(cs(i)) > TINYVAL) then
phi_read(i) = 0.d0 ! elastic
else
@@ -217,13 +156,13 @@ subroutine read_material_table()
if (val12read > 0.1) Qmu(i) = val12read
if (rho_s_read(i) <= 0.d0 .or. rho_f_read(i) <= 0.d0) &
- call stop_the_code('non-positive value of density')
+ call stop_the_code('Invalid poroelastic material: non-positive value of density')
if (phi_read(i) <= 0.d0 .or. tortuosity_read(i) <= 0.d0) &
- call stop_the_code('non-positive value of porosity or tortuosity')
+ call stop_the_code('Invalid poroelastic material: non-positive value of porosity or tortuosity')
if (kappa_s_read(i) <= 0.d0 .or. kappa_f_read(i) <= 0.d0 .or. kappa_fr_read(i) <= 0.d0 .or. mu_fr_read(i) <= 0.d0) &
- call stop_the_code('non-positive value of modulus')
+ call stop_the_code('Invalid poroelastic material: non-positive value of modulus')
if (Qmu(i) <= 0.00000001d0) &
- call stop_the_code('non-positive value of Qmu')
+ call stop_the_code('Invalid poroelastic material: non-positive value of Qmu')
else if (icodemat(i) <= 0) then
! tomographic material
@@ -239,8 +178,11 @@ subroutine read_material_table()
cs(i) = val2read
QKappa(i) = -1.0d0
Qmu(i) = -1.0d0
+
aniso3(i) = -1.0d0
aniso4(i) = -1.0d0
+
+ ! phi_read is used to determine element type
if (abs(cs(i)) > TINYVAL) then
phi_read(i) = 0.d0 ! elastic
else
@@ -256,7 +198,150 @@ subroutine read_material_table()
enddo ! nbmodels
! user output
- write(IMAIN,*) 'Materials:'
+ call print_materials_info()
+
+ end subroutine read_material_table
+
+!
+!---------------------------------------------------------------------------------------
+!
+
+ subroutine initialize_material_properties()
+
+! allocates and initializes material arrays
+
+ use constants, only: ATTENUATION_COMP_MAXIMUM
+
+ use shared_parameters, only: nbmodels, &
+ icodemat,compaction_grad
+
+ ! isotropy
+ use shared_parameters, only: cp,cs
+
+ ! anisotropy
+ use shared_parameters, only: aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12
+
+ ! attenuation
+ use shared_parameters, only: QKappa,Qmu
+
+ ! poroelasticity
+ use shared_parameters, only: rho_s_read,rho_f_read, &
+ phi_read,tortuosity_read, &
+ permxx_read,permxz_read,permzz_read, &
+ kappa_s_read,kappa_f_read,kappa_fr_read, &
+ eta_f_read,mu_fr_read
+
+ implicit none
+
+ ! safety check
+ if (nbmodels <= 0) call stop_the_code('Non-positive number of materials not allowed!')
+
+ ! allocates material tables
+ allocate(icodemat(nbmodels))
+ allocate(cp(nbmodels))
+ allocate(cs(nbmodels))
+
+ allocate(aniso3(nbmodels))
+ allocate(aniso4(nbmodels))
+ allocate(aniso5(nbmodels))
+ allocate(aniso6(nbmodels))
+ allocate(aniso7(nbmodels))
+ allocate(aniso8(nbmodels))
+ allocate(aniso9(nbmodels))
+ allocate(aniso10(nbmodels))
+ allocate(aniso11(nbmodels))
+ allocate(aniso12(nbmodels))
+
+ allocate(QKappa(nbmodels))
+ allocate(Qmu(nbmodels))
+
+ allocate(rho_s_read(nbmodels))
+ allocate(rho_f_read(nbmodels))
+
+ allocate(phi_read(nbmodels), &
+ tortuosity_read(nbmodels), &
+ permxx_read(nbmodels), &
+ permxz_read(nbmodels), &
+ permzz_read(nbmodels), &
+ kappa_s_read(nbmodels), &
+ kappa_f_read(nbmodels), &
+ kappa_fr_read(nbmodels), &
+ eta_f_read(nbmodels), &
+ mu_fr_read(nbmodels))
+
+ allocate(compaction_grad(nbmodels))
+
+ ! initializes material properties
+ icodemat(:) = 0
+
+ cp(:) = 0.d0
+ cs(:) = 0.d0
+
+ aniso3(:) = 0.d0
+ aniso4(:) = 0.d0
+ aniso5(:) = 0.d0
+ aniso6(:) = 0.d0
+ aniso7(:) = 0.d0
+ aniso8(:) = 0.d0
+ aniso9(:) = 0.d0
+ aniso10(:) = 0.d0
+ aniso11(:) = 0.d0
+
+ QKappa(:) = ATTENUATION_COMP_MAXIMUM
+ Qmu(:) = ATTENUATION_COMP_MAXIMUM
+
+ rho_s_read(:) = 0.d0
+ rho_f_read(:) = 0.d0
+
+ phi_read(:) = 0.d0
+ tortuosity_read(:) = 0.d0
+ permxx_read(:) = 0.d0
+ permxz_read(:) = 0.d0
+ permzz_read(:) = 0.d0
+ kappa_s_read(:) = 0.d0
+ kappa_f_read(:) = 0.d0
+ kappa_fr_read(:) = 0.d0
+ eta_f_read(:) = 0.d0
+ mu_fr_read(:) = 0.d0
+
+ compaction_grad(:) = 0.0d0
+
+ end subroutine initialize_material_properties
+
+!
+!---------------------------------------------------------------------------------------
+!
+
+ subroutine print_materials_info()
+
+ use constants, only: IMAIN,TINYVAL, &
+ ISOTROPIC_MATERIAL,ANISOTROPIC_MATERIAL,POROELASTIC_MATERIAL
+
+ use shared_parameters, only: nbmodels, &
+ icodemat,AXISYM
+
+ ! isotropy
+ use shared_parameters, only: cp,cs,rho_s_read
+
+ ! anisotropy
+ use shared_parameters, only: aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12
+
+ ! attenuation
+ use shared_parameters, only: QKappa,Qmu
+
+ ! poroelasticity
+ use shared_parameters, only: rho_f_read, &
+ phi_read,tortuosity_read, &
+ permxx_read,permxz_read,permzz_read, &
+ kappa_s_read,kappa_f_read,kappa_fr_read, &
+ eta_f_read,mu_fr_read
+
+ implicit none
+ ! local parameters
+ integer :: i
+
+ ! user output
+ write(IMAIN,*) ' Materials:'
write(IMAIN,*) ' Nb of solid, fluid or porous materials = ',nbmodels
write(IMAIN,*)
do i = 1,nbmodels
@@ -304,4 +389,4 @@ subroutine read_material_table()
write(IMAIN,*)
call flush_IMAIN()
- end subroutine read_material_table
+ end subroutine print_materials_info
diff --git a/src/shared/read_parameter_file.F90 b/src/shared/read_parameter_file.F90
index 389c87b20..9f6572a59 100644
--- a/src/shared/read_parameter_file.F90
+++ b/src/shared/read_parameter_file.F90
@@ -31,7 +31,7 @@
!
!========================================================================
- subroutine read_parameter_file(is_mesher,BROADCAST_AFTER_READ)
+ subroutine read_parameter_file(BROADCAST_AFTER_READ)
! reads in DATA/Par_file
@@ -40,7 +40,6 @@ subroutine read_parameter_file(is_mesher,BROADCAST_AFTER_READ)
implicit none
- logical, intent(in) :: is_mesher
logical, intent(in) :: BROADCAST_AFTER_READ
! initializes
@@ -69,53 +68,9 @@ subroutine read_parameter_file(is_mesher,BROADCAST_AFTER_READ)
endif
call flush_IMAIN()
- ! reads receiver lines
- if (is_mesher) then
- ! user output
- write(IMAIN,*) 'Receiver lines:'
- write(IMAIN,*) ' Nb of line sets = ',nreceiversets
- write(IMAIN,*)
- call flush_IMAIN()
- endif
+ ! reads receivers
call read_parameter_file_receiversets()
- ! only mesher needs to reads this
- if (is_mesher) then
- ! reads material definitions
- call read_material_table()
-
- ! mesher reads in internal region table for setting up mesh elements
- if (.not. read_external_mesh) then
- ! internal meshing
- ! user output
- write(IMAIN,*)
- write(IMAIN,*) 'Mesh from internal meshing:'
- write(IMAIN,*)
- call flush_IMAIN()
-
- ! reads interface definitions from interface file (we need to have nxread & nzread value for checking regions)
- call read_interfaces_file()
-
- ! internal meshing
- nx_elem_internal = nxread
- nz_elem_internal = nzread
-
- ! setup mesh array
- ! multiply by 2 if elements have 9 nodes
- if (NGNOD == 9) then
- nx_elem_internal = nx_elem_internal * 2
- nz_elem_internal = nz_elem_internal * 2
- nz_layer(:) = nz_layer(:) * 2
- endif
-
- ! total number of elements
- nelmnts = nxread * nzread
-
- ! reads material regions defined in Par_file
- call read_regions()
- endif
- endif
-
! closes file Par_file
call close_parameter_file()
endif
@@ -210,14 +165,18 @@ subroutine read_parameter_file(is_mesher,BROADCAST_AFTER_READ)
call bcast_all_singledp(PERIODIC_HORIZ_DIST)
! velocity and density models
- call bcast_all_singlei(nbmodels)
call bcast_all_string(TOMOGRAPHY_FILE)
call bcast_all_singlel(read_external_mesh)
+ ! infos for mesher
+ ! note: the mesher doesn't need to broadcast as only the main process (myrank==0)
+ ! is doing work in the mesher.
+ ! thus, this could be removed at the moment, but left for possible future use...
if (read_external_mesh) then
call bcast_all_string(mesh_file)
call bcast_all_string(nodes_coords_file)
call bcast_all_string(materials_file)
+ call bcast_all_string(nummaterial_velocity_file)
call bcast_all_string(free_surface_file)
call bcast_all_string(axial_elements_file)
call bcast_all_string(absorbing_surface_file)
@@ -225,6 +184,7 @@ subroutine read_parameter_file(is_mesher,BROADCAST_AFTER_READ)
call bcast_all_string(absorbing_cpml_file)
call bcast_all_string(tangential_detection_curve_file)
else
+ call bcast_all_singlei(nbmodels)
call bcast_all_string(interfacesfile)
call bcast_all_singledp(xmin_param)
call bcast_all_singledp(xmax_param)
@@ -306,6 +266,7 @@ subroutine read_parameter_file_init()
mesh_file = ''
nodes_coords_file = ''
materials_file = ''
+ nummaterial_velocity_file = ''
free_surface_file = ''
axial_elements_file = ''
absorbing_surface_file = ''
@@ -324,6 +285,7 @@ subroutine read_parameter_file_init()
absorbtop = .false.
absorbleft = .false.
+ nbmodels = 0
nbregions = 0
end subroutine read_parameter_file_init
@@ -928,15 +890,8 @@ subroutine read_parameter_file_only()
!
!--------------------------------------------------------------------
- ! read the different material materials (i.e. the number of models)
- call read_value_integer_p(nbmodels, 'nbmodels')
- if (err_occurred() /= 0) then
- some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'nbmodels = 1'
- write(*,*)
- endif
-
- ! material definitions will be read later on...
+ ! material definitions in the Par_file are only needed for internal meshes;
+ ! external meshes have to define the materials in MESH/nummaterial_velocity_file
call read_value_string_p(TOMOGRAPHY_FILE, 'TOMOGRAPHY_FILE')
if (err_occurred() /= 0) then
@@ -968,63 +923,70 @@ subroutine read_parameter_file_only()
call read_value_string_p(mesh_file, 'mesh_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'mesh_file = ./DATA/mesh_file'
+ write(*,'(a)') 'mesh_file = ./MESH/mesh_file'
write(*,*)
endif
call read_value_string_p(nodes_coords_file, 'nodes_coords_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'nodes_coords_file = ./DATA/nodes_coords_file'
+ write(*,'(a)') 'nodes_coords_file = ./MESH/nodes_coords_file'
write(*,*)
endif
call read_value_string_p(materials_file, 'materials_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'materials_file = ./DATA/materials_file'
+ write(*,'(a)') 'materials_file = ./MESH/materials_file'
+ write(*,*)
+ endif
+
+ call read_value_string_p(nummaterial_velocity_file, 'nummaterial_velocity_file')
+ if (err_occurred() /= 0) then
+ some_parameters_missing_from_Par_file = .true.
+ write(*,'(a)') 'nummaterial_velocity_file = ./MESH/nummaterial_velocity_file'
write(*,*)
endif
call read_value_string_p(free_surface_file, 'free_surface_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'free_surface_file = ./DATA/free_surface_file'
+ write(*,'(a)') 'free_surface_file = ./MESH/free_surface_file'
write(*,*)
endif
call read_value_string_p(axial_elements_file, 'axial_elements_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'axial_elements_file = ./DATA/axial_elements_file'
+ write(*,'(a)') 'axial_elements_file = ./MESH/axial_elements_file'
write(*,*)
endif
call read_value_string_p(absorbing_surface_file, 'absorbing_surface_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'absorbing_surface_file = ./DATA/absorbing_surface_file'
+ write(*,'(a)') 'absorbing_surface_file = ./MESH/absorbing_surface_file'
write(*,*)
endif
call read_value_string_p(acoustic_forcing_surface_file, 'acoustic_forcing_surface_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh'
+ write(*,'(a)') 'acoustic_forcing_surface_file = ./MESH/acoustic_forcing_surface_file'
write(*,*)
endif
call read_value_string_p(absorbing_cpml_file, 'absorbing_cpml_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'absorbing_cpml_file = ./DATA/absorbing_cpml_file'
+ write(*,'(a)') 'absorbing_cpml_file = ./MESH/absorbing_cpml_file'
write(*,*)
endif
call read_value_string_p(tangential_detection_curve_file, 'tangential_detection_curve_file')
if (err_occurred() /= 0) then
some_parameters_missing_from_Par_file = .true.
- write(*,'(a)') 'tangential_detection_curve_file = ./DATA/courbe_eros_nodes'
+ write(*,'(a)') 'tangential_detection_curve_file = ./MESH/tangential_detection_curve_file'
write(*,*)
endif
@@ -1033,6 +995,16 @@ subroutine read_parameter_file_only()
!-----------------
! internal mesh parameters
+ ! read the different material materials (i.e. the number of models)
+ call read_value_integer_p(nbmodels, 'nbmodels')
+ if (err_occurred() /= 0) then
+ some_parameters_missing_from_Par_file = .true.
+ write(*,'(a)') 'nbmodels = 1'
+ write(*,*)
+ endif
+
+ ! material definitions will be read later on...
+
! interfaces file
call read_value_string_p(interfacesfile, 'interfacesfile')
if (err_occurred() /= 0) then
@@ -1487,10 +1459,6 @@ subroutine check_parameters()
if (DT == 0.d0) call stop_the_code('DT must be non-zero value')
- ! reads in material definitions
- if (nbmodels <= 0) &
- call stop_the_code('Non-positive number of materials not allowed!')
-
! CPML and Stacey are mutually exclusive
if (STACEY_ABSORBING_CONDITIONS .and. PML_BOUNDARY_CONDITIONS) &
call stop_the_code('STACEY_ABSORBING_CONDITIONS and PML_BOUNDARY_CONDITIONS are mutually exclusive but are both set to .true.')
@@ -1513,8 +1481,9 @@ subroutine check_parameters()
call stop_the_code('Error bad value for parameter SAVE_MODEL')
end select
- ! check regions
+ ! check regions and material definitions
if (read_external_mesh .eqv. .false.) then
+ if (nbmodels <= 0) call stop_the_code('Non-positive number of materials not allowed!')
if (nbregions <= 0) call stop_the_code('Negative number of regions not allowed for internal meshing!')
endif
@@ -1559,7 +1528,7 @@ subroutine read_parameter_file_receiversets()
if (reread_rec_normal_to_surface .neqv. rec_normal_to_surface) &
call stop_the_code('Invalid re-reading of rec_normal_to_surface parameter')
- ! reads in receiver sets
+ ! reads in receivers
if (use_existing_STATIONS) then
! checks if STATIONS file exisits
stations_filename = trim(IN_DATA_FILES)//'STATIONS' ! by default: DATA/STATIONS
@@ -1603,9 +1572,16 @@ subroutine read_parameter_file_receiversets()
write(IMAIN,*) ' file name is ',trim(stations_filename)
write(IMAIN,*) ' found ',nrec,' receivers'
write(IMAIN,*)
+ call flush_IMAIN()
else
! receiver lines specified in Par_file
+ ! user output
+ write(IMAIN,*) 'Receiver lines:'
+ write(IMAIN,*) ' Nb of line sets = ',nreceiversets
+ write(IMAIN,*)
+ call flush_IMAIN()
+
! only valid if at least 1 receiver line is specified
if (nreceiversets < 1) &
call stop_the_code('number of receiver sets must be greater than 1')
diff --git a/src/shared/read_value_parameters.f90 b/src/shared/read_value_parameters.f90
index 1a46b359b..b07e4b5a0 100644
--- a/src/shared/read_value_parameters.f90
+++ b/src/shared/read_value_parameters.f90
@@ -139,33 +139,33 @@ subroutine read_next_line(iin,ignore_junk,string_read)
read(unit=iin,fmt="(a256)",iostat=ios) string_read
if (ios /= 0) call stop_the_code('error while reading input file')
-! suppress leading white spaces, if any
+ ! suppress leading white spaces, if any
string_read = adjustl(string_read)
-! suppress trailing carriage return (ASCII code 13) if any (e.g. if input text file coming from Windows/DOS)
+ ! suppress trailing carriage return (ASCII code 13) if any (e.g. if input text file coming from Windows/DOS)
if (index(string_read,achar(13)) > 0) string_read = string_read(1:index(string_read,achar(13))-1)
-! exit loop when we find the first line that is not a comment or a white line
+ ! exit loop when we find the first line that is not a comment or a white line
if (len_trim(string_read) == 0) cycle
- if (string_read(1:1) /= '#') exit
+ if (string_read(1:1) /= '#' .and. string_read(1:1) /= '!') exit
enddo
-! suppress trailing white spaces, if any
+ ! suppress trailing white spaces, if any
string_read = string_read(1:len_trim(string_read))
-! suppress trailing comments, if any
+ ! suppress trailing comments, if any
if (index(string_read,'#') > 0) string_read = string_read(1:index(string_read,'#')-1)
-! suppress leading junk (up to the first equal sign, included) if needed
+ ! suppress leading junk (up to the first equal sign, included) if needed
if (ignore_junk) then
index_equal_sign = index(string_read,'=')
- if (index_equal_sign <= 1 .or. index_equal_sign == len_trim(string_read)) call stop_the_code( &
-'incorrect syntax detected in DATA/Par_file')
+ if (index_equal_sign <= 1 .or. index_equal_sign == len_trim(string_read)) &
+ call stop_the_code('incorrect syntax detected in DATA/Par_file')
string_read = string_read(index_equal_sign + 1:len_trim(string_read))
endif
-! suppress leading and trailing white spaces again, if any, after having suppressed the leading junk
+ ! suppress leading and trailing white spaces again, if any, after having suppressed the leading junk
string_read = adjustl(string_read)
string_read = string_read(1:len_trim(string_read))
diff --git a/src/shared/shared_par.F90 b/src/shared/shared_par.F90
index de2d7c8d8..c943f13c6 100644
--- a/src/shared/shared_par.F90
+++ b/src/shared/shared_par.F90
@@ -275,6 +275,7 @@ module shared_input_parameters
!#
!#-----------------------------------------------------------------------------
character(len=MAX_STRING_LEN) :: mesh_file, nodes_coords_file, materials_file
+ character(len=MAX_STRING_LEN) :: nummaterial_velocity_file
character(len=MAX_STRING_LEN) :: free_surface_file
character(len=MAX_STRING_LEN) :: absorbing_surface_file
@@ -398,9 +399,12 @@ module shared_parameters
double precision, dimension(:),allocatable :: rho_s_read
double precision, dimension(:),allocatable :: rho_f_read
- ! acoustic/elastic/anisotropic
- double precision, dimension(:),allocatable :: cp,cs, &
- aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12,comp_g,QKappa,Qmu
+ ! acoustic/elastic
+ double precision, dimension(:),allocatable :: cp,cs,QKappa,Qmu
+
+ ! anisotropic
+ double precision, dimension(:),allocatable :: &
+ aniso3,aniso4,aniso5,aniso6,aniso7,aniso8,aniso9,aniso10,aniso11,aniso12
! poroelastic
! note: adds ending _read to indicate these are readin values and to distinguish from solver arrays
@@ -408,6 +412,10 @@ module shared_parameters
double precision, dimension(:),allocatable :: phi_read,tortuosity_read,permxx_read,permxz_read, &
permzz_read,kappa_s_read,kappa_f_read,kappa_fr_read,eta_f_read,mu_fr_read
+ ! compaction gradient
+ ! (in particular for Marmousi2 which defines a compaction gradient to increase velocities with depth)
+ double precision, dimension(:),allocatable :: compaction_grad
+
! mesh setup
! total number of elements
integer :: nelmnts
diff --git a/src/specfem2D/check_stability.F90 b/src/specfem2D/check_stability.F90
index 685b1fd84..4cfd3d0e7 100644
--- a/src/specfem2D/check_stability.F90
+++ b/src/specfem2D/check_stability.F90
@@ -37,7 +37,8 @@ subroutine check_stability()
use constants, only: IMAIN,STABILITY_THRESHOLD,CUSTOM_REAL,myrank
- use specfem_par, only: current_timeval,it,NSTEP,GPU_MODE, &
+ use specfem_par, only: it,NSTEP,DT,t0, &
+ GPU_MODE, &
SIMULATION_TYPE, &
ELASTIC_SIMULATION,any_elastic,displ_elastic,b_displ_elastic, &
POROELASTIC_SIMULATION,any_poroelastic, &
@@ -54,6 +55,9 @@ subroutine check_stability()
real(kind=CUSTOM_REAL) :: displnorm_all,displnorm_all_glob
real(kind=CUSTOM_REAL) :: b_displnorm_all,b_displnorm_all_glob
+ ! current time
+ double precision :: current_timeval
+
! timer to count elapsed time
double precision :: tCPU,t_remain,t_total,timestamp_seconds_current
integer :: ihours,iminutes,iseconds,int_tCPU, &
@@ -72,17 +76,22 @@ subroutine check_stability()
integer :: year,mon,day,hr,minutes,timestamp,julian_day_number,day_of_week
integer, external :: idaywk
- ! checks if anything to do
+ ! compute current time
+ current_timeval = (it-1) * DT - t0
+
! user output
if (myrank == 0) then
write(IMAIN,*)
write(IMAIN,*) '******************************************************************'
+ write(IMAIN,"(' Time step # ',i7,' out of ',i7)") it,NSTEP
+ write(IMAIN,*) '******************************************************************'
+ ! simulation time
if (current_timeval >= 1.d-3 .and. current_timeval < 1000.d0) then
- write(IMAIN,"('Time step number ',i7,' t = ',f9.4,' s out of ',i7)") it,current_timeval,NSTEP
+ write(IMAIN,"(' Time: ',f9.4,' s')") current_timeval
else
- write(IMAIN,"('Time step number ',i7,' t = ',1pe13.6,' s out of ',i7)") it,current_timeval,NSTEP
+ write(IMAIN,"(' Time: ',1pe13.6,' s')") current_timeval
endif
- write(IMAIN,*) '******************************************************************'
+ ! progress
write(IMAIN,*) 'We have done ',sngl(100.d0*dble(it-1)/dble(NSTEP-1)),'% of the total'
endif
diff --git a/src/specfem2D/compute_Bielak_conditions.f90 b/src/specfem2D/compute_Bielak_conditions.f90
index aa4f4447c..1d2a4e947 100644
--- a/src/specfem2D/compute_Bielak_conditions.f90
+++ b/src/specfem2D/compute_Bielak_conditions.f90
@@ -78,7 +78,7 @@ subroutine compute_Bielak_conditions(iglob,dxUx,dxUz,dzUx,dzUz,veloc_horiz,veloc
!!$
!!$
!!$! derivatives of analytical expression of horizontal and vertical displacements,
-!!$! computed using the "Mathematica" script in UTILS/deriv_ricker_spatial.m
+!!$! computed using the "Mathematica" script in utils/small_utilities/deriv_ricker_spatial.m
!!$ dxUx = (sqrt(3.d0)*a*((-8*t + 4*x)*exp(-a*(t - x/2.d0)**2) + &
!!$ ((2*t - x)*(-2 + a*(-2*t + x)**2))*exp(-a*(t - x/2.d0)**2) + &
!!$ (2*(-2*t + x - sqrt(3.d0)*(-9 + z)))*exp(-(a*(2*t - x + sqrt(3.d0)*(-9 + z))**2)/4.d0) + &
diff --git a/src/specfem2D/define_external_model.f90 b/src/specfem2D/define_external_model.f90
index 94c3ea6ae..3debff538 100644
--- a/src/specfem2D/define_external_model.f90
+++ b/src/specfem2D/define_external_model.f90
@@ -31,6 +31,47 @@
!
!========================================================================
+
+ subroutine define_external_model(coord,material_element,ibool, &
+ rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ c11,c12,c13,c15,c23,c25,c33,c35,c55)
+
+ use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,NDIM,IMAIN,ATTENUATION_COMP_MAXIMUM
+
+ use specfem_par, only: nspec,nglob
+
+ implicit none
+
+ double precision, dimension(NDIM,nglob), intent(in) :: coord
+
+ integer, dimension(nspec), intent(in) :: material_element
+
+ integer, dimension(NGLLX,NGLLZ,nspec), intent(in) :: ibool
+
+ real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLZ,nspec), intent(out) :: rho,vp,vs
+ real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLZ,nspec), intent(out) :: QKappa_attenuation,Qmu_attenuation
+ real(kind=CUSTOM_REAL), dimension(NGLLX,NGLLZ,nspec), intent(out) :: c11,c15,c13,c33,c35,c55,c12,c23,c25
+
+ ! to implement your own external model:
+ ! modify the *_dummy() routine below and uncomment this following line
+ !
+ !call define_external_model_dummy(coord,material_element,ibool, &
+ ! rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ ! c11,c12,c13,c15,c23,c25,c33,c35,c55)
+
+ ! by default, uses the AK135f external model defined below
+ call define_external_model_ak135f(coord,material_element,ibool, &
+ rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ c11,c12,c13,c15,c23,c25,c33,c35,c55)
+
+ end subroutine define_external_model
+
+!========================================================================
+!
+! dummy example below, to define your own external model
+!
+!========================================================================
+
subroutine define_external_model_dummy(coord,material_element,ibool, &
rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
c11,c12,c13,c15,c23,c25,c33,c35,c55)
@@ -43,8 +84,9 @@ subroutine define_external_model_dummy(coord,material_element,ibool, &
! -------------------------------------------------------------------------------------
! Dummy example of this routine, to be used as a template that users can modify.
-! To use it you will need to rename it as define_external_model() (i.e., get rid of "_dummy")
-! and suppress the existing define_external_model() routine provided below for the AK135F global Earth model.
+!
+! To use it you will need to uncomment the routine above and/or rename it as define_external_model() (i.e., get rid of "_dummy")
+! and suppress the existing default define_external_model_ak135f() routine provided below for the AK135F global Earth model.
! -------------------------------------------------------------------------------------
! users can modify this routine to assign any different external model (rho, vp, vs)
@@ -138,9 +180,10 @@ end subroutine define_external_model_dummy
! another example below, to define the AK135F global Earth model
!
!========================================================================
- subroutine define_external_model(coord,material_element,ibool, &
- rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
- c11,c12,c13,c15,c23,c25,c33,c35,c55)
+
+ subroutine define_external_model_ak135f(coord,material_element,ibool, &
+ rho,vp,vs,QKappa_attenuation,Qmu_attenuation, &
+ c11,c12,c13,c15,c23,c25,c33,c35,c55)
use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,NDIM,IMAIN,ATTENUATION_COMP_MAXIMUM
@@ -1130,5 +1173,5 @@ subroutine define_external_model(coord,material_element,ibool, &
vp(:,:,:) = vp(:,:,:)*1000.0d0
vs(:,:,:) = vs(:,:,:)*1000.0d0
- end subroutine define_external_model
+ end subroutine define_external_model_ak135f
diff --git a/src/specfem2D/define_external_model_from_marmousi.f90 b/src/specfem2D/define_external_model_from_marmousi.f90
index 36c239a85..674c778b1 100644
--- a/src/specfem2D/define_external_model_from_marmousi.f90
+++ b/src/specfem2D/define_external_model_from_marmousi.f90
@@ -54,7 +54,7 @@ subroutine define_external_model_from_marmousi(coord,ibool,rho,vp,vs,QKappa_atte
! local parameters
integer :: i,j,ispec,iglob,imat
- double precision :: x,z,rho0,vp0,vs0,comp_grad
+ double precision :: x,z,rho0,vp0,vs0,compaction_grad
! dummy routine here, just to demonstrate how the model can be assigned
! and how such a routine can be written
@@ -81,14 +81,14 @@ subroutine define_external_model_from_marmousi(coord,ibool,rho,vp,vs,QKappa_atte
rho0 = density(1,imat)
vp0 = sqrt(poroelastcoef(3,1,imat)/rho0)
vs0 = sqrt(poroelastcoef(2,1,imat)/rho0)
- comp_grad = poroelastcoef(4,1,imat)
+ compaction_grad = poroelastcoef(4,1,imat)
x = coord(1,iglob)
z = coord(2,iglob)
! updates model values using depth and compaction gradient information
rho(i,j,ispec) = rho0
- vp(i,j,ispec) = vp0 + comp_grad*z
+ vp(i,j,ispec) = vp0 + compaction_grad * z
! assumes Poisson solids
vs(i,j,ispec) = vp(i,j,ispec) / sqrt(3.d0)
diff --git a/src/specfem2D/initialize_simulation.F90 b/src/specfem2D/initialize_simulation.F90
index 3645c5cea..1f0cb3029 100644
--- a/src/specfem2D/initialize_simulation.F90
+++ b/src/specfem2D/initialize_simulation.F90
@@ -128,7 +128,7 @@ subroutine initialize_simulation()
! read the parameter file
BROADCAST_AFTER_READ = .true.
- call read_parameter_file(.false.,BROADCAST_AFTER_READ)
+ call read_parameter_file(BROADCAST_AFTER_READ)
! reads in source descriptions
! note: we will need a source frequency for outputting poroelastic velocities when reading the mesh databases
@@ -213,9 +213,9 @@ subroutine initialize_simulation()
! sets model flag
if (trim(MODEL) == 'default') then
- assign_external_model = .false.
+ use_external_velocity_model = .false.
else
- assign_external_model = .true.
+ use_external_velocity_model = .true.
endif
end subroutine initialize_simulation
diff --git a/src/specfem2D/iterate_time.F90 b/src/specfem2D/iterate_time.F90
index 4386f6de9..6fd27d276 100644
--- a/src/specfem2D/iterate_time.F90
+++ b/src/specfem2D/iterate_time.F90
@@ -56,7 +56,6 @@ subroutine iterate_time()
! timing
double precision,external :: wtime
- double precision :: start_time_of_time_loop,duration_of_time_loop_in_seconds
if (myrank == 0) write(IMAIN,400) ! Write = T i m e e v o l u t i o n l o o p =
!
@@ -144,8 +143,6 @@ subroutine iterate_time()
! *********************************************************
do it = it_begin,it_end
- ! compute current time
- current_timeval = (it-1) * DT
! display time step and max of norm of displacement
if (mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
@@ -413,35 +410,8 @@ subroutine iterate_time()
enddo ! end of the main time loop
- if (myrank == 0) then
- duration_of_time_loop_in_seconds = wtime() - start_time_of_time_loop
- write(IMAIN,*)
- write(IMAIN,*) 'Total duration of the time loop in seconds = ',sngl(duration_of_time_loop_in_seconds),' s'
- write(IMAIN,*) 'Total number of time steps = ',NSTEP
- write(IMAIN,*) 'Average duration of a time step of the time loop = ',sngl(duration_of_time_loop_in_seconds / NSTEP),' s'
- write(IMAIN,*) 'Total number of spectral elements in the mesh = ',NSPEC
- write(IMAIN,*) ' of which ',NSPEC - count(ispec_is_PML),' are regular elements'
- write(IMAIN,*) ' and ',count(ispec_is_PML),' are PML elements.'
- write(IMAIN,*) 'Average duration of the calculation per spectral element = ', &
- sngl(duration_of_time_loop_in_seconds / (NSTEP * NSPEC)),' s'
- write(IMAIN,*)
- call flush_IMAIN()
- endif
-
- call date_and_time(datein,timein,zone,time_values)
- year = time_values(1)
- mon = time_values(2)
- day = time_values(3)
- hr = time_values(5)
- minutes = time_values(6)
- call convtime(timestamp,year,mon,day,hr,minutes)
-
- if (myrank == 0) then
- write(IMAIN,*)
- write(IMAIN,*) 'Total duration of the timeloop in seconds, measured using '
- write(IMAIN,*) 'date and time of the system : ',sngl(timestamp*60.d0 + time_values(7) + &
- time_values(8)/1000.d0 - timestamp_seconds_start),' s'
- endif
+ ! output elapsed time
+ call print_elapsed_time()
! *********************************************************
! ************* END MAIN LOOP OVER THE TIME STEPS *********
@@ -557,3 +527,95 @@ subroutine manage_no_backward_reconstruction_io()
endif ! SIMULATION == 3
end subroutine manage_no_backward_reconstruction_io
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+
+ subroutine print_elapsed_time()
+
+ use constants, only: IMAIN,myrank
+ use specfem_par, only: NSTEP,NSPEC,ispec_is_PML, &
+ timestamp_seconds_start,start_time_of_time_loop
+
+ implicit none
+
+ ! local parameters
+ integer :: ihours,iminutes,iseconds,int_tCPU
+ integer :: nspec_total,nspec_pml,nspec_total_pml
+
+ ! time
+ character(len=8) :: datein
+ character(len=10) :: timein
+ character(len=5) :: zone
+ integer, dimension(8) :: time_values
+ integer :: year,mon,day,hr,minutes,timestamp
+ double precision :: timestamp_seconds_end
+
+ ! timing
+ double precision :: tCPU
+ double precision, external :: wtime
+
+ nspec_pml = count(ispec_is_PML)
+
+ ! gather info
+ call sum_all_i(NSPEC,nspec_total)
+ call sum_all_i(nspec_pml,nspec_total_pml)
+
+ ! output info
+ if (myrank == 0) then
+ ! elapsed time since beginning of the simulation
+ tCPU = wtime() - start_time_of_time_loop
+
+ int_tCPU = int(tCPU)
+ ihours = int_tCPU / 3600
+ iminutes = (int_tCPU - 3600*ihours) / 60
+ iseconds = int_tCPU - 3600*ihours - 60*iminutes
+
+ write(IMAIN,*)
+ write(IMAIN,*) 'Time loop finished. Timing info:'
+ write(IMAIN,*) 'Total duration of the time loop in seconds = ',sngl(tCPU),' s'
+ write(IMAIN,"(' Total duration of the time loop in hh:mm:ss = ',i6,' h ',i2.2,' m ',i2.2,' s')") ihours,iminutes,iseconds
+ write(IMAIN,*)
+ write(IMAIN,*) 'Total number of time steps = ',NSTEP
+ write(IMAIN,*) 'Average duration of a time step of the time loop = ',sngl(tCPU / NSTEP),' s'
+ write(IMAIN,*)
+ write(IMAIN,*) 'Total number of spectral elements in the mesh = ',nspec_total
+ write(IMAIN,*) ' of which ',nspec_total - nspec_total_pml,' are regular elements'
+ write(IMAIN,*) ' and ',nspec_total_pml,' are PML elements.'
+ write(IMAIN,*) 'Average duration of the calculation per spectral element = ', &
+ sngl(tCPU / (NSTEP * nspec_total)),' s'
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ call date_and_time(datein,timein,zone,time_values)
+ year = time_values(1)
+ mon = time_values(2)
+ day = time_values(3)
+ hr = time_values(5)
+ minutes = time_values(6)
+ call convtime(timestamp,year,mon,day,hr,minutes)
+
+ ! convert to seconds instead of minutes, to be more precise for 2D runs, which can be fast
+ timestamp_seconds_end = timestamp*60.d0 + time_values(7) + time_values(8)/1000.d0
+
+ ! elapsed time since beginning of the simulation
+ tCPU = timestamp_seconds_end - timestamp_seconds_start
+
+ int_tCPU = int(tCPU)
+ ihours = int_tCPU / 3600
+ iminutes = (int_tCPU - 3600*ihours) / 60
+ iseconds = int_tCPU - 3600*ihours - 60*iminutes
+
+ if (myrank == 0) then
+ write(IMAIN,*)
+ write(IMAIN,*) 'Total duration of the timeloop measured using date and time of the system'
+ write(IMAIN,*) ' in seconds = ',sngl(tCPU),' s'
+ write(IMAIN,"(' in in hh:mm:ss = ',i6,' h ',i2.2,' m ',i2.2,' s')") ihours,iminutes,iseconds
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ end subroutine print_elapsed_time
diff --git a/src/specfem2D/iterate_time_undoatt.F90 b/src/specfem2D/iterate_time_undoatt.F90
index d34db75e9..4d754eeaf 100644
--- a/src/specfem2D/iterate_time_undoatt.F90
+++ b/src/specfem2D/iterate_time_undoatt.F90
@@ -58,7 +58,7 @@ subroutine iterate_time_undoatt()
! timing
double precision, external :: wtime
- double precision :: start_time_of_time_loop,duration_of_time_loop_in_seconds
+
logical :: compute_b_wavefield
! checks if anything to do
@@ -226,8 +226,6 @@ subroutine iterate_time_undoatt()
do it_of_this_subset = 1, it_subset_end
it = it + 1
- ! compute current time
- current_timeval = (it-1) * DT
! display time step and max of norm of displacement
if (mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) call check_stability()
@@ -484,9 +482,6 @@ subroutine iterate_time_undoatt()
endif ! mod(it,NTSTEP_BETWEEN_COMPUTE_KERNELS) == 0
- ! compute current time
- current_timeval = (it-1) * DT
-
! display time step and max of norm of displacement
if ((.not. GPU_MODE) .and. mod(it,NTSTEP_BETWEEN_OUTPUT_INFO) == 0 .or. it == 5 .or. it == NSTEP) then
call check_stability()
@@ -614,26 +609,12 @@ subroutine iterate_time_undoatt()
!---- end of time iteration loop
!
- if (myrank == 0) then
- duration_of_time_loop_in_seconds = wtime() - start_time_of_time_loop
-
- write(IMAIN,*)
- write(IMAIN,*) 'Total duration of the time loop in seconds = ',sngl(duration_of_time_loop_in_seconds),' s'
- write(IMAIN,*) 'Total number of time steps = ',NSTEP
- write(IMAIN,*) 'Average duration of a time step of the time loop = ',sngl(duration_of_time_loop_in_seconds / NSTEP),' s'
- write(IMAIN,*) 'Total number of spectral elements in the mesh = ',NSPEC
- write(IMAIN,*) ' of which ',NSPEC - count(ispec_is_PML),' are regular elements'
- write(IMAIN,*) ' and ',count(ispec_is_PML),' are PML elements.'
- write(IMAIN,*) 'Average duration of the calculation per spectral element = ', &
- sngl(duration_of_time_loop_in_seconds / (NSTEP * NSPEC)),' s'
- write(IMAIN,*)
- call flush_IMAIN()
- endif
+ ! output elapsed time
+ call print_elapsed_time()
! Transfer fields from GPU card to host for further analysis
if (GPU_MODE) call it_transfer_from_GPU()
-
! frees undo_attenuation buffers
if (SIMULATION_TYPE == 3) then
if (any_acoustic) then
diff --git a/src/specfem2D/read_external_model.f90 b/src/specfem2D/read_external_model.f90
index 383227b44..7d85369ab 100644
--- a/src/specfem2D/read_external_model.f90
+++ b/src/specfem2D/read_external_model.f90
@@ -31,7 +31,7 @@
!
!========================================================================
- subroutine read_external_model(rhoext,vpext,vsext,QKappa_attenuationext,Qmu_attenuationext, &
+ subroutine read_external_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext, &
nspec_ext,c11ext,c12ext,c13ext,c15ext,c22ext,c23ext,c25ext,c33ext,c35ext,c55ext)
! reads in external model files
@@ -42,25 +42,17 @@ subroutine read_external_model(rhoext,vpext,vsext,QKappa_attenuationext,Qmu_atte
use specfem_par, only: nspec,ibool,ispec_is_elastic,ispec_is_anisotropic, &
coord,kmato,MODEL,myrank,setup_with_binary_database
- ! external model parameters
- use specfem_par, only: &
- ATTENUATION_VISCOELASTIC,ATTENUATION_VISCOACOUSTIC
-
implicit none
- real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec) :: rhoext,vpext,vsext,QKappa_attenuationext,Qmu_attenuationext
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec), intent(inout) :: rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext
- integer :: nspec_ext
- real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec_ext) :: c11ext,c12ext,c13ext,c15ext,c22ext,c23ext,c25ext, &
- c33ext,c35ext,c55ext
+ integer, intent(in) :: nspec_ext
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec_ext), intent(inout) :: c11ext,c12ext,c13ext,c15ext, &
+ c22ext,c23ext,c25ext, &
+ c33ext,c35ext,c55ext
! Local variables
- integer :: i,j,ispec,itmp
- integer :: ier
- real(kind=CUSTOM_REAL) :: tmp1,tmp2
- double precision :: vs_val,vp_val,rho_val
- character(len=MAX_STRING_LEN) :: inputname, line
- logical :: read_next_line
+ integer :: i,j,ispec
! note: we read in external models once the basic mesh with its geometry and GLL points has been setup.
! External models define new velocity/material parameters which need to be defined on all GLL points.
@@ -74,277 +66,36 @@ subroutine read_external_model(rhoext,vpext,vsext,QKappa_attenuationext,Qmu_atte
select case (trim(MODEL))
case ('legacy')
! old model format
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_model_velocity.dat_input'
-
- ! user output
- if (myrank == 0) then
- write(IMAIN,*) ' reading external files: rank ',myrank,' reads ',trim(inputname)
- call flush_IMAIN()
- endif
-
- ! opens file
- open(unit=IIN,file=trim(inputname),status='old',action='read',iostat=ier)
- if (ier /= 0) then
- print *,'Error rank ',myrank,' opening file: ',trim(inputname)
- print *,'Please check if the file exists...'
- call stop_the_code('Error opening DATA/proc*****_model_velocity.dat_input file.')
- endif
-
- do ispec = 1,nspec
- do j = 1,NGLLZ
- do i = 1,NGLLX
- ! reads next data line
- read_next_line = .true.
- do while (read_next_line)
- ! format: #unused #unused #unused #rho #vp #vs
- read(IIN,'(a256)',iostat=ier) line
-
- ! debug
- !print *,'debug: i,j,ispec',i,j,ispec,' error ',ier,' line ****',trim(line),'****'
-
- ! checks
- if (ier /= 0) then
- print *,'Error rank ',myrank,' reading line for i,j,ispec: ',i,j,ispec,'out of',nspec
- print *,'Error previous line ****',trim(line),'****'
- print *
- call stop_the_code('Error reading file model_velocity.dat_input')
- endif
-
- ! left adjust
- line = adjustl(line)
-
- ! trim white space
- line = trim(line)
-
- ! skip comment lines
- if (line(1:1) == '#') then
- read_next_line = .true.
- else
- read_next_line = .false.
- endif
- enddo
-
- ! reads in values
- read(line,*) itmp,tmp1,tmp2,rho_val,vp_val,vs_val
-
- rhoext(i,j,ispec) = rho_val
- vpext(i,j,ispec) = vp_val
- vsext(i,j,ispec) = vs_val
- enddo
- enddo
- enddo
- close(IIN)
-
- ! default no attenuation
- QKappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
- Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ call read_legacy_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
case ('ascii')
! ascii model format
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho_vp_vs.dat'
- if (myrank == 0) write(IMAIN,*) ' reading external files: ','DATA/proc*****_rho_vp_vs.dat'
-
- open(unit=IIN,file=inputname,status='old',action='read',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_rho_vp_vs.dat file.')
- do ispec = 1,nspec
- do j = 1,NGLLZ
- do i = 1,NGLLX
- ! format: #unused #unused #rho #vp #vs
- read(IIN,*) tmp1,tmp2,rho_val,vp_val,vs_val
-
- rhoext(i,j,ispec) = rho_val
- vpext(i,j,ispec) = vp_val
- vsext(i,j,ispec) = vs_val
- enddo
- enddo
- enddo
- close(IIN)
- ! default no attenuation
- QKappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
- Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ call read_ascii_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
case ('binary','gll')
! binary formats
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho.bin'
- if (myrank == 0) write(IMAIN,*) ' reading external files: ','DATA/proc*****_rho.bin, .._vp.bin, .._vs.bin'
-
- open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_rho.bin file.')
-
- read(IIN) rhoext
- close(IIN)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_vp.bin'
- open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_vp.bin file.')
-
- read(IIN) vpext
- close(IIN)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_vs.bin'
- open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_vs.bin file.')
-
- read(IIN) vsext
- close(IIN)
-
- ! user output
- if (myrank == 0) then
- write(IMAIN,*) ' rho min/max = ', minval(rhoext), maxval(rhoext)
- write(IMAIN,*) ' vp min/max = ', minval(vpext), maxval(vpext)
- write(IMAIN,*) ' vs min/max = ', minval(vsext), maxval(vsext)
- write(IMAIN,*)
- call flush_IMAIN()
- endif
-
- ! for the moment we don't do external model with both viscoacoustics and viscoelastics
- if (ATTENUATION_VISCOACOUSTIC) then
- ! visco-acoustic
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qkappa.bin'
- open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qkappa.bin file.')
-
- read(IIN) QKappa_attenuationext
- close(IIN)
- Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
-
- ! user output
- if (myrank == 0) then
- write(IMAIN,*) ' Qkappa min/max = ', minval(Qkappa_attenuationext), maxval(Qkappa_attenuationext)
- write(IMAIN,*)
- call flush_IMAIN()
- endif
-
- else if (ATTENUATION_VISCOELASTIC) then
- ! visco-elastic
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qkappa.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qkappa.bin file.')
-
- read(IIN) QKappa_attenuationext
- close(IIN)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qmu.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qmu.bin file.')
-
- read(IIN) Qmu_attenuationext
- close(IIN)
-
- ! user output
- if (myrank == 0) then
- write(IMAIN,*) ' Qkappa min/max = ', minval(Qkappa_attenuationext), maxval(Qkappa_attenuationext)
- write(IMAIN,*) ' Qmu min/max = ', minval(Qmu_attenuationext), maxval(Qmu_attenuationext)
- write(IMAIN,*)
- call flush_IMAIN()
- endif
-
- else
- ! default no attenuation
- QKappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
- Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
- endif
-
+ call read_binary_gll_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
case ('binary_voigt')
! Voigt model
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho.bin'
- if (myrank == 0) write(IMAIN,*) ' reading external files: ','DATA/proc*****_rho.bin, .._c11.bin, .._c55.bin'
-
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_rho.bin file.')
-
- read(IIN) rhoext
- close(IIN)
- print *, 'rho', minval(rhoext), maxval(rhoext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c11.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c11.bin file.')
-
- read(IIN) c11ext
- close(IIN)
- print *, 'c11ext', minval(c11ext), maxval(c11ext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c13.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c13.bin file.')
-
- read(IIN) c13ext
- close(IIN)
- print *, 'c13ext', minval(c13ext), maxval(c13ext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c15.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c15.bin file.')
-
- read(IIN) c15ext
- close(IIN)
- print *, 'c15ext', minval(c15ext), maxval(c15ext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c33.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c33.bin file.')
-
- read(IIN) c33ext
- close(IIN)
- print *, 'c33ext', minval(c33ext), maxval(c33ext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c35.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c35.bin file.')
-
- read(IIN) c35ext
- close(IIN)
- print *, 'c35ext', minval(c35ext), maxval(c35ext)
-
- write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c55.bin'
- open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
- if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c55.bin file.')
-
- read(IIN) c55ext
- close(IIN)
- print *, 'c55ext', minval(c55ext), maxval(c55ext)
-
- do ispec = 1,nspec
- do j = 1,NGLLZ
- do i = 1,NGLLX
- if (c55ext(i,j,ispec) < TINYVAL) then
- c33ext(i,j,ispec) = 0.0_CUSTOM_REAL
- c12ext(i,j,ispec) = 0.0_CUSTOM_REAL
- c23ext(i,j,ispec) = 0.0_CUSTOM_REAL
- vpext(i,j,ispec) = 1500.0
- vsext(i,j,ispec) = 0.0_CUSTOM_REAL
- else
- c12ext(i,j,ispec) = 1.d-6
- c23ext(i,j,ispec) = 1.d-6
- vpext(i,j,ispec) = sqrt(c33ext(i,j,ispec)/rhoext(i,j,ispec))
- vsext(i,j,ispec) = sqrt(c55ext(i,j,ispec)/rhoext(i,j,ispec))
- endif
- c25ext(i,j,ispec) = 0.0_CUSTOM_REAL
- enddo
- enddo
- enddo
-
- ! default no attenuation
- QKappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
- Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ call read_binary_voigt_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext, &
+ nspec_ext,c11ext,c12ext,c13ext,c15ext,c23ext,c25ext,c33ext,c35ext,c55ext)
case ('external')
! generic model defined in external files
call define_external_model(coord,kmato,ibool,rhoext,vpext,vsext, &
- QKappa_attenuationext,Qmu_attenuationext, &
+ Qkappa_attenuationext,Qmu_attenuationext, &
c11ext,c12ext,c13ext,c15ext,c23ext,c25ext,c33ext,c35ext,c55ext)
case ('marmousi')
! marmousi type model
call define_external_model_from_marmousi(coord,ibool,rhoext,vpext,vsext, &
- QKappa_attenuationext,Qmu_attenuationext, &
+ Qkappa_attenuationext,Qmu_attenuationext, &
c11ext,c12ext,c13ext,c15ext,c23ext,c25ext,c33ext,c35ext,c55ext)
case ('tomo')
! tomographic file
call define_external_model_from_tomo_file(rhoext,vpext,vsext, &
- QKappa_attenuationext,Qmu_attenuationext, &
+ Qkappa_attenuationext,Qmu_attenuationext, &
c11ext,c12ext,c13ext,c15ext,c22ext,c23ext,c25ext,c33ext,c35ext,c55ext)
case default
@@ -403,3 +154,403 @@ subroutine read_external_model(rhoext,vpext,vsext,QKappa_attenuationext,Qmu_atte
end subroutine read_external_model
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+ subroutine read_legacy_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
+
+! reads in legacy format model
+
+ use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,IMAIN,IN_DATA_FILES,IIN,MAX_STRING_LEN, &
+ ATTENUATION_COMP_MAXIMUM
+
+ use specfem_par, only: nspec,myrank
+
+ implicit none
+
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec), intent(inout) :: rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext
+
+ ! Local variables
+ integer :: i,j,ispec,itmp,ier
+ real(kind=CUSTOM_REAL) :: tmp1,tmp2
+ double precision :: vs_val,vp_val,rho_val
+ character(len=MAX_STRING_LEN) :: inputname, line
+ logical :: read_next_line
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_model_velocity.dat_input'
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' reading external files: rank ',myrank,' reads ',trim(inputname)
+ call flush_IMAIN()
+ endif
+
+ ! opens file
+ open(unit=IIN,file=trim(inputname),status='old',action='read',iostat=ier)
+ if (ier /= 0) then
+ print *,'Error rank ',myrank,' opening file: ',trim(inputname)
+ print *,'Please check if the file exists...'
+ call stop_the_code('Error opening DATA/proc******_model_velocity.dat_input file.')
+ endif
+
+ do ispec = 1,nspec
+ do j = 1,NGLLZ
+ do i = 1,NGLLX
+ ! reads next data line
+ read_next_line = .true.
+ do while (read_next_line)
+ ! format: #unused #unused #unused #rho #vp #vs
+ read(IIN,'(a256)',iostat=ier) line
+
+ ! debug
+ !print *,'debug: i,j,ispec',i,j,ispec,' error ',ier,' line ****',trim(line),'****'
+
+ ! checks
+ if (ier /= 0) then
+ print *,'Error rank ',myrank,' reading line for i,j,ispec: ',i,j,ispec,'out of',nspec
+ print *,'Error previous line ****',trim(line),'****'
+ print *
+ call stop_the_code('Error reading file proc******_model_velocity.dat_input')
+ endif
+
+ ! left adjust
+ line = adjustl(line)
+
+ ! trim white space
+ line = trim(line)
+
+ ! skip comment lines
+ if (line(1:1) == '#') then
+ read_next_line = .true.
+ else
+ read_next_line = .false.
+ endif
+ enddo
+
+ ! reads in values
+ read(line,*) itmp,tmp1,tmp2,rho_val,vp_val,vs_val
+
+ rhoext(i,j,ispec) = rho_val
+ vpext(i,j,ispec) = vp_val
+ vsext(i,j,ispec) = vs_val
+ enddo
+ enddo
+ enddo
+ close(IIN)
+
+ ! default no attenuation
+ QKappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+
+ end subroutine read_legacy_model
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+ subroutine read_ascii_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
+
+! reads in ascii format model
+
+ use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,IMAIN,IN_DATA_FILES,IIN,MAX_STRING_LEN, &
+ ATTENUATION_COMP_MAXIMUM
+
+ use specfem_par, only: nspec,myrank
+
+ implicit none
+
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec), intent(inout) :: rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext
+
+ ! Local variables
+ integer :: i,j,ispec,ier
+ real(kind=CUSTOM_REAL) :: tmp1,tmp2
+ double precision :: vs_val,vp_val,rho_val
+ character(len=MAX_STRING_LEN) :: inputname, line
+ logical :: read_next_line
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho_vp_vs.dat'
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' reading external files: ','DATA/proc******_rho_vp_vs.dat'
+ call flush_IMAIN()
+ endif
+
+ ! opens file
+ open(unit=IIN,file=trim(inputname),status='old',action='read',iostat=ier)
+ if (ier /= 0) then
+ print *,'Error rank ',myrank,' opening file: ',trim(inputname)
+ print *,'Please check if the file exists...'
+ call stop_the_code('Error opening DATA/proc******_rho_vp_vs.dat file.')
+ endif
+
+ do ispec = 1,nspec
+ do j = 1,NGLLZ
+ do i = 1,NGLLX
+ ! reads next data line
+ read_next_line = .true.
+ do while (read_next_line)
+ ! format: #unused #unused #unused #rho #vp #vs
+ read(IIN,'(a256)',iostat=ier) line
+
+ ! debug
+ !print *,'debug: i,j,ispec',i,j,ispec,' error ',ier,' line ****',trim(line),'****'
+
+ ! checks
+ if (ier /= 0) then
+ print *,'Error rank ',myrank,' reading line for i,j,ispec: ',i,j,ispec,'out of',nspec
+ print *,'Error previous line ****',trim(line),'****'
+ print *
+ call stop_the_code('Error reading file proc******_rho_vp_vs.dat ')
+ endif
+
+ ! left adjust
+ line = adjustl(line)
+
+ ! trim white space
+ line = trim(line)
+
+ ! skip comment lines
+ if (line(1:1) == '#') then
+ read_next_line = .true.
+ else
+ read_next_line = .false.
+ endif
+ enddo
+
+ ! reads in values
+ ! format: #unused #unused #rho #vp #vs
+ read(line,*) tmp1,tmp2,rho_val,vp_val,vs_val
+
+ rhoext(i,j,ispec) = rho_val
+ vpext(i,j,ispec) = vp_val
+ vsext(i,j,ispec) = vs_val
+ enddo
+ enddo
+ enddo
+ close(IIN)
+
+ ! default no attenuation
+ Qkappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+
+ end subroutine read_ascii_model
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+ subroutine read_binary_gll_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext)
+
+! reads in binary and GLL format model
+
+ use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,IMAIN,IN_DATA_FILES,IIN,MAX_STRING_LEN, &
+ ATTENUATION_COMP_MAXIMUM
+
+ use specfem_par, only: nspec,myrank
+
+ ! external model parameters
+ use specfem_par, only: &
+ ATTENUATION_VISCOELASTIC,ATTENUATION_VISCOACOUSTIC
+
+ implicit none
+
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec), intent(inout) :: rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext
+
+ ! Local variables
+ integer :: ier
+ character(len=MAX_STRING_LEN) :: inputname
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho.bin'
+ if (myrank == 0) write(IMAIN,*) ' reading external files: ','DATA/proc*****_rho.bin, .._vp.bin, .._vs.bin'
+
+ open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_rho.bin file.')
+
+ read(IIN) rhoext
+ close(IIN)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_vp.bin'
+ open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_vp.bin file.')
+
+ read(IIN) vpext
+ close(IIN)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_vs.bin'
+ open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_vs.bin file.')
+
+ read(IIN) vsext
+ close(IIN)
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' rho min/max = ', minval(rhoext), maxval(rhoext)
+ write(IMAIN,*) ' vp min/max = ', minval(vpext), maxval(vpext)
+ write(IMAIN,*) ' vs min/max = ', minval(vsext), maxval(vsext)
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ ! for the moment we don't do external model with both viscoacoustics and viscoelastics
+ if (ATTENUATION_VISCOACOUSTIC) then
+ ! visco-acoustic
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qkappa.bin'
+ open(unit = IIN, file = inputname, status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qkappa.bin file.')
+
+ read(IIN) Qkappa_attenuationext
+ close(IIN)
+ Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' Qkappa min/max = ', minval(Qkappa_attenuationext), maxval(Qkappa_attenuationext)
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ else if (ATTENUATION_VISCOELASTIC) then
+ ! visco-elastic
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qkappa.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qkappa.bin file.')
+
+ read(IIN) Qkappa_attenuationext
+ close(IIN)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_Qmu.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_Qmu.bin file.')
+
+ read(IIN) Qmu_attenuationext
+ close(IIN)
+
+ ! user output
+ if (myrank == 0) then
+ write(IMAIN,*) ' Qkappa min/max = ', minval(Qkappa_attenuationext), maxval(Qkappa_attenuationext)
+ write(IMAIN,*) ' Qmu min/max = ', minval(Qmu_attenuationext), maxval(Qmu_attenuationext)
+ write(IMAIN,*)
+ call flush_IMAIN()
+ endif
+
+ else
+ ! default no attenuation
+ Qkappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ endif
+
+ end subroutine read_binary_gll_model
+
+!
+!-------------------------------------------------------------------------------------------------
+!
+
+ subroutine read_binary_voigt_model(rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext, &
+ nspec_ext,c11ext,c12ext,c13ext,c15ext,c23ext,c25ext,c33ext,c35ext,c55ext)
+
+! reads in binary voigt format model
+
+ use constants, only: CUSTOM_REAL,NGLLX,NGLLZ,IMAIN,IN_DATA_FILES,IIN,MAX_STRING_LEN, &
+ ATTENUATION_COMP_MAXIMUM,TINYVAL
+
+ use specfem_par, only: nspec,myrank
+
+ implicit none
+
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec), intent(inout) :: rhoext,vpext,vsext,Qkappa_attenuationext,Qmu_attenuationext
+
+ integer, intent(in) :: nspec_ext
+ real(kind=CUSTOM_REAL),dimension(NGLLX,NGLLZ,nspec_ext), intent(inout) :: c11ext,c12ext,c13ext,c15ext, &
+ c23ext,c25ext, &
+ c33ext,c35ext,c55ext
+
+ ! Local variables
+ integer :: i,j,ispec,ier
+ character(len=MAX_STRING_LEN) :: inputname
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_rho.bin'
+ if (myrank == 0) write(IMAIN,*) ' reading external files: ','DATA/proc*****_rho.bin, .._c11.bin, .._c55.bin'
+
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted',iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_rho.bin file.')
+
+ read(IIN) rhoext
+ close(IIN)
+ print *, 'rho', minval(rhoext), maxval(rhoext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c11.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c11.bin file.')
+
+ read(IIN) c11ext
+ close(IIN)
+ print *, 'c11ext', minval(c11ext), maxval(c11ext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c13.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c13.bin file.')
+
+ read(IIN) c13ext
+ close(IIN)
+ print *, 'c13ext', minval(c13ext), maxval(c13ext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c15.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c15.bin file.')
+
+ read(IIN) c15ext
+ close(IIN)
+ print *, 'c15ext', minval(c15ext), maxval(c15ext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c33.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c33.bin file.')
+
+ read(IIN) c33ext
+ close(IIN)
+ print *, 'c33ext', minval(c33ext), maxval(c33ext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c35.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c35.bin file.')
+
+ read(IIN) c35ext
+ close(IIN)
+ print *, 'c35ext', minval(c35ext), maxval(c35ext)
+
+ write(inputname,'(a,i6.6,a)') trim(IN_DATA_FILES)//'proc',myrank,'_c55.bin'
+ open(unit = IIN, file = inputname,status='old',action='read',form='unformatted', iostat=ier)
+ if (ier /= 0) call stop_the_code('Error opening DATA/proc*****_c55.bin file.')
+
+ read(IIN) c55ext
+ close(IIN)
+ print *, 'c55ext', minval(c55ext), maxval(c55ext)
+
+ do ispec = 1,nspec
+ do j = 1,NGLLZ
+ do i = 1,NGLLX
+ if (c55ext(i,j,ispec) < TINYVAL) then
+ c33ext(i,j,ispec) = 0.0_CUSTOM_REAL
+ c12ext(i,j,ispec) = 0.0_CUSTOM_REAL
+ c23ext(i,j,ispec) = 0.0_CUSTOM_REAL
+ vpext(i,j,ispec) = 1500.0
+ vsext(i,j,ispec) = 0.0_CUSTOM_REAL
+ else
+ c12ext(i,j,ispec) = 1.d-6
+ c23ext(i,j,ispec) = 1.d-6
+ vpext(i,j,ispec) = sqrt(c33ext(i,j,ispec)/rhoext(i,j,ispec))
+ vsext(i,j,ispec) = sqrt(c55ext(i,j,ispec)/rhoext(i,j,ispec))
+ endif
+ c25ext(i,j,ispec) = 0.0_CUSTOM_REAL
+ enddo
+ enddo
+ enddo
+
+ ! default no attenuation
+ Qkappa_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+ Qmu_attenuationext(:,:,:) = ATTENUATION_COMP_MAXIMUM
+
+ end subroutine read_binary_voigt_model
diff --git a/src/specfem2D/read_materials.f90 b/src/specfem2D/read_materials.f90
index 2316f407d..607afaa3b 100644
--- a/src/specfem2D/read_materials.f90
+++ b/src/specfem2D/read_materials.f90
@@ -41,7 +41,8 @@ subroutine read_materials(f0)
use specfem_par, only: AXISYM,density,porosity,tortuosity,anisotropycoef,permeability,poroelastcoef, &
numat,myrank,QKappa_attenuationcoef,Qmu_attenuationcoef, &
- freq0_poroelastic,Q0_poroelastic,ATTENUATION_PORO_FLUID_PART,assign_external_model,tomo_material,myrank
+ freq0_poroelastic,Q0_poroelastic,ATTENUATION_PORO_FLUID_PART, &
+ use_external_velocity_model,tomo_material,myrank
implicit none
@@ -303,7 +304,7 @@ subroutine read_materials(f0)
! line format:
! #model_number #-1 #(val0)0 #(val1)0 #(val2)A 0 0 0 0 0 0 0 0 0 0
- assign_external_model = .true.
+ use_external_velocity_model = .true.
tomo_material = n
mu = val2 ! for acoustic medium vs must be 0 anyway
diff --git a/src/specfem2D/setup_mesh.F90 b/src/specfem2D/setup_mesh.F90
index 8a0e79765..78be41fd6 100644
--- a/src/specfem2D/setup_mesh.F90
+++ b/src/specfem2D/setup_mesh.F90
@@ -558,15 +558,15 @@ subroutine setup_mesh_material_properties()
! user output
if (myrank == 0) then
write(IMAIN,*) 'Material properties:'
- write(IMAIN,*) ' MODEL : ',trim(MODEL)
- write(IMAIN,*) ' nspec : ',nspec_all
- write(IMAIN,*) ' assign external model : ',assign_external_model
+ write(IMAIN,*) ' MODEL : ',trim(MODEL)
+ write(IMAIN,*) ' nspec : ',nspec_all
+ write(IMAIN,*) ' external velocity model : ',use_external_velocity_model
write(IMAIN,*)
call flush_IMAIN()
endif
! allocates material arrays
- if (assign_external_model) then
+ if (use_external_velocity_model) then
nspec_ext = nspec
else
! dummy allocations
@@ -602,7 +602,7 @@ subroutine setup_mesh_material_properties()
c22ext(:,:,:) = 0.0_CUSTOM_REAL
! reads in external models
- if (assign_external_model) then
+ if (use_external_velocity_model) then
! user output
if (myrank == 0) then
if (trim(MODEL) == 'tomo') then
@@ -673,7 +673,7 @@ subroutine setup_mesh_material_properties()
do j = 1,NGLLZ
do i = 1,NGLLX
! gets material values
- if (assign_external_model) then
+ if (use_external_velocity_model) then
! external model
rhol = rhoext(i,j,ispec)
vp = vpext(i,j,ispec)
@@ -844,7 +844,7 @@ subroutine setup_mesh_material_properties()
! for non-elastic elements, the values in arrays c11ext,.. or anistropycoef(..) are just zero
do j = 1,NGLLZ
do i = 1,NGLLX
- if (assign_external_model) then
+ if (use_external_velocity_model) then
c11store(i,j,ispec) = c11ext(i,j,ispec)
c12store(i,j,ispec) = c12ext(i,j,ispec)
c13store(i,j,ispec) = c13ext(i,j,ispec)
diff --git a/src/specfem2D/specfem2D_par.f90 b/src/specfem2D/specfem2D_par.f90
index f1957d1d7..491f8797a 100644
--- a/src/specfem2D/specfem2D_par.f90
+++ b/src/specfem2D/specfem2D_par.f90
@@ -66,8 +66,8 @@ module specfem_par
double precision, dimension(:), allocatable :: QKappa_attenuationcoef
double precision, dimension(:), allocatable :: Qmu_attenuationcoef
- ! external models
- logical :: assign_external_model
+ ! external velocity models
+ logical :: use_external_velocity_model
integer :: nspec_ATT_el,nspec_ATT_ac,nglob_att
real(kind=CUSTOM_REAL), dimension(:,:,:,:), allocatable :: inv_tau_sigma_nu1,phi_nu1,inv_tau_sigma_nu2,phi_nu2
@@ -313,16 +313,14 @@ module specfem_par
! for backward simulation in adjoint inversion
real(kind=CUSTOM_REAL) :: b_deltatover2,b_deltatsquareover2,b_deltat ! coefficients of the explicit Newmark time scheme
- ! current time
- double precision :: current_timeval
-
! UNDO_ATTENUATION_AND_OR_PML
integer :: NSUBSET_ITERATIONS
integer :: iteration_on_subset,it_of_this_subset
integer :: it_subset_end
! to determine date and time at which the run will finish
- double precision :: timestamp_seconds_start
+ double precision :: timestamp_seconds_start ! based on date_and_time()
+ double precision :: start_time_of_time_loop ! based on wtime()
!---------------------------------------------------------------------
! global variable shared by acoustic/elastic/poroelastic simulation
diff --git a/utils/CPML/Par_file_to_use_with_this_timing_routine_HOWTO b/utils/CPML/Par_file_to_use_with_this_timing_routine_HOWTO
index 9f3e5b863..57ae1bfcc 100644
--- a/utils/CPML/Par_file_to_use_with_this_timing_routine_HOWTO
+++ b/utils/CPML/Par_file_to_use_with_this_timing_routine_HOWTO
@@ -268,15 +268,16 @@ read_external_mesh = .false.
# data concerning mesh, when generated using third-party app (more info in README)
# (see also absorbing_conditions above)
-mesh_file = ./DATA/Mesh_canyon/canyon_mesh_file # file containing the mesh
-nodes_coords_file = ./DATA/Mesh_canyon/canyon_nodes_coords_file # file containing the nodes coordinates
-materials_file = ./DATA/Mesh_canyon/canyon_materials_file # file containing the material number for each element
-free_surface_file = ./DATA/Mesh_canyon/canyon_free_surface_file # file containing the free surface
-axial_elements_file = ./DATA/axial_elements_file # file containing the axial elements if AXISYM is true
-absorbing_surface_file = ./DATA/Mesh_canyon/canyon_absorbing_surface_file # file containing the absorbing surface
-acoustic_forcing_surface_file = ./DATA/MSH/Surf_acforcing_Bottom_enforcing_mesh # file containing the acoustic forcing surface
-absorbing_cpml_file = Elements_CPML_list # file containing the CPML element numbers
-tangential_detection_curve_file = ./DATA/courbe_eros_nodes # file containing the curve delimiting the velocity model
+mesh_file = dummy # file containing the mesh
+nodes_coords_file = dummy # file containing the nodes coordinates
+materials_file = dummy # file containing the material number for each element
+nummaterial_velocity_file = dummy # file containing the material properties for each material
+free_surface_file = dummy # file containing the free surface
+axial_elements_file = dummy # file containing the axial elements if AXISYM is true
+absorbing_surface_file = dummy # file containing the absorbing surface
+acoustic_forcing_surface_file = dummy # file containing the acoustic forcing surface
+absorbing_cpml_file = dummy # file containing the CPML element numbers
+tangential_detection_curve_file = dummy # file containing the curve delimiting the velocity model
#-----------------------------------------------------------
#
diff --git a/utils/change_simulation_type.pl b/utils/change_simulation_type.pl
deleted file mode 100755
index aa9d6a208..000000000
--- a/utils/change_simulation_type.pl
+++ /dev/null
@@ -1,64 +0,0 @@
-#!/usr/bin/perl
-
-# this script changes the simulation_type in DATA/Par_file
-# Qinya Liu, May 2007, Caltech
-
-use Time::Local;
-use Getopt::Std;
-use POSIX;
-
-sub Usage{
-print STDERR <;
-close(IN);
-
-foreach $vfm (@vfm){
- if($vfm=~/SIMULATION_TYPE/){
- if(${opt_a}){
- print "Changed simulation_type to 2 in Par_file \n";
- $vfm=~s/= 1/= 2/;
- $vfm=~s/= 3/= 2/;
- }
- elsif(${opt_f}){
- print "Changed simulation_type to 1 in Par_file \n";
- $vfm=~s/= 2/= 1/;
- $vfm=~s/= 3/= 1/;
- }
- elsif(${opt_b}){
- print "Changed simulation_type to 3 in Par_file \n";
- $vfm=~s/= 1/= 3/;
- $vfm=~s/= 2/= 3/;
- }
- elsif(${opt_F}){
- print "Changed simulation_type to 1 and save_forward = .true. in Par_file \n";
- $vfm=~s/= 2/= 1/;
- $vfm=~s/= 3/= 1/;
- }
- }
- if ($vfm=~/SAVE_FORWARD/) {
- if ($opt_F) { $vfm=~s/false/true/; }
- else {$vfm=~s/true/false/;}
-
- }
-}
-
-open(OUT,">DATA/Par_file");
-foreach $vfm (@vfm){
- print OUT "$vfm";
-}
-close(OUT);
diff --git a/utils/change_simulation_type.pl b/utils/change_simulation_type.pl
new file mode 120000
index 000000000..61bd19202
--- /dev/null
+++ b/utils/change_simulation_type.pl
@@ -0,0 +1 @@
+scripts/change_simulation_type.pl
\ No newline at end of file
diff --git a/utils/compare_kernel_correlations.py b/utils/compare_kernel_correlations.py
deleted file mode 100755
index 7d86a91ef..000000000
--- a/utils/compare_kernel_correlations.py
+++ /dev/null
@@ -1,161 +0,0 @@
-#!/usr/bin/env python
-#
-# plot the cross-correlation and L2-norm between reference and output seismograms
-#
-from __future__ import print_function
-import sys
-import glob
-import os
-import numpy as np
-
-# tolerance values
-TOL_CORR = 0.8
-TOL_ERR = 0.01
-
-def plot_correlations(syn_file,ref_file):
- """
- plots correlation and L2-norm values between reference and output file
- """
- print('comparing kernels')
- print(' reference file: %s' % ref_file)
- print(' file : %s\n' % syn_file)
-
- # makes sure files are both available
- if not os.path.isfile(ref_file):
- print(" file " + ref_file + " not found")
- sys.exit(1)
- if not os.path.isfile(syn_file):
- print(" file " + syn_file + " not found")
- sys.exit(1)
-
- corr_min = 1.0
- err_max = 0.0
- shift_max = 0.0
-
- # gets x-coordinates
- syn_x = np.loadtxt(syn_file)[:, 0]
- dx = syn_x[1] - syn_x[0]
- print(" dx size = ",dx)
- print("")
-
- # gets y-coordinates
- #syn_y = np.loadtxt(syn_file)[:, 1]
- #dy = syn_y[1] - syn_y[0]
- #print(" dy size = ",dy)
-
- # outputs table header
- print("|%-30s| %13s| %13s|" % ('kernel name', 'corr', 'err'))
- print("|------------------------------------------------------------|")
-
- # build reference and synthetics file names
- # specfem file: proc******_rhop_alpha_beta_kernel.dat
- fname = os.path.basename(syn_file)
- names = str.split(fname,"_")
-
- # debug
- #print("kernel names: ",names) #['proc000000', 'rho', 'kappa', 'kernel.dat']
-
- # number of kernels
- num_kernel_names = len(names) - 1
-
- # counter
- n = 0
- for i in range(1,num_kernel_names):
- # trace
- kernel = names[i]
-
- # numpy: reads in file data
- # data format: e.g. #x-coord #y-coord #rhop #alpha #beta
- iker = i + 1
- ref = np.loadtxt(ref_file)[:, iker]
- syn = np.loadtxt(syn_file)[:, iker]
-
- # length warning
- if len(ref) != len(syn):
- print("Mismatch of file length in both files syn/ref = %d / %d" %(len(syn),len(ref)))
- sys.exit(1)
-
- # dx step size in reference file
- ref_x = np.loadtxt(ref_file)[:, 0]
- dx_ref = ref_x[1] - ref_x[0]
- # mismatch warning
- if abs(dx - dx_ref)/dx > 1.e-5:
- print("Mismatch of dx size in both files syn/ref = %e / %e" %(dx,dx_ref))
- sys.exit(1)
-
- # least square test
- norm = np.linalg.norm
- sqrt = np.sqrt
-
- # normalized by power in reference solution
- fac_norm = norm(ref)
- # or normalized by power in (ref*syn)
- #fac_norm = sqrt(norm(ref)*norm(syn))
- if fac_norm > 0.0:
- err = norm(ref-syn)/fac_norm
- else:
- err = norm(ref-syn)
- #print('norm syn = %e norm ref = %e' % (norm(syn),fac_norm))
-
- # correlation test
- # total length
- if fac_norm > 0.0:
- corr_mat = np.corrcoef(ref, syn)
- else:
- corr_mat = np.cov(ref-syn)
- corr = np.min(corr_mat)
-
- # statistics
- corr_min = min(corr, corr_min)
- err_max = max(err, err_max)
-
- # info string
- info = ""
- if corr < TOL_CORR: info += " poor correlation"
- if err > TOL_ERR: info += " poor match"
-
- # print results to screen
- print("|%-30s| %13.5f| %13.5le| %s" % (kernel, corr, err, info))
-
- # counter
- n += 1
-
- # print min(coor) max(err)
- print("|------------------------------------------------------------|")
- print("|%30s| %13.5f| %13.5le|" % ('min/max', corr_min, err_max))
-
- # output summary
- print("\nsummary:")
- print("%d kernels compared" % n)
- print("correlations: values 1.0 perfect, < %.1f poor correlation" % TOL_CORR)
- if corr_min < TOL_CORR:
- print(" poor correlation seismograms found")
- else:
- print(" no poor correlations found")
- print("")
-
- print("L2-error : values 0.0 perfect, > %.2f poor match" % TOL_ERR)
- if err_max > TOL_ERR:
- print(" poor matching seismograms found")
- else:
- print(" no poor matches found")
- print("")
-
-def usage():
- print("usage: ./compare_kernel_correlations.py kernel-file1 kernel-file2")
- print(" with")
- print(" kernel-file1 - ASCII kernel file,")
- print(" OUTPUT_FILES/proc000000_rhop_alpha_beta_kernel.dat")
- print(" kernel-file1 - ASCII kernel file for reference")
-
-if __name__ == '__main__':
- # gets arguments
- if len(sys.argv) != 3:
- usage()
- sys.exit(1)
- else:
- out_kernel = sys.argv[1]
- ref_kernel = sys.argv[2]
-
- plot_correlations(out_kernel,ref_kernel)
-
diff --git a/utils/compare_kernel_correlations.py b/utils/compare_kernel_correlations.py
new file mode 120000
index 000000000..8e6724051
--- /dev/null
+++ b/utils/compare_kernel_correlations.py
@@ -0,0 +1 @@
+scripts/compare_kernel_correlations.py
\ No newline at end of file
diff --git a/utils/compare_seismogram_correlations.py b/utils/compare_seismogram_correlations.py
deleted file mode 100755
index 9871fcac0..000000000
--- a/utils/compare_seismogram_correlations.py
+++ /dev/null
@@ -1,365 +0,0 @@
-#!/usr/bin/env python
-#
-# plot the cross-correlation and L2-norm between reference and output seismograms
-#
-from __future__ import print_function
-
-import sys
-import glob
-import os
-
-try:
- import numpy as np
-except:
- print("Error importing numpy, check if numpy module is installed")
- print("")
- # python version
- print("python version:")
- print(sys.version)
- print("")
- # import module paths
- print("module paths:")
- for path in sys.path:
- print(path)
- print("")
- sys.exit(1)
-
-
-# tolerance values
-TOL_CORR = 0.8
-TOL_ERR = 0.01
-TOL_SHIFT = 0.01
-
-###############################################################
-# USER PARAMETERS
-
-# computes correlations within a moving window
-# (set either to False or True)
-USE_SUB_WINDOW_CORR = False
-
-# for moving window correlations:
-# apprixomate minimum period of simulation
-# (default: NEX = 80 -> T_min = 256/80 * 17 s = 54.4 s)
-TMIN = 54.4
-###############################################################
-
-def get_cross_correlation_timeshift(x,y,dt):
- """
- computes the time shift of the maximum cross-correlation of signal x with respect to y
- """
- # checks signals
- if len(x) != len(y):
- print("Error: lengths in cross-correlation don't match")
- return 1.e30
-
- # cross-correlation length
- signal_length = len(x)
- length = 2 * signal_length - 1
-
- # cross-correlation array
- crosscorrelation = np.correlate(x, y, mode='full')
-
- # index of maximum (between [0,2 * signal_length - 1]
- indexmax = np.argmax(crosscorrelation)
-
- # position (negative -> signal shifted to right, positive -> signal shifted to left)
- # time lag (will have steps of dt)
- lag = (indexmax + 1) - signal_length
-
- # subsample precision
- maxval = crosscorrelation[indexmax]
-
- #debug
- #print("xcorr: ",indexmax,maxval,len(crosscorrelation),length)
-
- # gets values left/right from maximum value
- if indexmax >= 1 and indexmax < length-1:
- val_left = crosscorrelation[indexmax-1]
- val_right = crosscorrelation[indexmax+1]
- elif indexmax == 0:
- # wrap-around values
- val_left = crosscorrelation[length-1]
- val_right = crosscorrelation[1]
- elif indexmax == length-1:
- # wrap-around values
- val_left = crosscorrelation[indexmax-1]
- val_right = crosscorrelation[0]
-
- # quadratic interpolation will give this maximum
- # see: http://www.dsprelated.com/freebooks/sasp/Peak_Detection_Steps_3.html
- if (val_left - 2.0*maxval + val_right) != 0.0:
- peak_shift = 0.5 * (val_left - val_right) / (val_left - 2.0*maxval + val_right)
- else:
- peak_shift = 0.0
-
- # adds subsample shift
- lag += peak_shift
-
- # cross-correlation time lag
- time_shift = lag * dt
-
- # debug
- #print("cross-correlation:",length,signal_length,"shift = ",indexmax,lag,time_shift)
-
- return time_shift
-
-
-def plot_correlations(out_dir,ref_dir):
- """
- plots correlation and L2-norm values between reference and output seismograms
- """
- print('comparing seismograms')
- print(' reference directory: %s' % ref_dir)
- print(' output directory : %s\n' % out_dir)
-
- # checks if directory exists
- if not os.path.isdir(ref_dir):
- print("Please check if directory exists: ",ref_dir)
- sys.exit(1)
- if not os.path.isdir(out_dir):
- print("Please check if directory exists: ",out_dir)
- sys.exit(1)
-
- # seismogram file ending
- ## global version: ending = '.sem.ascii' # MX*.sem.ascii, ..
- ## cartesian version:
- ending = '.sem*' # .semd, .semv, .sema, .semp, ..
-
- # gets seismograms
- files = glob.glob(out_dir + '/*' + ending)
- if len(files) == 0:
- print("no seismogram files with ending ",ending," found")
- print("Please check directory: ",out_dir)
- sys.exit(1)
-
- files.sort()
-
- corr_min = 1.0
- err_max = 0.0
- shift_max = 0.0
-
- # gets time step size from first file
- syn_file = files[0]
- print(" time step: reading from first file ",syn_file)
- syn_time = np.loadtxt(syn_file)[:, 0]
- dt = syn_time[1] - syn_time[0]
- print(" time step: size = ",dt)
- # warning
- if dt <= 0.0:
- print("warning: invalid time step size for file ",files[0])
-
- # determines window length
- if USE_SUB_WINDOW_CORR:
- # moving window
- print(" using correlations in moving sub-windows")
- print(" minimum period: ",TMIN)
- # checks
- if dt <= 0.0:
- # use no moving window
- window_length = len(syn_time) - 1
- else:
- # window length for minimum period
- window_length = int(TMIN/dt)
-
- print(" moving window length: ",window_length)
-
-
- print("")
- print("comparing ",len(files),"seismograms")
- print("")
-
- # outputs table header
- print("|%-30s| %13s| %13s| %13s|" % ('file name', 'corr', 'err', 'time shift'))
-
- # counter
- n = 0
-
- for f in files:
- # build reference and synthetics file names
- # specfem file: **network**.**station**.**comp**.sem.ascii
- fname = os.path.basename(f)
- names = str.split(fname,".")
-
- # trace
- net = names[0]
- sta = names[1]
- cha = names[2]
-
- # filenames
- # old format
- #fname_old = sta + '.' + net + '.' + cha + '.sem.ascii'
- #ref_file = ref_dir + '/' + fname_old
- #syn_file = out_dir + '/' + fname_old
- # new format
- ref_file = ref_dir + '/' + fname
- syn_file = out_dir + '/' + fname
-
- # makes sure files are both available
- if not os.path.isfile(ref_file):
- print(" file " + ref_file + " not found")
- continue
- if not os.path.isfile(syn_file):
- print(" file " + syn_file + " not found")
- continue
-
- # numpy: reads in file data
- ref0 = np.loadtxt(ref_file)[:, 1]
- syn0 = np.loadtxt(syn_file)[:, 1]
-
- #debug
- #print(" seismogram: ", fname, "vs", fname_old," lengths: ",len(ref0),len(syn0))
-
- # cuts common length
- length = min(len(ref0),len(syn0))
- if length <= 1: continue
-
- # length warning
- if len(ref0) != len(syn0):
- print("** warning: mismatch of file length in both files syn/ref = %d / %d" %(len(syn0),len(ref0)))
- #print("** warning: using smaller length %d" % length)
-
- # time step size in reference file
- ref_time = np.loadtxt(ref_file)[:, 0]
- dt_ref = ref_time[1] - ref_time[0]
- # mismatch warning
- if abs(dt - dt_ref)/dt > 1.e-5:
- print("** warning: mismatch of time step size in both files syn/ref = %e / %e" %(dt,dt_ref))
- #print("** warning: using time step size %e from file %s" %(dt,syn_file))
-
- #debug
- #print("common length: ",length)
-
- ref = ref0[0:length]
- syn = syn0[0:length]
-
- # least square test
- norm = np.linalg.norm
- sqrt = np.sqrt
-
- # normalized by power in reference solution
- fac_norm = norm(ref)
- # or normalized by power in (ref*syn)
- #fac_norm = sqrt(norm(ref)*norm(syn))
-
- if fac_norm > 0.0:
- err = norm(ref-syn)/fac_norm
- else:
- err = norm(ref-syn)
-
- #debug
- #print('norm syn = %e norm ref = %e' % (norm(syn),fac_norm))
-
- # correlation test
- # total length
- if fac_norm > 0.0:
- corr_mat = np.corrcoef(ref, syn)
- else:
- if norm(ref-syn) > 0.0:
- corr_mat = np.cov(ref-syn)
- else:
- # both zero traces
- print("** warning: comparing zero traces")
- corr_mat = 1.0
- corr = np.min(corr_mat)
-
- # time shift
- if fac_norm > 0.0:
- # shift (in s) by cross correlation
- shift = get_cross_correlation_timeshift(ref,syn,dt)
- else:
- # no correlation with zero trace
- shift = 0.0
-
- # correlation in moving window
- if USE_SUB_WINDOW_CORR:
- # moves window through seismogram
- for i in range(0,length-window_length):
- # windowed signals
- x = ref[i:i+window_length]
- y = syn[i:i+window_length]
-
- # correlations
- corr_win = np.corrcoef(x, y)
- corr_w = np.min(corr_win)
- corr = min(corr, corr_w)
-
- # cross-correlation array
- shift_w = get_cross_correlation_timeshift(x,y,dt)
- if abs(shift) < abs(shift_w): shift = shift_w
-
- # statistics
- corr_min = min(corr, corr_min)
- err_max = max(err, err_max)
- if abs(shift_max) < abs(shift): shift_max = shift
-
- # info string
- info = ""
- if corr < TOL_CORR: info += " poor correlation"
- if err > TOL_ERR: info += " poor match"
- if abs(shift) > TOL_SHIFT: info += " significant shift"
-
- # print results to screen
- print("|%-30s| %13.5f| %13.5le| %13.5le| %s" % (fname, corr, err, shift, info))
-
- # counter
- n += 1
-
-
- # check if any comparison done
- if n == 0:
- # values indicating failure
- corr_min = 0.0
- err_max = 1.e9
- shift_max = 1.e9
-
- # print min(coor) max(err)
- print("|---------------------------------------------------------------------------|")
- print("|%30s| %13.5f| %13.5le| %13.5le|" % ('min/max', corr_min, err_max, shift_max))
-
- # output summary
- print("\nsummary:")
- print("%d seismograms compared\n" % n)
- if n == 0:
- print("\nno seismograms found for comparison!\n\n")
-
- print("correlations: values 1.0 perfect, < %.1f poor correlation" % TOL_CORR)
- if corr_min < TOL_CORR:
- print(" poor correlation seismograms found")
- else:
- print(" no poor correlations found")
- print("")
-
- print("L2-error : values 0.0 perfect, > %.2f poor match" % TOL_ERR)
- if err_max > TOL_ERR:
- print(" poor matching seismograms found")
- else:
- print(" no poor matches found")
- print("")
-
- print("Time shift : values 0.0 perfect, > %.2f significant shift" % TOL_SHIFT)
- if abs(shift_max) > TOL_SHIFT:
- print(" significant time shift in seismograms found")
- else:
- print(" no significant time shifts found")
- print("")
-
-
-def usage():
- print("usage: ./compare_seismogram_correlations.py directory1/ directory2/")
- print(" with")
- print(" directory1 - directory holding seismogram files (***.sem.ascii),")
- print(" e.g. OUTPUT_FILES/")
- print(" directory2 - directory holding corresponding reference seismogram files,")
- print(" e.g. OUTPUT_FILES_reference_OK/")
-
-if __name__ == '__main__':
- # gets arguments
- if len(sys.argv) != 3:
- usage()
- sys.exit(1)
- else:
- out_dir = sys.argv[1]
- ref_dir = sys.argv[2]
-
- plot_correlations(out_dir,ref_dir)
-
diff --git a/utils/compare_seismogram_correlations.py b/utils/compare_seismogram_correlations.py
new file mode 120000
index 000000000..9683188e0
--- /dev/null
+++ b/utils/compare_seismogram_correlations.py
@@ -0,0 +1 @@
+scripts/compare_seismogram_correlations.py
\ No newline at end of file
diff --git a/utils/compare_two_images.py b/utils/compare_two_images.py
deleted file mode 100755
index bca401f7b..000000000
--- a/utils/compare_two_images.py
+++ /dev/null
@@ -1,286 +0,0 @@
-#!/usr/bin/env python
-#
-# compares two images
-
-# taken from http://www.pyimagesearch.com/2014/09/15/python-compare-two-images in April 2015
-
-# computes the Mean Squared Error (MSE) and the Structural Similarity Index
-# (SSIM) between two images (having the exact same size)
-
-# Slightly modified by Dimitri Komatitsch and Elliott Sales de Andrade, April 2015
-
-#########################################################
-# requires the "python-skimage" package to be installed
-#########################################################
-
-# In 3D comparing kernels i.e. volumetric stuff would be a bit difficult,
-# however in 2D we can see them as images if we draw them and then we can use
-# Python routines that compute a similarity index between two images.
-#
-# I took one from
-# http://www.pyimagesearch.com/2014/09/15/python-compare-two-images/ and
-# slightly modified it. It works well. You then just need to check if the
-# Structural Similarity Index (SSIM) is greater than 0.99.
-#
-# For the 2D code we can apply this to EXAMPLES/LuoYang_fluid_solid_kernel for
-# instance in the nightly builds.
-#
-# For the 3D code for now we could just draw pictures along a couple of cut
-# planes and use that script as well. Better than nothing.
-
-# import the necessary packages
-from __future__ import (absolute_import, division, print_function)
-
-import sys
-
-print("compare two images...")
-
-try:
- import numpy as np
-except:
- print("Error importing numpy, please install numpy package first...")
- sys.tracebacklimit=0
- raise Exception("Importing numpy failed, please install numpy package first...")
-
-print("numpy version: ",np.__version__)
-
-try:
- import skimage
-except:
- print("Error importing skimage, please install skimage package (scikit-image) first...")
- sys.tracebacklimit=0
- raise Exception("Importing skimage failed, please install skimage package (scikit-image) first...")
-
-version = skimage.__version__
-print("skimage version: ",version)
-
-# determines skimage version function
-v = version.split('.')
-new_version = 0
-if len(v) > 2:
- print("skimage structural similarity support: %i.%i.x" % (int(v[0]),int(v[1])))
- if int(v[1]) >= 16:
- new_version = 2
- elif int(v[1]) > 11 and int(v[1]) < 16:
- new_version = 1
- else:
- new_version = 0
-
-# imports rgb2gray
-# more recent versions use rgb2gray instead of rbg2grey (which throws a deprecation warning)
-try:
- from skimage.color import rgb2gray
-except:
- print("Error importing rgb2gray from skimage.color, please install skimage package (scikit-image) first...")
- sys.tracebacklimit=0
- raise Exception("Importing skimage.color rgb2gray failed")
-
-# imports rgba2rgb
-if new_version == 2:
- # since versions >= 0.13.x
- try:
- from skimage.color import rgba2rgb
- except:
- print("Error importing rgba2rgb from skimage.color, please install skimage package (scikit-image) first...")
- sys.tracebacklimit=0
- raise Exception("Importing skimage.color rgba2rgb failed")
-
-# imports imread
-if new_version == 2:
- # uses skimage.io
- try:
- from skimage.io import imread
- except:
- print("Error importing imread from skimage.io, please install skimage package (scikit-image) first...")
- sys.tracebacklimit=0
- raise Exception("Importing skimage.io imread failed")
-else:
- # uses skimage.data
- try:
- from skimage.data import imread
- except:
- print("Error importing imread from skimage.data, please install skimage package (scikit-image) first...")
- sys.tracebacklimit=0
- raise Exception("Importing skimage.data imread failed")
-
-# imports structural similarity function
-if new_version == 2:
- # function was renamed from skimage.measure.compare_ssim to skimage.metrics.structural_similarity
- try:
- from skimage.metrics import structural_similarity as ssim
- except:
- print("Error importing structural_similarity from skimage.metrics, please install skimage package (scikit-image) first...")
-elif new_version == 1:
- # deprecated: from skimage.measure import structural_similarity as ssim
- print("importing new function compare_ssim as ssim")
- try:
- from skimage.measure import compare_ssim as ssim
- except:
- print("Error importing compare_ssim from skimage.measure, please install skimage package (scikit-image) first...")
-else:
- # older version <= 0.11.x
- print("importing old function structural_similarity as ssim")
- try:
- from skimage.measure import structural_similarity as ssim
- except:
- print("Error importing structural_similarity from skimage.measure, please install skimage package (scikit-image) first...")
-print("")
-
-#####################################################################
-# USER PARAMETERS
-
-# tolerance values
-TOL_SIM = 0.99
-
-# verbosity
-VERBOSE = False
-
-#####################################################################
-
-def mse(imageA, imageB):
- # the 'Mean Squared Error' between the two images is the
- # sum of the squared difference between the two images;
- # NOTE: the two images must have the same dimension
- err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)
- err /= float(imageA.shape[0] * imageA.shape[1])
-
- # return the MSE, the lower the error, the more "similar"
- # the two images are
- return err
-
-
-def compare_images(imageA, imageB, title, show_plot=True):
- """
- computes the mean squared error and structural similarity
- """
- global new_version
-
- # index values for mean squared error
- if VERBOSE: print("comparing mean squared error...")
- m = mse(imageA, imageB)
-
- # convert the images to grayscale
- if VERBOSE: print("converting to greyscale...")
- if new_version == 2:
- imageA_grey = rgb2gray(rgba2rgb(imageA))
- imageB_grey = rgb2gray(rgba2rgb(imageB))
- else:
- imageA_grey = rgb2gray(imageA)
- imageB_grey = rgb2gray(imageB)
-
- # uses image copies to avoid runtime warning for ssim computation
- img1_grey = np.copy(imageA_grey)
- img2_grey = np.copy(imageB_grey)
-
- # index values for structural similarity
- if VERBOSE: print("comparing structural similarity...")
- s = ssim(img1_grey, img2_grey)
-
- if show_plot:
- if VERBOSE: print("plotting images...")
- try:
- import matplotlib.pyplot as plt
- except:
- print("Error importing pyplot from matplotlib, please install matplotlib package first...")
- sys.tracebacklimit=0
- raise Exception("Importing matplotlib failed")
-
- # setup the figure
- fig, ax = plt.subplots(2, 2)
- fig.suptitle("%s\nMSE: %.5f, SSIM: %.5f" % (title, m, s))
-
- ax[0][0].text(-10, -10, 'MSE: %.5f' %(m))
-
- # show first image
- ax[0][0].imshow(imageA, cmap=plt.cm.gray)
- ax[0][0].axis("off")
-
- # show the second image
- ax[0][1].imshow(imageB, cmap=plt.cm.gray)
- ax[0][1].axis("off")
-
- ax[1][0].text(-10, -10, 'SSIM: %.5f' %(s))
-
- # show first grey image
- ax[1][0].imshow(img1_grey, cmap=plt.cm.gray)
- ax[1][0].axis("off")
-
- # show the second grey image
- ax[1][1].imshow(img2_grey, cmap=plt.cm.gray)
- ax[1][1].axis("off")
-
- # show the images
- plt.show()
-
- return m, s
-
-
-def plot_image_comparison(image1,image2,show):
- """
- plots comparison between two images
- """
- print("comparing images:")
- print(" image 1 = %s" % image1)
- print(" image 2 = %s" % image2)
- print("")
- if show:
- print(" with image plots")
- else:
- print(" without image plots")
- print("")
-
- # load the images
- if VERBOSE: print("loading images...")
- imageA = imread(image1)
- imageB = imread(image2)
-
- # compare the images
- m, s = compare_images(imageA, imageB, "Image 1 vs. Image 2", show_plot=show)
-
- # user output
- print("")
- print("mean squared error : values 0.0 perfect match")
- print("structural similarity: values 1.0 perfect, < %.2f poor similarity" % TOL_SIM)
- print("")
- print("mean squared error = %f" % m)
- print("structural similarity = %f" % s)
- print("")
- print("result:")
- if s < TOL_SIM:
- # Failure
- print(" poor image similarity found")
- print("")
- sys.exit(1)
- else:
- # Success
- print(" good image similarity found")
- print("")
- sys.exit(0)
-
-
-def usage():
- print("usage: ./compare_two_images.py image1 image2 (show)")
- print(" with")
- print(" image1,image2 - path to images (jpg,png) for comparison")
- print(" (optional) show - set to 1 to show image plots, otherwise only outputs comparison values")
-
-if __name__ == '__main__':
- # initialize
- image1 = ''
- image2 = ''
- show = False
-
- # gets arguments
- if len(sys.argv) < 2 or len(sys.argv) > 4:
- usage()
- sys.exit(1)
- else:
- image1 = sys.argv[1]
- image2 = sys.argv[2]
- if len(sys.argv) == 4:
- if int(sys.argv[3]) == 1: show = True
-
- # compares images
- plot_image_comparison(image1,image2,show)
-
-
diff --git a/utils/compare_two_images.py b/utils/compare_two_images.py
new file mode 120000
index 000000000..620fbdfd6
--- /dev/null
+++ b/utils/compare_two_images.py
@@ -0,0 +1 @@
+scripts/compare_two_images.py
\ No newline at end of file
diff --git a/utils/cubit2specfem2d/README b/utils/cubit2specfem2d/README
index 12dd34af8..df63a7f89 100644
--- a/utils/cubit2specfem2d/README
+++ b/utils/cubit2specfem2d/README
@@ -1,5 +1,8 @@
-SPECFEM2D/UTILS/cubit2specfem2d/README
+----------------------------------------------------------
+README
+----------------------------------------------------------
-The preferred version for using cubit to output files specific for SPECFEM2D would be to use the python script cubit2specfem2d.py, similar to the procedure used for SPECFEM3D. Read comments in the file cubit2specfem2d.py itself.
+The preferred version for using cubit to output files specific for SPECFEM2D would be to use the python script cubit2specfem2d.py,
+similar to the procedure used for SPECFEM3D. Read comments in the file cubit2specfem2d.py itself.
An alternative is to use the matlab scripts in the folder matlab.
diff --git a/utils/cubit2specfem2d/boundary_definition.py b/utils/cubit2specfem2d/boundary_definition.py
index 07a7ed652..4dc9cf09d 100755
--- a/utils/cubit2specfem2d/boundary_definition.py
+++ b/utils/cubit2specfem2d/boundary_definition.py
@@ -34,8 +34,8 @@ def define_bc_edges():
"""
#from utilities import get_v_h_list
#
- list_vol = cubit.parse_cubit_list("volume","all",1)
- print("#define_edge: volume list length = ",len(list_vol))
+ list_vol = cubit.parse_cubit_list("volume","all")
+ print("# define_bc_edge: volume list length = ",len(list_vol))
xmin_box = cubit.get_total_bounding_box("volume",list_vol)[0]
xmax_box = cubit.get_total_bounding_box("volume",list_vol)[1]
@@ -46,17 +46,15 @@ def define_bc_edges():
zmin_box = cubit.get_total_bounding_box("volume",list_vol)[6] #it is the z_min of the box ... box= xmin,xmax,d,ymin,ymax,d,zmin...
zmax_box = cubit.get_total_bounding_box("volume",list_vol)[7]
- print("#define_edge: bounding box xmin/xmax = ",xmin_box,xmax_box)
- print("#define_edge: bounding box ymin/ymax = ",ymin_box,ymax_box)
- print("#define_edge: bounding box zmin/zmax = ",zmin_box,zmax_box)
+ print("# define_bc_edge: bounding box xmin/xmax = ",xmin_box,xmax_box)
+ print("# define_bc_edge: bounding box ymin/ymax = ",ymin_box,ymax_box)
+ print("# define_bc_edge: bounding box zmin/zmax = ",zmin_box,zmax_box)
# cubit2specfem2d.py needs one block per border (abs_bottom, abs_right, abs_left, abs_top, topo, axis)
#
# 2D model should be defined in with top at maximum, bottom at minimum (e.g. z pointing up in positive direction, not depth)
if abs(xmax_box-xmin_box) < 0.001:
- print("")
- print("# model in YZ plane")
- print("")
+ print("# define_bc_edge: mesh in YZ plane")
border_t = zmax_box - 0.1 # top minus margin
border_b = zmin_box + 0.1 # bottom
border_l = ymin_box + 0.1 # left
@@ -64,20 +62,22 @@ def define_bc_edges():
cubit.cmd('block 1001 edge in surf all with z_coord > ' + str(border_t))
cubit.cmd('block 1001 name "topo"')
+ cubit.cmd('block 1001 element type BAR2') # convert to BAR2 types (not BEAM2) since export requires BAR2
cubit.cmd('block 1002 edge in surf all with z_coord < ' + str(border_b))
cubit.cmd('block 1002 name "abs_bottom"')
+ cubit.cmd('block 1002 element type BAR2')
cubit.cmd('block 1003 edge in surf all with y_coord < ' + str(border_l))
cubit.cmd('block 1003 name "abs_left"')
+ cubit.cmd('block 1003 element type BAR2')
cubit.cmd('block 1004 edge in surf all with y_coord > ' + str(border_r))
cubit.cmd('block 1004 name "abs_right"')
+ cubit.cmd('block 1004 element type BAR2')
if abs(ymax_box-ymin_box) < 0.001:
- print("")
- print("# model in XZ plane")
- print("")
+ print("# define_bc_edge: mesh in XZ plane")
border_t = zmax_box - 0.1 # top minus margin
border_b = zmin_box + 0.1 # bottom
border_l = xmin_box + 0.1 # left
@@ -85,20 +85,22 @@ def define_bc_edges():
cubit.cmd('block 1001 edge in surf all with z_coord > ' + str(border_t))
cubit.cmd('block 1001 name "topo"')
+ cubit.cmd('block 1001 element type BAR2')
cubit.cmd('block 1002 edge in surf all with z_coord < ' + str(border_b))
cubit.cmd('block 1002 name "abs_bottom"')
+ cubit.cmd('block 1002 element type BAR2')
cubit.cmd('block 1003 edge in surf all with x_coord < ' + str(border_l))
cubit.cmd('block 1003 name "abs_left"')
+ cubit.cmd('block 1003 element type BAR2')
cubit.cmd('block 1004 edge in surf all with x_coord > ' + str(border_r))
cubit.cmd('block 1004 name "abs_right"')
+ cubit.cmd('block 1004 element type BAR2')
if abs(zmax_box-zmin_box) < 0.001:
- print("")
- print("# model in XY plane")
- print("")
+ print("# define_bc_edge: mesh in XY plane")
border_t = ymax_box - 0.1 # top minus margin
border_b = ymin_box + 0.1 # bottom
border_l = xmin_box + 0.1 # left
@@ -106,28 +108,32 @@ def define_bc_edges():
cubit.cmd('block 1001 edge in surf all with y_coord > ' + str(border_t))
cubit.cmd('block 1001 name "topo"')
+ cubit.cmd('block 1001 element type BAR2')
cubit.cmd('block 1002 edge in surf all with y_coord < ' + str(border_b))
cubit.cmd('block 1002 name "abs_bottom"')
+ cubit.cmd('block 1002 element type BAR2')
cubit.cmd('block 1003 edge in surf all with x_coord < ' + str(border_l))
cubit.cmd('block 1003 name "abs_left"')
+ cubit.cmd('block 1003 element type BAR2')
cubit.cmd('block 1004 edge in surf all with x_coord > ' + str(border_r))
cubit.cmd('block 1004 name "abs_right"')
+ cubit.cmd('block 1004 element type BAR2')
# outputs block infos
list_ids = cubit.get_block_id_list()
- print("#blocks: ",list_ids)
+ print("# define_bc_edge: blocks: ",list_ids)
for id in list_ids:
- print("#block id: ",id)
+ print("# define_bc_edge: block id: ",id)
name = cubit.get_exodus_entity_name("block", id)
- print("#block name: ",name)
+ print("# define_bc_edge: block name: ",name)
num_a = cubit.get_block_attribute_count(id)
- print("#block number of attributes: ",num_a)
+ print("# define_bc_edge: block number of attributes: ",num_a)
#attr = cubit.get_block_attribute_value(id,1)
edges = cubit.get_block_edges(id)
- print("# number of edges = ",len(edges))
- print("")
+ print("# define_bc_edge: number of edges = ",len(edges))
+ print("#")
return
diff --git a/utils/cubit2specfem2d/cubit2specfem2d.py b/utils/cubit2specfem2d/cubit2specfem2d.py
index 54a0f8c08..05e8485e7 100644
--- a/utils/cubit2specfem2d/cubit2specfem2d.py
+++ b/utils/cubit2specfem2d/cubit2specfem2d.py
@@ -1,41 +1,47 @@
#!/usr/bin/env python
#
# Script to export a Cubit13+/Trelis 2D mesh in specfem2d format
-# Author unknown, comments and modifications by Alexis Bottero (alexis dot bottero At gmail dot com)
+# Initial Author unknown, comments and modifications by Alexis Bottero (alexis dot bottero At gmail dot com)
+#
+# this script supports both, QUAD4 for linear or QUAD9 for quadratic element types for surface elements,
+# as well as BAR2 or BAR3 edge types for edges.
+
+# Create your mesh in Cubit
+# (or build the simpleAxisym2dMesh.py for a QUAD4 element example, MeshSansCPMLquad9.py for a QUAD9 element type example)
+# and play this script within Cubit as a Python journal file.
#
-# Create your mesh in Cubit (or build the simpleAxisym2dMesh.py example) and play this script within Cubit as a Python journal file.
# Instructions for mesh creation :
-# _The mesh must be in XZ plane!
-# _One block per material :
+# The mesh by default is assumed to be in the XZ plane, but it will recognize also XY or YZ plane meshes!
+#
+# Define a block per material, for example like :
# cubit.cmd('block 1 name "Acoustic channel" ') # acoustic material region
# cubit.cmd('block 1 attribute count 6') # number of attributes
-# cubit.cmd('block 1 attribute index 1 1') # material index
+# cubit.cmd('block 1 attribute index 1 1') # material index
# cubit.cmd('block 1 attribute index 2 1500 ') # vp
# cubit.cmd('block 1 attribute index 3 0 ') # vs
# cubit.cmd('block 1 attribute index 4 1000 ') # rho
# cubit.cmd('block 1 attribute index 5 0 ') # Q_flag
# cubit.cmd('block 1 attribute index 6 0 ') # anisotropy_flag
-# cubit.cmd('block 1 element type QUAD4')
+# cubit.cmd('block 1 element type QUAD4') # or 'QUAD9' for quadratic elements
#
-# _One block per border (abs_bottom, abs_right, abs_left, abs_top, topo, axis). If axisymmetric simulation don't create a block
-# abs_left but a block axis.
-# Ex:
+# Define a block per absorbing border (abs_bottom, abs_right, abs_left, abs_top, topo, axis).
+# For axisymmetric simulations, you don't need to create a block abs_left, but a block axis.
+# Example:
# cubit.cmd('block 3 edge in surf all with z_coord > -0.1') # topo
# cubit.cmd('block 3 name "topo"')
#
-#_ One block per pml layer of a given type (acoustic or elastic) : pml_x_acoust,pml_z_acoust,pml_xz_acoust,pml_x_elast,pml_z_elast,pml_xz_elast
+# Define one block per pml layer of a given type (acoustic or elastic)
+# pml_x_acoust,pml_z_acoust,pml_xz_acoust,pml_x_elast,pml_z_elast,pml_xz_elast
# !! Warning !! pml blocks don't have faces in common
# !! Warning !! you must create the corresponding absorbing surface blocks (abs_bottom, abs_right, abs_left, abs_top)!
#
-# Ideas to improve that script (ctrl+f for TODO also): _Allow 2D models built in XY and ZY planes
-#
# The names of the block and the entities types must match the ones given during the definition of the class mesh on this file :
# Below :
# class mesh(mesh_tools):
# """ A class to store the mesh """
# def __init__(self):
#
-#!! Warning : a block in cubit != quad !! A block is a group of something (quads, edges, volumes, surfaces...)
+# !! Warning : a block in cubit != quad !! A block is a group of something (quads, edges, volumes, surfaces...)
# On this case the blocks are used to gather faces corresponding to different materials and edges corresponding to free surfaces,
# absorbing surfaces, topography or axis
from __future__ import print_function
@@ -203,21 +209,45 @@ def edge_min_length(self,surface):
edge_store = edge
self.edgemin = edge_store
return self.edgemin,self.dmin
- def jac_check(self,nodes):
+ def jac_check(self,nodes,plane_id,type=""):
x0 = cubit.get_nodal_coordinates(nodes[0])
x1 = cubit.get_nodal_coordinates(nodes[1])
x2 = cubit.get_nodal_coordinates(nodes[2])
- xv1 = x1[0]-x0[0]
- xv2 = x2[0]-x1[0]
- zv1 = x1[2]-x0[2]
- zv2 = x2[2]-x1[2]
- jac = -xv2*zv1+xv1*zv2
+ # plane identifier: 1 == XZ-plane, 2 == XY-plane, 3 == YZ-plane
+ if plane_id == 1:
+ # XZ-plane
+ xv1 = x1[0]-x0[0]
+ xv2 = x2[0]-x1[0]
+ zv1 = x1[2]-x0[2]
+ zv2 = x2[2]-x1[2]
+ jac = -xv2*zv1 + xv1*zv2
+ elif plane_id == 2:
+ # XY-plane
+ xv1 = x1[0]-x0[0]
+ xv2 = x2[0]-x1[0]
+ yv1 = x1[1]-x0[1]
+ yv2 = x2[1]-x1[1]
+ jac = -xv2*yv1 + xv1*yv2
+ else:
+ # YZ-plane
+ yv1 = x1[1]-x0[1]
+ yv2 = x2[1]-x1[1]
+ zv1 = x1[2]-x0[2]
+ zv2 = x2[2]-x1[2]
+ jac = -yv2*zv1 + yv1*zv2
+ # checks jacobian
if jac > 0:
return nodes
elif jac < 0:
- return nodes[0],nodes[3],nodes[2],nodes[1]
+ # change the ordre for the local coordinate system
+ if type == 'QUAD9':
+ # for 9 node finite elements Page.11 in Specfem2d-manual.pdf
+ return nodes[0],nodes[3],nodes[2],nodes[1],nodes[7],nodes[6],nodes[5],nodes[4],nodes[8]
+ else:
+ # QUAD4 type
+ return nodes[0],nodes[3],nodes[2],nodes[1]
else:
- print('error, jacobian = 0', jac,nodes)
+ print('error, jacobian = 0', jac,nodes,'x0/x1/x2:',x0,x1,x2)
def mesh_analysis(self,frequency):
cubit.cmd('set info off') # Turn off return messages from Cubit commands
cubit.cmd('set echo off') # Turn off echo of Cubit commands
@@ -287,8 +317,9 @@ def __init__(self):
self.pmlname = 'elements_cpml_list' # Name of cpml file to create
self.axisname = 'elements_axis' # Name of axial elements file to create and name of the block containing axial edges
self.recname = 'STATIONS'
- self.face = 'QUAD4' # Faces' type
- self.edge = 'BAR2' # Edges' type
+ self.face = ['QUAD4','QUAD9'] # Faces' type
+ self.edge = ['BAR2','BAR3'] # Edges' type
+ self.plane_id = 1 # plane identifier: 1 == XZ-plane, 2 == XY-plane, 3 == YZ-plane
self.topo = 'topo' # Name of the block containing topography edges
self.pml_boun_name = ['pml_x_acoust','pml_z_acoust','pml_xz_acoust','pml_x_elast','pml_z_elast','pml_xz_elast'] # Name of the block containing pml layers elements
self.abs_boun_name = ['abs_bottom','abs_right','abs_top','abs_left'] # Name of the block containing absorbing layer edges
@@ -303,6 +334,35 @@ def __init__(self):
self.percent_gll = 0.172
self.point_wavelength = 5
cubit.cmd('compress') # Fill the gaps in the numbering of the entities
+ # get 2d plane of coordinates
+ # determined based on bounding box dimensions
+ list_vol = cubit.parse_cubit_list("volume","all")
+ #print("# volume list length = ",len(list_vol))
+ xmin_box = cubit.get_total_bounding_box("volume",list_vol)[0]
+ xmax_box = cubit.get_total_bounding_box("volume",list_vol)[1]
+ ymin_box = cubit.get_total_bounding_box("volume",list_vol)[3]
+ ymax_box = cubit.get_total_bounding_box("volume",list_vol)[4]
+ zmin_box = cubit.get_total_bounding_box("volume",list_vol)[6] #it is the z_min of the box ... box= xmin,xmax,d,ymin,ymax,d,zmin...
+ zmax_box = cubit.get_total_bounding_box("volume",list_vol)[7]
+ #print("# bounding box xmin/xmax = ",xmin_box,xmax_box)
+ #print("# bounding box ymin/ymax = ",ymin_box,ymax_box)
+ #print("# bounding box zmin/zmax = ",zmin_box,zmax_box)
+ #print("")
+ # plane identifier: 1 == XZ-plane, 2 == XY-plane, 3 == YZ-plane
+ if abs(ymax_box-ymin_box) < 0.001:
+ print("# cubit2specfem2d: mesh in XZ plane")
+ self.plane_id = 1
+ elif abs(zmax_box-zmin_box) < 0.001:
+ print("# cubit2specfem2d: mesh in XY plane")
+ self.plane_id = 2
+ elif abs(xmax_box-xmin_box) < 0.001:
+ print("# cubit2specfem2d: mesh in YZ plane")
+ self.plane_id = 3
+ else:
+ print("# WARNING: cubit2specfem2d: mesh is not 2D, will ignored Y-dimension")
+ self.plane_id = 1
+ #print("# plane identifier: ",plane_id)
+ #print("#")
def __repr__(self):
pass
def block_definition(self):
@@ -320,14 +380,14 @@ def block_definition(self):
blocks = cubit.get_block_id_list() # Load the blocks list
for block in blocks: # Loop on the blocks
name = cubit.get_exodus_entity_name('block',block) # Contains the name of the blocks
- ty = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
- if ty == self.face: # If we are dealing with a block containing faces
- print("block: ",name," contains faces")
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
+ if type in self.face: # If we are dealing with a block containing faces
+ print("block: ",name," contains faces ",type)
nAttributes = cubit.get_block_attribute_count(block)
if (nAttributes != 1 and nAttributes != 6):
print('Blocks not properly defined, 2d blocks must have one attribute (material id) or 6 attributes')
return None,None,None,None,None,None,None,None
- flag=int(cubit.get_block_attribute_value(block,0)) # Fetch the first attribute value (containing material id)
+ flag = int(cubit.get_block_attribute_value(block,0)) # Fetch the first attribute value (containing material id)
print(" nAttributes : ",nAttributes)
if nAttributes == 6:
self.write_nummaterial_velocity_file = True
@@ -336,12 +396,14 @@ def block_definition(self):
rho = cubit.get_block_attribute_value(block,3) # Fetch the third attribute value (containing material density)
qFlag = cubit.get_block_attribute_value(block,4) # Fetch the first attribute value (containing Qflag)
anisotropy_flag = cubit.get_block_attribute_value(block,5) # Fetch the first attribute value (containing anisotropy_flag)
+ anisotropy_flag = int(anisotropy_flag)
# Store (material_id,rho,velP,velS,Qflag,anisotropy_flag) in par :
par = tuple([flag,rho,velP,velS,qFlag,anisotropy_flag])
material[name] = par # associate the name of the block to its id and properties
block_flag.append(int(flag)) # Append material id to block_flag
block_mat.append(block) # Append block id to block_mat
for pml_idx,pml_name in enumerate(self.pml_boun_name):
+ # block considered refered to one of the pml layers
if pml_name in name:
pml_boun[pml_idx].append(block)
self.abs_mesh = True
@@ -356,8 +418,8 @@ def block_definition(self):
# # -> Put it at the correct position in pml_boun
# # (index 0 : pml_x_acoust, index 1 : pml_z_acoust, index 2 : pml_xz_acoust,
# # index 3 : pml_x_elast, index 4 : pml_z_elast, index 5 : pml_xz_elast)
- elif ty == self.edge: # If we are dealing with a block containing edges
- print("block: ",name," contains edges")
+ elif type in self.edge: # If we are dealing with a block containing edges
+ print("block: ",name," contains edges ",type)
block_bc_flag.append(2) # Append "2" to block_bc_flag
block_bc.append(block) # Append block id to block_bc
bc[name] = 2 # Associate the name of the block with its connectivity : an edge has connectivity = 2
@@ -380,7 +442,7 @@ def block_definition(self):
abs_boun[self.abs_boun_name.index(name)] = block
# -> Put it at the correct position in abs_boun (index 0 : bottom, index 1 : right, index 2 : top, index 3 : left)
else:
- print('Blocks not properly defined', ty)
+ print('Blocks not properly defined', type)
return None,None,None,None,None,None,None,None
nsets = cubit.get_nodeset_id_list() # Get the list of all nodeset
if len(nsets) == 0: self.receivers = None # If this list is empty : put None in self.receivers
@@ -417,17 +479,81 @@ def block_definition(self):
# rho = (1.6612*vp-0.472*vp**2+0.0671*vp**3-0.0043*vp**4+0.000106*vp**4)*1000
# txt = '%3i %1i %20f %20f %20f %1i %1i\n' % (flag,1,rho,vel,vel/(3**.5),0,0)
# return txt
- def nummaterial_write(self,nummaterial_name):
+ def mat_parameter(self, properties):
+ # print properties
+ # format nummaterials file:
+ # #material_domain_id #material_id #rho #vp #vs #Q_kappa #Q_mu #anisotropy_flag
+ # get material properties
+ mat_id = properties[0]
+ #print('number of material:', mat_id)
+ # material id flag must be strictly positive or negative, but not equal to 0
+ if mat_id > 0:
+ # material defined
+ rho = properties[1]
+ vp = properties[2]
+ vs = properties[3]
+ Q_kappa = 9999.0 # not defined yet
+ Q_mu = properties[4]
+ aniso_flag = properties[5]
+ # determine acoustic==1 or elastic==2 domain
+ domain_id = 1 if vs == 0.0 else 2
+ # format:
+ #(1)material_domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_kappa #(7)Q_mu #(8)anisotropy_flag
+ # with material_domain_id ==1 for acoustic or ==2 for elastic materials
+ txt = f"{domain_id} {mat_id} {rho} {vp} {vs} {Q_kappa} {Q_mu} {aniso_flag}\n"
+ elif mat_id < 0:
+ # material undefined, for tomography file
+ if properties[2] == 'tomography':
+ # format:
+ #(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+ txt = '%1i %3i %s %s 1\n' % (2, mat_id, "tomography elastic", properties[3])
+ else:
+ raise RuntimeError('Error: material id must be strictly positive or negative, but not equal to 0')
+ # info output
+ #print("material: ",txt)
+ return txt
+ def nummaterial_write(self,nummaterial_name,placeholder=True):
""" Write material features on file : nummaterial_name """
print('Writing '+nummaterial_name+'.....')
nummaterial = open(nummaterial_name,'w') # Create the file "nummaterial_name" and open it
+ if placeholder:
+ txt = '''# nummaterial_velocity_file - created by script cubit2specfem2d.py
+# format:
+#(1)domain_id #(2)material_id #(3)rho #(4)vp #(5)vs #(6)Q_k #(7)Q_mu #(8)ani
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : POSITIVE integer identifier of material block
+# rho : density
+# vp : P-velocity
+# vs : S-velocity
+# Q_k : 9999 = no Q_kappa attenuation
+# Q_mu : 9999 = no Q_mu attenuation
+# ani : 0=no anisotropy/ 1,2,.. check with aniso_model.f90
+#
+# example:
+# 2 1 2300 2800 1500 9999.0 9999.0 0
+#
+# or
+#
+#(1)domain_id #(2)material_id tomography elastic #(3)filename #(4)positive
+#
+# where
+# domain_id : 1=acoustic / 2=elastic / 3=poroelastic
+# material_id : NEGATIVE integer identifier of material block
+# filename : filename of the tomography file
+# positive : a positive unique identifier
+#
+# example:
+# 2 -1 tomography elastic tomo.xyz 1
+#
+# materials
+'''
+ nummaterial.write(txt)
+ # writes block materials
for block in self.block_mat: # For each 2D block
name = cubit.get_exodus_entity_name('block',block) # Extract the name of the block
- lineToWrite = str(self.material[name][0])+" 1 "+str(self.material[name][1])+" " \
- +str(self.material[name][2])+" "+str(self.material[name][3])+" "+str(self.material[name][4])+" " \
- +str(self.material[name][5])+"\n" # flag rho vp vs rho Qflag anisotropy_flag
- nummaterial.write(lineToWrite)
- #nummaterial.write(self.tomo(self.material[name][0],self.material[name][2]))
+ nummaterial.write(str(self.mat_parameter(self.material[name])))
nummaterial.close()
print('Ok')
def mesh_write(self,mesh_name):
@@ -443,14 +569,27 @@ def mesh_write(self,mesh_name):
num_write = 0
for block,flag in zip(self.block_mat,self.block_flag): # for each 2D block
quads = cubit.get_block_faces(block) # Import quads ids
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for inum,quad in enumerate(quads): # For each of these quads
- nodes = cubit.get_connectivity('face',quad) # Get the nodes
- nodes = self.jac_check(nodes) # Check the jacobian
- txt = ('%10i %10i %10i %10i\n')% nodes
+ if type == 'QUAD9':
+ # QUAD9
+ nodes = cubit.get_expanded_connectivity('face',quad) # Get all the nodes in quad including interior points
+ else:
+ # QUAD4
+ nodes = cubit.get_connectivity('face',quad) # Get the nodes
+ nodes = self.jac_check(nodes,self.plane_id,type) # Check the jacobian
+ if type == 'QUAD9':
+ # QUAD9: quadratic element: 4 corners + 4 edge mid-points + 1 center nodal point
+ # format: #elem1 #elem2 #elem3 #elem4 #elem5 #elem6 #elem7 #elem8 #elem9
+ txt = ('%10i %10i %10i %10i %10i %10i %10i %10i %10i\n')% nodes
+ else:
+ # QUAD4: linear element: 4 corners
+ # format: #elem1 #elem2 #elem3 #elem4
+ txt = ('%10i %10i %10i %10i\n')% nodes
toWritetoFile[quad] = txt
#meshfile.write(txt) # Write a line to mesh file
num_write = num_write+inum+1
- print('block', block, 'number of ',self.face,' : ', inum+1)
+ print('block', block, 'number of type ',type,' : ', inum+1)
meshfile.writelines(toWritetoFile)
meshfile.close()
print('Ok num elements/write =',str(num_elems), str(num_write))
@@ -464,8 +603,8 @@ def material_write(self,mat_name):
cubit.cmd('set echo off') # Turn off echo of Cubit commands
num_elems = cubit.get_quad_count() # Store the number of elements
toWritetoFile = [""]*num_elems
- print('block_mat:',self.block_mat)
- print('block_flag:',self.block_flag)
+ #print('block_mat:',self.block_mat)
+ #print('block_flag:',self.block_flag)
for block,flag in zip(self.block_mat,self.block_flag): # for each 2D block
print('mat: ',block,' flag: ',flag)
quads = cubit.get_block_faces(block) # Import quads id
@@ -498,13 +637,14 @@ def pmls_write(self,pml_name):
print('Number of elements in all PMLs :',npml_elements)
for block,flag in zip(self.block_mat,self.block_flag): # For each 2D block
quads = cubit.get_block_faces(block) # Import quads id
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for quad in quads: # For each quad
#id_element = id_element+1 # global id of this quad
for ipml in range(0, 6): # iabs = 0,1,2,3,4,5 : for each pml layer (x_acoust, z_acoust, xz_acoust,x_elast, z_elast, xz_elast)
if faces_all[ipml] != []: #type(faces_all[ipml]) is not int: # ~ if there are elements in that pml
if quad in faces_all[ipml]: # If this quad is belong to that pml
# nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
- # nodes = self.jac_check(list(nodes)) # Check the jacobian of the quad
+ # nodes = self.jac_check(list(nodes),self.plane_id) # Check the jacobian of the quad
toWritetoFile[indexFile] = ('%10i %10i\n') % (quad,ipml%3+1)
indexFile = indexFile + 1
#pml_file.write(('%10i %10i\n') % (id_element,ipml%3+1)) # Write its id in the file next to its type
@@ -527,8 +667,14 @@ def nodescoord_write(self,nodecoord_name):
nodecoord.write('%10i\n' % num_nodes) # Write the number of nodes on the first line
for node in node_list: # For all nodes
x,y,z = cubit.get_nodal_coordinates(node) # Import its coordinates (3 coordinates even for a 2D model in cubit)
- txt = ('%20f %20f\n') % (x,z)
- nodecoord.write(txt) # Write x and z coordinates on the file -> Model must be in x,z coordinates. TODO
+ # plane identifier: 1 == XZ-plane, 2 == XY-plane, 3 == YZ-plane
+ if self.plane_id == 1:
+ txt = ('%20f %20f\n') % (x,z)
+ elif self.plane_id == 2:
+ txt = ('%20f %20f\n') % (x,y)
+ else:
+ txt = ('%20f %20f\n') % (y,z)
+ nodecoord.write(txt) # Write 2d coordinates on the file
nodecoord.close()
print('Ok')
cubit.cmd('set info on') # Turn on return messages from Cubit commands
@@ -548,18 +694,24 @@ def free_write(self,freename): #freename = None):
toWritetoFile = [] #[""]*(len(edges_all)+1)
toWritetoFile.append('%10i\n' % len(edges_all)) # Print the number of edges on the free surface
for block,flag in zip(self.block_mat,self.block_flag): # For each 2D block
- print(block,flag)
+ #print('free surface: ',block,flag)
quads = cubit.get_block_faces(block) # Import quads id
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for quad in quads: # For each quad
edges = set(cubit.get_sub_elements("face", quad, 1)) # Get the lower dimension entities associated with a higher dimension entities.
# Here it gets the 1D edges associates with the face of id "quad". Store it as a Set
intersection = edges & edges_all # Contains the edges of the considered quad that is on the free surface
if len(intersection) != 0: # If this quad touch the free surface
#print(" ",quad," -> this quad touch the free surface!")
- nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
+ if type == 'QUAD9':
+ # QUAD9
+ nodes = cubit.get_expanded_connectivity('face',quad) # Get all the nodes in quad including interior points
+ else:
+ # QUAD4
+ nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
#print(" it is described by nodes:",nodes," and edges :",edges)
#print(" edges:",intersection," is/are on the free surface")
- nodes = self.jac_check(list(nodes)) # Check the jacobian of the quad
+ nodes = self.jac_check(list(nodes),self.plane_id,type) # Check the jacobian of the quad
for e in intersection: # For each edge on the free surface
node_edge = cubit.get_connectivity('edge',e) # Import the nodes describing the edge
#print(" edge",e,"is composed of nodes",node_edge)
@@ -568,6 +720,9 @@ def free_write(self,freename): #freename = None):
if i in node_edge: # If this node is belonging to the free surface
nodes_ok.append(i) # Put it in nodes_ok
#print(" nodes:",nodes_ok,"belong to free surface")
+ # free surface contains 1/ element number, 2/ number of nodes that form the free surface,
+ # 3/ first node on the free surface, 4/ second node on the free surface, if relevant (if 2/ is equal to 2)
+ # format: #elemid #num_nodes==2 #node1 #node2
txt = '%10i %10i %10i %10i\n' % (quad,2,nodes_ok[0],nodes_ok[1])
toWritetoFile.append(txt)
# Write the id of the quad, 2 (number of nodes describing a free surface elements), and the nodes
@@ -601,6 +756,7 @@ def forcing_write(self,forcname):
indexFile = 1
for block,flag in zip(self.block_mat,self.block_flag): # For each 2D block
quads = cubit.get_block_faces(block) # Import quads id
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for quad in quads: # For each quad
#id_element = id_element+1 # id of this quad
edges = set(cubit.get_sub_elements("face", quad, 1)) # Get the lower dimension entities associated with a higher dimension entities.
@@ -608,8 +764,13 @@ def forcing_write(self,forcname):
for iforc in range(0,self.nforc): # iforc = 0,1,2,3 : for each forcing boundaries
intersection = edges & edges_forc[iforc] # Contains the edges of the considered quad that is on the forcing boundary considered
if len(intersection) != 0: # If this quad touch the forcing boundary considered
- nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
- nodes = self.jac_check(list(nodes)) # Check the jacobian of the quad
+ if type == 'QUAD9':
+ # QUAD9
+ nodes = cubit.get_expanded_connectivity('face',quad) # Get all the nodes in quad including interior points
+ else:
+ # QUAD4
+ nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
+ nodes = self.jac_check(list(nodes),self.plane_id,type) # Check the jacobian of the quad
for e in intersection: # For each edge on the forcing boundary considered
node_edge = cubit.get_connectivity('edge',e) # Import the nodes describing the edge
nodes_ok = []
@@ -656,6 +817,7 @@ def abs_write(self,absname):
indexFile = 1
for block,flag in zip(self.block_mat,self.block_flag): # For each 2D block
quads = cubit.get_block_faces(block) # Import quads id
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for quad in quads: # For each quad
#id_element = id_element+1 # id of this quad
edges = set(cubit.get_sub_elements("face", quad, 1)) # Get the lower dimension entities associated with a higher dimension entities.
@@ -663,14 +825,23 @@ def abs_write(self,absname):
for iabs in range(0,self.nabs): # iabs = 0,1,2,3 : for each absorbing boundaries
intersection = edges & edges_abs[iabs] # Contains the edges of the considered quad that is on the absorbing boundary considered
if len(intersection) != 0: # If this quad touch the absorbing boundary considered
- nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
- nodes = self.jac_check(list(nodes)) # Check the jacobian of the quad
+ if type == 'QUAD9':
+ # QUAD9
+ nodes = cubit.get_expanded_connectivity('face',quad) # Get all the nodes in quad including interior points
+ else:
+ # QUAD4
+ nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
+ nodes = self.jac_check(list(nodes),self.plane_id,type) # Check the jacobian of the quad
for e in intersection: # For each edge on the absorbing boundary considered
node_edge = cubit.get_connectivity('edge',e) # Import the nodes describing the edge
nodes_ok = []
for i in nodes: # Loop on the nodes of the quad
if i in node_edge: # If this node is belonging to absorbing surface
nodes_ok.append(i) # Add it to nodes_ok
+ # 'abs_surface' contains 1/ element number, 2/ number of nodes that form the absorbing edge
+ # (which currently must always be equal to 2),
+ # 3/ first node on the abs surface, 4/ second node on the abs surface
+ # 5/ 1=IBOTTOM, 2=IRIGHT, 3=ITOP, 4=ILEFT
#txt = '%10i %10i %10i %10i %10i\n' % (id_element,2,nodes_ok[0],nodes_ok[1],iabs+1)
txt = '%10i %10i %10i %10i %10i\n' % (quad,2,nodes_ok[0],nodes_ok[1],iabs+1)
# Write the id of the quad, 2 (number of nodes describing a free surface elements), the nodes and the type of boundary
@@ -700,22 +871,30 @@ def axis_write(self,axis_name):
indexFile = 1
for block,flag in zip(self.block_mat,self.block_flag): # For each 2D block
quads = cubit.get_block_faces(block) # Import quads id
+ type = cubit.get_block_element_type(block) # Contains the block element type (QUAD4...)
for quad in quads: # For each quad
#id_element = id_element+1 # id of this quad
edges = set(cubit.get_sub_elements("face", quad, 1)) # Get the lower dimension entities associated with a higher dimension entities.
# Here it gets the 1D edges associates with the face of id "quad". Store it as a Set
intersection = edges & edges_all # Contains the edges of the considered quad that are on the axis
if len(intersection) != 0: # If this quad touch the axis
- nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
- nodes = self.jac_check(list(nodes)) # Check the jacobian of the quad
+ if type == 'QUAD9':
+ # QUAD9
+ nodes = cubit.get_expanded_connectivity('face',quad) # Get all the nodes in quad including interior points
+ else:
+ # QUAD4
+ nodes = cubit.get_connectivity('face',quad) # Import the nodes describing the quad
+ nodes = self.jac_check(list(nodes),self.plane_id,type) # Check the jacobian of the quad
for e in intersection: # For each edge on the axis
node_edge = cubit.get_connectivity('edge',e) # Import the nodes describing the edge
nodes_ok = []
for i in nodes: # Loop on the nodes of the quad
if i in node_edge: # If this node is belonging to the axis
nodes_ok.append(i) # Add it to nodes_ok
+ # format: #ispec_id #dump==2 #inode1 #inode2
txt = '%10i %10i %10i %10i\n' % (quad,2,nodes_ok[0],nodes_ok[1])
#txt = '%10i %10i %10i %10i\n' % (id_element,2,nodes_ok[0],nodes_ok[1])
+ #txt = '%10i %10i %10i %10i %10i\n' % (id_element,2,nodes_ok[0],nodes_ok[1],4)
# Write the id of the quad, 2 (number of nodes describing a free surface elements), the nodes
toWritetoFile[indexFile] = txt
indexFile = indexFile + 1
@@ -732,7 +911,14 @@ def rec_write(self,recname):
nodes = cubit.get_nodeset_nodes(self.receivers) # Import nodes in nodeset containing receiver positions
for i,n in enumerate(nodes): # For each receiver
x,y,z = cubit.get_nodal_coordinates(n) # Import its coordinates (3 coordinates even for a 2D model in cubit)
- recfile.write('ST%i XX %20f %20f 0.0 0.0 \n' % (i,x,z)) # Write x and z coordinates on the file -> Model must be in x,z coordinates. TODO
+ # plane identifier: 1 == XZ-plane, 2 == XY-plane, 3 == YZ-plane
+ if self.plane_id == 1:
+ txt = ('ST%i XX %20f %20f 0.0 0.0 \n') % (i,x,z)
+ elif self.plane_id == 2:
+ txt = ('ST%i XX %20f %20f 0.0 0.0 \n') % (i,x,y)
+ else:
+ txt = ('ST%i XX %20f %20f 0.0 0.0 \n') % (i,y,z)
+ recfile.write(txt) # Write 2d coordinates on the file
recfile.close()
print('Ok')
def write(self,path = ''):
@@ -771,7 +957,7 @@ def export2SPECFEM2D(path_exporting_mesh_SPECFEM2D='.'):
profile = mesh()
# writes out
profile.write(path=path_exporting_mesh_SPECFEM2D)
- print("END SPECFEM2D exporting process......")
+ print("# END SPECFEM2D exporting process......")
# gets executed when run as script within cubit
#export2SPECFEM2D()
diff --git a/utils/cubit2specfem2d/cubit2specfem2d_QUAD9.py b/utils/cubit2specfem2d/cubit2specfem2d_QUAD9.py
index 401a7e3f5..444754f4b 100644
--- a/utils/cubit2specfem2d/cubit2specfem2d_QUAD9.py
+++ b/utils/cubit2specfem2d/cubit2specfem2d_QUAD9.py
@@ -1,6 +1,18 @@
#!python
#!/usr/bin/env python
#
+#
+##########################################################################################
+#
+# INFO: this script has become obsolete as the cubit2specfem2d.py file supports now
+# both QUAD4 and QUAD9 elements.
+#
+# Please use cubit2specfem2d.py to convert Cubit/Trelis meshes to SPECFEM2D format.
+#
+# the script here is left for historic purposes, but might be removed in future...
+#
+###########################################################################################
+#
# Script to export a Cubit13+/Trelis 2D mesh in specfem2d format for the elements QUAD9
# pour creer des fichiers correspondant a Specfem2d a partir du maillage de Cubit
# Initial author unknown, comments and modifications by Alexis Bottero (alexis dot bottero At gmail dot com) et Ting YU, CNRS and EDF, France, December 2015
diff --git a/utils/cubit2specfem2d/run_cubit_to_specfem.py b/utils/cubit2specfem2d/run_cubit_to_specfem.py
new file mode 100755
index 000000000..42909f6e9
--- /dev/null
+++ b/utils/cubit2specfem2d/run_cubit_to_specfem.py
@@ -0,0 +1,74 @@
+#!/usr/bin/env python
+#
+from __future__ import print_function
+import os
+import sys
+
+## CUBIT/Trelis
+import cubit
+try:
+ #cubit.init([""])
+ cubit.init(["-noecho","-nojournal"])
+except:
+ pass
+
+version = cubit.get_version()
+version_major = int(version.split(".")[0])
+version_minor = int(version.split(".")[1])
+print("#")
+print("# cubit version: ",version)
+print("#")
+
+# current work directory
+cubit.cmd('pwd')
+
+os.system('mkdir -p MESH')
+
+cubit.cmd('set echo on')
+
+# avoids assigning empty blocks
+cubit.cmd('set duplicate block elements on')
+
+
+# adds path to scripts (if not setup yet)
+sys.path.append('../../utils/cubit2specfem2d/')
+
+## This is boundary_definition.py
+# extracts the bounding edges and defines them into blocks
+import boundary_definition
+
+# reload script in case it has been modified during the cubit session
+import importlib
+importlib.reload(boundary_definition)
+
+boundary_definition.define_bc_edges()
+
+## Define material properties for model
+cubit.cmd('#### DEFINE MATERIAL PROPERTIES #######################')
+#cubit.cmd('set duplicate block elements on') # allow for multiple occurrences of entities in different blocks
+cubit.cmd('block 1 face in volume all')
+cubit.cmd('block 1 element type QUAD4')
+
+cubit.cmd('#### DEFINE MATERIAL PROPERTIES #######################')
+cubit.cmd('block 1 name "elastic 1" ') # elastic material region
+cubit.cmd('block 1 attribute count 6')
+cubit.cmd('block 1 attribute index 1 1 ') # volume 1
+cubit.cmd('block 1 attribute index 2 2800 ') # vp
+cubit.cmd('block 1 attribute index 3 1500 ') # vs
+cubit.cmd('block 1 attribute index 4 2300 ') # rho
+cubit.cmd('block 1 attribute index 5 9000.0 ') # Q_mu
+cubit.cmd('block 1 attribute index 6 0 ') # anisotropy_flag
+
+cubit.cmd('save as "top.cub" overwrite')
+
+## export mesh
+import cubit2specfem2d
+
+# reloads script
+import importlib
+importlib.reload(cubit2specfem2d)
+
+cubit2specfem2d.export2SPECFEM2D('MESH/')
+
+cubit.cmd('set echo off')
+
diff --git a/utils/Cray_compiler_information/Daniel_Peter_here_is_how_to_configure_SPECFEM3D_on_Piz_Daint_jan2017.txt b/utils/infos/Cray_compiler_information/Daniel_Peter_here_is_how_to_configure_SPECFEM3D_on_Piz_Daint_jan2017.txt
similarity index 100%
rename from utils/Cray_compiler_information/Daniel_Peter_here_is_how_to_configure_SPECFEM3D_on_Piz_Daint_jan2017.txt
rename to utils/infos/Cray_compiler_information/Daniel_Peter_here_is_how_to_configure_SPECFEM3D_on_Piz_Daint_jan2017.txt
diff --git a/utils/Cray_compiler_information/configure_SPECFEM_for_Piz_Daint.bash b/utils/infos/Cray_compiler_information/configure_SPECFEM_for_Piz_Daint.bash
similarity index 100%
rename from utils/Cray_compiler_information/configure_SPECFEM_for_Piz_Daint.bash
rename to utils/infos/Cray_compiler_information/configure_SPECFEM_for_Piz_Daint.bash
diff --git a/utils/Cray_compiler_information/here_are_more_details_on_how_to_successfully_configure_the_code_on_CRAY_machines.txt b/utils/infos/Cray_compiler_information/here_are_more_details_on_how_to_successfully_configure_the_code_on_CRAY_machines.txt
similarity index 100%
rename from utils/Cray_compiler_information/here_are_more_details_on_how_to_successfully_configure_the_code_on_CRAY_machines.txt
rename to utils/infos/Cray_compiler_information/here_are_more_details_on_how_to_successfully_configure_the_code_on_CRAY_machines.txt
diff --git a/utils/SPECFEM2D_implicit_with_MUMPS_from_Zhinan_Xie_2012_with_mpi_third_step_final_version_Dimitri_cleaned_may2017.tar.bz2 b/utils/infos/SPECFEM2D_implicit_with_MUMPS_from_Zhinan_Xie_2012_with_mpi_third_step_final_version_Dimitri_cleaned_may2017.tar.bz2
similarity index 100%
rename from utils/SPECFEM2D_implicit_with_MUMPS_from_Zhinan_Xie_2012_with_mpi_third_step_final_version_Dimitri_cleaned_may2017.tar.bz2
rename to utils/infos/SPECFEM2D_implicit_with_MUMPS_from_Zhinan_Xie_2012_with_mpi_third_step_final_version_Dimitri_cleaned_may2017.tar.bz2
diff --git a/utils/for_ADJOINT_TOMOGRAPHY_TOOLS_see_in_directory_utils_in_the_SPECFEM3D_package.txt b/utils/infos/for_ADJOINT_TOMOGRAPHY_TOOLS_see_in_directory_utils_in_the_SPECFEM3D_package.txt
similarity index 100%
rename from utils/for_ADJOINT_TOMOGRAPHY_TOOLS_see_in_directory_utils_in_the_SPECFEM3D_package.txt
rename to utils/infos/for_ADJOINT_TOMOGRAPHY_TOOLS_see_in_directory_utils_in_the_SPECFEM3D_package.txt
diff --git a/utils/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90
similarity index 100%
rename from utils/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90
rename to utils/infos/older_or_specific_versions_of_mesher/meshfem2D_circular_canyon.f90
diff --git a/utils/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90
similarity index 100%
rename from utils/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90
rename to utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_2.f90
diff --git a/utils/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90 b/utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90
similarity index 100%
rename from utils/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90
rename to utils/infos/older_or_specific_versions_of_mesher/meshfem2D_non_struct_3.f90
diff --git a/utils/patch_from_Brad_Aagaard_to_make_Scotch_compile_on_MacOS.txt b/utils/infos/patch_from_Brad_Aagaard_to_make_Scotch_compile_on_MacOS.txt
similarity index 100%
rename from utils/patch_from_Brad_Aagaard_to_make_Scotch_compile_on_MacOS.txt
rename to utils/infos/patch_from_Brad_Aagaard_to_make_Scotch_compile_on_MacOS.txt
diff --git a/utils/infos/update_config.sub_and_config.guess.sh b/utils/infos/update_config.sub_and_config.guess.sh
new file mode 100755
index 000000000..a649da9a6
--- /dev/null
+++ b/utils/infos/update_config.sub_and_config.guess.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+#
+# see:
+# https://www.gnu.org/software/gettext/manual/html_node/config_002eguess.html
+#
+#
+# updates config.guess from GNU config.git repository
+echo
+wget -O config.guess 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.guess;hb=HEAD'
+echo
+
+# updates config.sub from GNU config.git repository
+echo
+wget -O config.sub 'https://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD'
+echo
+
+# updates install-sh from GNU automake.git repository
+echo
+wget -O install-sh 'https://git.savannah.gnu.org/gitweb/?p=automake.git;a=blob_plain;f=lib/install-sh;hb=HEAD'
+
diff --git a/utils/SEM_save_dir.py b/utils/scripts/SEM_save_dir.py
old mode 100644
new mode 100755
similarity index 100%
rename from utils/SEM_save_dir.py
rename to utils/scripts/SEM_save_dir.py
diff --git a/utils/scripts/change_simulation_type.pl b/utils/scripts/change_simulation_type.pl
new file mode 100755
index 000000000..aa9d6a208
--- /dev/null
+++ b/utils/scripts/change_simulation_type.pl
@@ -0,0 +1,64 @@
+#!/usr/bin/perl
+
+# this script changes the simulation_type in DATA/Par_file
+# Qinya Liu, May 2007, Caltech
+
+use Time::Local;
+use Getopt::Std;
+use POSIX;
+
+sub Usage{
+print STDERR <;
+close(IN);
+
+foreach $vfm (@vfm){
+ if($vfm=~/SIMULATION_TYPE/){
+ if(${opt_a}){
+ print "Changed simulation_type to 2 in Par_file \n";
+ $vfm=~s/= 1/= 2/;
+ $vfm=~s/= 3/= 2/;
+ }
+ elsif(${opt_f}){
+ print "Changed simulation_type to 1 in Par_file \n";
+ $vfm=~s/= 2/= 1/;
+ $vfm=~s/= 3/= 1/;
+ }
+ elsif(${opt_b}){
+ print "Changed simulation_type to 3 in Par_file \n";
+ $vfm=~s/= 1/= 3/;
+ $vfm=~s/= 2/= 3/;
+ }
+ elsif(${opt_F}){
+ print "Changed simulation_type to 1 and save_forward = .true. in Par_file \n";
+ $vfm=~s/= 2/= 1/;
+ $vfm=~s/= 3/= 1/;
+ }
+ }
+ if ($vfm=~/SAVE_FORWARD/) {
+ if ($opt_F) { $vfm=~s/false/true/; }
+ else {$vfm=~s/true/false/;}
+
+ }
+}
+
+open(OUT,">DATA/Par_file");
+foreach $vfm (@vfm){
+ print OUT "$vfm";
+}
+close(OUT);
diff --git a/EXAMPLES/change_something_in_all_the_Par_files_automatically.bash b/utils/scripts/change_something_in_all_the_Par_files_automatically.bash
similarity index 100%
rename from EXAMPLES/change_something_in_all_the_Par_files_automatically.bash
rename to utils/scripts/change_something_in_all_the_Par_files_automatically.bash
diff --git a/utils/scripts/compare_kernel_correlations.py b/utils/scripts/compare_kernel_correlations.py
new file mode 100755
index 000000000..7d86a91ef
--- /dev/null
+++ b/utils/scripts/compare_kernel_correlations.py
@@ -0,0 +1,161 @@
+#!/usr/bin/env python
+#
+# plot the cross-correlation and L2-norm between reference and output seismograms
+#
+from __future__ import print_function
+import sys
+import glob
+import os
+import numpy as np
+
+# tolerance values
+TOL_CORR = 0.8
+TOL_ERR = 0.01
+
+def plot_correlations(syn_file,ref_file):
+ """
+ plots correlation and L2-norm values between reference and output file
+ """
+ print('comparing kernels')
+ print(' reference file: %s' % ref_file)
+ print(' file : %s\n' % syn_file)
+
+ # makes sure files are both available
+ if not os.path.isfile(ref_file):
+ print(" file " + ref_file + " not found")
+ sys.exit(1)
+ if not os.path.isfile(syn_file):
+ print(" file " + syn_file + " not found")
+ sys.exit(1)
+
+ corr_min = 1.0
+ err_max = 0.0
+ shift_max = 0.0
+
+ # gets x-coordinates
+ syn_x = np.loadtxt(syn_file)[:, 0]
+ dx = syn_x[1] - syn_x[0]
+ print(" dx size = ",dx)
+ print("")
+
+ # gets y-coordinates
+ #syn_y = np.loadtxt(syn_file)[:, 1]
+ #dy = syn_y[1] - syn_y[0]
+ #print(" dy size = ",dy)
+
+ # outputs table header
+ print("|%-30s| %13s| %13s|" % ('kernel name', 'corr', 'err'))
+ print("|------------------------------------------------------------|")
+
+ # build reference and synthetics file names
+ # specfem file: proc******_rhop_alpha_beta_kernel.dat
+ fname = os.path.basename(syn_file)
+ names = str.split(fname,"_")
+
+ # debug
+ #print("kernel names: ",names) #['proc000000', 'rho', 'kappa', 'kernel.dat']
+
+ # number of kernels
+ num_kernel_names = len(names) - 1
+
+ # counter
+ n = 0
+ for i in range(1,num_kernel_names):
+ # trace
+ kernel = names[i]
+
+ # numpy: reads in file data
+ # data format: e.g. #x-coord #y-coord #rhop #alpha #beta
+ iker = i + 1
+ ref = np.loadtxt(ref_file)[:, iker]
+ syn = np.loadtxt(syn_file)[:, iker]
+
+ # length warning
+ if len(ref) != len(syn):
+ print("Mismatch of file length in both files syn/ref = %d / %d" %(len(syn),len(ref)))
+ sys.exit(1)
+
+ # dx step size in reference file
+ ref_x = np.loadtxt(ref_file)[:, 0]
+ dx_ref = ref_x[1] - ref_x[0]
+ # mismatch warning
+ if abs(dx - dx_ref)/dx > 1.e-5:
+ print("Mismatch of dx size in both files syn/ref = %e / %e" %(dx,dx_ref))
+ sys.exit(1)
+
+ # least square test
+ norm = np.linalg.norm
+ sqrt = np.sqrt
+
+ # normalized by power in reference solution
+ fac_norm = norm(ref)
+ # or normalized by power in (ref*syn)
+ #fac_norm = sqrt(norm(ref)*norm(syn))
+ if fac_norm > 0.0:
+ err = norm(ref-syn)/fac_norm
+ else:
+ err = norm(ref-syn)
+ #print('norm syn = %e norm ref = %e' % (norm(syn),fac_norm))
+
+ # correlation test
+ # total length
+ if fac_norm > 0.0:
+ corr_mat = np.corrcoef(ref, syn)
+ else:
+ corr_mat = np.cov(ref-syn)
+ corr = np.min(corr_mat)
+
+ # statistics
+ corr_min = min(corr, corr_min)
+ err_max = max(err, err_max)
+
+ # info string
+ info = ""
+ if corr < TOL_CORR: info += " poor correlation"
+ if err > TOL_ERR: info += " poor match"
+
+ # print results to screen
+ print("|%-30s| %13.5f| %13.5le| %s" % (kernel, corr, err, info))
+
+ # counter
+ n += 1
+
+ # print min(coor) max(err)
+ print("|------------------------------------------------------------|")
+ print("|%30s| %13.5f| %13.5le|" % ('min/max', corr_min, err_max))
+
+ # output summary
+ print("\nsummary:")
+ print("%d kernels compared" % n)
+ print("correlations: values 1.0 perfect, < %.1f poor correlation" % TOL_CORR)
+ if corr_min < TOL_CORR:
+ print(" poor correlation seismograms found")
+ else:
+ print(" no poor correlations found")
+ print("")
+
+ print("L2-error : values 0.0 perfect, > %.2f poor match" % TOL_ERR)
+ if err_max > TOL_ERR:
+ print(" poor matching seismograms found")
+ else:
+ print(" no poor matches found")
+ print("")
+
+def usage():
+ print("usage: ./compare_kernel_correlations.py kernel-file1 kernel-file2")
+ print(" with")
+ print(" kernel-file1 - ASCII kernel file,")
+ print(" OUTPUT_FILES/proc000000_rhop_alpha_beta_kernel.dat")
+ print(" kernel-file1 - ASCII kernel file for reference")
+
+if __name__ == '__main__':
+ # gets arguments
+ if len(sys.argv) != 3:
+ usage()
+ sys.exit(1)
+ else:
+ out_kernel = sys.argv[1]
+ ref_kernel = sys.argv[2]
+
+ plot_correlations(out_kernel,ref_kernel)
+
diff --git a/utils/scripts/compare_seismogram_correlations.py b/utils/scripts/compare_seismogram_correlations.py
new file mode 100755
index 000000000..9871fcac0
--- /dev/null
+++ b/utils/scripts/compare_seismogram_correlations.py
@@ -0,0 +1,365 @@
+#!/usr/bin/env python
+#
+# plot the cross-correlation and L2-norm between reference and output seismograms
+#
+from __future__ import print_function
+
+import sys
+import glob
+import os
+
+try:
+ import numpy as np
+except:
+ print("Error importing numpy, check if numpy module is installed")
+ print("")
+ # python version
+ print("python version:")
+ print(sys.version)
+ print("")
+ # import module paths
+ print("module paths:")
+ for path in sys.path:
+ print(path)
+ print("")
+ sys.exit(1)
+
+
+# tolerance values
+TOL_CORR = 0.8
+TOL_ERR = 0.01
+TOL_SHIFT = 0.01
+
+###############################################################
+# USER PARAMETERS
+
+# computes correlations within a moving window
+# (set either to False or True)
+USE_SUB_WINDOW_CORR = False
+
+# for moving window correlations:
+# apprixomate minimum period of simulation
+# (default: NEX = 80 -> T_min = 256/80 * 17 s = 54.4 s)
+TMIN = 54.4
+###############################################################
+
+def get_cross_correlation_timeshift(x,y,dt):
+ """
+ computes the time shift of the maximum cross-correlation of signal x with respect to y
+ """
+ # checks signals
+ if len(x) != len(y):
+ print("Error: lengths in cross-correlation don't match")
+ return 1.e30
+
+ # cross-correlation length
+ signal_length = len(x)
+ length = 2 * signal_length - 1
+
+ # cross-correlation array
+ crosscorrelation = np.correlate(x, y, mode='full')
+
+ # index of maximum (between [0,2 * signal_length - 1]
+ indexmax = np.argmax(crosscorrelation)
+
+ # position (negative -> signal shifted to right, positive -> signal shifted to left)
+ # time lag (will have steps of dt)
+ lag = (indexmax + 1) - signal_length
+
+ # subsample precision
+ maxval = crosscorrelation[indexmax]
+
+ #debug
+ #print("xcorr: ",indexmax,maxval,len(crosscorrelation),length)
+
+ # gets values left/right from maximum value
+ if indexmax >= 1 and indexmax < length-1:
+ val_left = crosscorrelation[indexmax-1]
+ val_right = crosscorrelation[indexmax+1]
+ elif indexmax == 0:
+ # wrap-around values
+ val_left = crosscorrelation[length-1]
+ val_right = crosscorrelation[1]
+ elif indexmax == length-1:
+ # wrap-around values
+ val_left = crosscorrelation[indexmax-1]
+ val_right = crosscorrelation[0]
+
+ # quadratic interpolation will give this maximum
+ # see: http://www.dsprelated.com/freebooks/sasp/Peak_Detection_Steps_3.html
+ if (val_left - 2.0*maxval + val_right) != 0.0:
+ peak_shift = 0.5 * (val_left - val_right) / (val_left - 2.0*maxval + val_right)
+ else:
+ peak_shift = 0.0
+
+ # adds subsample shift
+ lag += peak_shift
+
+ # cross-correlation time lag
+ time_shift = lag * dt
+
+ # debug
+ #print("cross-correlation:",length,signal_length,"shift = ",indexmax,lag,time_shift)
+
+ return time_shift
+
+
+def plot_correlations(out_dir,ref_dir):
+ """
+ plots correlation and L2-norm values between reference and output seismograms
+ """
+ print('comparing seismograms')
+ print(' reference directory: %s' % ref_dir)
+ print(' output directory : %s\n' % out_dir)
+
+ # checks if directory exists
+ if not os.path.isdir(ref_dir):
+ print("Please check if directory exists: ",ref_dir)
+ sys.exit(1)
+ if not os.path.isdir(out_dir):
+ print("Please check if directory exists: ",out_dir)
+ sys.exit(1)
+
+ # seismogram file ending
+ ## global version: ending = '.sem.ascii' # MX*.sem.ascii, ..
+ ## cartesian version:
+ ending = '.sem*' # .semd, .semv, .sema, .semp, ..
+
+ # gets seismograms
+ files = glob.glob(out_dir + '/*' + ending)
+ if len(files) == 0:
+ print("no seismogram files with ending ",ending," found")
+ print("Please check directory: ",out_dir)
+ sys.exit(1)
+
+ files.sort()
+
+ corr_min = 1.0
+ err_max = 0.0
+ shift_max = 0.0
+
+ # gets time step size from first file
+ syn_file = files[0]
+ print(" time step: reading from first file ",syn_file)
+ syn_time = np.loadtxt(syn_file)[:, 0]
+ dt = syn_time[1] - syn_time[0]
+ print(" time step: size = ",dt)
+ # warning
+ if dt <= 0.0:
+ print("warning: invalid time step size for file ",files[0])
+
+ # determines window length
+ if USE_SUB_WINDOW_CORR:
+ # moving window
+ print(" using correlations in moving sub-windows")
+ print(" minimum period: ",TMIN)
+ # checks
+ if dt <= 0.0:
+ # use no moving window
+ window_length = len(syn_time) - 1
+ else:
+ # window length for minimum period
+ window_length = int(TMIN/dt)
+
+ print(" moving window length: ",window_length)
+
+
+ print("")
+ print("comparing ",len(files),"seismograms")
+ print("")
+
+ # outputs table header
+ print("|%-30s| %13s| %13s| %13s|" % ('file name', 'corr', 'err', 'time shift'))
+
+ # counter
+ n = 0
+
+ for f in files:
+ # build reference and synthetics file names
+ # specfem file: **network**.**station**.**comp**.sem.ascii
+ fname = os.path.basename(f)
+ names = str.split(fname,".")
+
+ # trace
+ net = names[0]
+ sta = names[1]
+ cha = names[2]
+
+ # filenames
+ # old format
+ #fname_old = sta + '.' + net + '.' + cha + '.sem.ascii'
+ #ref_file = ref_dir + '/' + fname_old
+ #syn_file = out_dir + '/' + fname_old
+ # new format
+ ref_file = ref_dir + '/' + fname
+ syn_file = out_dir + '/' + fname
+
+ # makes sure files are both available
+ if not os.path.isfile(ref_file):
+ print(" file " + ref_file + " not found")
+ continue
+ if not os.path.isfile(syn_file):
+ print(" file " + syn_file + " not found")
+ continue
+
+ # numpy: reads in file data
+ ref0 = np.loadtxt(ref_file)[:, 1]
+ syn0 = np.loadtxt(syn_file)[:, 1]
+
+ #debug
+ #print(" seismogram: ", fname, "vs", fname_old," lengths: ",len(ref0),len(syn0))
+
+ # cuts common length
+ length = min(len(ref0),len(syn0))
+ if length <= 1: continue
+
+ # length warning
+ if len(ref0) != len(syn0):
+ print("** warning: mismatch of file length in both files syn/ref = %d / %d" %(len(syn0),len(ref0)))
+ #print("** warning: using smaller length %d" % length)
+
+ # time step size in reference file
+ ref_time = np.loadtxt(ref_file)[:, 0]
+ dt_ref = ref_time[1] - ref_time[0]
+ # mismatch warning
+ if abs(dt - dt_ref)/dt > 1.e-5:
+ print("** warning: mismatch of time step size in both files syn/ref = %e / %e" %(dt,dt_ref))
+ #print("** warning: using time step size %e from file %s" %(dt,syn_file))
+
+ #debug
+ #print("common length: ",length)
+
+ ref = ref0[0:length]
+ syn = syn0[0:length]
+
+ # least square test
+ norm = np.linalg.norm
+ sqrt = np.sqrt
+
+ # normalized by power in reference solution
+ fac_norm = norm(ref)
+ # or normalized by power in (ref*syn)
+ #fac_norm = sqrt(norm(ref)*norm(syn))
+
+ if fac_norm > 0.0:
+ err = norm(ref-syn)/fac_norm
+ else:
+ err = norm(ref-syn)
+
+ #debug
+ #print('norm syn = %e norm ref = %e' % (norm(syn),fac_norm))
+
+ # correlation test
+ # total length
+ if fac_norm > 0.0:
+ corr_mat = np.corrcoef(ref, syn)
+ else:
+ if norm(ref-syn) > 0.0:
+ corr_mat = np.cov(ref-syn)
+ else:
+ # both zero traces
+ print("** warning: comparing zero traces")
+ corr_mat = 1.0
+ corr = np.min(corr_mat)
+
+ # time shift
+ if fac_norm > 0.0:
+ # shift (in s) by cross correlation
+ shift = get_cross_correlation_timeshift(ref,syn,dt)
+ else:
+ # no correlation with zero trace
+ shift = 0.0
+
+ # correlation in moving window
+ if USE_SUB_WINDOW_CORR:
+ # moves window through seismogram
+ for i in range(0,length-window_length):
+ # windowed signals
+ x = ref[i:i+window_length]
+ y = syn[i:i+window_length]
+
+ # correlations
+ corr_win = np.corrcoef(x, y)
+ corr_w = np.min(corr_win)
+ corr = min(corr, corr_w)
+
+ # cross-correlation array
+ shift_w = get_cross_correlation_timeshift(x,y,dt)
+ if abs(shift) < abs(shift_w): shift = shift_w
+
+ # statistics
+ corr_min = min(corr, corr_min)
+ err_max = max(err, err_max)
+ if abs(shift_max) < abs(shift): shift_max = shift
+
+ # info string
+ info = ""
+ if corr < TOL_CORR: info += " poor correlation"
+ if err > TOL_ERR: info += " poor match"
+ if abs(shift) > TOL_SHIFT: info += " significant shift"
+
+ # print results to screen
+ print("|%-30s| %13.5f| %13.5le| %13.5le| %s" % (fname, corr, err, shift, info))
+
+ # counter
+ n += 1
+
+
+ # check if any comparison done
+ if n == 0:
+ # values indicating failure
+ corr_min = 0.0
+ err_max = 1.e9
+ shift_max = 1.e9
+
+ # print min(coor) max(err)
+ print("|---------------------------------------------------------------------------|")
+ print("|%30s| %13.5f| %13.5le| %13.5le|" % ('min/max', corr_min, err_max, shift_max))
+
+ # output summary
+ print("\nsummary:")
+ print("%d seismograms compared\n" % n)
+ if n == 0:
+ print("\nno seismograms found for comparison!\n\n")
+
+ print("correlations: values 1.0 perfect, < %.1f poor correlation" % TOL_CORR)
+ if corr_min < TOL_CORR:
+ print(" poor correlation seismograms found")
+ else:
+ print(" no poor correlations found")
+ print("")
+
+ print("L2-error : values 0.0 perfect, > %.2f poor match" % TOL_ERR)
+ if err_max > TOL_ERR:
+ print(" poor matching seismograms found")
+ else:
+ print(" no poor matches found")
+ print("")
+
+ print("Time shift : values 0.0 perfect, > %.2f significant shift" % TOL_SHIFT)
+ if abs(shift_max) > TOL_SHIFT:
+ print(" significant time shift in seismograms found")
+ else:
+ print(" no significant time shifts found")
+ print("")
+
+
+def usage():
+ print("usage: ./compare_seismogram_correlations.py directory1/ directory2/")
+ print(" with")
+ print(" directory1 - directory holding seismogram files (***.sem.ascii),")
+ print(" e.g. OUTPUT_FILES/")
+ print(" directory2 - directory holding corresponding reference seismogram files,")
+ print(" e.g. OUTPUT_FILES_reference_OK/")
+
+if __name__ == '__main__':
+ # gets arguments
+ if len(sys.argv) != 3:
+ usage()
+ sys.exit(1)
+ else:
+ out_dir = sys.argv[1]
+ ref_dir = sys.argv[2]
+
+ plot_correlations(out_dir,ref_dir)
+
diff --git a/utils/scripts/compare_two_images.py b/utils/scripts/compare_two_images.py
new file mode 100755
index 000000000..bca401f7b
--- /dev/null
+++ b/utils/scripts/compare_two_images.py
@@ -0,0 +1,286 @@
+#!/usr/bin/env python
+#
+# compares two images
+
+# taken from http://www.pyimagesearch.com/2014/09/15/python-compare-two-images in April 2015
+
+# computes the Mean Squared Error (MSE) and the Structural Similarity Index
+# (SSIM) between two images (having the exact same size)
+
+# Slightly modified by Dimitri Komatitsch and Elliott Sales de Andrade, April 2015
+
+#########################################################
+# requires the "python-skimage" package to be installed
+#########################################################
+
+# In 3D comparing kernels i.e. volumetric stuff would be a bit difficult,
+# however in 2D we can see them as images if we draw them and then we can use
+# Python routines that compute a similarity index between two images.
+#
+# I took one from
+# http://www.pyimagesearch.com/2014/09/15/python-compare-two-images/ and
+# slightly modified it. It works well. You then just need to check if the
+# Structural Similarity Index (SSIM) is greater than 0.99.
+#
+# For the 2D code we can apply this to EXAMPLES/LuoYang_fluid_solid_kernel for
+# instance in the nightly builds.
+#
+# For the 3D code for now we could just draw pictures along a couple of cut
+# planes and use that script as well. Better than nothing.
+
+# import the necessary packages
+from __future__ import (absolute_import, division, print_function)
+
+import sys
+
+print("compare two images...")
+
+try:
+ import numpy as np
+except:
+ print("Error importing numpy, please install numpy package first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing numpy failed, please install numpy package first...")
+
+print("numpy version: ",np.__version__)
+
+try:
+ import skimage
+except:
+ print("Error importing skimage, please install skimage package (scikit-image) first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing skimage failed, please install skimage package (scikit-image) first...")
+
+version = skimage.__version__
+print("skimage version: ",version)
+
+# determines skimage version function
+v = version.split('.')
+new_version = 0
+if len(v) > 2:
+ print("skimage structural similarity support: %i.%i.x" % (int(v[0]),int(v[1])))
+ if int(v[1]) >= 16:
+ new_version = 2
+ elif int(v[1]) > 11 and int(v[1]) < 16:
+ new_version = 1
+ else:
+ new_version = 0
+
+# imports rgb2gray
+# more recent versions use rgb2gray instead of rbg2grey (which throws a deprecation warning)
+try:
+ from skimage.color import rgb2gray
+except:
+ print("Error importing rgb2gray from skimage.color, please install skimage package (scikit-image) first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing skimage.color rgb2gray failed")
+
+# imports rgba2rgb
+if new_version == 2:
+ # since versions >= 0.13.x
+ try:
+ from skimage.color import rgba2rgb
+ except:
+ print("Error importing rgba2rgb from skimage.color, please install skimage package (scikit-image) first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing skimage.color rgba2rgb failed")
+
+# imports imread
+if new_version == 2:
+ # uses skimage.io
+ try:
+ from skimage.io import imread
+ except:
+ print("Error importing imread from skimage.io, please install skimage package (scikit-image) first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing skimage.io imread failed")
+else:
+ # uses skimage.data
+ try:
+ from skimage.data import imread
+ except:
+ print("Error importing imread from skimage.data, please install skimage package (scikit-image) first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing skimage.data imread failed")
+
+# imports structural similarity function
+if new_version == 2:
+ # function was renamed from skimage.measure.compare_ssim to skimage.metrics.structural_similarity
+ try:
+ from skimage.metrics import structural_similarity as ssim
+ except:
+ print("Error importing structural_similarity from skimage.metrics, please install skimage package (scikit-image) first...")
+elif new_version == 1:
+ # deprecated: from skimage.measure import structural_similarity as ssim
+ print("importing new function compare_ssim as ssim")
+ try:
+ from skimage.measure import compare_ssim as ssim
+ except:
+ print("Error importing compare_ssim from skimage.measure, please install skimage package (scikit-image) first...")
+else:
+ # older version <= 0.11.x
+ print("importing old function structural_similarity as ssim")
+ try:
+ from skimage.measure import structural_similarity as ssim
+ except:
+ print("Error importing structural_similarity from skimage.measure, please install skimage package (scikit-image) first...")
+print("")
+
+#####################################################################
+# USER PARAMETERS
+
+# tolerance values
+TOL_SIM = 0.99
+
+# verbosity
+VERBOSE = False
+
+#####################################################################
+
+def mse(imageA, imageB):
+ # the 'Mean Squared Error' between the two images is the
+ # sum of the squared difference between the two images;
+ # NOTE: the two images must have the same dimension
+ err = np.sum((imageA.astype("float") - imageB.astype("float")) ** 2)
+ err /= float(imageA.shape[0] * imageA.shape[1])
+
+ # return the MSE, the lower the error, the more "similar"
+ # the two images are
+ return err
+
+
+def compare_images(imageA, imageB, title, show_plot=True):
+ """
+ computes the mean squared error and structural similarity
+ """
+ global new_version
+
+ # index values for mean squared error
+ if VERBOSE: print("comparing mean squared error...")
+ m = mse(imageA, imageB)
+
+ # convert the images to grayscale
+ if VERBOSE: print("converting to greyscale...")
+ if new_version == 2:
+ imageA_grey = rgb2gray(rgba2rgb(imageA))
+ imageB_grey = rgb2gray(rgba2rgb(imageB))
+ else:
+ imageA_grey = rgb2gray(imageA)
+ imageB_grey = rgb2gray(imageB)
+
+ # uses image copies to avoid runtime warning for ssim computation
+ img1_grey = np.copy(imageA_grey)
+ img2_grey = np.copy(imageB_grey)
+
+ # index values for structural similarity
+ if VERBOSE: print("comparing structural similarity...")
+ s = ssim(img1_grey, img2_grey)
+
+ if show_plot:
+ if VERBOSE: print("plotting images...")
+ try:
+ import matplotlib.pyplot as plt
+ except:
+ print("Error importing pyplot from matplotlib, please install matplotlib package first...")
+ sys.tracebacklimit=0
+ raise Exception("Importing matplotlib failed")
+
+ # setup the figure
+ fig, ax = plt.subplots(2, 2)
+ fig.suptitle("%s\nMSE: %.5f, SSIM: %.5f" % (title, m, s))
+
+ ax[0][0].text(-10, -10, 'MSE: %.5f' %(m))
+
+ # show first image
+ ax[0][0].imshow(imageA, cmap=plt.cm.gray)
+ ax[0][0].axis("off")
+
+ # show the second image
+ ax[0][1].imshow(imageB, cmap=plt.cm.gray)
+ ax[0][1].axis("off")
+
+ ax[1][0].text(-10, -10, 'SSIM: %.5f' %(s))
+
+ # show first grey image
+ ax[1][0].imshow(img1_grey, cmap=plt.cm.gray)
+ ax[1][0].axis("off")
+
+ # show the second grey image
+ ax[1][1].imshow(img2_grey, cmap=plt.cm.gray)
+ ax[1][1].axis("off")
+
+ # show the images
+ plt.show()
+
+ return m, s
+
+
+def plot_image_comparison(image1,image2,show):
+ """
+ plots comparison between two images
+ """
+ print("comparing images:")
+ print(" image 1 = %s" % image1)
+ print(" image 2 = %s" % image2)
+ print("")
+ if show:
+ print(" with image plots")
+ else:
+ print(" without image plots")
+ print("")
+
+ # load the images
+ if VERBOSE: print("loading images...")
+ imageA = imread(image1)
+ imageB = imread(image2)
+
+ # compare the images
+ m, s = compare_images(imageA, imageB, "Image 1 vs. Image 2", show_plot=show)
+
+ # user output
+ print("")
+ print("mean squared error : values 0.0 perfect match")
+ print("structural similarity: values 1.0 perfect, < %.2f poor similarity" % TOL_SIM)
+ print("")
+ print("mean squared error = %f" % m)
+ print("structural similarity = %f" % s)
+ print("")
+ print("result:")
+ if s < TOL_SIM:
+ # Failure
+ print(" poor image similarity found")
+ print("")
+ sys.exit(1)
+ else:
+ # Success
+ print(" good image similarity found")
+ print("")
+ sys.exit(0)
+
+
+def usage():
+ print("usage: ./compare_two_images.py image1 image2 (show)")
+ print(" with")
+ print(" image1,image2 - path to images (jpg,png) for comparison")
+ print(" (optional) show - set to 1 to show image plots, otherwise only outputs comparison values")
+
+if __name__ == '__main__':
+ # initialize
+ image1 = ''
+ image2 = ''
+ show = False
+
+ # gets arguments
+ if len(sys.argv) < 2 or len(sys.argv) > 4:
+ usage()
+ sys.exit(1)
+ else:
+ image1 = sys.argv[1]
+ image2 = sys.argv[2]
+ if len(sys.argv) == 4:
+ if int(sys.argv[3]) == 1: show = True
+
+ # compares images
+ plot_image_comparison(image1,image2,show)
+
+
diff --git a/utils/convolve_source_timefunction.sh b/utils/scripts/convolve_source_timefunction.sh
similarity index 100%
rename from utils/convolve_source_timefunction.sh
rename to utils/scripts/convolve_source_timefunction.sh
diff --git a/utils/createTomographyFile.py b/utils/scripts/createTomographyFile.py
similarity index 100%
rename from utils/createTomographyFile.py
rename to utils/scripts/createTomographyFile.py
diff --git a/utils/create_main_repo_example_movie.pdf b/utils/scripts/create_main_repo_example_movie_pdf.sh
similarity index 100%
rename from utils/create_main_repo_example_movie.pdf
rename to utils/scripts/create_main_repo_example_movie_pdf.sh
diff --git a/utils/create_sinus_Paul_Cristini_ficsinmod.py b/utils/scripts/create_sinus_Paul_Cristini_ficsinmod.py
old mode 100644
new mode 100755
similarity index 100%
rename from utils/create_sinus_Paul_Cristini_ficsinmod.py
rename to utils/scripts/create_sinus_Paul_Cristini_ficsinmod.py
diff --git a/utils/create_specfem2D_gpu_cuda_kernel_proto.pl b/utils/scripts/create_specfem2D_gpu_cuda_kernel_proto.pl
similarity index 100%
rename from utils/create_specfem2D_gpu_cuda_kernel_proto.pl
rename to utils/scripts/create_specfem2D_gpu_cuda_kernel_proto.pl
diff --git a/utils/create_specfem2D_gpu_cuda_method_stubs.pl b/utils/scripts/create_specfem2D_gpu_cuda_method_stubs.pl
similarity index 100%
rename from utils/create_specfem2D_gpu_cuda_method_stubs.pl
rename to utils/scripts/create_specfem2D_gpu_cuda_method_stubs.pl
diff --git a/EXAMPLES/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py b/utils/scripts/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py
similarity index 100%
rename from EXAMPLES/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py
rename to utils/scripts/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py
diff --git a/utils/replace_use_mpi_with_include_mpif_dot_h.pl b/utils/scripts/replace_use_mpi_with_include_mpif_dot_h.pl
similarity index 100%
rename from utils/replace_use_mpi_with_include_mpif_dot_h.pl
rename to utils/scripts/replace_use_mpi_with_include_mpif_dot_h.pl
diff --git a/utils/script_to_change_all_stop_statements_to_calls_to_a_subroutine_called_stop_the_code.pl b/utils/scripts/script_to_change_all_stop_statements_to_calls_to_a_subroutine_called_stop_the_code.pl
similarity index 100%
rename from utils/script_to_change_all_stop_statements_to_calls_to_a_subroutine_called_stop_the_code.pl
rename to utils/scripts/script_to_change_all_stop_statements_to_calls_to_a_subroutine_called_stop_the_code.pl
diff --git a/utils/su_Seismic_Unix_seismograms_create.py b/utils/scripts/su_Seismic_Unix_seismograms_create.py
old mode 100644
new mode 100755
similarity index 100%
rename from utils/su_Seismic_Unix_seismograms_create.py
rename to utils/scripts/su_Seismic_Unix_seismograms_create.py
diff --git a/utils/update_headers_change_word_f90.pl b/utils/scripts/update_headers_change_word_f90.pl
similarity index 100%
rename from utils/update_headers_change_word_f90.pl
rename to utils/scripts/update_headers_change_word_f90.pl
diff --git a/EXAMPLES/view_all_parameter_files_to_modify_them.bash b/utils/scripts/view_all_parameter_files_to_modify_them.bash
similarity index 100%
rename from EXAMPLES/view_all_parameter_files_to_modify_them.bash
rename to utils/scripts/view_all_parameter_files_to_modify_them.bash
diff --git a/utils/Ra_Cleave_record_pressure_in_addition_to_displacement/email_from_Ra_Cleave_about_multiple_receiver_types_in_SPECFEM2D_to_record_pressure_in_addition_to_displacement_2013.txt b/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/email_from_Ra_Cleave_about_multiple_receiver_types_in_SPECFEM2D_to_record_pressure_in_addition_to_displacement_2013.txt
similarity index 100%
rename from utils/Ra_Cleave_record_pressure_in_addition_to_displacement/email_from_Ra_Cleave_about_multiple_receiver_types_in_SPECFEM2D_to_record_pressure_in_addition_to_displacement_2013.txt
rename to utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/email_from_Ra_Cleave_about_multiple_receiver_types_in_SPECFEM2D_to_record_pressure_in_addition_to_displacement_2013.txt
diff --git a/utils/Ra_Cleave_record_pressure_in_addition_to_displacement/read_parameter_file_Ra_Cleave.F90 b/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/read_parameter_file_Ra_Cleave.F90
similarity index 100%
rename from utils/Ra_Cleave_record_pressure_in_addition_to_displacement/read_parameter_file_Ra_Cleave.F90
rename to utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/read_parameter_file_Ra_Cleave.F90
diff --git a/utils/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90 b/utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90
similarity index 100%
rename from utils/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90
rename to utils/small_utilities/Ra_Cleave_record_pressure_in_addition_to_displacement/save_databases_Ra_Cleave.f90
diff --git a/utils/create_gaussian_profile.f90 b/utils/small_utilities/create_gaussian_profile.f90
similarity index 100%
rename from utils/create_gaussian_profile.f90
rename to utils/small_utilities/create_gaussian_profile.f90
diff --git a/utils/create_pressure_plane_wave_with_Hamming_window.f90 b/utils/small_utilities/create_pressure_plane_wave_with_Hamming_window.f90
similarity index 100%
rename from utils/create_pressure_plane_wave_with_Hamming_window.f90
rename to utils/small_utilities/create_pressure_plane_wave_with_Hamming_window.f90
diff --git a/utils/decimate_mesh.f90 b/utils/small_utilities/decimate_mesh.f90
similarity index 100%
rename from utils/decimate_mesh.f90
rename to utils/small_utilities/decimate_mesh.f90
diff --git a/utils/deriv_ricker_spatial.m b/utils/small_utilities/deriv_ricker_spatial.m
similarity index 100%
rename from utils/deriv_ricker_spatial.m
rename to utils/small_utilities/deriv_ricker_spatial.m
diff --git a/utils/filter.f90 b/utils/small_utilities/filter_input_trace.f90
similarity index 100%
rename from utils/filter.f90
rename to utils/small_utilities/filter_input_trace.f90
diff --git a/utils/program_compute_mean_seismograms.f90 b/utils/small_utilities/program_compute_mean_seismograms.f90
similarity index 100%
rename from utils/program_compute_mean_seismograms.f90
rename to utils/small_utilities/program_compute_mean_seismograms.f90
diff --git a/utils/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries.f90 b/utils/small_utilities/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries.f90
similarity index 100%
rename from utils/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries.f90
rename to utils/small_utilities/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries.f90
diff --git a/utils/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/rotate_mesh_for_absorbing_conditions.f90 b/utils/small_utilities/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/rotate_mesh_for_absorbing_conditions.f90
similarity index 100%
rename from utils/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/rotate_mesh_for_absorbing_conditions.f90
rename to utils/small_utilities/program_rotate_edges_of_external_mesh_for_plane_wave_boundaries/rotate_mesh_for_absorbing_conditions.f90
diff --git a/utils/recombine_all_slices_from_binary_dump.f90 b/utils/small_utilities/recombine_all_slices_from_binary_dump.f90
similarity index 100%
rename from utils/recombine_all_slices_from_binary_dump.f90
rename to utils/small_utilities/recombine_all_slices_from_binary_dump.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/Makefile b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/Makefile
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/Makefile
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/Makefile
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_Earth.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/compute_gradient_of_a_field_with_the_SEM_rectangle.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/constants.h b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/constants.h
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/constants.h
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/constants.h
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_derivation_matrices.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_shape_functions.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_shape_functions.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_shape_functions.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/define_shape_functions.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/gll_library.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/lagrange_poly.f90
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/obj/.gitignore b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/obj/.gitignore
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/obj/.gitignore
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/obj/.gitignore
diff --git a/utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90 b/utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90
similarity index 100%
rename from utils/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90
rename to utils/small_utilities/sample_code_to_compute_SEM_derivatives_on_a_mesh/recompute_jacobian.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/README_HOWTO_use_this_demo_code.txt b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/README_HOWTO_use_this_demo_code.txt
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/README_HOWTO_use_this_demo_code.txt
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/README_HOWTO_use_this_demo_code.txt
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/create_color_image.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/createnum_slow.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_derivation_matrices.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_shape_functions.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_shape_functions.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_shape_functions.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/define_shape_functions.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/gll_library.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/is_in_convex_quadrilateral.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/is_in_convex_quadrilateral.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/is_in_convex_quadrilateral.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/is_in_convex_quadrilateral.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/lagrange_poly.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jaricom.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jaricom.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jaricom.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jaricom.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapimin.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapimin.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapimin.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapimin.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapistd.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapistd.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapistd.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcapistd.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcarith.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcarith.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcarith.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcarith.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccoefct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccoefct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccoefct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccoefct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccolor.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccolor.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccolor.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jccolor.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcdctmgr.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcdctmgr.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcdctmgr.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcdctmgr.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jchuff.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jchuff.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jchuff.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jchuff.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcinit.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcinit.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcinit.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcinit.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmainct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmainct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmainct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmainct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmarker.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmarker.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmarker.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmarker.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmaster.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmaster.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmaster.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcmaster.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcomapi.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcomapi.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcomapi.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcomapi.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jconfig.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jconfig.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jconfig.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jconfig.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcparam.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcparam.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcparam.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcparam.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcprepct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcprepct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcprepct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcprepct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcsample.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcsample.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcsample.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jcsample.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jctrans.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jctrans.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jctrans.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jctrans.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapimin.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapimin.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapimin.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapimin.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapistd.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapistd.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapistd.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdapistd.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdarith.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdarith.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdarith.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdarith.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatadst.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatadst.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatadst.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatadst.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatasrc.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatasrc.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatasrc.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdatasrc.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcoefct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcoefct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcoefct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcoefct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcolor.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcolor.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcolor.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdcolor.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdct.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdct.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdct.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdct.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jddctmgr.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jddctmgr.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jddctmgr.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jddctmgr.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdhuff.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdhuff.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdhuff.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdhuff.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdinput.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdinput.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdinput.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdinput.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmainct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmainct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmainct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmainct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmarker.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmarker.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmarker.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmarker.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmaster.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmaster.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmaster.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmaster.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmerge.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmerge.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmerge.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdmerge.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdpostct.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdpostct.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdpostct.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdpostct.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdsample.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdsample.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdsample.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdsample.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdtrans.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdtrans.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdtrans.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jdtrans.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jerror.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctflt.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctflt.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctflt.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctflt.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctfst.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctfst.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctfst.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctfst.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctint.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctint.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctint.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jfdctint.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctflt.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctflt.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctflt.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctflt.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctfst.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctfst.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctfst.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctfst.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctint.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctint.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctint.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jidctint.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jinclude.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jinclude.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jinclude.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jinclude.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemmgr.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemmgr.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemmgr.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemmgr.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemnobs.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemnobs.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemnobs.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemnobs.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemsys.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemsys.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemsys.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmemsys.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmorecfg.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmorecfg.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmorecfg.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jmorecfg.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpegint.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpegint.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpegint.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpegint.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpeglib.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpeglib.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpeglib.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jpeglib.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant1.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant1.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant1.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant1.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant2.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant2.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant2.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jquant2.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jutils.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jutils.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jutils.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jutils.c
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jversion.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jversion.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jversion.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/jversion.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/libjpeg.txt b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/libjpeg.txt
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/libjpeg.txt
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/libjpeg/libjpeg.txt
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_axisymmetric.csh b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_axisymmetric.csh
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_axisymmetric.csh
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_axisymmetric.csh
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain.csh b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain.csh
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain.csh
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain.csh
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain_with_ITZ_for_Ting.csh b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain_with_ITZ_for_Ting.csh
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain_with_ITZ_for_Ting.csh
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/make_Fortran_2D_plane_strain_with_ITZ_for_Ting.csh
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_ITZ_for_Ting.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plot_post_with_modif_KH.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plotall.gnu b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plotall.gnu
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/plotall.gnu
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/plotall.gnu
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/precision.h b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/precision.h
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/precision.h
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/precision.h
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/prepare_color_image.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/prepare_color_image.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/prepare_color_image.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/prepare_color_image.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/recompute_jacobian.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_axisymmetric.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_ITZ_for_Ting.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/specfem2D_plane_strain_with_modif_KH.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_color_image_snaphot.f90 b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_color_image_snaphot.f90
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_color_image_snaphot.f90
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_color_image_snaphot.f90
diff --git a/utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_jpeg_image.c b/utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_jpeg_image.c
similarity index 100%
rename from utils/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_jpeg_image.c
rename to utils/small_utilities/small_SEM_solver_in_Fortran_without_MPI_to_learn/write_jpeg_image.c