[cig-commits] r21600 - seismo/2D/SPECFEM2D/trunk/src/specfem2D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Thu Mar 21 11:19:54 PDT 2013


Author: dkomati1
Date: 2013-03-21 11:19:53 -0700 (Thu, 21 Mar 2013)
New Revision: 21600

Modified:
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/pml_init.F90
   seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.F90
Log:
fixed a problem in the MPI_REDUCE I implemented yesterday, in the case of MPI slices that contain no absorbing element at all


Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/pml_init.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/pml_init.F90	2013-03-21 16:42:21 UTC (rev 21599)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/pml_init.F90	2013-03-21 18:19:53 UTC (rev 21600)
@@ -82,10 +82,11 @@
   integer :: ier
 #endif
 
+  nspec_PML = 0
+
   ! detection of PML elements
 
   if(.not. read_external_mesh) then
-  nspec_PML = 0
 
      ! ibound is the side we are looking (bottom, right, top or left)
      do ibound=1,4
@@ -184,15 +185,8 @@
 
      endif !end of SIMULATION_TYPE == 3
 
-#ifdef USE_MPI
-     call MPI_REDUCE(nspec_PML, nspec_PML_tot, 1, MPI_INTEGER, MPI_SUM, 0, MPI_COMM_WORLD, ier)
-#else
-     nspec_PML_tot = nspec_PML
-#endif
-     if(myrank == 0) write(IOUT,*) "Number of PML spectral elements on side ",ibound,":",nspec_PML_tot
+     enddo ! end loop on the four boundaries
 
-     enddo ! end loop on the 4 boundaries
-
  if(SIMULATION_TYPE == 3 .or. (SIMULATION_TYPE == 1 .and. SAVE_FORWARD))then
        nglob_interface = 0
        do ispec = 1,nspec
@@ -315,13 +309,6 @@
         end if
      enddo
 
-#ifdef USE_MPI
-     call MPI_REDUCE(nspec_PML, nspec_PML_tot, 1, MPI_INTEGER, MPI_SUM, 0, MPI_COMM_WORLD, ier)
-#else
-     nspec_PML_tot = nspec_PML
-#endif
-     if(myrank == 0) write(IOUT,*) "Total number of PML spectral elements :", nspec_PML_tot
-
      endif
 
   if(read_external_mesh) then
@@ -337,15 +324,15 @@
     endif
   enddo
 
+  endif
+
 #ifdef USE_MPI
-     call MPI_REDUCE(nspec_PML, nspec_PML_tot, 1, MPI_INTEGER, MPI_SUM, 0, MPI_COMM_WORLD, ier)
+  call MPI_REDUCE(nspec_PML, nspec_PML_tot, 1, MPI_INTEGER, MPI_SUM, 0, MPI_COMM_WORLD, ier)
 #else
-     nspec_PML_tot = nspec_PML
+  nspec_PML_tot = nspec_PML
 #endif
-     if(myrank == 0) write(IOUT,*) "Total number of PML spectral elements :", nspec_PML_tot
+  if(myrank == 0) write(IOUT,*) "Total number of PML spectral elements: ", nspec_PML_tot
 
-  endif
-
   end subroutine pml_init
 
 !

Modified: seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.F90	2013-03-21 16:42:21 UTC (rev 21599)
+++ seismo/2D/SPECFEM2D/trunk/src/specfem2D/read_databases.F90	2013-03-21 18:19:53 UTC (rev 21600)
@@ -805,6 +805,18 @@
       endif
     enddo
 
+  else ! if this MPI slice has no absorbing element at all
+
+    if (ipass == 1) then
+      nelemabs = 0
+      nspec_left = 0
+      nspec_right = 0
+      nspec_bottom = 0
+      nspec_top = 0
+    endif
+
+  endif
+
 #ifdef USE_MPI
     if (ipass == 1) then
       call MPI_REDUCE(nelemabs, nelemabs_tot, 1, MPI_INTEGER, MPI_SUM, 0, MPI_COMM_WORLD, ier)
@@ -833,8 +845,6 @@
       write(IOUT,*)
     endif
 
-  endif
-
   end subroutine read_databases_absorbing
 
 !



More information about the CIG-COMMITS mailing list