Skip to content

Commit

Permalink
Add NEP10-COBALT RT, refactor CI workflows, and add stable nightly re…
Browse files Browse the repository at this point in the history
…lease workflow (#33)

* Add NEP10.COBALT test case

* change NWA xml to make a prefect reproduce

* add stable_weekly release workflow
  • Loading branch information
yichengt900 authored Apr 30, 2024
1 parent 88337fc commit 867a843
Show file tree
Hide file tree
Showing 74 changed files with 2,775 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/CEFI_MOM6-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ jobs:
strategy:
max-parallel: 2
matrix:
case: ["NWA12.COBALT"] #, "NWA12.CFC"]
case: ["NWA12.COBALT", "NEP10.COBALT"]
steps:
- name: Run Experiment ${{ matrix.case }}
run: |
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/mom6_cobalt_1D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ on:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
Expand Down
27 changes: 27 additions & 0 deletions .github/workflows/nightly_update._yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: Update and Push Ocean BGC Submodule

on:
schedule:
- cron: '0 4 * * 2' # Run at 12:00 am EDT every Tuesday

jobs:
nightly_update:
runs-on: ubuntu-latest
steps:
- name: Set Git user name and email
run: |
git config --global user.email ${{ secrets.GHA_EMAIL }}
git config --global user.name ${{ secrets.GHA_ID }}

- name: Check out repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
submodules: 'recursive'

- name: Update Ocean BGC Submodule
run: |
git submodule update --remote --merge src/ocean_BGC
git add src/ocean_BGC
git commit -m "Update ocean_BGC submodule nightly"
30 changes: 30 additions & 0 deletions .github/workflows/stable_weekly_release.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
on:
schedule:
- cron: '0 0 * * 3' # Run at midnight (00:00) every Wednesday

jobs:
stable_release:
runs-on: ubuntu-latest

steps:
- name: Check out repository
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.PAT }}

- name: Show diff between stable/weekly_release and main
if: github.ref == 'refs/heads/main'
run: |
echo "Showing diff between stable/weekly_release and main"
git fetch origin stable/weekly_release:stable/weekly_release
git diff stable/weekly_release..origin/main
- name: Merge develop into main
if: github.ref == 'refs/heads/feature/main'
run: |
echo ${{ github.ref }}
git checkout stable/weekly_release
git pull origin stable/weekly_release
git merge origin/main --no-edit
git push --force origin stable/weekly_release
49 changes: 45 additions & 4 deletions builds/ci_build_driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,56 @@
#SBATCH --account=cefi

#
[ -d "build" ] && rm -rf build

#
[ -d "build" ] && rm -rf build
echo "Build MOM6SIS2-COBALT for CI testing started: " `date`

#
machine_name="gaea"
platform="ncrc5.intel23"
target="repro"
flavor="fms1_mom6sis2"

FMSlib_PATH="/gpfs/f5/cefi/scratch/Yi-cheng.Teng/github/FMS/2023.04_FMS1"
rootdir=$(pwd)
abs_rootdir=$rootdir

echo $abs_rootdir

#load modules
source $MODULESHOME/init/bash
source $rootdir/$machine_name/$platform.env
. $rootdir/$machine_name/$platform.env

makeflags="NETCDF=3"

if [[ $target =~ "repro" ]] ; then
makeflags="$makeflags REPRO=1"
fi

srcdir=$abs_rootdir/../src

#
echo "Build started: " `date`
sed -i 's/static pid_t gettid(void)/pid_t gettid(void)/g' $srcdir/FMS/affinity/affinity.c

#
./linux-build.bash -m gaea -p ncrc5.intel23 -t repro -f fms1_mom6sis2
if [[ $flavor == "fms1_mom6sis2" ]] ; then
echo "build mom6sis2 with FMS1 cap"

mkdir -p build/$machine_name-$platform/ocean_ice/$target
pushd build/$machine_name-$platform/ocean_ice/$target
rm -f path_names
$srcdir/mkmf/bin/list_paths $srcdir/MOM6/{config_src/infra/FMS1,config_src/memory/dynamic_symmetric,config_src/drivers/FMS_cap,config_src/external/ODA_hooks,config_src/external/database_comms,config_src/external/drifters,config_src/external/stochastic_physics,pkg/GSW-Fortran/{modules,toolbox}/,src/{*,*/*}/} $srcdir/SIS2/{config_src/dynamic_symmetric,config_src/external/Icepack_interfaces,src} $srcdir/icebergs/src $srcdir/FMS/{coupler,include}/ $srcdir/{ocean_BGC/generic_tracers,ocean_BGC/mocsy/src}/ $srcdir/{atmos_null,ice_param,land_null,coupler/shared/,coupler/full/}/

compiler_options='-DINTERNAL_FILE_NML -DMAX_FIELDS_=600 -DNOT_SET_AFFINITY -D_USE_MOM6_DIAG -D_USE_GENERIC_TRACER -DUSE_PRECISION=2 -D_USE_LEGACY_LAND_ -Duse_AM3_physics'

$srcdir/mkmf/bin/mkmf -t $abs_rootdir/$machine_name/$platform.mk -o "-I${FMSlib_PATH}/shared/$target" -p MOM6SIS2 -l "-L${FMSlib_PATH}/shared/$target -lfms" -c "$compiler_options" path_names

make $makeflags MOM6SIS2

fi


#
echo "Build ended: " `date`
echo "Build MOM6SIS2-COBALT for CI testing ended: " `date`
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_lp_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_msl_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_sf_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_sphum_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_ssrd_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_strd_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_t2m_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_u10_1993_padded.nc
1 change: 1 addition & 0 deletions exps/NEP10.COBALT/INPUT/ERA5_v10_1993_padded.nc
Loading

0 comments on commit 867a843

Please sign in to comment.