[cig-commits] r21250 - in seismo/3D/SPECFEM3D/trunk: . src/check_mesh_quality_CUBIT_Abaqus src/decompose_mesh src/generate_databases src/meshfem3D src/specfem3D

dkomati1 at geodynamics.org dkomati1 at geodynamics.org
Wed Jan 16 16:18:08 PST 2013


Author: dkomati1
Date: 2013-01-16 16:18:08 -0800 (Wed, 16 Jan 2013)
New Revision: 21250

Modified:
   seismo/3D/SPECFEM3D/trunk/Makefile.in
   seismo/3D/SPECFEM3D/trunk/configure
   seismo/3D/SPECFEM3D/trunk/configure.ac
   seismo/3D/SPECFEM3D/trunk/flags.guess
   seismo/3D/SPECFEM3D/trunk/src/check_mesh_quality_CUBIT_Abaqus/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/meshfem3D/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in
   seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_set_memory_variables.f90
Log:
moved if statements outside of loops in pml_set_memory_variables.f90;
got rid of FLAGS_NO_CHECK, now maintain a single flag called FLAGS_CHECK because of the two flags was almost unused in the Makefiles of the solver


Modified: seismo/3D/SPECFEM3D/trunk/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -34,15 +34,12 @@
 MPIFC = @MPIFC@
 MPILIBS = @MPILIBS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK)
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK)
 MPIFCCOMPILE_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_CHECK)
-MPIFCCOMPILE_NO_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_NO_CHECK)
- at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_NO_CHECK)
- at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_NO_CHECK)
+ at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_CHECK)
+ at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_CHECK)
 
 CC = @CC@
 CFLAGS = @CFLAGS@ $(CPPFLAGS)

Modified: seismo/3D/SPECFEM3D/trunk/configure
===================================================================
--- seismo/3D/SPECFEM3D/trunk/configure	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/configure	2013-01-17 00:18:08 UTC (rev 21250)
@@ -649,7 +649,6 @@
 MPI_INC
 CUDA_INC
 CUDA_LIB
-FLAGS_NO_CHECK
 FLAGS_CHECK
 MPICC
 MPILIBS
@@ -795,7 +794,6 @@
 MPILIBS
 MPICC
 FLAGS_CHECK
-FLAGS_NO_CHECK
 CUDA_LIB
 CUDA_INC
 MPI_INC
@@ -1471,10 +1469,7 @@
   MPIFC       MPI Fortran compiler command
   MPILIBS     extra libraries for linking MPI programs
   MPICC       MPI C compiler command
-  FLAGS_CHECK Fortran compiler flags for non-critical subroutines
-  FLAGS_NO_CHECK
-              Fortran compiler flags for creating fast, production-run code
-              for critical subroutines
+  FLAGS_CHECK Fortran compiler flags
   CUDA_LIB    Location of CUDA library libcudart
   CUDA_INC    Location of CUDA include files
   MPI_INC     Location of MPI include mpi.h, which is needed by nvcc when
@@ -7541,7 +7536,7 @@
 cit_fc_save_fc=$FC
 cit_fc_save_fcflags=$FCFLAGS
 FC=$MPIFC
-FCFLAGS="$FCFLAGS $FLAGS_NO_CHECK"
+FCFLAGS="$FCFLAGS $FLAGS_CHECK"
 
 { $as_echo "$as_me:$LINENO: checking whether mpif.h works" >&5
 $as_echo_n "checking whether mpif.h works... " >&6; }
@@ -7904,7 +7899,7 @@
 cit_fc_save_fc=$FC
 cit_fc_save_fcflags=$FCFLAGS
 FC=$FC
-FCFLAGS="$FCFLAGS $FLAGS_NO_CHECK"
+FCFLAGS="$FCFLAGS $FLAGS_CHECK"
 
 { $as_echo "$as_me:$LINENO: checking whether OpenMP directives work" >&5
 $as_echo_n "checking whether OpenMP directives work... " >&6; }
