Skip to content

Commit

Permalink
Add support for 4p2z to regression test
Browse files Browse the repository at this point in the history
1. Updated marbl_io_mod to initialize cocco tracers (7% of sp values, except
   coccoCaCO3 = spCaCO3 since sp is no longer calcifier) as well as microzooC
   and mesozooC (both equal to zooC)
2. Added marbl_with_4p2z settings files for both cgs and mks
3. Added a new 4p2z baseline (the cgs run on my laptop)
4. Updated run_test_suite.sh to make sure github tests with 4p2z

Expecting the 4p2z mks test to fail on github, locally netcdf_comparison
returns

Variable: POC_REMIN_DIC
... Max relative error (1.4034448149204683e-11) exceeds 1e-11

Variable: PON_REMIN_NH4
... Max relative error (1.403445286451049e-11) exceeds 1e-11

I suspect the github relative errors will be similar, and I'll need to bump the
tolerance to 2e-11.
  • Loading branch information
mnlevy1981 committed Aug 2, 2023
1 parent 48b8538 commit 8de48b5
Show file tree
Hide file tree
Showing 5 changed files with 782 additions and 1 deletion.
30 changes: 30 additions & 0 deletions MARBL_tools/run_test_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,36 @@ if [ "${STATUS}" == "PASS" ]; then
print_status "netCDF Comparison (1 inst (cgs) vs baseline (cgs))" >> ${RESULTS_CACHE}
fi

# Initialize MARBL (with 4p2z), compute surface fluxes and interior tendencies
cd ${MARBL_ROOT}/tests/regression_tests/call_compute_subroutines
(set -x ; ./call_compute_subroutines.py -s ../../input_files/settings/marbl_with_4p2z_cgs.settings)
STATUS=$(check_return $?)
print_status "call_compute_subroutines.py -s ../../input_files/settings/marbl_with_4p2z_cgs.settings" >> ${RESULTS_CACHE}

if [ "${STATUS}" == "PASS" ]; then
cd ${MARBL_ROOT}/MARBL_tools
BASE_ROOT=${MARBL_ROOT}/tests/input_files/baselines
HIST_ROOT=${MARBL_ROOT}/tests/regression_tests/call_compute_subroutines
(set -x ; ./netcdf_comparison.py -b ${BASE_ROOT}/call_compute_subroutines.history_4p2z.nc -n ${HIST_ROOT}/history_1inst.nc --strict loose)
STATUS=$(check_return $?)
print_status "netCDF Comparison (1 inst (cgs, 4p2z) vs baseline (cgs, 4p2z))" >> ${RESULTS_CACHE}
fi

# Initialize MARBL (with 4p2z), compute surface fluxes and interior tendencies in mks instead of cgs
cd ${MARBL_ROOT}/tests/regression_tests/call_compute_subroutines
(set -x ; ./call_compute_subroutines.py -s ../../input_files/settings/marbl_with_4p2z_mks.settings -u mks)
STATUS=$(check_return $?)
print_status "call_compute_subroutines.py -s ../../input_files/settings/marbl_with_4p2z_mks.settings -u mks" >> ${RESULTS_CACHE}

if [ "${STATUS}" == "PASS" ]; then
cd ${MARBL_ROOT}/MARBL_tools
BASE_ROOT=${MARBL_ROOT}/tests/input_files/baselines
HIST_ROOT=${MARBL_ROOT}/tests/regression_tests/call_compute_subroutines
(set -x ; ./netcdf_comparison.py -b ${BASE_ROOT}/call_compute_subroutines.history_with_4p2z.nc -n ${HIST_ROOT}/history_1inst.nc --strict loose)
STATUS=$(check_return $?)
print_status "netCDF Comparison (1 inst (mks, 4p2z) vs baseline (cgs, 4p2z))" >> ${RESULTS_CACHE}
fi

# Initialize MARBL (with ciso tracers), compute surface fluxes and interior tendencies
cd ${MARBL_ROOT}/tests/regression_tests/call_compute_subroutines
(set -x ; ./call_compute_subroutines.py -s ../../input_files/settings/marbl_with_ciso.settings)
Expand Down
23 changes: 22 additions & 1 deletion tests/driver_src/marbl_io_mod.F90
Original file line number Diff line number Diff line change
Expand Up @@ -548,7 +548,28 @@ subroutine marbl_io_read_tracers(col_id, tracer_metadata, tracers, lat, driver_s
do n = 1, size(tracer_metadata)
! Hard-code in mechanism for falling back to non-isotopic tracers when initializing CISO
! TODO: maybe this should be a namelist option?
if (trim(tracer_metadata(n)%short_name) == 'DI13C') then
if (trim(tracer_metadata(n)%short_name) == 'coccoChl') then
tracer_name_file = 'spChl'
scale_factor = 0.07_r8
else if (trim(tracer_metadata(n)%short_name) == 'coccoC') then
tracer_name_file = 'spC'
scale_factor = 0.07_r8
else if (trim(tracer_metadata(n)%short_name) == 'coccoP') then
tracer_name_file = 'spP'
scale_factor = 0.07_r8
else if (trim(tracer_metadata(n)%short_name) == 'coccoFe') then
tracer_name_file = 'spFe'
scale_factor = 0.07_r8
else if (trim(tracer_metadata(n)%short_name) == 'coccoCaCO3') then
tracer_name_file = 'spCaCO3'
scale_factor = c1
else if (trim(tracer_metadata(n)%short_name) == 'microzooC') then
tracer_name_file = 'zooC'
scale_factor = c1
else if (trim(tracer_metadata(n)%short_name) == 'mesozooC') then
tracer_name_file = 'zooC'
scale_factor = c1
else if (trim(tracer_metadata(n)%short_name) == 'DI13C') then
tracer_name_file = 'DIC'
scale_factor = 1.025_r8
else if (trim(tracer_metadata(n)%short_name) == 'DO13Ctot') then
Expand Down
Binary file not shown.
Loading

0 comments on commit 8de48b5

Please sign in to comment.