Skip to content

Commit

Permalink
Enable 1d restart test (#23)
Browse files Browse the repository at this point in the history
* Update 1d model config

* update 1d ci yaml
  • Loading branch information
yichengt900 authored Apr 18, 2024
1 parent 66e6858 commit 0d1325c
Show file tree
Hide file tree
Showing 6 changed files with 39 additions and 31 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/mom6_cobalt_1D.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,25 @@ jobs:
submodules: recursive

- name: Build mom6-sis2-cobalt
working-directory: ./builds
run: |
apt update; apt install -y wget
echo "build mom6-sis2-cobalt ..."
cd ./builds
./linux-build.bash -m docker -p linux-gnu -t debug -f mom6sis2
- name: Download 1d model dataset
working-directory: ./exps
run: |
cd ./exps
wget -q ftp.gfdl.noaa.gov:/pub/Yi-cheng.Teng/1d_datasets.tar.gz && tar -zxvf 1d_datasets.tar.gz && rm -rf 1d_datasets.tar.gz
- name: Run 1D toy case and check repro across restarts
working-directory: ./exps/OM4.single_column.COBALT
run: |
cd exps/OM4.single_column.COBALT
#mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/prod/MOM6SIS2
./driver.sh
- name: Check ref
working-directory: ./exps/OM4.single_column.COBALT
run: |
cd exps/OM4.single_column.COBALT
echo "new 48hrs ocean.stats: "
cat ./RESTART_48hrs/ocean.stats
echo "baseline 48 hrs ocean.stats: "
Expand Down
1 change: 1 addition & 0 deletions exps/OM4.single_column.COBALT/INPUT/MOM_IC.nc
12 changes: 10 additions & 2 deletions exps/OM4.single_column.COBALT/MOM_override
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,16 @@
#override REENTRANT_X = True
#override ALE_COORDINATE_CONFIG = "FNC1:2,6500,6,.01"
#override REGRIDDING_COORDINATE_MODE = "Z*"
#override REGRIDDING_COORDINATE_MODE = "Z*"
#override Z_INIT_REMAPPING_SCHEME = "PPM_IH4"
#override Z_INIT_REMAP_OLD_ALG = True
!#override TRACERS_MAY_REINIT = True
#override TRACERS_MAY_REINIT = True
#override INIT_LAYERS_FROM_Z_FILE = False
#override TS_CONFIG = file
#override TS_FILE = "MOM_IC.nc"
#override SALT_FILE= "MOM_IC.nc"
#override TEMP_IC_VAR = "Temp"
#override SALT_IC_VAR = "Salt"
!
#override KD = 5.e-4
#override RESOLN_SCALED_KH = False
Expand All @@ -28,4 +35,5 @@
#override PEN_SW_NBANDS = 3
#override CHL_FROM_FILE = False
#override DO_GEOTHERMAL = True
#override GEOTHERMAL_SCALE = 0.0
#override GEOTHERMAL_SCALE = 0.0
#override GENERIC_TRACER_IC_FILE = "MOM_IC.nc"
28 changes: 14 additions & 14 deletions exps/OM4.single_column.COBALT/driver.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@ echo "Test started: " `date`
#
echo "run 48hrs test ..."
ln -fs input.nml_48hr input.nml
../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out1 2>err1
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out1 2>err1
mv RESTART RESTART_48hrs
mv ocean.stats* RESTART_48hrs

#
echo "run 24hrs test ..."
ln -fs input.nml_24hr input.nml
../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out2 2>err2
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out2 2>err2
mv RESTART RESTART_24hrs
mv ocean.stats* RESTART_24hrs

Expand All @@ -29,7 +29,7 @@ popd
#
echo "run 24hrs rst test ..."
ln -fs input.nml_24hr_rst input.nml
../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out3 2>err3
mpirun --allow-run-as-root -np 1 ../../builds/build/docker-linux-gnu/ocean_ice/debug/MOM6SIS2 > out3 2>err3
mv RESTART RESTART_24hrs_rst
mv ocean.stats* RESTART_24hrs_rst

Expand All @@ -43,19 +43,19 @@ if [ ! -d "$DIR1" ] || [ ! -d "$DIR2" ]; then
fi

# Define the files to compare
#FILES=("MOM.res.nc" "ice_cobalt.res.nc" "ice_model.res.nc" "ocean_cobalt_airsea_flux.res.nc")
FILES=("MOM.res.nc" "ice_cobalt.res.nc" "ice_model.res.nc" "ocean_cobalt_airsea_flux.res.nc")

# Iterate over the files
#for FILE in "${FILES[@]}"; do
# # Compare the files using nccmp
# echo "Compare ${FILE}"
# rm -rf org.txt
# rm -rf ref.txt
# ncdump ${DIR1}/${FILE} > org.txt
# ncdump ${DIR2}/${FILE} > ref.txt
# diff -q ./org.txt ./ref.txt > /dev/null || { echo "Error: ${FILE} is not identical, please check! Exiting now..."; exit 1; }
#done
for FILE in "${FILES[@]}"; do
# Compare the files using nccmp
echo "Compare ${FILE}"
rm -rf org.txt
rm -rf ref.txt
ncdump ${DIR1}/${FILE} > org.txt
ncdump ${DIR2}/${FILE} > ref.txt
diff -q ./org.txt ./ref.txt > /dev/null || { echo "Error: ${FILE} is not identical, please check! Exiting now..."; exit 1; }
done

#
#echo "All restart files are identical, PASS"
echo "All restart files are identical, PASS"
echo "Test ended: " `date`
2 changes: 1 addition & 1 deletion exps/OM4.single_column.COBALT/field_table
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
# "units", "kg/kg" /
###.................................................
"namelists","ocean_mod","generic_COBALT"
enforce_src_info = t
enforce_src_info = f
#
no3_src_file = INPUT/bgc_woa_esper_ics_1993_2023-04_BATS.nc
no3_src_var_name = no3
Expand Down
18 changes: 9 additions & 9 deletions exps/OM4.single_column.COBALT/ref/ocean.stats
Original file line number Diff line number Diff line change
@@ -1,11 +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
6, 731595.250, 0, En 1.9430699000185468E-06, CFL 0.00273, SL -1.0976E-03, M 6.97073E+15, S 35.2427, T 6.2460, Me -8.57E-10, Se -2.86E-07, Te -2.66E-06
12, 731595.500, 0, En 4.1702635092128206E-06, CFL 0.00285, SL -2.1342E-03, M 6.97073E+15, S 35.2427, T 6.2457, Me -7.46E-10, Se -6.81E-07, Te -6.81E-06
18, 731595.750, 0, En 1.1474414851572739E-05, CFL 0.00752, SL -3.2693E-03, M 6.97073E+15, S 35.2427, T 6.2459, Me -7.01E-10, Se -9.90E-07, Te -1.00E-05
24, 731596.000, 0, En 2.2889537195880983E-05, CFL 0.00823, SL -4.4872E-03, M 6.97072E+15, S 35.2427, T 6.2457, Me -1.14E-09, Se -1.40E-06, Te -1.42E-05
30, 731596.250, 0, En 2.8029594580345227E-05, CFL 0.00694, SL -5.5226E-03, M 6.97072E+15, S 35.2428, T 6.2454, Me -1.17E-09, Se -1.93E-06, Te -1.96E-05
36, 731596.500, 0, En 3.5426508192363729E-05, CFL 0.00718, SL -6.4927E-03, M 6.97072E+15, S 35.2428, T 6.2451, Me -1.19E-09, Se -2.38E-06, Te -2.42E-05
42, 731596.750, 0, En 4.0790161815603025E-05, CFL 0.00761, SL -7.1803E-03, M 6.97072E+15, S 35.2428, T 6.2453, Me -1.11E-09, Se -2.80E-06, Te -2.86E-05
48, 731597.000, 0, En 4.6113879916334494E-05, CFL 0.00890, SL -7.7386E-03, M 6.97072E+15, S 35.2428, T 6.2453, Me -8.74E-10, Se -3.06E-06, Te -3.14E-05
0, 731595.000, 0, En 4.0531850015098391E-27, CFL 0.00000, SL -0.0000E+00, M 6.97073E+15, S 36.6039, T 20.1934, Me 0.00E+00, Se 0.00E+00, Te 0.00E+00
6, 731595.250, 0, En 8.1378403741497590E-07, CFL 0.00201, SL -1.1025E-03, M 6.97073E+15, S 36.6039, T 20.1931, Me -8.61E-10, Se -3.47E-08, Te -9.00E-08
12, 731595.500, 0, En 1.0965166953916849E-06, CFL 0.00195, SL -2.1512E-03, M 6.97073E+15, S 36.6039, T 20.1929, Me -7.51E-10, Se -3.52E-08, Te -2.01E-07
18, 731595.750, 0, En 4.8253111198979680E-06, CFL 0.00590, SL -3.3036E-03, M 6.97073E+15, S 36.6039, T 20.1931, Me -7.07E-10, Se -3.67E-08, Te -2.91E-07
24, 731596.000, 0, En 7.9419977210872199E-06, CFL 0.00601, SL -4.5424E-03, M 6.97072E+15, S 36.6039, T 20.1929, Me -1.15E-09, Se -5.79E-08, Te -4.14E-07
30, 731596.250, 0, En 5.8922068996536806E-06, CFL 0.00396, SL -5.6012E-03, M 6.97072E+15, S 36.6039, T 20.1926, Me -1.19E-09, Se -6.41E-08, Te -5.57E-07
36, 731596.500, 0, En 6.2438296335804349E-06, CFL 0.00379, SL -6.5992E-03, M 6.97072E+15, S 36.6039, T 20.1924, Me -1.21E-09, Se -6.86E-08, Te -6.80E-07
42, 731596.750, 0, En 7.5986995355453777E-06, CFL 0.00438, SL -7.3112E-03, M 6.97072E+15, S 36.6039, T 20.1926, Me -1.13E-09, Se -6.98E-08, Te -8.03E-07
48, 731597.000, 0, En 9.7326940294133761E-06, CFL 0.00527, SL -7.8910E-03, M 6.97072E+15, S 36.6039, T 20.1926, Me -8.89E-10, Se -6.41E-08, Te -8.82E-07

0 comments on commit 0d1325c

Please sign in to comment.