Move Grid Generation and Remapping Out of step_MOM_thermo #761
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.
DRAFT FOR DISCUSSION
This PR will move the grid generation (regridding) and remapping routines out of the step_MOM_thermo. This is for two reasons: (1) these routines are not related to stepping the thermodynamics and (2) this change will allow a separate timestep for grid generation and remapping.
These changes were mostly straightforward but some routines in step_MOM_thermo after the ALE block were rearranged and moved into another new routine. I am creating this draft to discuss those changes.
These code changes did not change answers in the Baltic 0.25 degree example case. They should be tested in layer mode and with particles before these changes are accepted. It also did not change the diagnostics saved in my Baltic 0.25 degree example, but diagnostics should also be checked carefully.
Commit:
Move grid generation, remapping, and subsequent processes into a new routine ALE_gridgen_and_remapping which is called immediately after step_MOM_thermo.
Clean up inputs and local variables in step_MOM_thermo by removing those only used for grid generation and remapping.
Routines that need to be done after step_thermo, grid generation and remapping, regardless of use_ALE or not into another routine since they do not make sense in ALE_gridgen_and_remapping.
Answers and diagnostics have not changed in Baltic case in ALE mode. Testing still needs to be done layer mode and with particles.