Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Test diagnostics and diag system #147

Closed
nichannah opened this issue Apr 24, 2015 · 1 comment
Closed

Test diagnostics and diag system #147

nichannah opened this issue Apr 24, 2015 · 1 comment

Comments

@nichannah
Copy link
Collaborator

Issue #62 will result in some changes to the diagnostic infrastructure. Before doing this we need a way to test the diagnostics to ensure that no regressions are introduced. Tests for diagnostic output would be very useful for other reasons also.

Three kinds of tests are proposed:

  1. make checksums of diagnostic output fields and test against a baseline to find regressions.
  2. some 'absolute' checks, for example checking that there are no NaNs in the output, or comparing against some expected field statistics.
  3. checking the that all diagnostics actually work. i.e. ensure that we can get output for all diagnostics in the code.
@nichannah
Copy link
Collaborator Author

Introduction

Presently the model is tested for regressions by comparing checksums of key values between code changes. This allows scientific changes to be detected and then verified. The outputs of the model are not tested. In particular this means that incorrect calculation of diagnostic outputs will go unnoticed.

The purpose of this task is to support testing of diagnostics. One motivation to do this now is so that changes to the diagnostic manager within MOM can be made.

This task will introduce three kinds of system-level tests:
1. Compare checksums on diagnostic output against previous checksums. Call these relative system tests.
2. Do arbitrary pass/fail checks on particular fields. For example checking agains expected statistics. Call these absolute system tests.
3. Check that all diagnostics in the code do work.

Requirements

  • Test that all available diagnostics are in fact output.
  • Cover ocean and ice diagnostics.
  • Detect changes to diagnostic output.
  • It should be easy to update the baseline if legitimate changes to diagnostics do occur. i.e. just do a 'cp' or 'mv'.
  • Easy to extend and add new absolute system tests.

Design

Steps:
1. Run the test case and get a list of all available diagnostics for that test case.
2. Put each of the available diagnostics into the diag_table with it's own output file and frequency 0.
3. Run the test case again. It should output all available diagnostics at the maximum frequency.
4. Do checks on output from above.

This process is generic, i.e. it is not tied to a particular test case. It could be repeated for several test cases until we know that we've covered absolutely all the diagnostics in the source code. Presently it only runs on the ice_ocean_SIS2/Baltic test.

Implementation

See MOM-examples/test/test_diagnostic_output.py

Presently, in order to run the tests a GNU repro executable should already exist. Then run:

cd MOM-examples
nosetests

On gaea is may be necessary to do module load python_nose first.

adcroft added a commit to NOAA-GFDL/SIS2 that referenced this issue May 4, 2015
adcroft added a commit to NOAA-GFDL/MOM6-examples that referenced this issue May 4, 2015
- NOAA-GFDL/SIS2@66d58c3 Merge branch 'nicjhan-diagnostic-tests' into dev/master
- NOAA-GFDL/SIS2@0b468a2 Revert "Call diag_mediator_end() to close open files. mom-ocean/MOM6#147"
- NOAA-GFDL/SIS2@620e355 Increase the maximum diagnostics to allow exhaustive diagnostic checking.
- NOAA-GFDL/SIS2@41812db Fix diagnostic tmp array shape. mom-ocean/MOM6#147
- NOAA-GFDL/SIS2@3440869 Call diag_mediator_end() to close open files. mom-ocean/MOM6#147
- NOAA-GFDL/SIS2@4d80387 Array shape mismatches for ice SW diagnostics. Closes #17.
adcroft pushed a commit to NOAA-GFDL/SIS2 that referenced this issue May 5, 2015
adcroft added a commit to NOAA-GFDL/MOM6-examples that referenced this issue May 5, 2015
- mom-ocean/MOM6@599379a Only call diag_manager_end() in solo mode
- NOAA-GFDL/SIS2@6a26cd1 Call diag_mediator_end() to close open files. mom-ocean/MOM6#147
- NOAA-GFDL/SIS2@16d0be6 Removed call to diag_manager_end()
nikizadehgfdl pushed a commit to nikizadehgfdl/MOM6 that referenced this issue Oct 9, 2017
- 08367b4 Merge branch 'nicjhan-diagnostic-tests' into dev/master
- 958789e Removing latent_evap from list of obsolete diagnostics
- b9a23f4 Revert "Update diagnostic name, old name has been obsoleted. Closes mom-ocean#155"
- 9d03ff3 Merge branch 'diagnostic-tests' of github.com:nicjhan/NOAA-GFDL-MOM6 into nicjhan-diagnostic-tests
- ad474f4 Maximum number of diagnostics increased in order to do exhaustive diagnostic checking. mom-ocean#147.
- 7f5cc91 Update diagnostic name, old name has been obsoleted. Closes mom-ocean#155
- c464f2d Only register N2, S2 diagnostics when the configuration supports them. mom-ocean#147
- b1ae675 Bugfix: Fl_itidal diagnostic shape incorrect. Closes mom-ocean#151
- 568c54c Call diag_mediator_end to close open files. Closes mom-ocean#156
nikizadehgfdl pushed a commit to nikizadehgfdl/MOM6 that referenced this issue Oct 9, 2017
        $ py.test
Or if you don't have py.test installed:
        $ python tests/runtests.py
Asl use --help, paying particular attention to the 'custom options' section.
See CommerceGov/NOAA-GFDL-MOM6/mom-ocean#147.
gustavo-marques pushed a commit to gustavo-marques/MOM6 that referenced this issue May 6, 2020
Add option to control Biharmonic coeff. via grid Reynolds number
MJHarrison-GFDL pushed a commit to MJHarrison-GFDL/MOM6 that referenced this issue Jun 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant