Skip to content

Commit

Permalink
Minor bug fixes, changes to continuous integration, input sanitizing …
Browse files Browse the repository at this point in the history
…made optional.
  • Loading branch information
RobertPincus committed May 27, 2020
1 parent e68ad73 commit 22f3b92
Show file tree
Hide file tree
Showing 27 changed files with 451 additions and 425 deletions.
110 changes: 110 additions & 0 deletions .github/workflows/main.yml
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
177 changes: 0 additions & 177 deletions .travis.yml

This file was deleted.

1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ Example programs and documentation are evolving - please see examples/ in the re
1. The default method for solution for longwave problems that include scattering has been changed from 2-stream methods to a re-scaled and refined no-scattering calculation following [Tang et al. 2018](https://doi.org/10.1175/JAS-D-18-0014.1).
2. In RRTMGP gas optics, the spectrally-resolved solar source function in can be adjusted by specifying the total solar irradiance (`gas_optics%set_tsi(tsi)`) and/or the facular and sunspot indicies (`gas_optics%set_solar_variability(mg_index, sb_index, tsi)`)from the [NRLSSI2 model of solar variability](http://doi.org/10.1175/BAMS-D-14-00265.1).
3. `rte_lw()` now includes optional arguments for computing the Jacobian (derivative) of broadband flux with respect to changes in surface temperature. In calculations neglecting scattering only the Jacobian of upwelling flux is computed. When using re-scaling to account for scattering the Jacobians of both up- and downwelling flux are computed.
4. A new module, `mo_rte_config`, contains two logical variables that indicate whether arguments to routines are to be checked for correct extents and/or valid values. These variables can be changed via calls to `rte_config_checks()`. Setting the values to `.false.` removes the checks. Invalid values may cause incorrect results, crashes, or other mayhem

Relative to commit `69d36c9` to `master` on Apr 20, 2020, the required arguments to both the longwave and shortwave versions of `ty_gas_optics_rrtmgp%load()`have changed.

Expand Down
Loading

0 comments on commit 22f3b92

Please sign in to comment.