Add present_and_true() to 5 modules#1114
Open
Hallberg-NOAA wants to merge 5 commits into
Open
Conversation
Added a local copy of the function `present_and_true()` to the MOM_debugging module, and used it to clean up the logic in 6 places. This includes eliminating the `are_scalars` local variables in 6 routines, as they are no longer necessary. All answers are bitwise identical.
Added a local copy of the function `present_and_true()` to the MOM_checksums module, and used it to clean up the logic in 27 places. This includes eliminating the `vector_pair` local variable in 6 places and the `do_corner` local variable in 8 places, as they are no longer necessary. All answers are bitwise identical.
Added a local copy of the function `present_and_true()` to the MOM_forcing_type module, and used it to simplify the logic in 22 places. This includes eliminating the `tau2ustar`, `shelf_sfc_acc` and `do_pres` local variables in routines where they are no longer necessary. In the case of tests for `use_glc_runoff` this commit effectively adds a test for the logical setting of that argument instead of just its presence, so this could prevent the unnecessary declaration of some unused diagnostics, which could show up as added entries in available_diags files for cases using the NUOPC coupler. In 4 other cases a simple call to `present()` was able to simplify the code. All answers are bitwise identical.
Added a local copy of the function `present_and_true()` to the MOM_document module, and used it to clean up the logic in 13 places. All answers are bitwise identical.
Added a local copy of the function `present_and_true()` to the MOM_document module, and used it to clean up the logic in 27 places. This includes eliminating the `variableKindIsLogical` and `do_log` local variables in places where they are no longer necessary. All answers are bitwise identical.
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 pull request consists of 5 commits that add local copies of the function
present_and_true()to the MOM_debugging, MOM_checksums, MOM_file_parser, MOM_document and MOM_forcing_type modules, and then uses them to simplifyunnecessarily complicated code logic in a total of 95 expressions. In 4 other cases a simple call to
present()was able to simplify the code. In the case of tests foruse_glc_runoffin the MOM_forcing_type module, this effectively adds a test for the logical setting of that argument instead of just its presence, so this could prevent the unnecessary declaration of some unused diagnostics, which could show up as added entries in available_diags files for cases using the NUOPC coupler. All answers are bitwise identical.