[cig-commits] [commit] devel, master: Stop if doubling elements cannot be determined. (ca6bfa6)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Nov 6 08:30:58 PST 2014


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

On branches: devel,master
Link       : https://github.com/geodynamics/specfem3d_globe/compare/bc58e579b3b0838a0968725a076f5904845437ca...be63f20cbb6f462104e949894dbe205d2398cd7f

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

commit ca6bfa6f198dcc0c212331ca3183a6ccaf831fd8
Author: Elliott Sales de Andrade <esalesde at physics.utoronto.ca>
Date:   Wed Sep 10 20:27:40 2014 -0400

    Stop if doubling elements cannot be determined.
    
    This should fix a couple "possibly uninitialized variable" warnings.


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

ca6bfa6f198dcc0c212331ca3183a6ccaf831fd8
 src/shared/define_all_layers.f90 | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/src/shared/define_all_layers.f90 b/src/shared/define_all_layers.f90
index 1970989..32db17f 100644
--- a/src/shared/define_all_layers.f90
+++ b/src/shared/define_all_layers.f90
@@ -79,6 +79,8 @@
 
 ! find element below top of which we should implement the second doubling in the mantle
 ! locate element closest to optimal value
+  elem_doubling_mantle = -1
+  DEPTH_SECOND_DOUBLING_REAL = 0
   distance_min = HUGEVAL
   do ielem = 2,NER_TOPDDOUBLEPRIME_771
     zval = RTOPDDOUBLEPRIME + ielem * (R771 - RTOPDDOUBLEPRIME) / dble(NER_TOPDDOUBLEPRIME_771)
@@ -89,9 +91,12 @@
       DEPTH_SECOND_DOUBLING_REAL = R_EARTH - zval
     endif
   enddo
+  if (elem_doubling_mantle == -1) stop 'Unable to determine second doubling element'
 
 ! find element below top of which we should implement the third doubling in the middle of the outer core
 ! locate element closest to optimal value
+  elem_doubling_middle_outer_core = -1
+  DEPTH_THIRD_DOUBLING_REAL = 0
   distance_min = HUGEVAL
 ! start at element number 4 because we need at least two elements below for the fourth doubling
 ! implemented at the bottom of the outer core
@@ -104,10 +109,13 @@
       DEPTH_THIRD_DOUBLING_REAL = R_EARTH - zval
     endif
   enddo
+  if (elem_doubling_middle_outer_core == -1) stop 'Unable to determine third doubling element'
 
   if (ADD_4TH_DOUBLING) then
 ! find element below top of which we should implement the fourth doubling in the middle of the outer core
 ! locate element closest to optimal value
+    elem_doubling_bottom_outer_core = -1
+    DEPTH_FOURTH_DOUBLING_REAL = 0
     distance_min = HUGEVAL
 ! end two elements before the top because we need at least two elements above for the third doubling
 ! implemented in the middle of the outer core
@@ -120,6 +128,7 @@
         DEPTH_FOURTH_DOUBLING_REAL = R_EARTH - zval
       endif
     enddo
+    if (elem_doubling_bottom_outer_core == -1) stop 'Unable to determine fourth doubling element'
 ! make sure that the two doublings in the outer core are found in the right order
     if (elem_doubling_bottom_outer_core >= elem_doubling_middle_outer_core) &
                     stop 'Error in location of the two doublings in the outer core'



More information about the CIG-COMMITS mailing list