-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Minor bug fixes, changes to continuous integration, input sanitizing …
…made optional.
- Loading branch information
1 parent
e68ad73
commit 22f3b92
Showing
27 changed files
with
451 additions
and
425 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,110 @@ | ||
name: Continuous Integration | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
CI: | ||
runs-on: ubuntu-18.04 | ||
strategy: | ||
matrix: | ||
fortran-compiler: [gfortran-8, gfortran-9, ifort] | ||
rte-kernels: [default, openacc] | ||
env: | ||
FC: ${{ matrix.fortran-compiler }} | ||
NCHOME: /usr | ||
NFHOME: /usr | ||
# I would like to use this variable within the run scripts | ||
# i.e. to source files and change FCFLAGS, but can't figure out how | ||
USING_IFORT: ${{ contains(matrix.fortran-compiler, 'ifort') }} | ||
steps: | ||
# | ||
# Checks-out repository under $GITHUB_WORKSPACE | ||
# | ||
- uses: actions/checkout@v2 | ||
# | ||
# Set up Python and dependencies | ||
# | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.7 | ||
- name: Setup conda | ||
uses: s-weigand/setup-conda@v1 | ||
with: | ||
python-version: 3.7 | ||
- name: Install python dependencies | ||
run: conda install --yes urllib3 netcdf4 xarray dask scipy | ||
# | ||
# Install NetCDF library | ||
# | ||
- name: Install netcdf C library | ||
run: sudo apt-get install libnetcdf-dev | ||
# | ||
# Intel compilers and libraries if needed | ||
# https://software.intel.com/content/www/us/en/develop/articles/oneapi-repo-instructions.html#aptpkg | ||
# | ||
- name: Install Intel compilers libraries | ||
if: contains(matrix.fortran-compiler, 'ifort') | ||
run: | | ||
wget https://apt.repos.intel.com/intel-gpg-keys/GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
sudo apt-key add GPG-PUB-KEY-INTEL-SW-PRODUCTS-2023.PUB | ||
sudo add-apt-repository "deb https://apt.repos.intel.com/oneapi all main" | ||
sudo apt-get update | ||
sudo apt-get install intel-oneapi-common-licensing | ||
sudo apt-get install intel-oneapi-common-vars | ||
sudo apt-get install intel-oneapi-dev-utilities | ||
sudo apt-get install intel-oneapi-ifort | ||
# | ||
# NetCDF FORTRAN library | ||
# | ||
- name: Build NetCDF Fortran library | ||
run: | | ||
if [[ -e /opt/intel/inteloneapi/setvars.sh ]]; then source /opt/intel/inteloneapi/setvars.sh; fi | ||
git clone https://github.com/Unidata/netcdf-fortran.git --branch v4.4.4 | ||
cd netcdf-fortran | ||
./configure --prefix=${NFHOME} F77=${FC} | ||
make | ||
sudo make install | ||
- name: Stage RFMIP files | ||
run: | | ||
export RRTMGP_ROOT=${GITHUB_WORKSPACE} | ||
cd ${RRTMGP_ROOT}/examples/rfmip-clear-sky | ||
python ./stage_files.py | ||
- name: Make library, examples, tests | ||
# Compiler flags for gfortran 8 and 9. Over-ridden in run script if using ifort | ||
env: | ||
FCFLAGS: "-ffree-line-length-none -m64 -std=f2008 -march=native -fbounds-check -finit-real=nan -DUSE_CBOOL" | ||
run: | | ||
export RRTMGP_ROOT=${GITHUB_WORKSPACE} | ||
export RTE_KERNELS=${{ matrix.rte-kernels }} | ||
if [[ -e /opt/intel/inteloneapi/setvars.sh ]]; then | ||
source /opt/intel/inteloneapi/setvars.sh; | ||
export FCFLAGS="-m64 -g -traceback -heap-arrays -assume realloc_lhs -extend-source 132 -check bounds,uninit,pointers,stack -stand f08"; | ||
fi | ||
cd ${RRTMGP_ROOT} | ||
${FC} --version | ||
make -C build -j 2 | ||
make -C tests -j 1 | ||
make -C examples/all-sky -j 2 | ||
export RRTMGP_BUILD=${RRTMGP_ROOT}/build | ||
make -C examples/rfmip-clear-sky -j 2 | ||
- name: Run examples, tests | ||
run: | | ||
export RRTMGP_ROOT=${GITHUB_WORKSPACE} | ||
if [[ -e /opt/intel/inteloneapi/setvars.sh ]]; then source /opt/intel/inteloneapi/setvars.sh; fi | ||
cd ${RRTMGP_ROOT}/examples/rfmip-clear-sky | ||
python ./run-rfmip-examples.py --block_size 8 | ||
cd ${RRTMGP_ROOT}/examples/all-sky | ||
python ./run-allsky-example.py | ||
cd ${RRTMGP_ROOT}/tests | ||
cp ${RRTMGP_ROOT}/examples/rfmip-clear-sky/multiple_input4MIPs_radiation_RFMIP_UColorado-RFMIP-1-2_none.nc test_atmospheres.nc | ||
./clear_sky_regression test_atmospheres.nc ${RRTMGP_ROOT}/rrtmgp/data/rrtmgp-data-lw-g256-2018-12-04.nc | ||
./clear_sky_regression test_atmospheres.nc ${RRTMGP_ROOT}/rrtmgp/data/rrtmgp-data-sw-g224-2018-12-04.nc | ||
- name: Comparison | ||
run: | | ||
export RRTMGP_ROOT=${GITHUB_WORKSPACE} | ||
cd ${RRTMGP_ROOT}/examples/rfmip-clear-sky | ||
python ./compare-to-reference.py --fail=7.e-4 | ||
cd ${RRTMGP_ROOT}/examples/all-sky | ||
python ./compare-to-reference.py | ||
cd ${RRTMGP_ROOT}/tests | ||
python verification.py |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.