Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revisits geocentric vs geographic positioning; updates SIEM meshing; updates source positioning and reference solutions; increases version to 8.1.1 #833

Merged
merged 60 commits into from
Mar 28, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
60 commits
Select commit Hold shift + click to select a range
11ceeba
adds data length check to plot script
danielpeter Feb 26, 2024
2040887
updates plotting script
danielpeter Feb 28, 2024
b4fdbc0
updates ellipticity routine names
danielpeter Feb 28, 2024
7e6af38
revisits geocentric to geographic colatitude conversions (accounting …
danielpeter Feb 28, 2024
121daf5
updates postprocessing tools (cross-section, smoothing)
danielpeter Feb 28, 2024
d395d41
update EMC model routine (to consider ellipticity)
danielpeter Feb 28, 2024
6d1a886
updates source positioning (ellipticity stretch); updates epicentral …
danielpeter Feb 28, 2024
df09255
code cleaning
danielpeter Feb 28, 2024
70af5a1
updates topo scripts
danielpeter Feb 28, 2024
0febd8e
moving debugging statements out of main loop
danielpeter Mar 1, 2024
702e282
updates ellipticity routines (to have all main routines in file make_…
danielpeter Mar 1, 2024
8b8705d
adding a great-circle distance routine
danielpeter Mar 1, 2024
906dd41
adding an output info
danielpeter Mar 1, 2024
aa1d460
updates rotation matrix (for single chunk simulations using elliptici…
danielpeter Mar 1, 2024
000d80f
updates geocentric to geographic/geodetic positioning for ellipticity
danielpeter Mar 1, 2024
e9039c4
updates output formatting (for very deep station burial depths)
danielpeter Mar 1, 2024
9efd8b5
updates output and synchronization (for checking output)
danielpeter Mar 1, 2024
982fd28
updates custom_real statements
danielpeter Mar 1, 2024
7027667
adds ellipticity to write_profile tool
danielpeter Mar 1, 2024
a2ec032
adds python script to create continent boundaries in AVS**.inp format
danielpeter Mar 1, 2024
9045a3e
updates vpremoon model initialization
danielpeter Mar 1, 2024
645396b
adds check to vpremoon model initialization
danielpeter Mar 1, 2024
4965c18
updates system command to fortran2008 standard
danielpeter Mar 4, 2024
911ce64
fixes haversine formula for colatitudes
danielpeter Mar 5, 2024
eab11e9
updates lat/lon routine for crustal models
danielpeter Mar 5, 2024
0d89563
adds flag for chunk center position
danielpeter Mar 5, 2024
37589d3
removes USE_OLD_VERSION_5_1_5_FORMAT flag
danielpeter Mar 5, 2024
5c9315a
removes USE_OLD_VERSION_7_0_0_FORMAT flag
danielpeter Mar 5, 2024
4c81cd8
updates chunk center position (to be at geographic position)
danielpeter Mar 5, 2024
9f79c28
increases version number to 8.1.1
danielpeter Mar 5, 2024
a229ca9
updates readme
danielpeter Mar 5, 2024
9e53ae5
updates citation file
danielpeter Mar 5, 2024
de2383c
updates single chunk rotation matrix
danielpeter Mar 14, 2024
d967daa
updates source array routines
danielpeter Mar 14, 2024
17dd924
updates element count output
danielpeter Mar 14, 2024
889be2c
updates scripts and state file
danielpeter Mar 14, 2024
4a52036
updates reference solution for regional_Greece_small/ example
danielpeter Mar 14, 2024
8685c25
updates reference solution for global_small/ example
danielpeter Mar 14, 2024
583811d
updates reference solution for point_force example
danielpeter Mar 14, 2024
38283b4
updates reference solution for regional_sgloberani/ example
danielpeter Mar 14, 2024
5bc3790
updates reference solution for regional_s40rts/ example
danielpeter Mar 14, 2024
d2f53eb
updates reference solution for regional_Greece_small_LDDRK/ example
danielpeter Mar 14, 2024
2f874af
updates makefiles in utils/adjoint_sources/ folder
danielpeter Mar 15, 2024
df6a847
updates vtk output (limits point data to paraview float range)
danielpeter Mar 15, 2024
4408685
updates reference solution for regular_kernel/ example
danielpeter Mar 15, 2024
b472cd4
updates reference solution for moon_global/ example
danielpeter Mar 15, 2024
eacb613
updates reference solution for mars_regional/ example
danielpeter Mar 15, 2024
b7e24c8
cleaning files
danielpeter Mar 15, 2024
6cea063
updates citation file (zenodo fix)
danielpeter Mar 18, 2024
720aaa9
cleans code formatting
danielpeter Mar 18, 2024
88b7401
cleans code
danielpeter Mar 21, 2024
8582094
cleans files
danielpeter Mar 21, 2024
c92b3e4
adds cleaning script
danielpeter Mar 21, 2024
17e810e
adds infinite-element mesh infos
danielpeter Mar 22, 2024
e8c668c
updates SIEM (spectral-infinite element method) meshing
danielpeter Mar 26, 2024
33b4a12
updates addressing
danielpeter Mar 26, 2024
65ad6ce
code cleaning
danielpeter Mar 26, 2024
ba979a3
updates reference solution for regional_small_adjoint/ example
danielpeter Mar 28, 2024
76d58ce
updates reference solution for regional_Greece_noise_small/ example
danielpeter Mar 28, 2024
05ad2f1
updates test
danielpeter Mar 28, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
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
Loading
Loading