diff --git a/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/MOM.res.nc b/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/MOM.res.nc new file mode 100644 index 0000000..6cd0a18 Binary files /dev/null and b/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/MOM.res.nc differ diff --git a/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/ocean.stats b/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/ocean.stats new file mode 100644 index 0000000..0963eee --- /dev/null +++ b/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/ocean.stats @@ -0,0 +1,11 @@ + Step, Day, Truncs, Energy/Mass, Maximum CFL, Mean Sea Level, Total Mass, Mean Salin, Mean Temp, Frac Mass Err, Salin Err, Temp Err + [days] [m2 s-2] [Nondim] [m] [kg] [PSU] [degC] [Nondim] [PSU] [degC] + 0, 731595.000, 0, En 4.0531850015098383E-27, CFL 0.00000, SL -0.0000E+00, M 6.97073E+15, S 35.2427, T 6.2462, Me 0.00E+00, Se 0.00E+00, Te 0.00E+00 + 18, 731595.250, 0, En 2.3854654580464527E-06, CFL 0.00372, SL -3.6569E-06, M 6.97073E+15, S 35.2427, T 6.2460, Me -9.14E-10, Se -2.87E-07, Te -2.53E-06 + 36, 731595.500, 0, En 4.7618800034270000E-06, CFL 0.00348, SL -6.7408E-06, M 6.97073E+15, S 35.2427, T 6.2457, Me -7.71E-10, Se -7.18E-07, Te -7.00E-06 + 54, 731595.750, 0, En 1.1464049165959475E-05, CFL 0.00749, SL -9.5684E-06, M 6.97073E+15, S 35.2427, T 6.2459, Me -7.07E-10, Se -9.88E-07, Te -1.03E-05 + 72, 731596.000, 0, En 2.3222960705556885E-05, CFL 0.00881, SL -1.4119E-05, M 6.97073E+15, S 35.2427, T 6.2457, Me -1.14E-09, Se -1.40E-06, Te -1.41E-05 + 90, 731596.250, 0, En 2.9040534962143268E-05, CFL 0.00771, SL -1.8938E-05, M 6.97073E+15, S 35.2427, T 6.2454, Me -1.20E-09, Se -1.96E-06, Te -1.97E-05 + 108, 731596.500, 0, En 3.6391342252032763E-05, CFL 0.00790, SL -2.3731E-05, M 6.97073E+15, S 35.2427, T 6.2451, Me -1.20E-09, Se -2.38E-06, Te -2.44E-05 + 126, 731596.750, 0, En 4.2200585475070879E-05, CFL 0.00923, SL -2.8306E-05, M 6.97073E+15, S 35.2427, T 6.2453, Me -1.14E-09, Se -2.80E-06, Te -2.88E-05 + 144, 731597.000, 0, En 4.6813518525667337E-05, CFL 0.00922, SL -3.1872E-05, M 6.97073E+15, S 35.2427, T 6.2453, Me -8.91E-10, Se -3.11E-06, Te -3.18E-05 diff --git a/.github/workflows/cobalt_ci.yml b/.github/workflows/cobalt_ci.yml index bab23fd..a10ba02 100644 --- a/.github/workflows/cobalt_ci.yml +++ b/.github/workflows/cobalt_ci.yml @@ -19,18 +19,57 @@ jobs: build: # The type of runner that the job will run on runs-on: ubuntu-latest + # define container + container: + image: clouden90/1d_mom6_cobalt:base + options: --user root # 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: Checkout Repository uses: actions/checkout@v3 - - # Build and Test within Docker container - - name: Build and Test - uses: docker://clouden90/1d_mom6_cobalt:base: with: - args: | - ls -l -h - pwd - which wget + submodules: recursive + + # Install wget and get data + - name: Install wget and get data + run: | + apt-get update + apt-get install -y wget + cd /opt + wget https://gfdl-med.s3.amazonaws.com/OceanBGC_dataset/1d_datasets.tar.gz + tar -zxvf 1d_datasets.tar.gz + rm -rf 1d_datasets.tar.gz + + # git clone MOM6_OBGC_examples and replace ocean_BGC + - name: git clone MOM6_OBGC_examples and build mom6sis2-cobalt + run: | + cd .. + git clone https://github.com/NOAA-CEFI-Regional-Ocean-Modeling/MOM6_OBGC_examples.git --recursive + rm -rf MOM6_OBGC_examples/src/ocean_BGC + cp -r ocean_BGC MOM6_OBGC_examples/src + cd MOM6_OBGC_examples/builds + ./linux-build.bash -m docker -p linux-gnu -t prod -f mom6sis2 + + + # run 1D mom6sis2-cobalt test + - name: 1D mom6sis2-cobalt test + run: | + cd ../MOM6_OBGC_examples/exps + ln -fs /opt/datasets ./ + cd OM4.single_column.COBALT.p4 + mkdir RESTART + mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/prod/MOM6SIS2 + + - name: baseline check + run: | + cd ../MOM6_OBGC_examples/exps/OM4.single_column.COBALT.p4 + mkdir -p ref + cp ../../src/ocean_BGC/.github/ref/OM4.single_column.COBALT.p4/docker-linux-gnu/* ./ref + # check ocean.stats + diff -q ref/ocean.stats ./ocean.stats > /dev/null || { echo "Error: ocean.stats are different, check and update ref! Exiting now..."; exit 1; } + # check MOM.res.nc + ncdump ref/MOM.res.nc > org_ref.txt + ncdump RESTART/MOM.res.nc > new_ref.txt + diff -q ./org_ref.txt ./new_ref.txt > /dev/null || { echo "Error: MOM.res.nc are different, check and update ref! Exiting now..."; exit 1; }