[cig-commits] r21209 - seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared

elliott.sales.de.andrade at geodynamics.org elliott.sales.de.andrade at geodynamics.org
Sun Jan 6 01:13:59 PST 2013


Author: elliott.sales.de.andrade
Date: 2013-01-06 01:13:59 -0800 (Sun, 06 Jan 2013)
New Revision: 21209

Modified:
   seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_value_parameters.f90
Log:
Prevent a crash when the Par_file is invalid.

If the code tries to read a double when the Par_file doesn't actually
contain one, then the code will crash mysteriously. This change fixes
the crash so that the offending configuration variable will be printed
out instead.

Modified: seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_value_parameters.f90
===================================================================
--- seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_value_parameters.f90	2013-01-06 07:59:33 UTC (rev 21208)
+++ seismo/3D/SPECFEM3D_GLOBE/trunk/src/shared/read_value_parameters.f90	2013-01-06 09:13:59 UTC (rev 21209)
@@ -39,7 +39,7 @@
 
   call param_read(string_read, len(string_read), name, len(name), ierr);
   if (ierr .ne. 0) return
-  read(string_read,*) value_to_read
+  read(string_read,*,iostat=ierr) value_to_read
 
   end subroutine read_value_integer
 
@@ -57,7 +57,7 @@
 
   call param_read(string_read, len(string_read), name, len(name), ierr);
   if (ierr .ne. 0) return
-  read(string_read,*) value_to_read
+  read(string_read,*,iostat=ierr) value_to_read
 
   end subroutine read_value_double_precision
 
@@ -75,7 +75,7 @@
 
   call param_read(string_read, len(string_read), name, len(name), ierr);
   if (ierr .ne. 0) return
-  read(string_read,*) value_to_read
+  read(string_read,*,iostat=ierr) value_to_read
 
   end subroutine read_value_logical
 



More information about the CIG-COMMITS mailing list