Skip to content

Commit af3961e

Browse files
author
Kevin Milner
committed
merged from upstream/dev
2 parents dc0930e + ee7f56c commit af3961e

File tree

883 files changed

+2272285
-714223
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

883 files changed

+2272285
-714223
lines changed

.github/scripts/bbp-build-ci.sh

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
#!/bin/bash
2+
3+
die () {
4+
echo >&2 "$@"
5+
exit 1
6+
}
7+
8+
download_untar () {
9+
URL=$1
10+
11+
# Download
12+
wget $URL 2>/dev/null || curl -O $URL 2>/dev/null
13+
14+
URL_NO_PROTO=${URL:7}
15+
URL_REL=${URL_NO_PROTO#*/}
16+
FILE=`basename "/${URL_REL%%\?*}"`
17+
18+
# Untar
19+
tar -xzf ${FILE}
20+
21+
# Clean up as we go
22+
rm ${FILE}
23+
}
24+
25+
echo
26+
27+
OLD_DIR=`pwd`
28+
mkdir ${RUNNER_WORKSPACE}/bin
29+
cd ${RUNNER_WORKSPACE}/bin
30+
ln -s /usr/bin/gcc-8 gcc
31+
ln -s /usr/bin/gfortran-8 gfortran
32+
cd ${OLD_DIR}
33+
export PATH=${RUNNER_WORKSPACE}/bin:$PATH
34+
35+
echo "======================GCC===================="
36+
gcc --version
37+
38+
echo "===================GFORTRAN=================="
39+
gfortran --version
40+
41+
echo "===================Python 3=================="
42+
python3 --version
43+
python3 -c "import numpy; print('Numpy: ', numpy.__version__)"
44+
python3 -c "import scipy; print('SciPy: ', scipy.__version__)"
45+
python3 -c "import matplotlib; print('Matplotlib: ', matplotlib.__version__)"
46+
python3 -c "import numba; print('Numba: ', numba.__version__)"
47+
python3 -c "import pyproj; print('PyProj: ', pyproj.__version__)"
48+
49+
# Set basic parameters
50+
VERSION=22.4.0
51+
BASEDIR="${RUNNER_WORKSPACE}"
52+
BBPDIR="${BASEDIR}/bbp/bbp"
53+
SRCDIR="${BBPDIR}/src"
54+
FFTW_BUILD_DIR="${BASEDIR}/fftbuild"
55+
FFTW_INSTALL_DIR="${BASEDIR}/fftw-3.3.8"
56+
export FFTW_INCDIR=${FFTW_INSTALL_DIR}/include
57+
export FFTW_LIBDIR=${FFTW_INSTALL_DIR}/lib
58+
59+
echo "===================FFTW=================="
60+
# Compile FFTW library
61+
mkdir -p ${FFTW_BUILD_DIR}
62+
OLD_DIR=`pwd`
63+
cd ${FFTW_BUILD_DIR}
64+
download_untar https://g-c662a6.a78b8.36fe.data.globus.org/bbp/releases/${VERSION}/fftw-3.3.8.tar.gz
65+
cd fftw-3.3.8
66+
./configure --prefix=${FFTW_INSTALL_DIR}
67+
make
68+
make install
69+
./configure --prefix=${FFTW_INSTALL_DIR} --enable-float
70+
make
71+
make install
72+
cd ${OLD_DIR}
73+
74+
# Create installation directories
75+
echo "=> Creating directory tree..."
76+
mkdir -p ${BASEDIR}/bbp_val
77+
mkdir -p ${BASEDIR}/bbp_gf
78+
mkdir -p ${BASEDIR}/bbp_data
79+
echo
80+
81+
# Compile source distribution
82+
echo "=> Main Broadband Platform Source Distribution"
83+
echo "==> Compiling... (it may take a while)"
84+
OLD_DIR=`pwd`
85+
cd ${SRCDIR}
86+
make
87+
cd ${OLD_DIR}
88+
# Done with main source distribution
89+
echo "==> Source code compiled!"
90+
echo
91+
92+
# Install LABasin500 (CI) region and NR validation packages
93+
echo "==> Installing LA Basin CI region..."
94+
cd ${BASEDIR}/bbp_gf
95+
download_untar https://g-c662a6.a78b8.36fe.data.globus.org/bbp/releases/${VERSION}/labasin500ci-velocity-model-${VERSION}.tar.gz
96+
echo
97+
ls ${BASEDIR}/bbp_gf
98+
echo
99+
100+
echo "==> Installing NR validation package..."
101+
cd ${BASEDIR}/bbp_val
102+
download_untar https://g-c662a6.a78b8.36fe.data.globus.org/bbp/releases/${VERSION}/nr-validation-${VERSION}.tar.gz
103+
echo
104+
ls ${BASEDIR}/bbp_val
105+
echo
106+
107+
echo "==> Build steps completed!"

.github/scripts/bbp-test-ci.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/bash
2+
3+
# Set basic parameters
4+
VERSION=22.4.0
5+
BASEDIR="${RUNNER_WORKSPACE}"
6+
BBPDIR="${BASEDIR}/bbp/bbp"
7+
SRCDIR="${BBPDIR}/src"
8+
9+
export BBP_DIR=${BBPDIR}
10+
export BBP_GF_DIR=${BASEDIR}/bbp_gf
11+
export BBP_VAL_DIR=${BASEDIR}/bbp_val
12+
export PYTHONPATH=${BBPDIR}/comps:${BBPDIR}/comps/PySeismoSoil:${PYTHONPATH}
13+
export BBP_DATA_DIR=${BASEDIR}/bbp_data
14+
export PATH=${BBPDIR}/comps:${BBPDIR}/utils/batch:$PATH
15+
ulimit -s unlimited
16+
17+
echo
18+
echo "===> Running Unit Tests..."
19+
20+
cd $BBP_DIR/tests
21+
./UnitTestsCI.py

.github/workflows/bbp-ci.yml

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
name: bbp-ci
2+
3+
on:
4+
push:
5+
pull_request:
6+
7+
jobs:
8+
bbp-build-linux:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
python-version: [ "3.8", "3.9", "3.10", "3.11", "3.12" ]
13+
steps:
14+
- name: set BBP_DIR
15+
run: echo "BBP_BASE_DIR=$RUNNER_WORKSPACE/bbp" >> $GITHUB_ENV
16+
- name: Setup Python ${{ matrix.python-version }}
17+
uses: actions/setup-python@v4
18+
with:
19+
python-version: ${{ matrix.python-version }}
20+
- name: configure Python
21+
run: |
22+
sudo apt-get update
23+
sudo apt-get install g++ -y
24+
sudo apt-get install gfortran -y
25+
pip install numpy
26+
pip install scipy
27+
pip install matplotlib
28+
pip install pyproj
29+
pip install numba
30+
- name: checkout Broadband Platform
31+
uses: actions/checkout@v3
32+
- name: build bbp
33+
run: ./.github/scripts/bbp-build-ci.sh
34+
shell: bash
35+
- name: test bbp
36+
run: ./.github/scripts/bbp-test-ci.sh
37+
shell: bash

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ __pycache__/
77
*.so
88

99
# Distribution / packaging
10+
.idea
1011
.Python
1112
env/
1213
build/
@@ -93,4 +94,4 @@ ENV/
9394
*.mod
9495
bin/
9596
*.version
96-
*.a
97+
*.a

CODE_OF_CONDUCT.md

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to make participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies within all project spaces, and it also applies when
49+
an individual is representing the project or its community in public spaces.
50+
Examples of representing a project or community include using an official
51+
project e-mail address, posting via an official social media account, or acting
52+
as an appointed representative at an online or offline event. Representation of
53+
a project may be further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at [email protected]. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org/), version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
For answers to common questions about this code of conduct, see
74+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Contributing to the SCEC Broadband Platform (BBP) System
2+
3+
This document provides an overview on how to contribute to BBP, and will provide step-by-step instructions on a practical contribution workflow.
4+
5+
## Getting Started
6+
7+
* Make sure you have an active GitHub account
8+
* Download and install git
9+
* Read the git documentation
10+
* Install the main branch of the SCECcode/bbp.git repository
11+
* If you haven't worked with Git Forks before, make sure to read the documentation linked below.
12+
13+
## Submitting a Pull Request
14+
15+
Pull requests are great! Please submit them to us! Here's how:
16+
17+
1. Fork the repo. [Some helping info](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/working-with-forks)
18+
2. Make a new branch. For features/additions base your new branch at `dev`.
19+
3. Add a test! Only pull requests for documentation and refactoring do not require a test.
20+
4. Make sure the tests pass. Run `./run_tests.sh` in the top-level directory of the repo.
21+
5. Push your changes to your fork and submit a pull request. Make sure to set the branch to `ucvm:dev`.
22+
6. Wait for our review. There may be some suggested changes or improvements. Changes can be made after
23+
the pull request has been opening by simply adding more commits to your branch.
24+
25+
Pull requests can be changed after they are opened, so create a pull request as early as possible.
26+
This allows us to provide feedback during development and to answer any questions.
27+
28+
Please make sure to set the correct branch for your pull request. Also, please do not include large files in your pull request.
29+
If you feel that you need to add large files, let us know and we can figure something out.
30+
31+
## Submitting an Issue
32+
33+
Please open an issue if you want to ask a question about BBP.
34+
35+
* Please search through the past issues to see if your question or the bug has already been addressed
36+
* Please apply the correct tag to your issue so others can search
37+
38+
If you want to submit a bug report, please provide the information below:
39+
* BBP version, Python version, and Platform (Linux, Windows, Mac OSX, etc)
40+
* How did you install BBP (Docker, from source...)
41+
* Please provide a short, complete, and correct example that demonstrates the issue.
42+
* If this broke in a recent update, please tell us when it used to work.
43+
44+
## Additional Resources
45+
* [Working with Git Forks](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/working-with-forks)
46+
* [Style Guide](http://google.github.io/styleguide/pyguide.html)
47+
* [Docs or it doesn’t exist](https://lukeplant.me.uk/blog/posts/docs-or-it-doesnt-exist/)
48+
* Performance Tips:
49+
* [Python](https://wiki.python.org/moin/PythonSpeed/PerformanceTips)
50+
* [NumPy and ctypes](https://scipy-cookbook.readthedocs.io/)
51+
* [SciPy](https://www.scipy.org/docs.html)
52+
* [NumPy Book](http://csc.ucdavis.edu/~chaos/courses/nlp/Software/NumPyBook.pdf)

CREDITS.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
## BBP Software Contributors
2+
The following developers have contributed to the development of the SCEC Broadband Platform.
3+
4+
* Norm Abrahamson, Pacific Gas & Electric (PG&E)
5+
* John Anderson, University of Nevada, Reno (UNR)
6+
* Ralph Archuleta, University of California Santa Barbara (UCSB)
7+
* Domniki Asimaki, California Institute of Technology (Caltech)
8+
* Karen Assatourians, Western University, Canada
9+
* Gail Atkinson, Western University, Canada
10+
* Jeff Bayless, AECOM
11+
* Scott Callaghan, Southern California Earthquake Center (SCEC)
12+
* Jorge Crempien, Pontificia Universidad Católica de Chile
13+
* Christine Goulet, Southern California Earthquake Center (SCEC)
14+
* Robert Graves, United States Geological Survey (USGS)
15+
* Behzad Hassani, British Columbia Hydro and Power Authority (BC Hydro)
16+
* Asako Iwaki, National Research Institute for Earth Science and Disaster Resilience (NIED)
17+
* Chen Ji, University of California Santa Barbara (UCSB)
18+
* Thomas H. Jordan, Southern California Earthquake Center (SCEC)
19+
* Philip Maechling, Southern California Earthquake Center (SCEC)
20+
* Hiroe Miyake, Earthquake Research Institute, University of Tokyo
21+
* Kim Olsen, San Diego State University (SDSU)
22+
* Arben Pitarka, Lawrence Livermore National Laboratory (LLNL)
23+
* Sanaz Rezaeian, United States Geological Survey (USGS)
24+
* Jian Shi, California Institute of Technology (Caltech)
25+
* Fabio Silva, Southern California Earthquake Center (SCEC)
26+
* Andreas Skarlatoudis, AECOM
27+
* Patrick Small, Southern California Earthquake Center (SCEC)
28+
* Paul Somerville, AECOM
29+
* Seok-Goo Song, Korea Institute of Geoscience and Mineral Resources (KIGAM)
30+
* Rumi Takedatsu, San Diego State University (SDSU)
31+
* Nan Wang, San Diego State University (SDSU)
32+
* Ke Xu, San Diego State University (SDSU)
33+
34+
## Software Reference
35+
The primary reference for the Broadband Platform software system (v15.3.0 and later) is:
36+
37+
* Maechling, P. J., F. Silva, S. Callaghan, and T. H. Jordan (2015). SCEC Broadband Platform: System Architecture and Software Implementation, Seismol. Res. Lett., 86, no. 1, doi: 10.1785/0220140125.
38+
39+
## Ground Motion Simulation Validation Method Reference
40+
The primary reference that describes the validation process developed by the Broadband Platform group to establish that the BBP platform software produces results are suitable for use in engineering applications is:
41+
42+
* Goulet, C.A., Abrahamson, N.A., Somerville, P.G. and K, E. Wooddell (2015) The SCEC Broadband Platform Validation Exercise: Methodology for Code Validation in the Context of Seismic-Hazard Analyses, Seismol. Res. Lett., 86, no. 1, doi: 10.1785/0220140104
43+
44+
## Results of Validation Study
45+
The primary reference that describes the results of the validation process in 2014 is:
46+
47+
* Dreger, D. S., Beroza, G.C., Day, S. M., Goulet, C. A., Jordan, T. H., Spudich, P. A., and Stewart, J. P. (2015). Validation of the SCEC Broadband Platform V14.3 Simulation Methods Using Pseudospectral Acceleration Data, Seismol. Res. Lett., 86, no. 1, doi:10.1785/0220140118.
48+
49+
## Ground Motion Methods References
50+
References for specific computational methods included in the Broadband Platform (v15.3.0 and later, including v16.5.0, v17.3.0, and v19.4.0) and for the validation procedures developed by the Broadband Platform include:
51+
52+
* Anderson, J. G (2015) The Composite Source Model for Broadband Simulations of Strong Ground Motions Seismological Research Letters, January/February 2015, v. 86, p. 68-74, First published on December 17, 2014, doi:10.1785/0220140098
53+
* Atkinson, G. M., and Assatourians, K. (2015) Implementation and Validation of EXSIM (A Stochastic Finite‐Fault Ground‐Motion Simulation Algorithm) on the SCEC Broadband Platform Seismological Research Letters, January/February 2015, v. 86, p. 48-60, First published on December 17, 2014, doi:10.1785/0220140097
54+
* Crempien, J. G. F., and Archuleta, R. J. (2015) UCSB Method for Simulation of Broadband Ground Motion from Kinematic Earthquake Sources Seismological Research Letters, January/February 2015, v. 86, p. 61-67, First published on December 17, 2014, doi:10.1785/0220140103
55+
* Dreger, D. S., and Jordan, T. H. (2015) Introduction to the Focus Section on Validation of the SCEC Broadband Platform V14.3 Simulation Methods Seismological Research Letters, January/February 2015, v. 86, p. 15-16, doi:10.1785/0220140233
56+
* Graves, R., and Pitarka, A. (2015) Refinements to the Graves and Pitarka (2010) Broadband Ground‐Motion Simulation Method Seismological Research Letters, January/February 2015, v. 86, p. 75-80, First published on December 17, 2014, doi:10.1785/0220140101
57+
* Irikura, K., & Miyake, H. (2011). Recipe for Predicting Strong Ground Motion from Crustal Earthquake Scenarios. Pure and Applied Geophysics, 168(2011), 85–104. doi:10.1007/s00024- 010-0150-9
58+
* Olsen, K. B., and Takedatsu, R. (2015) The SDSU Broadband Ground‐Motion Generation Module BBtoolbox Version 1.5 Seismological Research Letters, January/February 2015, v. 86, p. 81-88, First published on December 17, 2014, doi:10.1785/0220140102
59+
* Pitarka, A., R. Graves, K. Irikura, H. Miyake, and A. Rodgers (2017). Performance of Irikura Recipe Rupture Model Generator in Earthquake Ground Motion Simulations with Graves and Pitarka Hybrid Approach, Pure and Applied Geophysics, 174(9), doi:10.1007/s00024-017-1504-3
60+
* Song, S.G. (2016) Developing a generalized pseudo-dynamic source model of Mw 6.5-7.0 to simulate strong ground motions, Geophysical Journal International, 204, 1254-1265. doi: 10.1093/gji/ggv521
61+
* Song, S.G., Dalguer, L.A. and Mai, P.M. (2014) Pseudo-dynamic source modeling with 1-point and 2-point statistics of earthquake source parameters, Geophysical Journal International, 196, 1770-1786. doi: 10.1093/gji/ggt479
62+
* Stewart, J. P., Boore, D.M., Seyhan, E., and Atkinson, G.M. (2016) NGA-West2 equations for predicting vertical-component PGA, PGV, and 5%-damped PSA from shallow crustal earthquakes. Earthq. Spectra, 32 (2): 1005–1031.

0 commit comments

Comments
 (0)