[cig-commits] [commit] devel, master: added my scripts to clean all the Par_files. set Cuthill-McKee sorting to .false. by default. (dce6ce3)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Wed Jun 18 15:21:02 PDT 2014
Repository : https://github.com/geodynamics/specfem2d
On branches: devel,master
Link : https://github.com/geodynamics/specfem2d/compare/fc67e6fd7ad890705b2b72b4b3c509accb22249e...e9ca46c40131588d89d7b0883250bc6584ce6b4c
>---------------------------------------------------------------
commit dce6ce35243b431e66b4896d36c06f46695b14f2
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date: Mon Mar 19 01:25:41 2012 +0000
added my scripts to clean all the Par_files.
set Cuthill-McKee sorting to .false. by default.
>---------------------------------------------------------------
dce6ce35243b431e66b4896d36c06f46695b14f2
.../Par_file_Abel_Balanche_bathy_source_solid | 2 +-
Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in | 2 +-
Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in | 2 +-
INDUSTRIAL_FORMAT/Par_file | 2 +-
M2_UPPA/Par_file_M2_UPPA | 2 +-
Rayleigh_wave_no_crack/Par_file_Rayleigh_2D | 2 +-
Tape2007/Par_file_Tape2007_132rec_checker | 2 +-
Tape2007/Par_file_Tape2007_onerec | 2 +-
Tape2007_kernel/Par_file_Tape2007_onerec | 2 +-
Tromp2005/Par_file_Tromp2005 | 2 +-
Tromp2005/Par_file_Tromp2005_s100 | 2 +-
Tromp2005_kernel/Par_file_Tromp2005 | 2 +-
acoustic_poroelastic/Par_file_acoustic_poroelastic | 2 +-
attenuation/Par_file_attenuation_2D | 2 +-
canyon/Par_file_canyon | 2 +-
change_all_2D_Par_files.csh | 21 +++
clean_a_Par_file.py | 35 ++++
.../fluid_solid_external_mesh/Par_file_fluid_solid | 2 +-
.../Par_file_fluid_solid | 2 +-
.../Par_file_fluid_solid | 2 +-
init_plane/Par_file_Slave | 2 +-
init_plane/Par_file_Slave_for | 2 +-
init_plane/Par_file_Slave_kernel | 2 +-
noise_layered/model_0/Par_file_fair | 2 +-
noise_layered/model_0/Par_file_good | 2 +-
noise_layered/model_1/Par_file_best | 2 +-
noise_layered/model_1/Par_file_fair | 2 +-
noise_layered/model_1/Par_file_good | 2 +-
noise_layered/model_2/Par_file_fair | 2 +-
noise_layered/model_2/Par_file_good | 2 +-
noise_uniform/Par_file_noise_1 | 2 +-
noise_uniform/Par_file_noise_2 | 2 +-
noise_uniform/Par_file_noise_3 | 2 +-
...e_their_format_when_new_parameters_are_added.py | 191 +++++++++++++++++++++
semi_infinite_homo/Par_file_elastic_2D | 2 +-
35 files changed, 279 insertions(+), 32 deletions(-)
diff --git a/Abel_Brest/Par_file_Abel_Balanche_bathy_source_solid b/Abel_Brest/Par_file_Abel_Balanche_bathy_source_solid
index 42fb253..8af3730 100644
--- a/Abel_Brest/Par_file_Abel_Balanche_bathy_source_solid
+++ b/Abel_Brest/Par_file_Abel_Balanche_bathy_source_solid
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in b/Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in
index 5fce1ff..98c55e9 100644
--- a/Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in
+++ b/Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 4 # number of processes
partitioning_method = 3 # ascending order = 1, Scotch = 3
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
diff --git a/Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in b/Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in
index 6bc8363..b88dedb 100644
--- a/Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in
+++ b/Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # ascending order = 1, Scotch = 3
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
diff --git a/INDUSTRIAL_FORMAT/Par_file b/INDUSTRIAL_FORMAT/Par_file
index abeb693..059de1d 100644
--- a/INDUSTRIAL_FORMAT/Par_file
+++ b/INDUSTRIAL_FORMAT/Par_file
@@ -9,7 +9,7 @@ SAVE_FORWARD = .true. # save the last frame, needed for adjo
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/M2_UPPA/Par_file_M2_UPPA b/M2_UPPA/Par_file_M2_UPPA
index c594fe8..3065cf7 100644
--- a/M2_UPPA/Par_file_M2_UPPA
+++ b/M2_UPPA/Par_file_M2_UPPA
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Rayleigh_wave_no_crack/Par_file_Rayleigh_2D b/Rayleigh_wave_no_crack/Par_file_Rayleigh_2D
index 02ac95d..a68e20c 100644
--- a/Rayleigh_wave_no_crack/Par_file_Rayleigh_2D
+++ b/Rayleigh_wave_no_crack/Par_file_Rayleigh_2D
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .true. # use a plane wave as source or not
diff --git a/Tape2007/Par_file_Tape2007_132rec_checker b/Tape2007/Par_file_Tape2007_132rec_checker
index 241cf20..7887b4d 100644
--- a/Tape2007/Par_file_Tape2007_132rec_checker
+++ b/Tape2007/Par_file_Tape2007_132rec_checker
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Tape2007/Par_file_Tape2007_onerec b/Tape2007/Par_file_Tape2007_onerec
index 0be02f0..6526740 100644
--- a/Tape2007/Par_file_Tape2007_onerec
+++ b/Tape2007/Par_file_Tape2007_onerec
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Tape2007_kernel/Par_file_Tape2007_onerec b/Tape2007_kernel/Par_file_Tape2007_onerec
index 446578f..9c9f962 100644
--- a/Tape2007_kernel/Par_file_Tape2007_onerec
+++ b/Tape2007_kernel/Par_file_Tape2007_onerec
@@ -9,7 +9,7 @@ SAVE_FORWARD = .true. # save the last frame, needed for adjo
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Tromp2005/Par_file_Tromp2005 b/Tromp2005/Par_file_Tromp2005
index 08adcea..e71fbae 100644
--- a/Tromp2005/Par_file_Tromp2005
+++ b/Tromp2005/Par_file_Tromp2005
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Tromp2005/Par_file_Tromp2005_s100 b/Tromp2005/Par_file_Tromp2005_s100
index c5bb107..83cdb55 100644
--- a/Tromp2005/Par_file_Tromp2005_s100
+++ b/Tromp2005/Par_file_Tromp2005_s100
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/Tromp2005_kernel/Par_file_Tromp2005 b/Tromp2005_kernel/Par_file_Tromp2005
index 39308e2..5e1b3ab 100644
--- a/Tromp2005_kernel/Par_file_Tromp2005
+++ b/Tromp2005_kernel/Par_file_Tromp2005
@@ -9,7 +9,7 @@ SAVE_FORWARD = .true. # save the last frame, needed for adjo
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/acoustic_poroelastic/Par_file_acoustic_poroelastic b/acoustic_poroelastic/Par_file_acoustic_poroelastic
index 9a45f50..5567df1 100644
--- a/acoustic_poroelastic/Par_file_acoustic_poroelastic
+++ b/acoustic_poroelastic/Par_file_acoustic_poroelastic
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/attenuation/Par_file_attenuation_2D b/attenuation/Par_file_attenuation_2D
index 0ad3adb..dad2450 100644
--- a/attenuation/Par_file_attenuation_2D
+++ b/attenuation/Par_file_attenuation_2D
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/canyon/Par_file_canyon b/canyon/Par_file_canyon
index f387347..33426f5 100644
--- a/canyon/Par_file_canyon
+++ b/canyon/Par_file_canyon
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .true. # use a plane wave as source or not
diff --git a/change_all_2D_Par_files.csh b/change_all_2D_Par_files.csh
new file mode 100755
index 0000000..0c69a42
--- /dev/null
+++ b/change_all_2D_Par_files.csh
@@ -0,0 +1,21 @@
+#!/bin/csh
+
+# I get the list of files using
+# alias list_all_2D_Par_files_to_change " ls DATA/Par_file EXAMPLES/*/Par_fi* EXAMPLES/*/*/Par_fi* "
+#
+# and then I manually remove EXAMPLES/unused_older_examples_DATA_to_sort , which is by definition in an obsolete/incompatible format
+#
+
+foreach file ( DATA/Par_file EXAMPLES/Abel_Brest/Par_file_Abel_Balanche_bathy_source_solid EXAMPLES/acoustic_poroelastic/Par_file_acoustic_poroelastic EXAMPLES/attenuation/Par_file_attenuation_2D EXAMPLES/canyon/Par_file_canyon EXAMPLES/fluid_solid/fluid_solid_external_mesh/Par_file_fluid_solid EXAMPLES/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/Par_file_fluid_solid EXAMPLES/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/Par_file_fluid_solid EXAMPLES/Gmsh_example_MPI/Par_file_Gmsh_SqrCircles.in EXAMPLES/Gmsh_example_serial/Par_file_Gmsh_SqrCircles.in EXAMPLES/INDUSTRIAL_FORMAT/Par_file EXAMPLES/init_plane/Par_file_Slave EXAMPLES/init_plane/Par_file_Slave_for EXAMPLES/init_plane/Par_file_Slave_kernel EXAMPLES/M2_UPPA/Par_file_M2_UPPA EXAMPLES/noise_layered/model_0/Par_file_fair EXAMPLES/noise_layered/model_0/Par_file_good EXAMPLES/noise_layered/model_1/Par_file_best EXAMPLES/noise_layered/model_1/Par_file_fair EXAMPLES/noise_layered/model_1/Par_file_good
EXAMPLES/noise_layered/model_2/Par_file_fair EXAMPLES/noise_layered/model_2/Par_file_good EXAMPLES/noise_uniform/Par_file_noise_1 EXAMPLES/noise_uniform/Par_file_noise_2 EXAMPLES/noise_uniform/Par_file_noise_3 EXAMPLES/Rayleigh_wave_no_crack/Par_file_Rayleigh_2D EXAMPLES/Rayleigh_wave_with_crack/Par_file_Rayleigh_2D EXAMPLES/semi_infinite_homo/Par_file_elastic_2D EXAMPLES/Tape2007_kernel/Par_file_Tape2007_onerec EXAMPLES/Tape2007/Par_file_Tape2007_132rec_checker EXAMPLES/Tape2007/Par_file_Tape2007_onerec EXAMPLES/Tromp2005_kernel/Par_file_Tromp2005 EXAMPLES/Tromp2005/Par_file_Tromp2005 EXAMPLES/Tromp2005/Par_file_Tromp2005_s100 )
+
+set newfile = "../"$file
+
+# DK DK leave the white spaces, in order to have the right alignment with other variables
+sed -e '1,$s/PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization\/permutation for mesh numbering/PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization\/permutation for mesh numbering (can be very costly and not very useful)/g' < $newfile > __________temp_27_zzzyyyyxxxx__________
+
+clean_a_Par_file.py __________temp_27_zzzyyyyxxxx__________ $file
+
+mv __________temp_27_zzzyyyyxxxx__________ $newfile
+
+end
+
diff --git a/clean_a_Par_file.py b/clean_a_Par_file.py
new file mode 100755
index 0000000..b3ed2c4
--- /dev/null
+++ b/clean_a_Par_file.py
@@ -0,0 +1,35 @@
+#!/usr/bin/perl
+
+#
+# Script to clean a given file
+#
+# Author : Dimitri Komatitsch, EPS - Harvard University, May 1998
+#
+
+ $name = $ARGV[0];
+ $nametoprint = $ARGV[1];
+
+# change tabs to white spaces
+ system("expand -6 < $name > _____testzzzXXXyyy_____");
+ $f90name = $name;
+ print STDOUT "Cleaning file $nametoprint ...\n";
+
+ open(FILEF77,"<_____testzzzXXXyyy_____");
+ open(FILEF90,">$f90name");
+
+# read the input file
+ while($line = <FILEF77>) {
+
+# suppress trailing white spaces and carriage return
+ $line =~ s/\s*$//;
+
+# write the output line
+ print FILEF90 "$line\n";
+
+ }
+
+ close(FILEF77);
+ close(FILEF90);
+
+ system("rm -f _____testzzzXXXyyy_____");
+
diff --git a/fluid_solid/fluid_solid_external_mesh/Par_file_fluid_solid b/fluid_solid/fluid_solid_external_mesh/Par_file_fluid_solid
index da1545e..eedd0cb 100644
--- a/fluid_solid/fluid_solid_external_mesh/Par_file_fluid_solid
+++ b/fluid_solid/fluid_solid_external_mesh/Par_file_fluid_solid
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/Par_file_fluid_solid b/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/Par_file_fluid_solid
index 6f8f3b5..b0a3889 100644
--- a/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/Par_file_fluid_solid
+++ b/fluid_solid/from_2000_Geophysics_paper_flat_ocean_bottom/Par_file_fluid_solid
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/Par_file_fluid_solid b/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/Par_file_fluid_solid
index 11077e6..08866d9 100644
--- a/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/Par_file_fluid_solid
+++ b/fluid_solid/from_2000_Geophysics_paper_sinusoidal_ocean_bottom/Par_file_fluid_solid
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/init_plane/Par_file_Slave b/init_plane/Par_file_Slave
index ca1fafc..f60abd9 100644
--- a/init_plane/Par_file_Slave
+++ b/init_plane/Par_file_Slave
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .true. # use a plane wave as source or not
diff --git a/init_plane/Par_file_Slave_for b/init_plane/Par_file_Slave_for
index 4b4a8dd..1c7125f 100644
--- a/init_plane/Par_file_Slave_for
+++ b/init_plane/Par_file_Slave_for
@@ -9,7 +9,7 @@ SAVE_FORWARD = .true. # save the last frame, needed for adjo
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .true. # use a plane wave as source or not
diff --git a/init_plane/Par_file_Slave_kernel b/init_plane/Par_file_Slave_kernel
index f1ee20f..464dae2 100644
--- a/init_plane/Par_file_Slave_kernel
+++ b/init_plane/Par_file_Slave_kernel
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_0/Par_file_fair b/noise_layered/model_0/Par_file_fair
index be2bf40..ac2c3d1 100644
--- a/noise_layered/model_0/Par_file_fair
+++ b/noise_layered/model_0/Par_file_fair
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_0/Par_file_good b/noise_layered/model_0/Par_file_good
index 34e9151..9e7042d 100644
--- a/noise_layered/model_0/Par_file_good
+++ b/noise_layered/model_0/Par_file_good
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_1/Par_file_best b/noise_layered/model_1/Par_file_best
index 59d8fc1..f3a08cb 100644
--- a/noise_layered/model_1/Par_file_best
+++ b/noise_layered/model_1/Par_file_best
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_1/Par_file_fair b/noise_layered/model_1/Par_file_fair
index 4c02374..ebae388 100644
--- a/noise_layered/model_1/Par_file_fair
+++ b/noise_layered/model_1/Par_file_fair
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_1/Par_file_good b/noise_layered/model_1/Par_file_good
index 3bb7cbb..ce3f70c 100644
--- a/noise_layered/model_1/Par_file_good
+++ b/noise_layered/model_1/Par_file_good
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_2/Par_file_fair b/noise_layered/model_2/Par_file_fair
index 2e020b6..d459a65 100644
--- a/noise_layered/model_2/Par_file_fair
+++ b/noise_layered/model_2/Par_file_fair
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_layered/model_2/Par_file_good b/noise_layered/model_2/Par_file_good
index 05f4538..61259f1 100644
--- a/noise_layered/model_2/Par_file_good
+++ b/noise_layered/model_2/Par_file_good
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_uniform/Par_file_noise_1 b/noise_uniform/Par_file_noise_1
index b1fc985..318e88c 100644
--- a/noise_uniform/Par_file_noise_1
+++ b/noise_uniform/Par_file_noise_1
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_uniform/Par_file_noise_2 b/noise_uniform/Par_file_noise_2
index 06fda53..32c5163 100644
--- a/noise_uniform/Par_file_noise_2
+++ b/noise_uniform/Par_file_noise_2
@@ -9,7 +9,7 @@ SAVE_FORWARD = .true.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/noise_uniform/Par_file_noise_3 b/noise_uniform/Par_file_noise_3
index 40b37f0..8ea307e 100644
--- a/noise_uniform/Par_file_noise_3
+++ b/noise_uniform/Par_file_noise_3
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false.
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 9 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
diff --git a/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py b/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py
new file mode 100755
index 0000000..ab40450
--- /dev/null
+++ b/process_DATA_Par_files_to_update_their_format_when_new_parameters_are_added.py
@@ -0,0 +1,191 @@
+# -*- coding: utf-8 -*-
+"""
+Created on Tue Nov 15 09:00:00 2011
+Updated on Fri Jan 13 2012
+
+Processing of Par_file to update them to new format
+
+Usage : "python PathTo/EXAMPLES/ProcessParFileParametersToNewRelease.py"
+This will process all Par_file starting from current directory
+
+ at author: Cristini Paul, Laboratoire de Mecanique et d'Acoustique, CNRS, Marseille, France
+"""
+import os, string, sys
+from os import listdir, walk
+from shutil import copy, move
+from os.path import exists
+#------------------------------------------------------------------------------
+def LoadLig(Fichier):
+ f = open(Fichier,'r')
+ ligs= f.readlines()
+ f.close()
+ return ligs
+#------------------------------------------------------------------------------
+def mylister(currdir):
+ for file in os.listdir(currdir):
+ path=os.path.join(currdir, file)
+ if not os.path.isdir(path):
+ #print path
+ Fichiers.append(path)
+ else:
+ mylister(path)
+#------------------------------------------------------------------------------
+def ProcessParfile_r19201(fic):
+ # Open the file and get all lines from Par_file
+ ligs= LoadLig(fic)
+ # Test pour voir si le traitement a déjà été fait
+ for lig in ligs:
+ if 'ADD_PERIODIC_CONDITIONS' in lig:
+ print '----> '+fic+' already processed to r19201'
+ return
+ # New additions to the Par_file
+ a1='PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)\n'
+ a2='USER_T0 = 0.0d0 # use this t0 as earliest starting time rather than the automatically calculated one\n'
+ a3='SU_FORMAT = .false. # output seismograms in Seismic Unix format (adjoint traces will be read in the same format)\n'
+ a4='factor_subsample_image = 1 # factor to subsample color images output by the code (useful for very large models)\n'+ \
+ 'POWER_DISPLAY_COLOR = 0.30d0 # non linear display to enhance small amplitudes in color images\n'+ \
+ 'DRAW_WATER_CONSTANT_BLUE_IN_JPG = .true. # display acoustic layers as constant blue in JPEG images, because they likely correspond to water\n'
+ a5='US_LETTER = .false. # US letter paper or European A4\n'+ \
+ 'USE_SNAPSHOT_NUMBER_IN_FILENAME = .false. # use snapshot number in the file name of JPEG color snapshots instead of the time step\n'
+ a6='\n# for horizontal periodic conditions: detect common points between left and right edges\n'+ \
+ 'ADD_PERIODIC_CONDITIONS = .false.\n\n'+ \
+ '# horizontal periodicity distance for periodic conditions\n'+ \
+ 'PERIODIC_horiz_dist = 0.3597d0\n\n'+ \
+ '# grid point detection tolerance for periodic conditions\n'+ \
+ 'PERIODIC_DETECT_TOL = 3.3334d-6\n'
+ #--------------------------------------------------------------------------
+ # Ajout des parametres supplementaires
+ #
+ for ilg, lig in enumerate(ligs):
+ if lig.startswith('partitioning'):
+ ligs.insert(ilg+1,a1)
+
+ if lig.startswith('deltat'):
+ ligs.insert(ilg+1,a2)
+
+ if lig.startswith('rec_normal'):
+ ligs.insert(ilg+1,a3)
+
+ if lig.startswith('subsamp'):
+ ligs[ilg]=string.replace(ligs[ilg],'subsamp ','subsamp_postscript',1)
+ ligs.insert(ilg+1,a4)
+
+ if lig.startswith('sizemax'):
+ ligs.insert(ilg+1,a5)
+
+ if lig.startswith('absorbing_conditions'):
+ ligs.insert(ilg+1,a6)
+ #
+ move(fic,fic+'.before_update_to_r19201')
+ fm = open(fic,'w')
+ fm.writelines(ligs)
+ fm.close()
+ #
+ print 'xxxxx------> '+fic+' processed to r19201'
+ return
+#------------------------------------------------------------------------------
+def ProcessParfile_r19340(fic):
+ # Open the file and get all lines from Par_file
+ ligs= LoadLig(fic)
+ # Teste si le traitement a déjà été fait
+ for lig in ligs:
+ if 'nreceiversets' in lig:
+ print '----> '+fic+' already processed to r19340'
+ return
+ #
+ # Ajout des parametres supplementaires
+ #
+ for ilg, lig in enumerate(ligs):
+ if lig.startswith('nreceiverlines'):
+ ligs[ilg]=ligs[ilg].replace('lines','sets ')
+ #
+ move(fic,fic+'.before_update_to_r19340')
+ #
+ fm = open(fic,'w')
+ fm.writelines(ligs)
+ fm.close()
+ #
+ print 'xxxxx------> '+fic+' processed to r19340'
+ return
+#------------------------------------------------------------------------------
+def ProcessParfile_r19346(fic):
+ # Open the file and get all lines from Par_file
+ ligs= LoadLig(fic)
+ # Teste si le traitement a déjà été fait
+ for lig in ligs:
+ if 'ATTENUATION_PORO_FLUID_PART' in lig:
+ print '----> '+fic+' already processed to r19346'
+ return
+ #--------------------------------------------------------------------------
+ # Ajout des parametres supplementaires
+ #
+ for ilg, lig in enumerate(ligs):
+ if lig.startswith('TURN_ATTENUATION_ON'):
+ ligs[ilg]=ligs[ilg].replace('TURN_ATTENUATION_ON ', \
+ 'ATTENUATION_VISCOELASTIC_SOLID')
+ if lig.startswith('TURN_VISCATTENUATION_ON'):
+ ligs[ilg]=ligs[ilg].replace('TURN_VISCATTENUATION_ON ', \
+ 'ATTENUATION_PORO_FLUID_PART')
+ #
+ move(fic,fic+'.before_update_to_r19346')
+ #
+ fm = open(fic,'w')
+ fm.writelines(ligs)
+ fm.close()
+ #
+ print 'xxxxx------> '+fic+' processed to r19346'
+ return
+#------------------------------------------------------------------------------
+def ProcessParfile_r19xxx(fic):
+ # Open the file and get all lines from Par_file
+ ligs= LoadLig(fic)
+ # Teste si le traitement a déjà été fait
+ for lig in ligs:
+ if 'time_stepping_scheme' in lig:
+ print '----> '+fic+' already processed to r19xxx'
+ return
+ #
+ a1='time_stepping_scheme = 1 # 1 = Newmark (2nd order), \
+ 2 = LDDRK4-6 (4th-order 6-stage low storage Runge-Kutta), \
+ 3 = classical 4th-order 4-stage Runge-Kutta\n'
+
+ #--------------------------------------------------------------------------
+ # Ajout des parametres supplementaires
+ #
+ for ilg, lig in enumerate(ligs):
+ if lig.startswith('USER_T0'):
+ ligs.insert(ilg+1,a1)
+ #
+ move(fic,fic+'.before_update_to_r19xxx')
+ #
+ fm = open(fic,'w')
+ fm.writelines(ligs)
+ fm.close()
+ #
+ print 'xxxxx------> '+fic+' processed to r19xxx'
+ return
+#------------------------------------------------------------------------------
+if __name__=='__main__':
+ ## Liste de tous les fichiers à partir du répertoire courant
+ Fichiers=[]
+ mylister('.')
+ #
+ print '~'*80
+ Ct_Par_file=0
+ for fic in Fichiers:
+ repert, ficname = os.path.split(fic)
+ if not( ('.svn' in repert) or ('unused' in repert) or \
+ '.before_update_to_' in ficname):
+ if ficname.startswith('Par_file'):
+ print 'Analysis of file : '+fic
+ if not (ficname.endswith('~')):
+ Ct_Par_file+=1
+ ProcessParfile_r19201(fic)
+ ProcessParfile_r19340(fic)
+ ProcessParfile_r19346(fic)
+ ProcessParfile_r19xxx(fic)
+ print '~'*80
+ #
+ print 'Number of Par_file analysed : ', Ct_Par_file
+ print 'END OF Par_file PROCESSING'
+
diff --git a/semi_infinite_homo/Par_file_elastic_2D b/semi_infinite_homo/Par_file_elastic_2D
index cd837cb..016ffd8 100644
--- a/semi_infinite_homo/Par_file_elastic_2D
+++ b/semi_infinite_homo/Par_file_elastic_2D
@@ -9,7 +9,7 @@ SAVE_FORWARD = .false. # save the last frame, needed for adj
# parameters concerning partitioning
nproc = 1 # number of processes
partitioning_method = 3 # SCOTCH = 3, ascending order (very bad idea) = 1
-PERFORM_CUTHILL_MCKEE = .true. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering
+PERFORM_CUTHILL_MCKEE = .false. # perform inverse Cuthill-McKee (1969) optimization/permutation for mesh numbering (can be very costly and not very useful)
ngnod = 4 # number of control nodes per element (4 or 9)
initialfield = .false. # use a plane wave as source or not
More information about the CIG-COMMITS
mailing list