Skip to content

Commit

Permalink
Merge pull request #833 from danielpeter/devel
Browse files Browse the repository at this point in the history
revisits geocentric vs geographic positioning; updates SIEM meshing; updates source positioning and reference solutions; increases version to 8.1.1
  • Loading branch information
danielpeter committed Mar 28, 2024
2 parents dc089fc + 05ad2f1 commit 2c619fd
Show file tree
Hide file tree
Showing 536 changed files with 444,008 additions and 429,051 deletions.
11 changes: 5 additions & 6 deletions CITATION.cff
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
cff-version: 1.2.0

message: "If this software turns out to be helpful for your research, please cite both the article from preferred-citation and the software itself. More detailed citation suggestions can be found in the user manual."
title: 'SPECFEM/specfem3d_globe: SPECFEM3D_GLOBE v8.1.0'
version: v8.1.0
date-released: 2023-12-20
repository-code: https://github.com/SPECFEM/specfem3d_globe/tree/v8.1.0
title: 'SPECFEM/specfem3d_globe: SPECFEM3D_GLOBE v8.1.1'
version: v8.1.1
date-released: '2024-03-18'
repository-code: https://github.com/SPECFEM/specfem3d_globe/tree/v8.1.1
url: "https://github.com/SPECFEM/specfem3d_globe"
type: software
identifiers:
- type: doi
- value: 10.5281/zenodo.10411115
license:
- gpl-3.0-or-later
license: "GPL-3.0"

authors:
- family-names: Komatitsch
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ def convert_etopo_ascii2bin(filename_in,filename_out):
text = inf.readlines(1024*1024) # 1M at a time
if not len(text):
break
ioin = BytesIO(''.join(text))
ioin = BytesIO(b"".join(text))
data = np.genfromtxt(ioin)
if not len(data):
break
Expand Down
47 changes: 42 additions & 5 deletions DATA/topo_bathy/run_create_topo_bathy_file.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,9 @@
# plots PNM image
plot_image = True

## smoothing (turned on by default)
use_smoothing = True

####################################################################

# global parameters
Expand Down Expand Up @@ -967,6 +970,12 @@ def create_topo_bathy(topo):
print("Unrecognized option %s" % topo)
sys.exit(1)

# for raw, unmodified output sets filter size to zero
if not use_smoothing:
SIZE_FILTER_ONE_SIDE = 0
print(" not using smoothing")
print("")

# 1-degree in km
if 'mars' in topo:
radius = 3390.0
Expand Down Expand Up @@ -1004,6 +1013,15 @@ def create_topo_bathy(topo):
#filename_grid = 'etopo1_ice_c_resampled_at_2minutes.grd'
#filename_out = 'topo_bathy_etopo1_ice_c_resampled_at_2minutes_original_unmodified_unsmoothed.dat'

# raw topo output filenames
if not use_smoothing:
# special case for etopo1 & etopo2 handling
if topo == 'etopo1':
filename_out_smoothed = 'topo_bathy_etopo1_unmodified_unsmoothed.dat'
elif topo == 'etopo2':
filename_out_smoothed = 'topo_bathy_etopo2_unmodified_unsmoothed.dat'
# for all other topo, it will use a default 'topo_bathy_***_smoothed_window_0.dat' output name

# data file download
download_data_file(topo,filename_web)

Expand Down Expand Up @@ -1038,13 +1056,32 @@ def create_topo_bathy(topo):
print("all done")


def usage():
print("usage: ./run_create_topo_bathy_file.py topo [== etopo1,etopo2,etopo4,etopo5,etopo15,mars,moon] [--raw]")
sys.exit(1)


if __name__ == '__main__':

# gets arguments
if '--help' in sys.argv or '-h' in sys.argv or len(sys.argv) != 2:
print("usage: ./run_create_topo_bathy_file.py topo [== etopo1,etopo2,etopo4,etopo5,etopo15,mars,moon]")
sys.exit(1)
else:
topo = sys.argv[1]
if len(sys.argv) <= 1:
usage()

topo = sys.argv[1]

# reads arguments
i = 0
for arg in sys.argv:
i += 1
#print("arg: ",i,arg)
# get arguments
if "--help" in arg or '-h' in arg:
usage()
elif "--raw" in arg:
use_smoothing = False
elif i > 2:
print("argument not recognized: ",arg)
sys.exit(1)

create_topo_bathy(topo)

