Skip to content

Add more documentation to history tape code#2020

Merged
ekluzek merged 2 commits into
ESCOMP:masterfrom
johnpaulalex:hist_doc
Jun 22, 2023
Merged

Add more documentation to history tape code#2020
ekluzek merged 2 commits into
ESCOMP:masterfrom
johnpaulalex:hist_doc

Conversation

@johnpaulalex

Copy link
Copy Markdown
Contributor

Description of changes

Add more documentation to history tape code

  • Add more breadcrumbs between related variables and methods
  • Put related namelist flags/methods together
  • Update some out of date comments

Doc-only change.

Specific notes

Contributors other than yourself, if any: none

CTSM Issues Fixed (include github issue #): none fixed, but preparation for fixing issue 27.

Are answers expected to change (and if so in what way)? no

Any User Interface Changes (namelist or namelist defaults changes)? no

Testing performed, if any:
Ran unit tests to confirm new comments didn't break compilation

  * Add more breadcrumbs between related variables and methods
  * Put related namelist flags/methods together
  * Update some out of date comments

Doc-only change.

@ekluzek ekluzek left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

This is some great improvements to the documentation, and naming of some variables as well as the ordering of some things. There's a few suggestions I have about changes, but largely this is good to go. There's not a lot of code that actually changes here, so this all seems quite safe.

Comment thread src/main/histFileMod.F90 Outdated
logical, public :: &
hist_empty_htapes = .false. ! namelist: disable default-active history fields (which
! only exist on history tape 1). Overridden by hist_fincl1
! flag.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Hmmm, my first reaction here is that it isn't "overridden" by the hist_fincl1 flag. But, in a way it is in that anything in hist_fincl1 -- will be output. The way I've thought about it is that this turns all the default fields off -- and you have to explicitly add the list that you want to hist_fincl1.

@johnpaulalex johnpaulalex Jun 14, 2023

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Makes sense, I reworded to "Use hist_fincl1 to enable select fields on top of this."

Comment thread src/main/histFileMod.F90

character(len=max_namlen+2), public :: &
hist_fincl1(max_flds) = ' ' ! namelist: list of fields to add
hist_fincl1(max_flds) = ' ' ! namelist: list of fields to include in history tape 1

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wonder if you should also include something that says "the "h0" set of files" or something to that effect?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This sounds like documentation on the mapping between history tapes and filenames. I've added a note about this to the history_tape type and the set_hist_filename method; and put a breadcrumb to history_tape at the very top of the file.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Yes, exactly, we call it "history tape 1", but the filenames are actually labeled as "h0". This is kind of an awkward thing we've been preserving. I like what you added below for history_tape and the breadcrumbs you put for pointing to it. Maybe there could be another one on top of the hist_fincl and hist_fexcl definitions?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

SGTM. How do I add a change at this point - looks like this commit got pulled into PR #2031, so should I just send a new PR for this final thing?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

You could either: create a new PR, add it to #2022 which is still outstanding, or add it to here, and this PR will stay open and I can pull it into another tag. I have a slight preference for adding to #2022, but any of these would work fine. So I don't care too much.

Because we run a bunch of testing by hand to create our tags, I am very likely to merge a few PR's together to create the tag (especially if they are simple bit-for-bit type things). So you should expect that. But, it's also easier to see things broken up into smallish PR's so you can see what's going on with a specific PR. So I do still like having things broken up into separate PR's.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Added PR #2034 (note its commit is on top of the commits in this PR)

Comment thread src/main/histFileMod.F90 Outdated
Comment thread src/main/histFileMod.F90
Comment thread src/main/histFileMod.F90
@johnpaulalex johnpaulalex requested a review from ekluzek June 14, 2023 16:34
@ekluzek ekluzek self-assigned this Jun 16, 2023
@ekluzek ekluzek added code health improving internal code structure to make easier to maintain (sustainability) documentation additions or edits to user-facing documentation or its infrastructure labels Jun 16, 2023
@ekluzek ekluzek merged commit d7e60a3 into ESCOMP:master Jun 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

code health improving internal code structure to make easier to maintain (sustainability) documentation additions or edits to user-facing documentation or its infrastructure

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants