-
Notifications
You must be signed in to change notification settings - Fork 66
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
MOM6: +(*)Write unscaled restart files. #94
MOM6: +(*)Write unscaled restart files. #94
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.
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.
|
Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/15099 ✔️ |
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: