Skip to content

Commit cb0a08c

Browse files
authored
Merge pull request #861 from danielpeter/devel
small updates on 1D Berkeley and adds reference solution to Berkeley example for testing; updates submodule address
2 parents 36f3715 + 778f9c3 commit cb0a08c

34 files changed

+44272
-299
lines changed

.github/scripts/run_tests.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,9 @@ fi
116116
if [ "${TESTDIR}" == "EXAMPLES/global_small" ]; then
117117
sed -i "s:^RECORD_LENGTH_IN_MINUTES .*:RECORD_LENGTH_IN_MINUTES = 0.1:" DATA/Par_file
118118
fi
119+
if [ "${TESTDIR}" == "EXAMPLES/regional_Berkeley" ]; then
120+
sed -i "s:^RECORD_LENGTH_IN_MINUTES .*:RECORD_LENGTH_IN_MINUTES = 4.0:" DATA/Par_file # needs increase due to source time function
121+
fi
119122

120123
# debug
121124
if [ "${DEBUG}" == "true" ]; then

.github/workflows/CI.yml

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -663,3 +663,27 @@ jobs:
663663
GPU: true
664664
run: ./.github/scripts/run_tests.sh
665665
shell: bash
666+
667+
linuxTest_15:
668+
name: Test 15 - regional_Berkeley
669+
runs-on: ubuntu-latest
670+
needs: [linuxCheck]
671+
672+
steps:
673+
- uses: actions/checkout@v4
674+
675+
- name: Install packages
676+
run: ./.github/scripts/run_install.sh
677+
shell: bash
678+
679+
- name: Run build
680+
env:
681+
TESTFLAGS: --enable-vectorization
682+
run: ./.github/scripts/run_build.sh
683+
shell: bash
684+
685+
- name: Run test
686+
env:
687+
TESTDIR: EXAMPLES/regional_Berkeley
688+
run: ./.github/scripts/run_tests.sh
689+
shell: bash

.gitmodules

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@
33
url = https://github.com/geodynamics/autoconf_cig.git
44
[submodule "external_libs/ROCm-HIP-CPU"]
55
path = external_libs/ROCm-HIP-CPU
6-
url = git@github.com:ROCm/HIP-CPU.git
6+
url = https://github.com/ROCm/HIP-CPU.git

.travis/run_tests.sh

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,8 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "1" ]; then
180180
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
181181
./run_this_example.sh
182182
if [[ $? -ne 0 ]]; then exit 1; fi
183+
# cleanup
184+
rm -rf OUTPUT_FILES* DATABASES_MPI*
183185
cd $WORKDIR
184186
fi
185187
echo -en 'travis_fold:end:coverage.regular-kernel\\r'
@@ -197,6 +199,8 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "1" ]; then
197199
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
198200
./run_this_example.sh
199201
if [[ $? -ne 0 ]]; then exit 1; fi
202+
# cleanup
203+
rm -rf OUTPUT_FILES* DATABASES_MPI*
200204
cd $WORKDIR
201205
fi
202206
echo -en 'travis_fold:end:coverage.regional-LDDRK\\r'
@@ -215,6 +219,8 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "2" ]; then
215219
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
216220
./run_this_example.sh
217221
if [[ $? -ne 0 ]]; then exit 1; fi
222+
# cleanup
223+
rm -rf OUTPUT_FILES* DATABASES_MPI*
218224
cd $WORKDIR
219225
fi
220226
echo -en 'travis_fold:end:coverage.regional-s40rts\\r'
@@ -225,6 +231,7 @@ echo -en 'travis_fold:end:coverage.regional-s40rts\\r'
225231
## tested by github actions
226232
## - EXAMPLES/regional_Greece_small
227233
## - EXAMPLES/regional_sgloberani
234+
## - EXAMPLES/regional_Berkeley
228235
## - EXAMPLES/point_force
229236
## - EXAMPLES/moon_global
230237
## - EXAMPLES/mars_regional
@@ -244,6 +251,8 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "1" ]; then
244251
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
245252
./run_this_example.sh
246253
if [[ $? -ne 0 ]]; then exit 1; fi
254+
# cleanup
255+
rm -rf OUTPUT_FILES* DATABASES_MPI*
247256
cd $WORKDIR
248257
fi
249258
echo -en 'travis_fold:end:coverage.point-force\\r'
@@ -261,6 +270,8 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "2" ]; then
261270
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
262271
./run_this_example.sh
263272
if [[ $? -ne 0 ]]; then exit 1; fi
273+
# cleanup
274+
rm -rf OUTPUT_FILES* DATABASES_MPI*
264275
cd $WORKDIR
265276
fi
266277
echo -en 'travis_fold:end:coverage.moon-global\\r'
@@ -278,10 +289,31 @@ if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "2" ]; then
278289
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
279290
./run_this_example.sh
280291
if [[ $? -ne 0 ]]; then exit 1; fi
292+
# cleanup
293+
rm -rf OUTPUT_FILES* DATABASES_MPI*
281294
cd $WORKDIR
282295
fi
283296
echo -en 'travis_fold:end:coverage.mars-regional\\r'
284297

298+
echo 'Coverage...' && echo -en 'travis_fold:start:coverage.regional-Berkeley\\r'
299+
if [ "$TESTCOV" == "1" ] && [ "$TESTID" == "2" ]; then
300+
##
301+
## testing regional_Berkeley
302+
##
303+
echo "##################################################################"
304+
echo "EXAMPLES/regional_Berkeley/"
305+
echo
306+
cd EXAMPLES/regional_Berkeley/
307+
sed -i "s:^RECORD_LENGTH_IN_MINUTES .*:RECORD_LENGTH_IN_MINUTES = 0.0:" DATA/Par_file
308+
sed -i "s:^NTSTEP_BETWEEN_OUTPUT_INFO .*:NTSTEP_BETWEEN_OUTPUT_INFO = 50:" DATA/Par_file
309+
./run_this_example.sh
310+
if [[ $? -ne 0 ]]; then exit 1; fi
311+
# cleanup
312+
rm -rf OUTPUT_FILES* DATABASES_MPI*
313+
cd $WORKDIR
314+
fi
315+
echo -en 'travis_fold:end:coverage.regional-Berkeley\\r'
316+
285317

286318
# done
287319
echo "all done"

EXAMPLES/process_DATA_Par_files_to_update_their_parameters_from_a_main_file.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,8 @@
3636
# (more exclude directories can be appended in this list)
3737
EXCLUDE_DIR_LIST = [ \
3838
"unused_routines", \
39-
"small_SEM_solvers_in_Fortran_and_C_without_MPI_to_learn" \
39+
"small_SEM_solvers_in_Fortran_and_C_without_MPI_to_learn", \
40+
"tmp"
4041
]
4142

4243
# optional parameters in Par_file
@@ -56,7 +57,13 @@
5657
"SCATTERING_STRENGTH", \
5758
"SCATTERING_CORRELATION", \
5859
"SHIFT_SIMULTANEOUS_RUNS", \
59-
"FILESYSTEM_IO_BANDWIDTH" \
60+
"FILESYSTEM_IO_BANDWIDTH", \
61+
"STF_IS_UCB_HEAVISIDE", \
62+
"SOURCE_T1", \
63+
"SOURCE_T2", \
64+
"SOURCE_T3", \
65+
"SOURCE_T4", \
66+
"TAU" \
6067
]
6168

6269
#

EXAMPLES/regional_Berkeley/DATA/Par_file

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -269,6 +269,16 @@ USE_MONOCHROMATIC_CMT_SOURCE = .false.
269269
# print source time function
270270
PRINT_SOURCE_TIME_FUNCTION = .true.
271271

272+
## Berkeley source time function
273+
STF_IS_UCB_HEAVISIDE = .true.
274+
# UCB source frequency content (i.e., heaviside function)
275+
SOURCE_T1 = 500.d0
276+
SOURCE_T2 = 400.d0
277+
SOURCE_T3 = 50.d0
278+
SOURCE_T4 = 40.d0
279+
# UCB source time shift
280+
TAU = 500.d0
281+
272282
#-----------------------------------------------------------
273283
#
274284
# Seismograms

EXAMPLES/regional_Berkeley/README

Lines changed: 15 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
README
33
----------------------------------------------------------
44

5-
This example creates a regional mesh using transversely isotropic PREM
5+
This example creates a regional mesh using the 3D Berkeley model SEMUCB_A3d
66
and runs a spectral-element simulation.
77

8+
In the Par_file, we also add the following parameters to use a specific Berkeley source time function:
9+
```
10+
## Berkeley source time function
11+
STF_IS_UCB_HEAVISIDE = .true.
12+
# UCB source frequency content (i.e., heaviside function)
13+
SOURCE_T1 = 500.d0
14+
SOURCE_T2 = 400.d0
15+
SOURCE_T3 = 50.d0
16+
SOURCE_T4 = 40.d0
17+
# UCB source time shift
18+
TAU = 500.d0
19+
```
20+
821
The simulation is setup to use 4 CPUs only, thus can be run locally on a desktop machine
922
(needs to have MPI installed).
1023

@@ -18,24 +31,9 @@ type:
1831
to setup this directory for the simulation and to run a corresponding
1932
script "run_mesher_solver.bash".
2033

21-
The simulation is accurate down to a shortest period of ~ 15 s.
34+
The simulation is accurate down to a shortest period of ~ 21 s.
2235
(minimum period resolved ~ (256/NEX_XI) * (ANGULAR_WIDTH_XI_IN_DEGREES/90) * 17)
2336

2437
Reference seismograms for comparisons are provided in the directory: REF_SEIS/
25-
26-
27-
2. kernel simulation:
28-
---------------------
29-
30-
type:
31-
./run_this_example.kernel.sh
32-
33-
to setup this directory for the simulation and to submit a corresponding
34-
script "run_mesher_solver.kernel.bash".
35-
36-
The simulation will use the adjoint source given in directory: SEM/
37-
to compute a travel-time sensitivity kernel.
38-
39-
4038
Please modify these scripts according to your specifics.
4139

0 commit comments

Comments
 (0)