Skip to content

Commit

Permalink
Containerized 2d tide case and tested it through github Action runner (
Browse files Browse the repository at this point in the history
…#118)

* containerized NWA12.tidesonly case

* Added new mom6_2d_tide ci workflow

* Try to clean-up gha disk space

* Added image pull step

* fix typo

* Added docker run step

* remove -it

* Added run case

* fix typos

* fix a few typos

* more typos

* remove --allow-run-as-root

* forget to load modules

* Reduce runday to 2 days

* tiny mod
  • Loading branch information
yichengt900 authored Nov 26, 2024
1 parent 588d718 commit c3b527b
Show file tree
Hide file tree
Showing 20 changed files with 229 additions and 54 deletions.
97 changes: 97 additions & 0 deletions .github/workflows/mom6_tide_2D.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,97 @@
name: mom6_tide_2d

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest

# container:
# image: noaaepic/ubuntu22.04-intel-llvm-unified:v1.8.0
# options: --user=root

# env:
# PR_NUMBER: ${{ github.event.number }}

steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 1
submodules: recursive

- name: Clean up disk space
run: |
echo "maximize disk space on git-runner ..."
df -h
sudo apt-get clean
sudo rm -rf /var/lib/apt/lists/* /tmp/* ~/.cache
sudo rm -rf /usr/share/dotnet
sudo rm -rf /opt/ghc
sudo rm -rf "/usr/local/share/boost"
sudo rm -rf "$AGENT_TOOLSDIRECTORY"
docker system prune -af
df -h
- name: Set up Docker
uses: docker/setup-buildx-action@v3

- name: Download Image
run: |
echo "Pull the Image ..."
docker pull noaaepic/ubuntu22.04-intel-llvm-unified:v1.8.0
docker images
df -h
- name: running Doker
run: |
echo "Run Docker Image ..."
pwd
docker run --rm \
-v ${{ github.workspace }}:/workspace \
-w /workspace \
noaaepic/ubuntu22.04-intel-llvm-unified:v1.8.0 \
sh -c "cd builds/;
./linux-build.bash -m docker -p linux-intel -t repro -f mom6solo;
cd ../exps;
wget -q ftp.gfdl.noaa.gov:/pub/Yi-cheng.Teng/nwa12_tideonly_ci_datasets.tar.gz && tar -zxvf nwa12_tideonly_ci_datasets.tar.gz;
cd NWA12.tidesonly;
source /root/.bashenv
mpirun -np 4 ../../builds/build/docker-linux-intel/ocean_only/repro/MOM6;
cat ./ocean.stats;
diff -q ref/docker-linux-intel-repro/ocean.stats ./ocean.stats"
# - name: Build mom6solo
# working-directory: ./builds
# run: |
# echo "build mom6solo ..."
# ./linux-build.bash -m docker -p linux-intel -t repro -f mom6solo

# - name: Download 1d model dataset
# working-directory: ./exps
# run: |
# wget -q ftp.gfdl.noaa.gov:/pub/Yi-cheng.Teng/1d_ci_datasets.tar.gz && tar -zxvf 1d_ci_datasets.tar.gz && rm -rf 1d_ci_datasets.tar.gz

# - name: Run 1D toy case and check repro across restarts
# working-directory: ./exps/OM4.single_column.COBALT
# run: |
# ./driver.sh

# - name: Run mppnccombine to combine sub-region diag outputs
# working-directory: ./exps/OM4.single_column.COBALT
# run: |
# /opt/bin/mppnccombine -64 -h 16384 -m -k 100 20040102.ocean_daily_subset.nc 20040102.ocean_daily_subset.nc.00*

# - name: Check ref
# working-directory: ./exps/OM4.single_column.COBALT
# run: |
# echo "new 48hrs ocean.stats: "
# cat ./RESTART_48hrs/ocean.stats
# echo "baseline 48 hrs ocean.stats: "
# cat ./ref/ocean.stats
# diff -q ref/ocean.stats ./RESTART_48hrs/ocean.stats > /dev/null || { echo "Error: ocean.stats are different."; echo "Plz update exps/OM4.single_column.COBALT/ref/ocean.stats with the following: "; cat ./RESTART_48hrs/ocean.stats; exit 1; }
2 changes: 1 addition & 1 deletion builds/docker/linux-intel.mk
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ CFLAGS := -traceback
# Flags based on perforance target (production (OPT), reproduction (REPRO), or debug (DEBUG)
CFLAGS_OPT = -O2 -debug minimal
CFLAGS_REPRO = -O2 -debug minimal
CFLAGS_DEBUG = -O0 -g -ftrapuv
CFLAGS_DEBUG = -O0 -g -ftrapv

# Flags to add additional build options
CFLAGS_OPENMP = -qopenmp
Expand Down
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/grid_spec.nc
1 change: 0 additions & 1 deletion exps/NWA12.tidesonly/INPUT/land_mask.nc

This file was deleted.

2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/ocean_hgrid.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/ocean_mask.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/ocean_mosaic.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/ocean_topog.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tu_001.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tu_002.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tu_003.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tz_001.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tz_002.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/INPUT/tz_003.nc
2 changes: 1 addition & 1 deletion exps/NWA12.tidesonly/MOM_input
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ VARIABLE_BUOYFORCE = False ! [Boolean] default = True
DT_FORCING = 3600.0 ! [s] default = 600.0
! The time step for changing forcing, coupling with other components, or
! potentially writing certain diagnostics. The default value is given by DT.
DAYMAX = 10.0 ! [days]
DAYMAX = 2.0 ! [days]
! The final time of the whole simulation, in units of TIMEUNIT seconds. This
! also sets the potential end time of the present run segment if the end time is
! not set via ocean_solo_nml in input.nml.
Expand Down
Loading

0 comments on commit c3b527b

Please sign in to comment.