[cig-commits] r12464 - seismo/2D/SPECFEM2D/trunk

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Tue Jul 22 06:49:06 PDT 2008


Author: dkomati1
Date: 2008-07-22 06:49:06 -0700 (Tue, 22 Jul 2008)
New Revision: 12464

Modified:
   seismo/2D/SPECFEM2D/trunk/specfem2D.F90
Log:
fixed small bug in reordering of ibool in version 4


Modified: seismo/2D/SPECFEM2D/trunk/specfem2D.F90
===================================================================
--- seismo/2D/SPECFEM2D/trunk/specfem2D.F90	2008-07-22 09:48:27 UTC (rev 12463)
+++ seismo/2D/SPECFEM2D/trunk/specfem2D.F90	2008-07-22 13:49:06 UTC (rev 12464)
@@ -844,6 +844,8 @@
 
   inumber = 0
 
+  if(.not. ACTUALLY_IMPLEMENT_PERM_WHOLE) then
+
 ! first reduce cache misses in outer elements, since they are taken first
 ! loop over spectral elements
   do ispec = 1,nspec_outer
@@ -880,11 +882,33 @@
     enddo
   enddo
 
+  else ! if ACTUALLY_IMPLEMENT_PERM_WHOLE
+
+! reduce cache misses in all the elements
+! loop over spectral elements
+  do ispec = 1,nspec
+    do j=1,NGLLZ
+      do i=1,NGLLX
+        if(mask_ibool(copy_ibool_ori(i,j,ispec)) == -1) then
+! create a new point
+          inumber = inumber + 1
+          ibool(i,j,ispec) = inumber
+          mask_ibool(copy_ibool_ori(i,j,ispec)) = inumber
+        else
+! use an existing point created previously
+          ibool(i,j,ispec) = mask_ibool(copy_ibool_ori(i,j,ispec))
+        endif
+      enddo
+    enddo
+  enddo
+
+  endif
+
   deallocate(copy_ibool_ori)
   deallocate(mask_ibool)
 
-  else
-    !stop 'incorrect pass number for reduction of cache misses'
+  else if(ipass /= 1) then
+    stop 'incorrect pass number for reduction of cache misses'
   endif
 
 !---- compute shape functions and their derivatives for regular interpolated display grid



More information about the cig-commits mailing list