-
Notifications
You must be signed in to change notification settings - Fork 232
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
+Complete MOM6 framework code restructuring #1293
Merged
adcroft
merged 16 commits into
mom-ocean:dev/gfdl
from
Hallberg-NOAA:revise_framework_3rd
Jan 22, 2021
Merged
+Complete MOM6 framework code restructuring #1293
adcroft
merged 16 commits into
mom-ocean:dev/gfdl
from
Hallberg-NOAA:revise_framework_3rd
Jan 22, 2021
Conversation
This file contains 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
Moved MOM_domains.F90 to MOM_domain_infra.F90 and MOM_domain_init.F90 to MOM_domains.F90, and eliminated MOM_domains_init from MOM_domain_infra.F90. The interfaces from MOM_domains.F90 that were previously used are still available from the new MOM_domains module. Also replaced the tripolar argument to create_MOM_domain with the simple logical tripolar_N. All answers are bitwise identical, but a module name that was briefly in use no longer exists.
Renamed MOM_io_wrapper to MOM_io_infra and MOM_coms_wrapper to MOM_coms_infra. All answers are bitwise identical, but there are changes to module names that are only used in the framework directory.
Created a separate thin error handler, MOM_error_infra.F90, to work with the MOM infrastructure routines and wrap infrastructure calls, and use this in MOM_error_handler. All answers are bitwise identical, but there is a new module.
Removed time_interp_external_mod interfaces from MOM_time_domain.F90, and replaced calls to time_interp_external in MOM_ALE_sponge.F90 with calls coming in via MOM_iterpolate. All answers are bitwise identical.
Added the new function diag_axis_init to MOM_diag_manager, with arguments and argument orders that are more appropriate for use with MOM6 than the version in the FMS diag_axis module, which it calls in turn. A MOM_domain_type is one of the new optional arguments, along with a level of grid refinement and a flag indicating that the null_axis id should be returned. Calls to diag_axis_init throughout the MOM6 code have been made consistent with this new interface. All answers are bitwise identical.
Moved the overloaded interface MOM_write_file to MOM_io and renamed MOM_write_field in MOM_io_infra to write_field after removing all of the optional turns arguments and the code to rotate arrays. Also added a variant of write_field to work on axis types. The unused fill_value optional arguments were also removed from the 1-d and scalar versions of this write_field. All answers are bitwise identical, but there are interface changes that are localized to the MOM_io modules.
Created the infrastructure wrapper module MOM_interp_infra.F90, while retaining MOM_interpolate.F90 to do the rotation of the arrays and to provide the public interfaces for use in the rest of the MOM6 code. As a part of this, time_interp_extern was renamed back to time_interp_external (now that the pgi compiler bugs no longer interfere), which is reflected in changes in other modules. All answers are bitwise identical, but there is a reversion of publicly visible interface name.
Eliminated the dependency of MOM_domain_infra.F90 on MOM_array_transform.F90 by explicitly rotatign the maskmap if necessary. Added the new optional argument coarsen to get_domain_extent and made three other existing arguments optional, which makes the routine get_domain_extent_dsamp2 redundant, so it was removed. Also store the domain name in the MOM_domain type, and use this as the default when cloning one domain type with another.
Renamed the recently added refine optional arguments to diag_axis_init to coarsen to better reflect what it does. All answers are bitwise identical.
Removed the routine read_axis_data, which performs a function that is already dealt with by MOM_read_data. It has been replaced with MOM_read_data in the one place where read_axis_data was actually being called. All answers are bitwise identical, but a public interface was deleted.
Added the new optional arguments refine and extra_halo to clone_MD_to_MD, and added calls to ensure that the cloned domain uses the same decomposition as its parent domain. Also added the new optional arguments xextent, yextent and coarsen to clone_MD_to_d2D, while also modifying the code to ensure proper inheritance of the symmetry of the parent domain, as described in the comments. Also use calls to clone_MD_to_d2D to create the domain2D elements of the MOM_domain_types, including the coarsened domains, reducing code duplication. All answers are bitwise identical, but there are new optional arguments to some publicly visible routines.
Use a call to clone_MOM_domain (which resolves to clone_MD_to_MD) to allocate and populate the mosaic supergrid type in MOM_grid_initialize.F90. This greatly reduces the number of interfaces from MOM_domains.F90 that are actually used and need to be made public.
As a result of reforms to MOM_grid_initialize in the previous commit, there are several interfaces from MOM_domains that are no longer used. The redundant interfaces were eliminated and the remaining interfaces regrouped with comments describing each group. This PR also folds deallocate_domain_contents into deallocate_domain. All answers are bitwise identical, but some unused public interfaces have been eliminated.
Creates and uses an explicit interface for init_extern_field, including a new optional MOM_domain_type argument, and the omission of some of the optional arguments to the FMS version of init_external_field that are unused in MOM6. All answers are bitwise identical, but there are changes to the optional argument to the optional arguments in a public interface.
adcroft
reviewed
Jan 19, 2021
Codecov Report
@@ Coverage Diff @@
## dev/gfdl #1293 +/- ##
============================================
+ Coverage 45.81% 45.93% +0.11%
============================================
Files 229 231 +2
Lines 71761 71660 -101
============================================
+ Hits 32880 32916 +36
+ Misses 38881 38744 -137
Continue to review full report at Codecov.
|
adcroft
approved these changes
Jan 21, 2021
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 includes a number of steps to complete the restructuring of the MOM6
framework code. Several modules were split into MOM-specific and FMS-specific
parts, with all rotation calls for input and output in the top level. Where
there are two related files, the FMS- specific parts are in the ..._infra.F90
files. It also includes a number of localized changes outside of the framework
directory that take advantage of the new interfaces to eliminate the direct use
of FMS-specific calls.
To complete the separation of the framework files into a MOM-specific
directory and an FMS wrapper directory, the files MOM_coms_infra.F90,
MOM_constants.F90, MOM_cpu_clock.F90, MOM_diag_manager.F90,
MOM_domain_infra.F90, MOM_error_infra.F90, MOM_interp_infra.F90,
MOM_io_infra.F90 and MOM_time_manager.F90 would be moved to the new
infrastructure directory, with no further changes to their contents.
The starting point for this PR is the result of PR#1289. The commits beyond
PR#1289 in this PR include: