[cig-commits] r20963 - seismo/3D/SPECFEM3D/trunk/src/decompose_mesh

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Sat Oct 27 16:38:09 PDT 2012


Author: dkomati1
Date: 2012-10-27 16:38:09 -0700 (Sat, 27 Oct 2012)
New Revision: 20963

Modified:
   seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/decompose_mesh.f90
Log:
added test to check that we can indeed read 8 or 27 element topology values from the mesh file


Modified: seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/decompose_mesh.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/decompose_mesh.f90	2012-10-27 23:01:09 UTC (rev 20962)
+++ seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/decompose_mesh.f90	2012-10-27 23:38:09 UTC (rev 20963)
@@ -190,8 +190,15 @@
       !          then top (positive z-direction) of element
       !             point 5 = (0,0,1), point 6 = (0,1,1), point 7 = (1,1,1), point 8 = (1,0,1)
 
-      read(98,*) num_elmnt,(elmnts(inode,num_elmnt), inode=1,NGNOD)
+      read(98,*,iostat=ier) num_elmnt,(elmnts(inode,num_elmnt), inode=1,NGNOD)
 
+      if( ier /= 0 ) then
+        print *,'error while attempting to read ',NGNOD,'element data values from the mesh file'
+        if(NGNOD == 8) print *,'check if your mesh file is indeed composed of HEX8 elements'
+        if(NGNOD == 27) print *,'check if your mesh file is indeed composed of HEX27 elements'
+        stop 'error reading element data from the mesh file'
+      endif
+
       if((num_elmnt > nspec) .or. (num_elmnt < 1) )  stop "ERROR : Invalid mesh file."
 
     enddo



More information about the CIG-COMMITS mailing list