@@ -7968,9 +7963,9 @@
 $as_echo "no" >&6; }
     { { $as_echo "$as_me:$LINENO: error: in \`$ac_pwd':" >&5
 $as_echo "$as_me: error: in \`$ac_pwd':" >&2;}
-{ { $as_echo "$as_me:$LINENO: error: cannot link a trivial OpenMP program using $FC with flags: $FLAGS_NO_CHECK
+{ { $as_echo "$as_me:$LINENO: error: cannot link a trivial OpenMP program using $FC with flags: $FLAGS_CHECK
 See \`config.log' for more details." >&5
-$as_echo "$as_me: error: cannot link a trivial OpenMP program using $FC with flags: $FLAGS_NO_CHECK
+$as_echo "$as_me: error: cannot link a trivial OpenMP program using $FC with flags: $FLAGS_CHECK
 See \`config.log' for more details." >&2;}
    { (exit 1); exit 1; }; }; }
 

Modified: seismo/3D/SPECFEM3D/trunk/configure.ac
===================================================================
--- seismo/3D/SPECFEM3D/trunk/configure.ac	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/configure.ac	2013-01-17 00:18:08 UTC (rev 21250)
@@ -353,8 +353,7 @@
 AC_ARG_VAR(MPIFC, [MPI Fortran compiler command])
 AC_ARG_VAR(MPILIBS, [extra libraries for linking MPI programs])
 AC_ARG_VAR(MPICC, [MPI C compiler command])
-AC_ARG_VAR(FLAGS_CHECK, [Fortran compiler flags for non-critical subroutines])
-AC_ARG_VAR(FLAGS_NO_CHECK, [Fortran compiler flags for creating fast, production-run code for critical subroutines])
+AC_ARG_VAR(FLAGS_CHECK, [Fortran compiler flags])
 AC_ARG_VAR(CUDA_LIB,[Location of CUDA library libcudart])
 AC_ARG_VAR(CUDA_INC,[Location of CUDA include files])
 AC_ARG_VAR(MPI_INC,[Location of MPI include mpi.h, which is needed by nvcc when compiling cuda files])
@@ -426,7 +425,7 @@
 # Checks for header files.
 
 if test "$want_mpi" = yes; then
-    CIT_FC_MPI_HEADER([$MPIFC], [$FLAGS_NO_CHECK])
+    CIT_FC_MPI_HEADER([$MPIFC], [$FLAGS_CHECK])
 fi
 
 # Checks for typedefs, structures, and compiler characteristics.
@@ -440,7 +439,7 @@
 fi
 
 if test "$want_openmp" = yes; then
-    CIT_FC_OPENMP_MODULE([$FC],[$FLAGS_NO_CHECK])        
+    CIT_FC_OPENMP_MODULE([$FC],[$FLAGS_CHECK])        
 fi
 
 

Modified: seismo/3D/SPECFEM3D/trunk/flags.guess
===================================================================
--- seismo/3D/SPECFEM3D/trunk/flags.guess	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/flags.guess	2013-01-17 00:18:08 UTC (rev 21250)
@@ -18,23 +18,19 @@
         # Cray Fortran
         #
         if test x"$FLAGS_CHECK" = x; then
-            FLAGS_CHECK="-eC -eD -hfp2"  # turn on full debugging and range checking
+            FLAGS_CHECK="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2" # turn on optimization; -Oaggress -Oipa4 would make it even more aggressive
+        # -eC -eD -hfp2  # turn on full debugging and range checking
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="-O3 -Onoaggress -Oipa0 -hfp2 -Ovector3 -Oscalar3 -Ocache2 -Ounroll2 -Ofusion2" # turn on optimization; -Oaggress -Oipa4 would make it even more aggressive
-        fi
         ;;
     pgf95|*/pgf95|pgf90|*/pgf90)
         #
         # Portland PGI
         #
         if test x"$FLAGS_CHECK" = x; then
-            FLAGS_CHECK="-fast -Mbounds -Mneginfo -Mdclchk -Minform=warn" # -mcmodel=medium
+            FLAGS_CHECK="-fast -Mnobounds -Minline -Mneginfo -Mdclchk -Knoieee -Minform=warn -Mdaz -Mflushz" # -mcmodel=medium
+        # -Mbounds
+        # -fastsse -tp amd64e -Msmart
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-# -fastsse -tp amd64e -Msmart
-            FLAGS_NO_CHECK="-fast -Mnobounds -Minline -Mneginfo -Mdclchk -Knoieee -Minform=warn -Mdaz -Mflushz" # -mcmodel=medium
-        fi
         ;;
     ifort|*/ifort)
         #
@@ -44,38 +40,21 @@
         if test x"$FLAGS_CHECK" = x; then
             FLAGS_CHECK="-O3 -xHost -ftz -assume byterecl -align sequence -vec-report0 -std03 -implicitnone -warn truncated_source -warn argument_checking -warn unused -warn declarations -warn alignments -warn ignore_loc -warn usage -check nobounds" # -mcmodel=medium -shared-intel
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="-O3 -xHost -ftz -assume byterecl -align sequence -vec-report0 -std03 -implicitnone -warn truncated_source -warn argument_checking -warn unused -warn declarations -warn alignments -warn ignore_loc -warn usage -check nobounds" # -mcmodel=medium -shared-intel
-        fi
         # useful for debugging...
-            # for debugging: change -check nobounds to -check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv
-        #if test x"$FLAGS_CHECK" = x; then
-        #    FLAGS_CHECK="-O3 -check nobounds -ftz -assume byterecl -traceback -ftrapuv -align sequence -vec-report0 -std03 -implicitnone -warn truncated_source -warn argument_checking -warn unused -warn declarations -warn alignments -warn ignore_loc -warn usage" # -mcmodel=medium -shared-intel
-        #fi
-        #if test x"$FLAGS_NO_CHECK" = x; then
-        #    # standard options (leave option -ftz, which is *critical* for performance)
-        #    FLAGS_NO_CHECK="-O3 -xP -ftz -assume byterecl -align sequence -vec-report0 -std03 -implicitnone -warn truncated_source -warn argument_checking -warn unused -warn declarations -warn alignments -warn ignore_loc -warn usage" # -mcmodel=medium -shared-intel
-        #fi
+        # for debugging: change -O3 -check nobounds to      -check all -debug -g -O0 -fp-stack-check -traceback -ftrapuv
         #
         ;;
     gfortran|*/gfortran|f95|*/f95)
         #
         # GNU gfortran
         #
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="-std=f2003 -fimplicit-none -frange-check -O2 -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow" # -mcmodel=medium
-        fi
         if test x"$FLAGS_CHECK" = x; then
-            FLAGS_CHECK="\$(FLAGS_NO_CHECK)"
+            FLAGS_CHECK="-std=f2003 -fimplicit-none -frange-check -O2 -fmax-errors=10 -pedantic -pedantic-errors -Waliasing -Wampersand -Wcharacter-truncation -Wline-truncation -Wsurprising -Wno-tabs -Wunderflow" # -mcmodel=medium
         fi
         # useful for debugging... -ffpe-trap=underflow,overflow,zero -fbacktrace -fbounds-check
         #
         # older gfortran syntax
-        #           FLAGS_NO_CHECK="-std=f2003 -fimplicit-none -frange-check -O2 -Wunused-labels -Waliasing -Wampersand -Wsurprising -Wline-truncation -Wunderflow" # -mcmodel=medium
-        #fi
-        #if test x"$FLAGS_CHECK" = x; then
-        #    FLAGS_CHECK="\$(FLAGS_NO_CHECK)" # -fbounds-check
-        #fi
+        #   -std=f2003 -fimplicit-none -frange-check -O2 -Wunused-labels -Waliasing -Wampersand -Wsurprising -Wline-truncation -Wunderflow" # -mcmodel=medium
         ;;
     g95|*/g95)
         #
@@ -84,23 +63,16 @@
         if test x"$FLAGS_CHECK" = x; then
             FLAGS_CHECK="-O"
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="-O"
-        fi
         ;;
     f90|*/f90)
         case $UNAME_MS in
             i*86:Linux | x86_64:Linux)
-                ################ PC Linux #################
                 #
                 # AbSoft
                 #
                 if test x"$FLAGS_CHECK" = x; then
                     FLAGS_CHECK="-W132 -s -O3 -cpu:p7 -v -YDEALLOC=ALL"
                 fi
-                if test x"$FLAGS_NO_CHECK" = x; then
-                    FLAGS_NO_CHECK="\$(FLAGS_CHECK)"
-                fi
                 ;;
             *:IRIX*)
                 ################ SGI Irix #################
@@ -111,11 +83,9 @@
                     fi
                 fi
                 if test x"$FLAGS_CHECK" = x; then
-                    FLAGS_CHECK="\$(FLAGS_NO_CHECK) -check_bounds"
+                    FLAGS_CHECK="-ansi -u -64 -O3 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
+                #   -check_bounds
                 fi
-                if test x"$FLAGS_NO_CHECK" = x; then
-                    FLAGS_NO_CHECK="-ansi -u -64 -O3 -OPT:Olimit=0 -OPT:roundoff=3 -OPT:IEEE_arithmetic=3 -r10000 -mips4"
-                fi
                 ;;
             SX-*:SUPER-UX | ES:ESOS)
                 ################## NEC SX ##################
@@ -125,9 +95,6 @@
                 if test x"$FLAGS_CHECK" = x; then
                     FLAGS_CHECK="-C hopt -R2 -Wf\" -L nostdout noinclist mrgmsg noeject -msg b -pvctl loopcnt=14000000 expand=10 fullmsg vecthreshold=20 -s\" -pi auto line=100 exp=swap_all,rank"
                 fi
-                if test x"$FLAGS_NO_CHECK" = x; then
-                    FLAGS_NO_CHECK="\$(FLAGS_CHECK)"
-                fi
                 ;;
         esac
         ;;
@@ -136,11 +103,9 @@
         # Lahey f90
         #
         if test x"$FLAGS_CHECK" = x; then
-            FLAGS_CHECK="--warn --wo --tpp --f95 --dal -O --chk"
+            FLAGS_CHECK="--warn --wo --tpp --f95 --dal -O"
+        #    --chk
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="--warn --wo --tpp --f95 --dal -O"
-        fi
         ;;
     ######## IBM ######
     mpxlf*|*/mpxlf*)
@@ -171,20 +136,17 @@
         # one should also use additional flags:
         # CFLAGS = -Wl,-relax
         #
-        if test x"$FLAGS_NO_CHECK" = x; then
+        if test x"$FLAGS_CHECK" = x; then
 # deleted -qxflag=dvz because it requires handler function __xl_dzx and thus linking will fail 
-            FLAGS_NO_CHECK="-O3 -qsave -qstrict -q64 -qtune=auto -qarch=auto -qcache=auto -qfree=f90 -qsuffix=f=f90 -qhalt=w -qlanglvl=90pure -qsuppress=1518-317 -Q -Q+rank,swap_all -Wl,-relax -qunroll=yes"
+            FLAGS_CHECK="-O3 -qsave -qstrict -q64 -qtune=auto -qarch=auto -qcache=auto -qfree=f90 -qsuffix=f=f90 -qhalt=w -qlanglvl=90pure -qsuppress=1518-317 -Q -Q+rank,swap_all -Wl,-relax -qunroll=yes"
         # on MareNostrum at the Barcelona SuperComputing Center (Spain) one can use
         # -qtune=ppc970 -qarch=ppc64v instead of -qtune=auto -qarch=auto
         # on "Babel" IBM BlueGene at IDRIS (France) use:
         # -qtune=auto -qarch=450d -qsave     instead of -qtune=auto -qarch=auto
-        fi
-        if test x"$FLAGS_CHECK" = x; then
         #
         # to debug with IBM xlf, one can add this: -g -O0 -C -qddim -qfullpath
         # to debug, one can add these three flags: -qflttrap=overflow:zerodivide:invalid:enable -qfloat=nans -qinitauto=7FBFFFFF
         #
-            FLAGS_CHECK="\$(FLAGS_NO_CHECK) -g -C -qddim -qfullpath"
         fi
         ;;
     pathf90|*/pathf90)
@@ -198,9 +160,6 @@
         if test x"$FLAGS_CHECK" = x; then
             FLAGS_CHECK="-O3 -OPT:Ofast -fno-math-errno -ffast-math -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON -msse3 -march=auto -fno-second-underscore -align64"
         fi
-        if test x"$FLAGS_NO_CHECK" = x; then
-            FLAGS_NO_CHECK="-O3 -OPT:Ofast -fno-math-errno -ffast-math -LNO:fusion=2 -LNO:simd=2 -LNO:simd_verbose=ON -msse3 -march=auto -fno-second-underscore -align64"
-        fi
         ;;
 
 esac
@@ -218,7 +177,6 @@
 echo MPIFC=\"$MPIFC\" | sed 's/\$/\\\$/g'
 echo MPILIBS=\"$MPILIBS\" | sed 's/\$/\\\$/g'
 echo FLAGS_CHECK=\"$FLAGS_CHECK\" | sed 's/\$/\\\$/g'
-echo FLAGS_NO_CHECK=\"$FLAGS_NO_CHECK\" | sed 's/\$/\\\$/g'
 echo FCENV=\"$FCENV\" | sed 's/\$/\\\$/g'
 
 # Added by IDRIS: set to default values if not passed as arguments

Modified: seismo/3D/SPECFEM3D/trunk/src/check_mesh_quality_CUBIT_Abaqus/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/check_mesh_quality_CUBIT_Abaqus/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/check_mesh_quality_CUBIT_Abaqus/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -32,13 +32,11 @@
 FC = @FC@
 FCFLAGS = #@FCFLAGS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK)
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK)
 
-FCLINK = $(FCCOMPILE_NO_CHECK)
+FCLINK = $(FCCOMPILE_CHECK)
 
 # E : executables directory
 E = ../../bin

Modified: seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/decompose_mesh/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -36,16 +36,11 @@
 MPIFC = @MPIFC@
 MPILIBS = @MPILIBS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
 MPIFCCOMPILE_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-MPIFCCOMPILE_NO_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
-#@COND_MPI_TRUE at FCLINK = $(MPIFCCOMPILE_NO_CHECK)
-#@COND_MPI_FALSE at FCLINK = $(FCCOMPILE_NO_CHECK)
-FCLINK = $(FCCOMPILE_NO_CHECK)
+FCLINK = $(FCCOMPILE_CHECK)
 
 CC = @CC@
 CFLAGS = @CFLAGS@ $(CPPFLAGS)

Modified: seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/generate_databases/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -34,7 +34,6 @@
 MPIFC = @MPIFC@
 MPILIBS = @MPILIBS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 SHARED = ../shared/
@@ -49,11 +48,9 @@
 OUTPUT=../../OUTPUT_FILES
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
 MPIFCCOMPILE_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-MPIFCCOMPILE_NO_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
- at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_NO_CHECK)
- at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_NO_CHECK)
+ at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_CHECK)
+ at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_CHECK)
 
 CC = @CC@
 CFLAGS = @CFLAGS@ $(CPPFLAGS)

Modified: seismo/3D/SPECFEM3D/trunk/src/meshfem3D/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/meshfem3D/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/meshfem3D/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -42,15 +42,12 @@
 MPIFC = @MPIFC@
 MPILIBS = @MPILIBS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
 MPIFCCOMPILE_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_CHECK) -I${SHARED}
-MPIFCCOMPILE_NO_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_NO_CHECK) -I${SHARED}
- at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_NO_CHECK)
- at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_NO_CHECK)
+ at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_CHECK)
+ at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_CHECK)
 
 CC = @CC@
 CFLAGS = @CFLAGS@ $(CPPFLAGS)

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/Makefile.in	2013-01-17 00:18:08 UTC (rev 21250)
@@ -58,7 +58,7 @@
 @COND_CUDA_FALSE at NVCCLINK = $(NVCC) $(NVCC_FLAGS)
 
 # OpenMP
-# with configure: ./configure --with-openmp FLAGS_NO_CHECK="-openmp .." OPENMP_LIB=.. 
+# with configure: ./configure --with-openmp FLAGS_CHECK="-openmp .." OPENMP_LIB=.. 
 @COND_OPENMP_TRUE at OPENMP_LIBS = $(OPENMP_LIB)
 @COND_OPENMP_FALSE at OPENMP_LIBS = 
 @COND_OPENMP_TRUE at COND_OPENMP_FFLAGS = -DOPENMP_MODE
@@ -70,7 +70,6 @@
 MPIFC = @MPIFC@
 MPILIBS = @MPILIBS@
 FLAGS_CHECK = @FLAGS_CHECK@
-FLAGS_NO_CHECK = @FLAGS_NO_CHECK@
 FCFLAGS_f90 = @FCFLAGS_f90@
 
 
@@ -87,11 +86,9 @@
 OUTPUT=../../OUTPUT_FILES
 
 FCCOMPILE_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_CHECK) $(COND_OPENMP_FFLAGS) -I$(SHARED)
-FCCOMPILE_NO_CHECK =@FCENV@ ${FC} ${FCFLAGS} $(FLAGS_NO_CHECK) $(COND_OPENMP_FFLAGS) -I$(SHARED)
 MPIFCCOMPILE_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_CHECK) $(COND_OPENMP_FFLAGS) -I$(SHARED)
-MPIFCCOMPILE_NO_CHECK =@FCENV@ ${MPIFC} ${FCFLAGS} $(FLAGS_NO_CHECK) $(COND_OPENMP_FFLAGS) -I$(SHARED)
- at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_NO_CHECK)
- at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_NO_CHECK)
+ at COND_MPI_TRUE@FCLINK = $(MPIFCCOMPILE_CHECK)
+ at COND_MPI_FALSE@FCLINK = $(FCCOMPILE_CHECK)
 
 CC = @CC@
 CFLAGS = @CFLAGS@ $(CPPFLAGS)
@@ -362,23 +359,23 @@
 ###
 
 $O/%.o: %.f90 $(SHARED)constants.h
-	${FCCOMPILE_NO_CHECK} -c -o $@ $<
+	${FCCOMPILE_CHECK} -c -o $@ $<
 
 $O/%.o: %.F90 $(SHARED)constants.h
-	${FCCOMPILE_NO_CHECK} -c -o $@ $<
+	${FCCOMPILE_CHECK} -c -o $@ $<
 
 $O/%.shared.o: ${SHARED}%.f90 $(SHARED)constants.h
-	${FCCOMPILE_NO_CHECK} -c -o $@ $<
+	${FCCOMPILE_CHECK} -c -o $@ $<
 
 $O/%.shared.o: ${SHARED}%.F90 $(SHARED)constants.h
-	${FCCOMPILE_NO_CHECK} -c -o $@ $<
+	${FCCOMPILE_CHECK} -c -o $@ $<
 
 
 ###
 ### OpenMP compilation
 ###
 $O/%.openmp.o: %.f90 $(SHARED)constants.h
-	${FCCOMPILE_NO_CHECK} -c -o $@ $<
+	${FCCOMPILE_CHECK} -c -o $@ $<
 
 
 ###
@@ -411,7 +408,7 @@
 	${FCCOMPILE_CHECK} -c -o $O/serial.o $(SHARED)serial.f90
 
 $O/smooth_vol_data.o: $(SHARED)constants.h $(SHARED)smooth_vol_data.f90
-	${MPIFCCOMPILE_NO_CHECK} -c -o $O/smooth_vol_data.o $(SHARED)smooth_vol_data.f90
+	${MPIFCCOMPILE_CHECK} -c -o $O/smooth_vol_data.o $(SHARED)smooth_vol_data.f90
 
 
 
@@ -421,14 +418,14 @@
 ##
 
 $O/sum_kernels.o: $(SHARED)constants.h $(SHARED)sum_kernels.f90
-	${MPIFCCOMPILE_NO_CHECK} -c -o $O/sum_kernels.o $(SHARED)sum_kernels.f90
+	${MPIFCCOMPILE_CHECK} -c -o $O/sum_kernels.o $(SHARED)sum_kernels.f90
 
 ##
 ## model update
 ##
 
 $O/model_update.o: $(SHARED)constants.h model_update.f90
-	${MPIFCCOMPILE_NO_CHECK} -c -o $O/model_update.o model_update.f90
+	${MPIFCCOMPILE_CHECK} -c -o $O/model_update.o model_update.f90
 
 $O/save_external_bin_m_up.o:  $(SHARED)constants.h save_external_bin_m_up.f90
 	${FCCOMPILE_CHECK} -c -o $O/save_external_bin_m_up.o save_external_bin_m_up.f90

Modified: seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_set_memory_variables.f90
===================================================================
--- seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_set_memory_variables.f90	2013-01-16 23:24:59 UTC (rev 21249)
+++ seismo/3D/SPECFEM3D/trunk/src/specfem3D/pml_set_memory_variables.f90	2013-01-17 00:18:08 UTC (rev 21250)
@@ -62,10 +62,12 @@
   real(kind=CUSTOM_REAL) :: A6,A7,A8,A9,A10,A11,A12,A13,A14,A15,A16,A17 ! for convolution of strain(complex)
   real(kind=CUSTOM_REAL) :: A18,A19,A20 ! for convolution of strain(simple)
 
+  if( CPML_regions(ispec_CPML) == 1 ) then
+
   do k=1,NGLLZ
      do j=1,NGLLY
         do i=1,NGLLX
-           if( CPML_regions(ispec_CPML) == 1 ) then
+
               !------------------------------------------------------------------------------
               !---------------------------- X-surface C-PML ---------------------------------
               !------------------------------------------------------------------------------
@@ -85,7 +87,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -108,7 +110,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) &
@@ -133,7 +135,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -156,7 +158,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -181,7 +183,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -204,7 +206,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -229,7 +231,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -312,7 +314,15 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2)
               endif
 
-           elseif( CPML_regions(ispec_CPML) == 2 ) then
+        enddo
+     enddo
+  enddo
+  endif
+
+  if( CPML_regions(ispec_CPML) == 2 ) then
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
               !------------------------------------------------------------------------------
               !---------------------------- Y-surface C-PML ---------------------------------
               !------------------------------------------------------------------------------
@@ -332,7 +342,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -355,7 +365,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                    rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) & 
                    + PML_dpotential_dxl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dxl(i,j,k,ispec_CPML) * coef2_1
@@ -380,7 +390,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0 
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -403,7 +413,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) &
@@ -428,7 +438,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -451,7 +461,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) & 
                       + PML_dpotential_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -502,7 +512,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0 
-                 end if
+                 endif
 
                  rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -558,7 +568,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2) 
               endif
 
-           elseif( CPML_regions(ispec_CPML) == 3 ) then
+        enddo
+     enddo
+  enddo
+  endif
+
+ if( CPML_regions(ispec_CPML) == 3 ) then
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
+
               !------------------------------------------------------------------------------
               !---------------------------- Z-surface C-PML ---------------------------------
               !------------------------------------------------------------------------------
@@ -578,7 +597,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -601,7 +620,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dxl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dxl(i,j,k,ispec_CPML) * coef2_1
@@ -626,7 +645,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -649,7 +668,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -674,7 +693,7 @@
               else
                  coef1_2 = deltat/2.0d0 
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -697,7 +716,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) &
@@ -774,7 +793,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duy_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duy_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -803,7 +822,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2)
               endif
 
-           elseif( CPML_regions(ispec_CPML) == 4 ) then
+        enddo
+     enddo
+  enddo
+  endif
+
+  if( CPML_regions(ispec_CPML) == 4 ) then
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
+
               !------------------------------------------------------------------------------
               !---------------------------- XY-edge C-PML -----------------------------------
               !------------------------------------------------------------------------------
@@ -824,7 +852,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -847,7 +875,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) &
@@ -873,7 +901,7 @@
               else
                  coef1_2 = deltat/2.0d0 
                  coef2_2 = deltat/2.0d0  
-              end if
+              endif
 
 
               if( ispec_is_elastic(ispec) ) then
@@ -897,7 +925,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) &
@@ -913,7 +941,7 @@
                  A13 = d_store_x(i,j,k,ispec_CPML) * k_store_y(i,j,k,ispec_CPML) &
                       + d_store_y(i,j,k,ispec_CPML) * k_store_x(i,j,k,ispec_CPML) &
                       + (it+0.0) * deltat * d_store_x(i,j,k,ispec_CPML) * d_store_y(i,j,k,ispec_CPML)
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
                  A13 = d_store_x(i,j,k,ispec_CPML)*k_store_y(i,j,k,ispec_CPML) &
                       + d_store_y(i,j,k,ispec_CPML)*k_store_x(i,j,k,ispec_CPML) &
                       + (it+0.5)*deltat*d_store_x(i,j,k,ispec_CPML)*d_store_y(i,j,k,ispec_CPML)
@@ -930,7 +958,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               coef0_2 = coef0_1
               coef1_2 = coef1_1
@@ -963,7 +991,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -990,7 +1018,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0 
-                 end if
+                 endif
 
                  rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -1032,7 +1060,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -1087,7 +1115,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2)
               endif
 
-           elseif(CPML_regions(ispec_CPML)==5) then
+        enddo
+     enddo
+  enddo
+  endif
+
+  if(CPML_regions(ispec_CPML)==5) then
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
+
               !------------------------------------------------------------------------------
               !---------------------------- XZ-edge C-PML -----------------------------------
               !------------------------------------------------------------------------------
@@ -1108,7 +1145,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0 
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -1131,7 +1168,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,2) &
@@ -1147,7 +1184,7 @@
                  A10 = d_store_x(i,j,k,ispec_CPML) * k_store_z(i,j,k,ispec_CPML) &
                       + d_store_z(i,j,k,ispec_CPML) * k_store_x(i,j,k,ispec_CPML) &
                       + (it+0.0) * deltat * d_store_x(i,j,k,ispec_CPML) * d_store_z(i,j,k,ispec_CPML)
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
                  A10 = d_store_x(i,j,k,ispec_CPML)*k_store_z(i,j,k,ispec_CPML) &
                       + d_store_z(i,j,k,ispec_CPML)*k_store_x(i,j,k,ispec_CPML) &
                       + (it+0.5)*deltat*d_store_x(i,j,k,ispec_CPML)*d_store_z(i,j,k,ispec_CPML)
@@ -1164,7 +1201,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               coef0_2 = coef0_1
               coef1_2 = coef1_1
@@ -1198,7 +1235,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -1226,7 +1263,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -1249,7 +1286,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) &
@@ -1274,7 +1311,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -1342,7 +1379,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0 
-                 end if
+                 endif
 
                  rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duy_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duy_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -1371,7 +1408,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2)
               endif
 
-           elseif( CPML_regions(ispec_CPML) == 6 ) then
+        enddo
+     enddo
+  enddo
+  endif
+
+  if( CPML_regions(ispec_CPML) == 6 ) then
+
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
               !------------------------------------------------------------------------------
               !---------------------------- YZ-edge C-PML -----------------------------------
               !------------------------------------------------------------------------------
@@ -1382,7 +1428,7 @@
                  A7 = d_store_y(i,j,k,ispec_CPML) * k_store_z(i,j,k,ispec_CPML) &
                       + d_store_z(i,j,k,ispec_CPML) * k_store_y(i,j,k,ispec_CPML) &
                       + (it+0.0) * deltat * d_store_y(i,j,k,ispec_CPML) * d_store_z(i,j,k,ispec_CPML)
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
                  A7 = d_store_y(i,j,k,ispec_CPML)*k_store_z(i,j,k,ispec_CPML) &
                       + d_store_z(i,j,k,ispec_CPML)*k_store_y(i,j,k,ispec_CPML) &
                       + (it+0.5)*deltat*d_store_y(i,j,k,ispec_CPML)*d_store_z(i,j,k,ispec_CPML)
@@ -1399,7 +1445,7 @@
               else
                  coef1_1 = deltat/2.0d0 
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               coef0_2 = coef0_1
               coef1_2 = coef1_1
@@ -1432,7 +1478,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dxl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dxl(i,j,k,ispec_CPML) * coef2_1
@@ -1460,7 +1506,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -1483,7 +1529,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,2) &
@@ -1509,7 +1555,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
                  
@@ -1532,7 +1578,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = 0.d0
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) = coef0_2 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,2) &
@@ -1583,7 +1629,7 @@
                  else
                     coef1_1 = deltat/2.0d0 
                     coef2_1 = deltat/2.0d0 
-                 end if
+                 endif
 
                  rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_x(i,j,k,ispec_CPML,2) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -1625,7 +1671,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0 
-                 end if
+                 endif
 
                  rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duy_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duy_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -1654,7 +1700,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2) 
               endif
 
-           elseif( CPML_regions(ispec_CPML) == 7 ) then
+        enddo
+     enddo
+  enddo
+  endif
+
+  if( CPML_regions(ispec_CPML) == 7 ) then
+
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
               !------------------------------------------------------------------------------
               !---------------------------- XYZ-corner C-PML --------------------------------
               !------------------------------------------------------------------------------
@@ -1674,7 +1729,7 @@
                          d_store_y(i,j,k,ispec_CPML) * k_store_z(i,j,k,ispec_CPML) ) / &
                          k_store_x(i,j,k,ispec_CPML) + &
                          (it+0.0)*deltat*d_store_y(i,j,k,ispec_CPML)*d_store_z(i,j,k,ispec_CPML)/k_store_x(i,j,k,ispec_CPML)
-                 elseif( ispec_is_acoustic(ispec) ) then
+                 else if( ispec_is_acoustic(ispec) ) then
                     A7 = (d_store_z(i,j,k,ispec_CPML)*k_store_y(i,j,k,ispec_CPML)+ &
                          d_store_y(i,j,k,ispec_CPML)*k_store_z(i,j,k,ispec_CPML)) / &
                          k_store_x(i,j,k,ispec_CPML) + &
@@ -1693,7 +1748,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0
-              end if
+              endif
 
               bb = d_store_x(i,j,k,ispec_CPML) / k_store_x(i,j,k,ispec_CPML) + alpha_store(i,j,k,ispec_CPML)
 
@@ -1705,7 +1760,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
 
               if( ispec_is_elastic(ispec) ) then
@@ -1743,7 +1798,7 @@
                  duzdxl_z = A6 * PML_duz_dxl(i,j,k,ispec_CPML)  &
                       + A7 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,1) + A8 * rmemory_duz_dxl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
                  
                  rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dxl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dxl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dxl(i,j,k,ispec_CPML) * coef2_1
@@ -1777,7 +1832,7 @@
                          + d_store_x(i,j,k,ispec_CPML) * k_store_z(i,j,k,ispec_CPML) ) / &
                          k_store_y(i,j,k,ispec_CPML) + &
                          (it+0.0)*deltat*d_store_x(i,j,k,ispec_CPML)*d_store_z(i,j,k,ispec_CPML)/k_store_y(i,j,k,ispec_CPML)
-                 elseif( ispec_is_acoustic(ispec) ) then
+                 else if( ispec_is_acoustic(ispec) ) then
                     A10 = (d_store_z(i,j,k,ispec_CPML)*k_store_x(i,j,k,ispec_CPML) &
                          +d_store_x(i,j,k,ispec_CPML)*k_store_z(i,j,k,ispec_CPML)) / &
                          k_store_y(i,j,k,ispec_CPML) + &
@@ -1796,7 +1851,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               bb = d_store_y(i,j,k,ispec_CPML) / k_store_y(i,j,k,ispec_CPML) + alpha_store(i,j,k,ispec_CPML)
 
@@ -1808,7 +1863,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0 
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -1845,7 +1900,7 @@
                  duzdyl_z = A9 * PML_duz_dyl(i,j,k,ispec_CPML)  &
                       + A10 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,1) + A11 * rmemory_duz_dyl_z(i,j,k,ispec_CPML,2) 
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
                  rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dyl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dyl(i,j,k,ispec_CPML) * coef2_1
 
@@ -1877,7 +1932,7 @@
                          + d_store_x(i,j,k,ispec_CPML)*k_store_y(i,j,k,ispec_CPML) ) / &
                          k_store_z(i,j,k,ispec_CPML) + &
                          (it+0.0)*deltat*d_store_x(i,j,k,ispec_CPML)*d_store_y(i,j,k,ispec_CPML)/k_store_z(i,j,k,ispec_CPML)
-                 elseif( ispec_is_acoustic(ispec) ) then
+                 else if( ispec_is_acoustic(ispec) ) then
                     A13 = (d_store_y(i,j,k,ispec_CPML)*k_store_x(i,j,k,ispec_CPML)&
                          +d_store_x(i,j,k,ispec_CPML)*k_store_y(i,j,k,ispec_CPML)) / &
                          k_store_z(i,j,k,ispec_CPML) + &
@@ -1896,7 +1951,7 @@
               else
                  coef1_1 = deltat/2.0d0
                  coef2_1 = deltat/2.0d0 
-              end if
+              endif
 
               bb = d_store_z(i,j,k,ispec_CPML) / k_store_z(i,j,k,ispec_CPML) + alpha_store(i,j,k,ispec_CPML)
 
@@ -1908,7 +1963,7 @@
               else
                  coef1_2 = deltat/2.0d0
                  coef2_2 = deltat/2.0d0
-              end if
+              endif
 
               if( ispec_is_elastic(ispec) ) then
 
@@ -1945,7 +2000,7 @@
                  duzdzl_z = A12 * PML_duz_dzl(i,j,k,ispec_CPML)  &
                       + A13 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,1) + A14 * rmemory_duz_dzl_z(i,j,k,ispec_CPML,2)
 
-              elseif( ispec_is_acoustic(ispec) ) then
+              else if( ispec_is_acoustic(ispec) ) then
 
                  rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_dpotential_dzl(i,j,k,ispec_CPML,1) &
                       + PML_dpotential_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_dpotential_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -1978,7 +2033,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_y(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -2020,7 +2075,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duz_dzl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duz_dzl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duz_dzl(i,j,k,ispec_CPML) * coef2_1
@@ -2062,7 +2117,7 @@
                  else
                     coef1_1 = deltat/2.0d0
                     coef2_1 = deltat/2.0d0
-                 end if
+                 endif
 
                  rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) = coef0_1 * rmemory_duy_dyl_x(i,j,k,ispec_CPML,1) &  
                       + PML_duy_dyl_new(i,j,k,ispec_CPML) * coef1_1 + PML_duy_dyl(i,j,k,ispec_CPML) * coef2_1
@@ -2091,9 +2146,16 @@
                       + A20 * rmemory_dux_dxl_y(i,j,k,ispec_CPML,1) + rmemory_dux_dxl_y(i,j,k,ispec_CPML,2)
               endif
 
-           endif ! CPML_regions
+        enddo
+     enddo
+  enddo
+  endif
 
-           if( ispec_is_elastic(ispec) ) then
+
+  if( ispec_is_elastic(ispec) ) then
+  do k=1,NGLLZ
+     do j=1,NGLLY
+        do i=1,NGLLX
               ! compute stress sigma
               sigma_xx = lambdalplus2mul*duxdxl_x + lambdal*duydyl_x + lambdal*duzdzl_x
               sigma_yx = mul*duxdyl_x + mul*duydxl_x
@@ -2119,10 +2181,10 @@
               tempx3(i,j,k) = jacobianl * (sigma_xx*gammaxl + sigma_yx*gammayl + sigma_zx*gammazl) ! this goes to accel_x
               tempy3(i,j,k) = jacobianl * (sigma_xy*gammaxl + sigma_yy*gammayl + sigma_zy*gammazl) ! this goes to accel_y
               tempz3(i,j,k) = jacobianl * (sigma_xz*gammaxl + sigma_yz*gammayl + sigma_zz*gammazl) ! this goes to accel_z
-           endif
-
         enddo
      enddo
   enddo
+  endif
 
 end subroutine pml_set_memory_variables
+



More information about the CIG-COMMITS mailing list