21 changes: 10 additions & 11 deletions EXAMPLES/README → EXAMPLES/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
----------------------------------------------------------
README
----------------------------------------------------------
======


This folder contains several examples of how to run forward and adjoint simulations.
Expand All @@ -11,23 +10,23 @@ The following examples are provided:

- basic usage:

* regional_Greece_small/
* `regional_Greece_small/`

contains an example for a small regional simulation and an event located in southern Greece;
the example can be run as a small test on a single desktop machine
(4 CPUs, forward simulation lasts ~5min, kernel simulation lasts ~10min)
(4 CPUs, forward simulation lasts ~5min, kernel simulation lasts ~10min)

* regional_MiddleEast/
* `regional_MiddleEast/`

contains an example for a regional simulation for the Middle East region
(64 CPUs, forward simulation lasts ~7min, kernel simulation lasts ~15min)

* global_s362ani_shakemovie/
* `global_s362ani_shakemovie/`

contains an example for a global shakemovie simulation using S362ANI as 3-D background model
(384 CPUs, forward simulation lasts ~1h 55min)

* global_PREM_kernels/
* `global_PREM_kernels/`

contains examples for amplitude and traveltime kernels using PREM as background model;
both examples focus on how adjoint sources for filtered measurements would be constructed and used.
Expand All @@ -36,15 +35,15 @@ The following examples are provided:

- PREM benchmark solutions:

* benchmarks/
* `benchmarks/`

contains PREM benchmarks for comparing SEM outputs with normal-mode solutions
(various resolutions: Vanuatu 384 CPUs/ Bolivia 1536 CPUs)
contains PREM benchmarks for comparing SEM outputs with normal-mode solutions
(various resolutions: Vanuatu 384 CPUs/ Bolivia 1536 CPUs)


- seismic interferometry:

* noise_examples/
* `noise_examples/`

contains examples of how to compute noise sensitivity kernels for global and regional simulations
(various resolutions: global 600 CPUs/ regional 400 CPUs)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,9 @@ program convolve_jeroen

implicit none

double precision, parameter :: DECAY_RATE=2.628d0
double precision, parameter :: DECAY_RATE = 2.628d0

double precision, parameter :: PI=3.141592653589793d0
double precision, parameter :: PI = 3.141592653589793d0

! number of samples in the ASCII seismogram files (i.e. it is the value of NSTEP in the SPECFEM3D code)
integer, parameter :: nlines = 15500
Expand Down Expand Up @@ -42,14 +42,14 @@ program convolve_jeroen
allocate(time(nlines),sem(nlines),sem_fil(nlines))

! read the seismogram from the standard input
do i=1,nlines
do i = 1,nlines
read(*,*) time(i),sem(i)
enddo

alpha=DECAY_RATE/hdur
dt=dble(time(2))-dble(time(1))
alpha = DECAY_RATE/hdur
dt = dble(time(2))-dble(time(1))
N_j=int(hdur/dt)
do i=1,nlines
do i = 1,nlines
sem_fil(i)=0.0d0
do j=-N_j,N_j
tau_j=dble(j)*dt
Expand Down Expand Up @@ -78,7 +78,7 @@ program convolve_jeroen
else

! convolve with a Gaussian
source=alpha*dexp(-alpha*alpha*tau_j*tau_j)/dsqrt(PI)
source = alpha*dexp(-alpha*alpha*tau_j*tau_j)/dsqrt(PI)

endif

Expand All @@ -90,7 +90,7 @@ program convolve_jeroen
! compute number of samples to remove from end of seismograms
number_remove = int(hdur / dt) + 1
! write the convolved seismogram to the standard output
do i=1,nlines - number_remove
do i = 1,nlines - number_remove
write(*,*) time(i),sngl(sem_fil(i))
enddo

Expand Down
41 changes: 23 additions & 18 deletions EXAMPLES/global_PREM_kernels/amplitude/xcombine_vol_data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
#
#
# note: script requires executable 'mesh2vtu'
##############################################
# USER PARAMETERS

Expand Down Expand Up @@ -40,18 +39,17 @@ else
fi

# for visualization
cp -v ~/SPECFEM3D_GLOBE/utils/Visualization/VTK_ParaView/AVS_continent_boundaries.inp .
cp -v ~/SPECFEM3D_GLOBE/utils/Visualization/VTK_ParaView/paraviewpython-example.py .
ln -s ../../../utils/Visualization/VTK_ParaView/AVS_continent_boundaries.inp
ln -s ../../../utils/Visualization/VTK_ParaView/paraviewpython-example.py

