[cig-commits] [commit] devel: avoided a potential side effect for array "rmemory_fsb_displ_elastic" owing to some "if" statements: the array was sometimes unallocated (3e66632)

cig_noreply at geodynamics.org cig_noreply at geodynamics.org
Thu Feb 27 15:45:39 PST 2014


Repository : ssh://geoshell/specfem2d

On branch  : devel
Link       : https://github.com/geodynamics/specfem2d/compare/1ce526c28606ad1b25a294f95021d8c20fa4063d...f553d8dce847cd390cc0e7ebd9d59704cbbf06ab

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

commit 3e6663288dc08085555e3e7e6c725e93bceee93a
Author: Dimitri Komatitsch <komatitsch at lma.cnrs-mrs.fr>
Date:   Fri Feb 28 00:43:02 2014 +0100

    avoided a potential side effect for array "rmemory_fsb_displ_elastic" owing to some "if" statements: the array was sometimes unallocated


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

3e6663288dc08085555e3e7e6c725e93bceee93a
 src/specfem2D/specfem2D.F90 | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/specfem2D/specfem2D.F90 b/src/specfem2D/specfem2D.F90
index e3ec6dc..fa441cc 100644
--- a/src/specfem2D/specfem2D.F90
+++ b/src/specfem2D/specfem2D.F90
@@ -1,3 +1,4 @@
+
   program specfem2D
 
 !========================================================================
@@ -3100,6 +3101,11 @@
       allocate(alpha_z_store(1,1,1))
     endif ! PML_BOUNDARY_CONDITIONS
 
+  ! avoid a potential side effect owing to the "if" statements above: this array may be unallocated,
+  ! if so we need to allocate a dummy version in order to be able to use that array as an argument
+  ! in some subroutine calls below
+  if(.not. allocated(rmemory_fsb_displ_elastic)) allocate(rmemory_fsb_displ_elastic(1,3,NGLLX,NGLLZ,1))
+
   !
   !---- build the global mass matrix
   !



More information about the CIG-COMMITS mailing list