Skip to content

Add arbitrary restart hour for UFS #481

Add arbitrary restart hour for UFS

Add arbitrary restart hour for UFS #481

Workflow file for this run

# CIME scripts regression tests
name: scripts regression tests
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the main branch
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: [ 3.8, 3.11, 3.x ]
env:
CC: mpicc
FC: mpifort
CXX: mpicxx
CPPFLAGS: "-I/usr/include -I/usr/local/include "
LDFLAGS: "-L/usr/lib/x86_64-linux-gnu -lnetcdf -lnetcdff -lpnetcdf"
# Versions of all dependencies can be updated here
ESMF_VERSION: v8.6.1
PARALLELIO_VERSION: pio2_6_3
CIME_MODEL: cesm
CIME_DRIVER: nuopc
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Setup Ubuntu Environment
id: load-env
run: |
set -x
sudo apt-get update
sudo apt-get install libxml2-utils
sudo apt-get install netcdf-bin
sudo apt-get install libnetcdf-dev
sudo apt-get install libnetcdff-dev
sudo apt-get install pnetcdf-bin
sudo apt-get install libpnetcdf-dev
sudo apt-get install doxygen
sudo apt-get install graphviz
sudo apt-get install wget
sudo apt-get install gfortran
sudo apt-get install libjpeg-dev
sudo apt-get install libz-dev
sudo apt-get install openmpi-bin
sudo apt-get install libopenmpi-dev
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: echo "PyYAML" > requirements.txt
- name: Install PyYAML
run: pip install -r requirements.txt
# use the latest cesm main
- name: cesm checkout
uses: actions/checkout@v4
with:
repository: ESCOMP/CESM
path: cesm
# this cmeps commit
- name: cmeps checkout
uses: actions/checkout@v4
with:
path: cesm/components/cmeps
# Checkout cesm datamodels and support
# cpl7 is needed - i think that's a bug
- name: checkout externals
run: |
git config --global user.name "${GITHUB_ACTOR}"
git config --global user.email "${GITHUB_ACTOR_ID}+${GITHUB_ACTOR}@users.noreply.github.com"
pushd cesm
./bin/git-fleximod update cime ccs_config cdeps share mct parallelio
cd ccs_config
git checkout main
cd ../cime
git checkout master
git status
if [[ ! -e "${PWD}/.gitmodules.bak" ]]
then
echo "Converting git@github.com to https://github.com urls in ${PWD}/.gitmodules"
sed -i".bak" "s/git@github.com:/https:\/\/github.com\//g" "${PWD}/.gitmodules"
fi
git submodule update --init
cd ../components/cdeps
git checkout main
git submodule update --init
cd ../../share
git checkout main
- name: Cache ESMF
id: cache-esmf
uses: actions/cache@v4
with:
path: ~/ESMF
key: ${{ runner.os }}-${{ env.ESMF_VERSION }}
- name: Cache ParallelIO
id: cache-ParallelIO
uses: actions/cache@v4
with:
path: ${GITHUB_WORKSPACE}/pio
key: ${{ runner.os }}-${{ env.PARALLELIO_VERSION }}.parallelio
- name: Cache inputdata
id: cache-inputdata
uses: actions/cache@v4
with:
path: $HOME/cesm/inputdata
key: inputdata
- name: Build ParallelIO
if: steps.cache-PARALLELIO.outputs.cache-hit != 'true'
uses: NCAR/ParallelIO/.github/actions/parallelio_cmake@05173a6556ea8d80eb34e3881a5014ea8f4b7543
with:
parallelio_version: ${{ env.ParallelIO_VERSION }}
enable_fortran: True
install_prefix: ${GITHUB_WORKSPACE}/pio
- name: Install ESMF
uses: esmf-org/install-esmf-action@v1
env:
ESMF_COMPILER: gfortran
ESMF_BOPT: g
ESMF_COMM: openmpi
ESMF_NETCDF: nc-config
ESMF_PNETCDF: pnetcdf-config
ESMF_INSTALL_PREFIX: ${GITHUB_WORKSPACE}/ESMF
ESMF_PIO: external
ESMF_PIO_INCLUDE: ${GITHUB_WORKSPACE}/pio/include
ESMF_PIO_LIBPATH: ${GITHUB_WORKSPACE}/pio/lib
with:
version: ${{ env.ESMF_VERSION }}
esmpy: false
cache: true
- name: PREP for scripts regression test
run: |
mkdir -p $HOME/cesm/scratch
mkdir -p $HOME/cesm/inputdata
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
export SRCROOT=$GITHUB_WORKSPACE/cesm/
export CIME_TEST_PLATFORM=ubuntu-latest
export PIO_INCDIR=$GITHUB_WORKSPACE/pio/include
export PIO_LIBDIR=$GITHUB_WORKSPACE/pio/lib
export PIO_VERSION_MAJOR=2
export PIO_TYPENAME_VALID_VALUES="netcdf,pnetcdf"
export NETCDF_PATH=/usr
export PNETCDF_PATH=/usr
export LD_LIBRARY_PATH=/usr/lib/libx86_64-linux-gnu/:$LD_LIBRARY_PATH
cat <<EOF >> $GITHUB_WORKSPACE/cesm/ccs_config/machines/cmake_macros/ubuntu-latest.cmake
set(NetCDF_Fortran_INCLUDE_DIR /usr/include)
set(NetCDF_Fortran_LIBRARY /usr/lib/x86_64-gnu-Linux/libnetcdff.so)
EOF
printenv >> $GITHUB_ENV
popd
- name: scripts regression tests
run: |
pushd $GITHUB_WORKSPACE/cesm/cime/CIME/tests
./scripts_regression_tests.py --no-fortran-run --compiler gnu --mpilib openmpi --machine ubuntu-latest
popd
# the following can be used by developers to login to the github server in case of errors
# see https://github.com/marketplace/actions/debugging-with-tmate for further details
# - name: Setup tmate session
# if: ${{ failure() }}
# uses: mxschmitt/action-tmate@v3