# only for crust_mantle region
echo
echo "alpha kernel"
echo
./bin/xcombine_vol_data $slice alpha_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_alpha_kernel.mesh OUTPUT_FILES/reg_1_alpha_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*alpha*.mesh
./bin/xcombine_vol_data_vtu $slice alpha_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

# colorbar
# see RGBPoints section
Expand All @@ -60,32 +58,39 @@ echo
sed "s:1e-09:$maxcolor:g" state_alpha_kernel.pvsm > tmp_alpha.pvsm

./paraviewpython-example.py tmp_alpha.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_alpha_kernel.jpg

echo
echo "beta kernel"
echo
./bin/xcombine_vol_data $slice beta_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_beta_kernel.mesh OUTPUT_FILES/reg_1_beta_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*beta*.mesh
./bin/xcombine_vol_data_vtu $slice beta_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

sed "s:alpha:beta:g" tmp_alpha.pvsm > tmp_beta.pvsm
./paraviewpython-example.py tmp_beta.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_beta_kernel.jpg

echo
echo "rho kernel"
echo
./bin/xcombine_vol_data $slice rho_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_rho_kernel.mesh OUTPUT_FILES/reg_1_rho_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*rho*.mesh
./bin/xcombine_vol_data_vtu $slice rho_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

sed "s:alpha:rho:g" tmp_alpha.pvsm > tmp_rho.pvsm
./paraviewpython-example.py tmp_rho.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_rho_kernel.jpg

echo
Expand Down
42 changes: 24 additions & 18 deletions EXAMPLES/global_PREM_kernels/traveltime/xcombine_vol_data.sh
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
#!/bin/bash
#
#
# note: script requires executable 'mesh2vtu'
##############################################
# USER PARAMETERS

Expand Down Expand Up @@ -40,18 +39,17 @@ else
fi

# for visualization
cp -v ~/SPECFEM3D_GLOBE/utils/Visualization/VTK_ParaView/AVS_continent_boundaries.inp .
cp -v ~/SPECFEM3D_GLOBE/utils/Visualization/VTK_ParaView/paraviewpython-example.py .
ln -s ../../../utils/Visualization/VTK_ParaView/AVS_continent_boundaries.inp
ln -s ../../../utils/Visualization/VTK_ParaView/paraviewpython-example.py

# only for crust_mantle region
echo
echo "alpha kernel"
echo
./bin/xcombine_vol_data $slice alpha_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_alpha_kernel.mesh OUTPUT_FILES/reg_1_alpha_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*alpha*.mesh
./bin/xcombine_vol_data_vtu $slice alpha_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

# colorbar
# see RGBPoints section
Expand All @@ -60,32 +58,40 @@ echo
sed "s:1e-09:$maxcolor:g" state_alpha_kernel.pvsm > tmp_alpha.pvsm

./paraviewpython-example.py tmp_alpha.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_alpha_kernel.jpg

echo
echo "beta kernel"
echo
./bin/xcombine_vol_data $slice beta_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_beta_kernel.mesh OUTPUT_FILES/reg_1_beta_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*beta*.mesh
./bin/xcombine_vol_data_vtu $slice beta_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

sed "s:alpha:beta:g" tmp_alpha.pvsm > tmp_beta.pvsm
./paraviewpython-example.py tmp_beta.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_beta_kernel.jpg

echo
echo "rho kernel"
echo
./bin/xcombine_vol_data $slice rho_kernel $dir $dir OUTPUT_FILES/ $res 1
echo ""
mesh2vtu OUTPUT_FILES/reg_1_rho_kernel.mesh OUTPUT_FILES/reg_1_rho_kernel.vtu
echo ""
rm -f OUTPUT_FILES/reg_*rho*.mesh
./bin/xcombine_vol_data_vtu $slice rho_kernel $dir $dir OUTPUT_FILES/ $res 1

# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi


sed "s:alpha:rho:g" tmp_alpha.pvsm > tmp_rho.pvsm
./paraviewpython-example.py tmp_rho.pvsm
# checks exit code
if [[ $? -ne 0 ]]; then exit 1; fi

mv -v image.jpg image_rho_kernel.jpg

echo
Expand Down

0 comments on commit 2c619fd

Please sign in to comment.