[cig-commits] [commit] devel: added a test to check that the CPML flags read from an external file make sense, and call a stop statement otherwise. Also improved a few print statements and a few comments. (def0803)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Tue Feb 25 19:11:03 PST 2014


Repository : ssh://geoshell/specfem2d

On branch  : devel
Link       : https://github.com/geodynamics/specfem2d/compare/cf40549f4c1d258bf2cfb1af1cce7f53f4661e58...92314517135e003089b35c0b323b8b78becb0e96

>---------------------------------------------------------------

commit def0803be4701958fdd3f8e14237487a05465d30
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date:   Wed Feb 26 04:07:52 2014 +0100

    added a test to check that the CPML flags read from an external file make sense, and call a stop statement otherwise.
    Also improved a few print statements and a few comments.


>---------------------------------------------------------------

def0803be4701958fdd3f8e14237487a05465d30
 ...nvention_for_CPML_flags_in_SPECFEM2D_v7.0.0.f90 |  29 +++++++++++++++++++++
 .../extract_thermocline.f90                        |   0
 .../plot_thermocline.gnu                           |   0
 .../ssp_example1.png                               | Bin
 .../thermocline.dat                                |   0
 .../thermocline_final.gif                          | Bin
 .../thermocline_original.gif                       | Bin
 src/meshfem2D/part_unstruct.F90                    |   6 ++++-
 src/meshfem2D/read_parameter_file.F90              |   3 +--
 src/specfem2D/compute_coupling_acoustic_el.f90     |   2 +-
 src/specfem2D/read_databases.F90                   |   2 +-
 src/specfem2D/specfem2D.F90                        |   2 +-
 12 files changed, 38 insertions(+), 6 deletions(-)

diff --git a/UTILS/old_convention_for_CPML_flags_in_SPECFEM2D_v7.0.0.f90 b/UTILS/old_convention_for_CPML_flags_in_SPECFEM2D_v7.0.0.f90
new file mode 100644
index 0000000..2046bfc
--- /dev/null
+++ b/UTILS/old_convention_for_CPML_flags_in_SPECFEM2D_v7.0.0.f90
@@ -0,0 +1,29 @@
+
+       if(region_CPML(ispec)==1)then
+! element is in the left cpml layer
+                                              :: should all become CPML_X_ONLY = 1 in the new numbering
+       else if(region_CPML(ispec)==2)then
+! element is in the right cpml layer
+
+======================================================================
+
+       else if(region_CPML(ispec)==4)then
+! element is in the top cpml layer
+                                              :: should all become CPML_Z_ONLY = 2 in the new numbering
+       else if(region_CPML(ispec)==8)then
+! element is in the bottom cpml layer
+
+======================================================================
+
+       else if(region_CPML(ispec)==5)then
+! element is in the left-top cpml corner
+
+       else if(region_CPML(ispec)==6)then
+! element is in the right-top cpml corner
+                                              :: should all become CPML_XZ_ONLY = 3 in the new numbering
+       else if(region_CPML(ispec)==9)then
+! element is in the left-bottom cpml corner
+
+       else if(region_CPML(ispec)==10)then
+! element is in the right-bottom cpml corner
+
diff --git a/UTILS/thermocline_abel_balanche/extract_thermocline.f90 b/UTILS/thermocline/extract_thermocline.f90
similarity index 100%
rename from UTILS/thermocline_abel_balanche/extract_thermocline.f90
rename to UTILS/thermocline/extract_thermocline.f90
diff --git a/UTILS/thermocline_abel_balanche/plot_thermocline.gnu b/UTILS/thermocline/plot_thermocline.gnu
similarity index 100%
rename from UTILS/thermocline_abel_balanche/plot_thermocline.gnu
rename to UTILS/thermocline/plot_thermocline.gnu
diff --git a/UTILS/thermocline_abel_balanche/ssp_example1.png b/UTILS/thermocline/ssp_example1.png
similarity index 100%
rename from UTILS/thermocline_abel_balanche/ssp_example1.png
rename to UTILS/thermocline/ssp_example1.png
diff --git a/UTILS/thermocline_abel_balanche/thermocline.dat b/UTILS/thermocline/thermocline.dat
similarity index 100%
rename from UTILS/thermocline_abel_balanche/thermocline.dat
rename to UTILS/thermocline/thermocline.dat
diff --git a/UTILS/thermocline_abel_balanche/thermocline_final.gif b/UTILS/thermocline/thermocline_final.gif
similarity index 100%
rename from UTILS/thermocline_abel_balanche/thermocline_final.gif
rename to UTILS/thermocline/thermocline_final.gif
diff --git a/UTILS/thermocline_abel_balanche/thermocline_original.gif b/UTILS/thermocline/thermocline_original.gif
similarity index 100%
rename from UTILS/thermocline_abel_balanche/thermocline_original.gif
rename to UTILS/thermocline/thermocline_original.gif
diff --git a/src/meshfem2D/part_unstruct.F90 b/src/meshfem2D/part_unstruct.F90
index d0045ba..f3a94cb 100644
--- a/src/meshfem2D/part_unstruct.F90
+++ b/src/meshfem2D/part_unstruct.F90
@@ -243,12 +243,14 @@ contains
   end subroutine read_mat
 
   !-----------------------------------------------
-  ! Read the position of pml element storing it in array 'region_pml_external_mesh'
+  ! Read the PML elements, storing them in array 'region_pml_external_mesh'
   !-----------------------------------------------
   subroutine read_pml_element(filename, region_pml_external_mesh, nspec_cpml)
 
   implicit none
 
+  include "constants.h"
+
   character(len=256), intent(in)  :: filename
   integer, dimension(1:nelmnts), intent(out)  :: region_pml_external_mesh
   integer, intent(out)  :: nspec_cpml
@@ -277,6 +279,8 @@ contains
 #else
      read(992,*) ispec, pml_flag
 #endif
+     if(pml_flag /= CPML_X_ONLY .and. pml_flag /= CPML_Z_ONLY .and. pml_flag /= CPML_XZ_ONLY) &
+       stop 'error: incorrect CPML element flag found, should be CPML_X_ONLY or CPML_Z_ONLY or CPML_XZ_ONLY only'
      region_pml_external_mesh(ispec) = pml_flag
   enddo
 
diff --git a/src/meshfem2D/read_parameter_file.F90 b/src/meshfem2D/read_parameter_file.F90
index d9f36ce..8014982 100644
--- a/src/meshfem2D/read_parameter_file.F90
+++ b/src/meshfem2D/read_parameter_file.F90
@@ -58,8 +58,7 @@ module parameter_file
   logical :: SAVE_FORWARD,read_external_mesh
 
   character(len=256) :: mesh_file, nodes_coords_file, materials_file, &
-                        free_surface_file, absorbing_surface_file,&
-                        CPML_element_file
+                        free_surface_file, absorbing_surface_file, CPML_element_file
   character(len=256)  :: tangential_detection_curve_file
 
   ! variables used for partitioning
diff --git a/src/specfem2D/compute_coupling_acoustic_el.f90 b/src/specfem2D/compute_coupling_acoustic_el.f90
index edfe976..0be15f5 100644
--- a/src/specfem2D/compute_coupling_acoustic_el.f90
+++ b/src/specfem2D/compute_coupling_acoustic_el.f90
@@ -126,7 +126,7 @@
                   displ_x = A8 * displ_elastic(1,iglob) + A9 * rmemory_fsb_displ_elastic(1,1,i,j,inum)
                   displ_z = A8 * displ_elastic(3,iglob) + A9 * rmemory_fsb_displ_elastic(1,3,i,j,inum)
                else
-                  stop 'PML do not support the fluid-solid boundary not inside CPML_X_ONLY'
+                  stop 'PML currently does not support a fluid-solid boundary located in a PML that is not CPML_X_ONLY'
                endif
              else
                displ_x = displ_elastic(1,iglob)
diff --git a/src/specfem2D/read_databases.F90 b/src/specfem2D/read_databases.F90
index c69f953..6fe875e 100644
--- a/src/specfem2D/read_databases.F90
+++ b/src/specfem2D/read_databases.F90
@@ -127,7 +127,7 @@
   double precision :: PERIODIC_HORIZ_DIST
 
 ! for CPML_element_file
-   logical :: read_external_mesh
+  logical :: read_external_mesh
 
   ! local parameters
   integer :: ier
diff --git a/src/specfem2D/specfem2D.F90 b/src/specfem2D/specfem2D.F90
index 0b1e2f4..b2b5035 100644
--- a/src/specfem2D/specfem2D.F90
+++ b/src/specfem2D/specfem2D.F90
@@ -571,7 +571,7 @@
 
   double precision :: ROTATE_PML_ANGLE
 
-!! DK DK for CPML_element_file
+! for CPML_element_file
   logical :: read_external_mesh
 
   double precision :: cutsnaps,sizemax_arrows,anglerec,xirec,gammarec



More information about the CIG-COMMITS mailing list