[cig-commits] [commit] QA: updates configuration scripts to allow for building binaries in a different directory than the root directory; bug fix in check_mesh_resolution() which speeds it up; adds middle abscissa check into zwgldj() routine and removes the checks in other locations (7a0c6c0)
cig_noreply at geodynamics.org
cig_noreply at geodynamics.org
Tue Feb 4 06:57:39 PST 2014
Repository : ssh://geoshell/specfem3d
On branch : QA
Link : https://github.com/geodynamics/specfem3d/compare/56deeb214ac966cde7e955473d9e61288b16d98f...e38ba401e045bc221ec1099e88d3aa31e7b4773c
>---------------------------------------------------------------
commit 7a0c6c0df6856bc7812d0272de2807084b547da9
Author: daniel peter <peterda at ethz.ch>
Date: Tue Feb 4 09:05:31 2014 +0100
updates configuration scripts to allow for building binaries in a different directory than the root directory; bug fix in check_mesh_resolution() which speeds it up; adds middle abscissa check into zwgldj() routine and removes the checks in other locations
>---------------------------------------------------------------
7a0c6c0df6856bc7812d0272de2807084b547da9
Makefile.in | 8 +-
configure | 63 +++++-----------
configure.ac | 20 ++---
src/generate_databases/calc_jacobian.f90 | 7 +-
src/generate_databases/create_regions_mesh.f90 | 27 +++----
src/shared/check_mesh_resolution.f90 | 100 ++++++++++++++-----------
src/shared/define_derivation_matrices.f90 | 6 +-
src/shared/gll_library.f90 | 5 ++
8 files changed, 110 insertions(+), 126 deletions(-)
diff --git a/Makefile.in b/Makefile.in
index 56f4e12..492f14a 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -81,21 +81,15 @@ MPI_INCLUDES = @MPI_INCLUDES@
SCOTCH_BUNDLED = @USE_BUNDLED_SCOTCH@
-ifeq (${SCOTCH_BUNDLED},1)
-SCOTCH_DIR = @top_srcdir@/src/decompose_mesh/@SCOTCH_DIR@
-SCOTCH_INCDIR = @top_srcdir@/src/decompose_mesh/@SCOTCH_INCLUDEDIR@
-SCOTCH_LIBDIR = @top_srcdir@/src/decompose_mesh/@SCOTCH_LIBDIR@
-else
SCOTCH_DIR = @SCOTCH_DIR@
SCOTCH_INCDIR = @SCOTCH_INCLUDEDIR@
SCOTCH_LIBDIR = @SCOTCH_LIBDIR@
-endif
SCOTCH_INC = -I${SCOTCH_INCDIR}
SCOTCH_LIBS = -L${SCOTCH_LIBDIR} -lscotch -lscotcherr
### added support for METIS as well, thus uncomment the line below and compile METIS if you want to use it instead of SCOTCH
-#SCOTCH_LIBS = -L at SCOTCH_LIBDIR@ -lscotch -lscotcherr -L./src/decompose_mesh/metis-4.0.3 -L./metis-4.0.3 -lmetis
+#SCOTCH_LIBS = -L${SCOTCH_LIBDIR} -lscotch -lscotcherr -L./src/decompose_mesh/metis-4.0.3 -L./metis-4.0.3 -lmetis
#######################################
diff --git a/configure b/configure
index 8eef2e9..b9e7be4 100755
--- a/configure
+++ b/configure
@@ -677,6 +677,7 @@ CPPFLAGS
CFLAGS
CC
FCLIBS
+srcdir
FCENV
OBJEXT
EXEEXT
@@ -3729,6 +3730,7 @@ FFLAGS="$FCFLAGS"
+
flags_guess="$SHELL $srcdir/flags.guess"
{ $as_echo "$as_me:${as_lineno-$LINENO}: running $flags_guess" >&5
$as_echo "$as_me: running $flags_guess" >&6;}
@@ -6120,6 +6122,7 @@ ac_link='$FC -o conftest$ac_exeext $FCFLAGS $LDFLAGS $ac_fcflags_srcext conftest
ac_compiler_gnu=$ac_cv_fc_compiler_gnu
+
############################################################
#checks for Scotch
@@ -6820,9 +6823,10 @@ ac_compiler_gnu=$ac_cv_fc_compiler_gnu
# uses bundled scotch: current version pointed to by symbolic link scotch/
USE_BUNDLED_SCOTCH=1
- SCOTCH_DIR="scotch"
+ SCOTCH_DIR="$srcdir/src/decompose_mesh/scotch"
SCOTCH_LIBDIR="${SCOTCH_DIR}/lib"
SCOTCH_INCLUDEDIR="${SCOTCH_DIR}/include"
+
fi
LDFLAGS=${ac_save_ldflags}
@@ -6864,7 +6868,6 @@ if test x"$LOCAL_PATH_IS_ALSO_GLOBAL" = x; then :
fi
-
# python and pyre, this is probably unused...
@@ -8235,18 +8238,21 @@ _ACEOF
ac_config_files="$ac_config_files Makefile setup/constants.h setup/precision.h"
-ac_config_files="$ac_config_files src/decompose_mesh/scotch/src/Makefile.inc"
-
-
-ac_config_links="$ac_config_links DATA/meshfem3D_files:DATA/meshfem3D_files"
+if test "$USE_BUNDLED_SCOTCH" = 1; then
+ ac_config_files="$ac_config_files ${SCOTCH_DIR}/src/Makefile.inc"
+fi
ac_config_commands="$ac_config_commands bin"
ac_config_commands="$ac_config_commands obj"
+ac_config_commands="$ac_config_commands DATA"
+
ac_config_commands="$ac_config_commands OUTPUT_FILES"
+ac_config_commands="$ac_config_commands DATABASES_MPI"
+
cat >confcache <<\_ACEOF
# This file is a shell script that caches the results of configure
@@ -8811,7 +8817,6 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
# Files that config.status was made for.
config_files="$ac_config_files"
config_headers="$ac_config_headers"
-config_links="$ac_config_links"
config_commands="$ac_config_commands"
_ACEOF
@@ -8842,9 +8847,6 @@ $config_files
Configuration headers:
$config_headers
-Configuration links:
-$config_links
-
Configuration commands:
$config_commands
@@ -8979,11 +8981,12 @@ do
"Makefile") CONFIG_FILES="$CONFIG_FILES Makefile" ;;
"setup/constants.h") CONFIG_FILES="$CONFIG_FILES setup/constants.h" ;;
"setup/precision.h") CONFIG_FILES="$CONFIG_FILES setup/precision.h" ;;
- "src/decompose_mesh/scotch/src/Makefile.inc") CONFIG_FILES="$CONFIG_FILES src/decompose_mesh/scotch/src/Makefile.inc" ;;
- "DATA/meshfem3D_files") CONFIG_LINKS="$CONFIG_LINKS DATA/meshfem3D_files:DATA/meshfem3D_files" ;;
+ "${SCOTCH_DIR}/src/Makefile.inc") CONFIG_FILES="$CONFIG_FILES ${SCOTCH_DIR}/src/Makefile.inc" ;;
"bin") CONFIG_COMMANDS="$CONFIG_COMMANDS bin" ;;
"obj") CONFIG_COMMANDS="$CONFIG_COMMANDS obj" ;;
+ "DATA") CONFIG_COMMANDS="$CONFIG_COMMANDS DATA" ;;
"OUTPUT_FILES") CONFIG_COMMANDS="$CONFIG_COMMANDS OUTPUT_FILES" ;;
+ "DATABASES_MPI") CONFIG_COMMANDS="$CONFIG_COMMANDS DATABASES_MPI" ;;
*) as_fn_error $? "invalid argument: \`$ac_config_target'" "$LINENO" 5;;
esac
@@ -8997,7 +9000,6 @@ done
if $ac_need_defaults; then
test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files
test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers
- test "${CONFIG_LINKS+set}" = set || CONFIG_LINKS=$config_links
test "${CONFIG_COMMANDS+set}" = set || CONFIG_COMMANDS=$config_commands
fi
@@ -9295,7 +9297,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
fi # test -n "$CONFIG_HEADERS"
-eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :L $CONFIG_LINKS :C $CONFIG_COMMANDS"
+eval set X " :F $CONFIG_FILES :H $CONFIG_HEADERS :C $CONFIG_COMMANDS"
shift
for ac_tag
do
@@ -9527,38 +9529,7 @@ $as_echo "$as_me: $ac_file is unchanged" >&6;}
|| as_fn_error $? "could not create -" "$LINENO" 5
fi
;;
- :L)
- #
- # CONFIG_LINK
- #
-
- if test "$ac_source" = "$ac_file" && test "$srcdir" = '.'; then
- :
- else
- # Prefer the file from the source tree if names are identical.
- if test "$ac_source" = "$ac_file" || test ! -r "$ac_source"; then
- ac_source=$srcdir/$ac_source
- fi
-
- { $as_echo "$as_me:${as_lineno-$LINENO}: linking $ac_source to $ac_file" >&5
-$as_echo "$as_me: linking $ac_source to $ac_file" >&6;}
- if test ! -r "$ac_source"; then
- as_fn_error $? "$ac_source: file not found" "$LINENO" 5
- fi
- rm -f "$ac_file"
-
- # Try a relative symlink, then a hard link, then a copy.
- case $ac_source in
- [\\/$]* | ?:[\\/]* ) ac_rel_source=$ac_source ;;
- *) ac_rel_source=$ac_top_build_prefix$ac_source ;;
- esac
- ln -s "$ac_rel_source" "$ac_file" 2>/dev/null ||
- ln "$ac_source" "$ac_file" 2>/dev/null ||
- cp -p "$ac_source" "$ac_file" ||
- as_fn_error $? "cannot link or copy $ac_source to $ac_file" "$LINENO" 5
- fi
- ;;
:C) { $as_echo "$as_me:${as_lineno-$LINENO}: executing $ac_file commands" >&5
$as_echo "$as_me: executing $ac_file commands" >&6;}
;;
@@ -9568,7 +9539,9 @@ $as_echo "$as_me: executing $ac_file commands" >&6;}
case $ac_file$ac_mode in
"bin":C) as_dir=bin; as_fn_mkdir_p ;;
"obj":C) as_dir=obj; as_fn_mkdir_p ;;
+ "DATA":C) as_dir=DATA; as_fn_mkdir_p ;;
"OUTPUT_FILES":C) as_dir=OUTPUT_FILES; as_fn_mkdir_p ;;
+ "DATABASES_MPI":C) as_dir=OUTPUT_FILES/DATABASES_MPI; as_fn_mkdir_p ;;
esac
done # for ac_tag
diff --git a/configure.ac b/configure.ac
index f1648e0..56ceea5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -120,6 +120,7 @@ F77="$FC"
FFLAGS="$FCFLAGS"
AC_PROVIDE([AC_PROG_F77])
AC_SUBST([FCENV])
+AC_SUBST(srcdir)
flags_guess="$SHELL $srcdir/flags.guess"
AC_MSG_NOTICE([running $flags_guess])
@@ -139,6 +140,7 @@ AC_CHECK_HEADER(emmintrin.h,AC_DEFINE([HAVE_EMMINTRIN],[1],[Define if emmintrin.
AC_CHECK_HEADER(xmmintrin.h,AC_DEFINE([HAVE_XMMINTRIN],[1],[Define if xmmintrin.h]))
AC_LANG_POP(C)
+
############################################################
#checks for Scotch
@@ -232,9 +234,10 @@ else
# uses bundled scotch: current version pointed to by symbolic link scotch/
USE_BUNDLED_SCOTCH=1
- SCOTCH_DIR="scotch"
+ SCOTCH_DIR="$srcdir/src/decompose_mesh/scotch"
SCOTCH_LIBDIR="${SCOTCH_DIR}/lib"
SCOTCH_INCLUDEDIR="${SCOTCH_DIR}/include"
+
fi
LDFLAGS=${ac_save_ldflags}
@@ -270,7 +273,6 @@ AS_IF([test x"$LOCAL_PATH_IS_ALSO_GLOBAL" = x],[
LOCAL_PATH_IS_ALSO_GLOBAL=true
])
-
# python and pyre, this is probably unused...
AC_ARG_VAR(PYTHON, [Python interpreter])
@@ -407,17 +409,17 @@ AC_CONFIG_FILES([
setup/precision.h
])
-AC_CONFIG_FILES([
- src/decompose_mesh/scotch/src/Makefile.inc
-])
-
-AC_CONFIG_LINKS([
- DATA/meshfem3D_files:DATA/meshfem3D_files
-])
+if test "$USE_BUNDLED_SCOTCH" = 1; then
+ AC_CONFIG_FILES([
+ ${SCOTCH_DIR}/src/Makefile.inc
+ ])
+fi
AC_CONFIG_COMMANDS([bin], [AS_MKDIR_P(bin)])
AC_CONFIG_COMMANDS([obj], [AS_MKDIR_P(obj)])
+AC_CONFIG_COMMANDS([DATA], [AS_MKDIR_P(DATA)])
AC_CONFIG_COMMANDS([OUTPUT_FILES], [AS_MKDIR_P(OUTPUT_FILES)])
+AC_CONFIG_COMMANDS([DATABASES_MPI], [AS_MKDIR_P(OUTPUT_FILES/DATABASES_MPI)])
AC_OUTPUT
diff --git a/src/generate_databases/calc_jacobian.f90 b/src/generate_databases/calc_jacobian.f90
index a21993e..8f13b5d 100644
--- a/src/generate_databases/calc_jacobian.f90
+++ b/src/generate_databases/calc_jacobian.f90
@@ -76,20 +76,23 @@
xxi = xxi + dershape3D(1,ia,i,j,k)*xelm(ia)
xeta = xeta + dershape3D(2,ia,i,j,k)*xelm(ia)
xgamma = xgamma + dershape3D(3,ia,i,j,k)*xelm(ia)
+
yxi = yxi + dershape3D(1,ia,i,j,k)*yelm(ia)
yeta = yeta + dershape3D(2,ia,i,j,k)*yelm(ia)
ygamma = ygamma + dershape3D(3,ia,i,j,k)*yelm(ia)
+
zxi = zxi + dershape3D(1,ia,i,j,k)*zelm(ia)
zeta = zeta + dershape3D(2,ia,i,j,k)*zelm(ia)
zgamma = zgamma + dershape3D(3,ia,i,j,k)*zelm(ia)
+
xmesh = xmesh + shape3D(ia,i,j,k)*xelm(ia)
ymesh = ymesh + shape3D(ia,i,j,k)*yelm(ia)
zmesh = zmesh + shape3D(ia,i,j,k)*zelm(ia)
enddo
jacobian = xxi*(yeta*zgamma-ygamma*zeta) - &
- xeta*(yxi*zgamma-ygamma*zxi) + &
- xgamma*(yxi*zeta-yeta*zxi)
+ xeta*(yxi*zgamma-ygamma*zxi) + &
+ xgamma*(yxi*zeta-yeta*zxi)
! check that the Jacobian transform is invertible, i.e. that the Jacobian never becomes negative or null
if(jacobian <= ZERO) call exit_MPI(myrank,'error: negative or null 3D Jacobian found')
diff --git a/src/generate_databases/create_regions_mesh.f90 b/src/generate_databases/create_regions_mesh.f90
index 6e6b500..95f8bb8 100644
--- a/src/generate_databases/create_regions_mesh.f90
+++ b/src/generate_databases/create_regions_mesh.f90
@@ -442,8 +442,6 @@ subroutine crm_ext_allocate_arrays(nspec,LOCAL_PATH,myrank, &
allocate(rhostore(NGLLX,NGLLY,NGLLZ,nspec), &
kappastore(NGLLX,NGLLY,NGLLZ,nspec), &
mustore(NGLLX,NGLLY,NGLLZ,nspec),stat=ier)
- !vpstore(NGLLX,NGLLY,NGLLZ,nspec), &
- !vsstore(NGLLX,NGLLY,NGLLZ,nspec),
if(ier /= 0) call exit_MPI(myrank,'not enough memory to allocate arrays')
! array with poroelastic model
@@ -570,11 +568,6 @@ subroutine crm_ext_setup_jacobian(myrank, &
call zwgljd(yigll,wygll,NGLLY,GAUSSALPHA,GAUSSBETA)
call zwgljd(zigll,wzgll,NGLLZ,GAUSSALPHA,GAUSSBETA)
-! if number of points is odd, the middle abscissa is exactly zero
- if(mod(NGLLX,2) /= 0) xigll((NGLLX-1)/2+1) = ZERO
- if(mod(NGLLY,2) /= 0) yigll((NGLLY-1)/2+1) = ZERO
- if(mod(NGLLZ,2) /= 0) zigll((NGLLZ-1)/2+1) = ZERO
-
! get the 3-D shape functions
call get_shape3D(myrank,shape3D,dershape3D,xigll,yigll,zigll,NGNOD)
@@ -616,10 +609,10 @@ subroutine crm_ext_setup_jacobian(myrank, &
! CUBIT should provide a mesh ordering such that the 3D jacobian is defined
! (otherwise mesh would be degenerated)
call calc_jacobian(myrank,xixstore,xiystore,xizstore, &
- etaxstore,etaystore,etazstore, &
- gammaxstore,gammaystore,gammazstore,jacobianstore, &
- xstore,ystore,zstore, &
- xelm,yelm,zelm,shape3D,dershape3D,ispec,nspec)
+ etaxstore,etaystore,etazstore, &
+ gammaxstore,gammaystore,gammazstore,jacobianstore, &
+ xstore,ystore,zstore, &
+ xelm,yelm,zelm,shape3D,dershape3D,ispec,nspec)
enddo
@@ -662,10 +655,10 @@ subroutine crm_ext_setup_indexing(ibool, &
! allocate memory for arrays
allocate(locval(npointot), &
- ifseg(npointot), &
- xp(npointot), &
- yp(npointot), &
- zp(npointot),stat=ier)
+ ifseg(npointot), &
+ xp(npointot), &
+ yp(npointot), &
+ zp(npointot),stat=ier)
if(ier /= 0) call exit_MPI(myrank,'not enough memory to allocate arrays')
! creates temporary global point arrays
@@ -707,8 +700,8 @@ subroutine crm_ext_setup_indexing(ibool, &
! unique global point locations
nglob_dummy = nglob
allocate(xstore_dummy(nglob_dummy), &
- ystore_dummy(nglob_dummy), &
- zstore_dummy(nglob_dummy),stat=ier)
+ ystore_dummy(nglob_dummy), &
+ zstore_dummy(nglob_dummy),stat=ier)
if(ier /= 0) stop 'error in allocate'
do ispec = 1, nspec
do k = 1, NGLLZ
diff --git a/src/shared/check_mesh_resolution.f90 b/src/shared/check_mesh_resolution.f90
index 6395caf..795abe0 100644
--- a/src/shared/check_mesh_resolution.f90
+++ b/src/shared/check_mesh_resolution.f90
@@ -62,7 +62,7 @@
integer :: myrank
integer :: NSPEC_AB_global_min,NSPEC_AB_global_max,NSPEC_AB_global_sum
integer :: NGLOB_AB_global_min,NGLOB_AB_global_max,NGLOB_AB_global_sum
- integer :: ispec !,sizeprocs
+ integer :: ispec
!********************************************************************************
@@ -82,6 +82,13 @@
integer:: ier
character(len=256) :: filename,prname
+ ! timing
+ double precision, external :: wtime
+ double precision :: time_start,tCPU
+
+ ! timing gets MPI starting time
+ time_start = wtime()
+
! initializations
if( DT <= 0.0d0) then
DT_PRESENT = .false.
@@ -169,7 +176,7 @@
! determines minimum/maximum velocities within this element
call get_vpvs_minmax(vpmin,vpmax,vsmin,vsmax,ispec,has_vs_zero, &
- NSPEC_AB,kappastore,mustore,rho_vp,rho_vs)
+ NSPEC_AB,kappastore,mustore,rho_vp,rho_vs)
! min/max for whole cpu partition
vpmin_glob = min(vpmin_glob, vpmin)
@@ -178,45 +185,13 @@
vsmin_glob = min(vsmin_glob, vsmin)
vsmax_glob = max(vsmax_glob, vsmax)
- ! computes minimum and maximum distance of neighbor GLL points in this grid cell
- call get_GLL_minmaxdistance(distance_min,distance_max,ispec, &
- NSPEC_AB,NGLOB_AB,ibool,xstore,ystore,zstore)
-
- distance_min_glob = min(distance_min_glob, distance_min)
- distance_max_glob = max(distance_max_glob, distance_max)
-
- x_min_glob = minval(xstore)
- x_max_glob = maxval(xstore)
-
- y_min_glob = minval(ystore)
- y_max_glob = maxval(ystore)
-
- z_min_glob = minval(zstore)
- z_max_glob = maxval(zstore)
-
! computes minimum and maximum size of this grid cell
call get_elem_minmaxsize(elemsize_min,elemsize_max,ispec, &
- NSPEC_AB,NGLOB_AB,ibool,xstore,ystore,zstore)
+ NSPEC_AB,NGLOB_AB,ibool,xstore,ystore,zstore)
elemsize_min_glob = min(elemsize_min_glob, elemsize_min)
elemsize_max_glob = max(elemsize_max_glob, elemsize_max)
- ! courant number
- ! based on minimum GLL point distance and maximum velocity
- ! i.e. on the maximum ratio of ( velocity / gridsize )
- if( DT_PRESENT ) then
- cmax = max(vpmax,vsmax) * DT / distance_min
- cmax_glob = max(cmax_glob,cmax)
-
- ! debug: for vtk output
- if( SAVE_MESH_FILES ) tmp1(ispec) = cmax
- endif
-
-
- ! suggested timestep
- dt_suggested = COURANT_SUGGESTED * distance_min / max( vpmax,vsmax )
- dt_suggested_glob = min( dt_suggested_glob, dt_suggested)
-
! estimation of minimum period resolved
! based on average GLL distance within element and minimum velocity
!
@@ -241,6 +216,31 @@
!pmax = distance_max / min( vpmin,vsmin ) * NELEM_PER_WAVELENGTH
!pmax_glob = max(pmax_glob,pmax)
+ ! computes minimum and maximum distance of neighbor GLL points in this grid cell
+ ! exact way (expensive)
+ call get_GLL_minmaxdistance(distance_min,distance_max,ispec, &
+ NSPEC_AB,NGLOB_AB,ibool,xstore,ystore,zstore)
+ ! approximate way (based on theoretical GLL point spacing)
+
+ distance_min_glob = min(distance_min_glob, distance_min)
+ distance_max_glob = max(distance_max_glob, distance_max)
+
+ ! courant number
+ ! based on minimum GLL point distance and maximum velocity
+ ! i.e. on the maximum ratio of ( velocity / gridsize )
+ if( DT_PRESENT ) then
+ cmax = max(vpmax,vsmax) * DT / distance_min
+ cmax_glob = max(cmax_glob,cmax)
+
+ ! debug: for vtk output
+ if( SAVE_MESH_FILES ) tmp1(ispec) = cmax
+ endif
+
+ ! suggested timestep
+ dt_suggested = COURANT_SUGGESTED * distance_min / max( vpmax,vsmax )
+ dt_suggested_glob = min( dt_suggested_glob, dt_suggested)
+
+
! debug: for vtk output
if( SAVE_MESH_FILES ) tmp2(ispec) = pmax
@@ -276,7 +276,7 @@
endif
endif
-! outputs infos
+ ! outputs infos
if ( myrank == 0 ) then
write(IMAIN,*)
write(IMAIN,*) '********'
@@ -315,6 +315,16 @@
endif
endif
+ ! model dimensions
+ x_min_glob = minval(xstore)
+ x_max_glob = maxval(xstore)
+
+ y_min_glob = minval(ystore)
+ y_max_glob = maxval(ystore)
+
+ z_min_glob = minval(zstore)
+ z_max_glob = maxval(zstore)
+
! min and max dimensions of the model
x_min = x_min_glob
x_max = x_max_glob
@@ -339,16 +349,14 @@
dt_suggested = dt_suggested_glob
call min_all_cr(dt_suggested,dt_suggested_glob)
-! determines global min/max values from all cpu partitions
+ ! determines global min/max values from all cpu partitions
if( DT_PRESENT ) then
! courant number
cmax = cmax_glob
call max_all_cr(cmax,cmax_glob)
endif
- !call world_size(sizeprocs)
-
-! outputs infos
+ ! outputs infos
if ( myrank == 0 ) then
write(IMAIN,*) '*********************************************'
write(IMAIN,*) '*** Verification of simulation parameters ***'
@@ -395,6 +403,14 @@
call bcast_all_cr(tmp_val,1)
min_resolved_period = tmp_val(1)
+ ! timing
+ tCPU = wtime() - time_start
+ if( myrank == 0 ) then
+ write(IMAIN,*) "Elapsed time for checking mesh resolution in seconds = ", tCPU
+ ! flushes file buffer for main output file (IMAIN)
+ call flush_IMAIN()
+ endif
+
! debug: for vtk output
if( SAVE_MESH_FILES ) then
call create_name_database(prname,myrank,LOCAL_PATH)
@@ -467,7 +483,7 @@
integer :: myrank
integer :: NSPEC_AB_global_min,NSPEC_AB_global_max,NSPEC_AB_global_sum
integer :: NGLOB_AB_global_min,NGLOB_AB_global_max,NGLOB_AB_global_sum
- integer :: ispec !,sizeprocs
+ integer :: ispec
!********************************************************************************
@@ -705,8 +721,6 @@
call max_all_i(NGLOB_AB,NGLOB_AB_global_max)
call sum_all_i(NGLOB_AB,NGLOB_AB_global_sum)
- !call world_size(sizeprocs)
-
! outputs infos
if ( myrank == 0 ) then
write(IMAIN,*)
diff --git a/src/shared/define_derivation_matrices.f90 b/src/shared/define_derivation_matrices.f90
index 1981337..228698b 100644
--- a/src/shared/define_derivation_matrices.f90
+++ b/src/shared/define_derivation_matrices.f90
@@ -59,9 +59,9 @@
call zwgljd(zigll,wzgll,NGLLZ,GAUSSALPHA,GAUSSBETA)
! if number of points is odd, the middle abscissa is exactly ZERO
- if(mod(NGLLX,2) /= 0) xigll((NGLLX-1)/2+1) = ZERO
- if(mod(NGLLY,2) /= 0) yigll((NGLLY-1)/2+1) = ZERO
- if(mod(NGLLZ,2) /= 0) zigll((NGLLZ-1)/2+1) = ZERO
+! if(mod(NGLLX,2) /= 0) xigll((NGLLX-1)/2+1) = ZERO
+! if(mod(NGLLY,2) /= 0) yigll((NGLLY-1)/2+1) = ZERO
+! if(mod(NGLLZ,2) /= 0) zigll((NGLLZ-1)/2+1) = ZERO
! distinguish between single and double precision for reals
if(CUSTOM_REAL == SIZE_REAL) then
diff --git a/src/shared/gll_library.f90 b/src/shared/gll_library.f90
index 420bf47..b37e10e 100644
--- a/src/shared/gll_library.f90
+++ b/src/shared/gll_library.f90
@@ -564,9 +564,14 @@
call zwgjd(z(2:n),w(2:n),nm1,alpg,betg)
endif
+! start and end point at exactly -1 and 1
z(1) = - one
z(np) = one
+! if number of points is odd, the middle abscissa is exactly zero
+ if(mod(np,2) /= 0) z((np-1)/2+1) = zero
+
+! weights
do i=2,np-1
w(i) = w(i)/(one-z(i)**2)
enddo
More information about the CIG-COMMITS
mailing list