MOM6: +(*)Write unscaled restart files.#94
Merged
Conversation
Added optional arguments to framework code to permit the restart files to work with dimensionally unscaled variables. All answers are bitwise identical, but there are new optional arguments for multiple public interfaces. - Added a new conversion factor element, conv, to the field_restart type to specify how a field is to be unscaled before writing, and whose reciprocal is used to scale restart fields as they are read in. - Added the new optional argument conversion to each of the register_restart_field() and register_restart_pair() routines, which is used to specify how each field will be rescaled when it is written to or read from a restart file. The default is the same as setting this to 1. - Added the new optional argument unscaled to fix_restart_scaling() and fix_restart_unit_scaling() to reset the unit conversion factors that will be save to the restart files to 1, consistent with writing out fields without scaling to the restart files.
Revised the MOM6 code so that the output restart files are always exactly the same as they would be if no dimensional rescaling is applied. The input restart files can still have rescaling, so files written by previous versions of the code still work exactly as before. This does change the output, in the sense that the restart files are unscaled and some units documents in the restart files are corrected, but the solutions themselves are bitwise identical. Also, there are new (non-optional) unit scaling type arguments to several routines. The specific changes in this commit include: - Added conversion factors to all register_restart_field() or register_restart_pair() call for variables that are subject to dimensional rescaling. - Revised the calculation of restart rescaling factors to reflect the rescaling that now occurs directly in the restore_state() call. - Added new US arguments to register_restarts_dyn_split_RK2(), MEKE_alloc_register_restart(), set_visc_register_restarts() - Added a new GV argument to mixedlayer_restrat_register_restarts() - Used the new unscaled argument in calls to fix_restart_scaling() and fix_restart_unit_scaling() - Revised several calls to register_restart_field() to avoid using the variant that uses a var_desc type, eliminating the need for some modules to reference the vardesc type or the routine var_desc(). - Added or corrected unit descriptions to the comments describing a few variables. - Noted a few probably bugs in comments with ###, but did not fix them.
Member
|
Just a reminder that this has outstanding |
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #94 +/- ##
=========================================
Coverage 28.99% 28.99%
=========================================
Files 246 246
Lines 72296 72304 +8
=========================================
+ Hits 20963 20967 +4
- Misses 51333 51337 +4
Continue to review full report at Codecov.
|
Member
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15099 ✔️ |
marshallward
approved these changes
Mar 30, 2022
This was referenced May 16, 2022
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR introduces code changes so that MOM6 writes out restart files in which
the dimensional rescaling of variables has been undone, although it is still
able to properly read older restart files that do have dimensionally rescaled
variables. This PR also includes some new optional arguments to the framework
code that will allow SIS2 to do the same; this has been tested and works, but
will have to come in a subsequent PR to SIS2 after the version of MOM6 in
coupled configurations is updated. In testing with this PR, the output
differences between cases with and without dimensional rescaling are confined to
MOM_parameter_doc.debug files. This PR includes a number of new subroutine
arguments, but the solutions are bitwise identical.
The commits in this PR include: