[cig-commits] [commit] devel: Fix out-of-bounds array access warning. (3cae917)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Wed Jun 4 13:00:00 PDT 2014


Repository : https://github.com/geodynamics/specfem3d_globe

On branch  : devel
Link       : https://github.com/geodynamics/specfem3d_globe/compare/754300e5a26e2a5d17069e661645fe819a7857a1...cd83b686a7c6014e132933f685157d43151a665e

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

commit 3cae9179b8721249767f23a97ec5c3feb695adba
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Tue May 20 01:51:53 2014 -0400

    Fix out-of-bounds array access warning.
    
    Even though this code is not really used without Roland Sylvain
    integrals enabled, it still induces warnings.


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

3cae9179b8721249767f23a97ec5c3feb695adba
 setup/constants.h.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/setup/constants.h.in b/setup/constants.h.in
index 4e08472..2008e40 100644
--- a/setup/constants.h.in
+++ b/setup/constants.h.in
@@ -432,8 +432,8 @@
   integer, parameter :: NY_OBSERVATION = NX_OBSERVATION
 
 ! the code will display sample output values at this particular point as a check
-  integer, parameter :: ixr = NX_OBSERVATION / 3
-  integer, parameter :: iyr = NY_OBSERVATION / 4
+  integer, parameter :: ixr = max(NX_OBSERVATION / 3, 1)
+  integer, parameter :: iyr = max(NY_OBSERVATION / 4, 1)
   integer, parameter :: ichunkr = 3
 
 ! how often (every how many spectral elements computed) we print a timestamp to monitor the behavior of the code



More information about the CIG-COMMITS mailing list