Skip to content
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

Params: Add do_not_log to param block open/close #558

Merged
merged 2 commits into from
Jan 31, 2024

Conversation

marshallward
Copy link
Member

This patch adds do_not_log to openParameterBlock, to prevent logging of BLOCK% %BLOCK entry and exit calls.

The argument was not added to closeParameterBlock, since this state can be tracked inside the block with a new log_access field in parameter_block.

This flag does not extend to parameters within the block, since (as far as I know) there is no way for a get_param to know if it is within a block or not. Even if it could know this, there would need to be some careful handling of nested blocks.

The potential block/parameter inconsistency should be supported at some point, but for now it is the user's responsibility to consistently apply do_not_log to blocks and its contents.

This patch adds `do_not_log` to `openParameterBlock`, to prevent logging
of `BLOCK%` `%BLOCK` entry and exit calls.

The argument was not added to `closeParameterBlock`, since this state
can be tracked inside the `block` with a new `log_access` field in
`parameter_block`.

This flag does not extend to parameters within the block, since (as far
as I know) there is no way for a `get_param` to know if it is within a
block or not.  Even if it could know this, there would need to be some
careful handling of nested blocks.

The potential block/parameter inconsistency should be supported at some
point, but for now it is the user's responsibility to consistently apply
`do_not_log` to blocks and its contents.
Copy link

codecov bot commented Jan 28, 2024

Codecov Report

Attention: 4 lines in your changes are missing coverage. Please review.

Comparison is base (435ccaa) 37.19% compared to head (4e9e42b) 37.19%.

Files Patch % Lines
src/framework/MOM_file_parser.F90 50.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##           dev/gfdl     #558      +/-   ##
============================================
- Coverage     37.19%   37.19%   -0.01%     
============================================
  Files           271      271              
  Lines         80346    80351       +5     
  Branches      14982    14985       +3     
============================================
+ Hits          29887    29888       +1     
- Misses        44902    44904       +2     
- Partials       5557     5559       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@Hallberg-NOAA Hallberg-NOAA left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for this valuable addition to the MOM6 code.

@marshallward
Copy link
Member Author

Gaea regression: https://gitlab.gfdl.noaa.gov/ogrp/MOM6/-/pipelines/22093 ✔️

@marshallward marshallward mentioned this pull request Jan 31, 2024
@marshallward marshallward merged commit f1e0f01 into NOAA-GFDL:dev/gfdl Jan 31, 2024
12 checks passed
@marshallward marshallward deleted the block_logging branch May 8, 2024 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants