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

Reduce redundancy; make interfaces more similar between tools; focusing here on fsurdat_modifier and subset_data #1714

Merged
merged 16 commits into from
Jul 27, 2022

Conversation

slevis-lmwg
Copy link
Contributor

Description of changes

Details in #1662

Specific notes

Starting by replacing zero_nonveg option with include_nonveg

Contributors other than yourself, if any:
@ekluzek @negin513 @adrifoster

CTSM Issues Fixed (include github issue #):
#1662

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

Any User Interface Changes (namelist or namelist defaults changes)?
Making interfaces more similar between tools, e.g. replacing zero_nonveg with include_nonveg

Testing performed, if any:
This far...
make lint: PASS
make test: OK (pre-existing errors in test_buildSetup_userDefinedMachine_allInfo and test_buildSetup_userDefinedMachine_minimalInfo

@slevis-lmwg slevis-lmwg self-assigned this Apr 16, 2022
Mostly I moved text from the tool's docstring to the README and made a
note of that in the tool's docstring. Also I included brief explanations
of the differences between:
- this tool and modify_singlept_site_neon.py
- this tool and subset_data
@slevis-lmwg
Copy link
Contributor Author

slevis-lmwg commented Jul 13, 2022

Update README:

To run on Cheyenne/Casper/Izumi
1) (Un)load, execute, and activate the following:
module unload python
module load conda
./manage_python_env
conda activate ctsm_py
(Use "deactivate" to reverse the latter.)

Fix accumulation variables when changing model time step

Accumulation variables (e.g., 1-day or 10-day averages) were writing and
reading their accumulation period (expressed in time steps) to the
restart file. This caused incorrect behavior when changing the model
time step relative to what was used to create the initial conditions
file (typically a 30-minute time step). So, for example, if you are
using a 15-minute time step with an initial conditions file that
originated from a run with a 30-minute time step (at some point in its
history), then an average that was supposed to be 10-day instead becomes
5-day; an average that was supposed to be 1-day becomes 12-hour, etc.
(The issue is that the number of time steps in the averaging period was
staying fixed rather than the actual amount of time staying fixed.)

For our out-of-the-box initial conditions files, this only impacts runs
that use something other than a 30-minute time step. Typically this
situation arises in configurations with an active atmospheric model that
is running at higher resolution than approximately 1 degree. It appears
that the biggest impacts are on VOC emissions and in BGC runs; we expect
the impact to be small (but still non-zero) in prescribed phenology (SP)
runs that don't use VOC emissions.

This tag fixes this issue by no longer writing or reading accumulation
variables' PERIOD to / from the restart file: this isn't actually needed
on the restart file.

See some discussion in ESCOMP#1789 for
more details, and see
ESCOMP#1802 (comment) for
some discussion of outstanding weirdness that can result for
accumulation variables when changing the model time step. The summary of
that comment is: There could be some weirdness at the start of a run,
but at least for a startup or hybrid run, that weirdness should work
itself out within about the first averaging period. A branch or restart
run could have some longer-term potential weirdness, so for now I think
we should recommend that people NOT change the time step on a branch or
restart run. With (significant?) additional work, we could probably
avoid this additional weirdness, but my feeling is that it isn't worth
the effort right now. In any case, I feel like my proposed fix will
bring things much closer to being correct than they currently are when
changing the time step.

Resolved conflict:
python/ctsm/modify_fsurdat/fsurdat_modifier.py
@slevis-lmwg slevis-lmwg added the PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete label Jul 14, 2022
@ekluzek
Copy link
Collaborator

ekluzek commented Jul 15, 2022

As with the other PR make sure 51c102c is added to the .git-blame-ignore-revs file.

@ekluzek ekluzek marked this pull request as ready for review July 15, 2022 21:31
Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

This is a nice update to make scripts more similar to each other.

Copy link
Collaborator

@ekluzek ekluzek left a comment

Choose a reason for hiding this comment

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

OK, looking at #1667 I do now think that dom_plant should be changed to dom_pft since the meaning in subset_data was changed. So that's the one change I see.

@slevis-lmwg
Copy link
Contributor Author

python testing PASS
pymods testing PASS

@slevis-lmwg
Copy link
Contributor Author

This PR should probably get merged before #1677.
We'll see whether I can address @ekluzek's last few comments in #1677 to have it ready right after...

Resolved conflicts and updated two files:
doc/ChangeLog
doc/ChangeSum
@slevis-lmwg
Copy link
Contributor Author

Python and pymod testing PASS
though I should point out (and should have pointed out previously) that pylint has suggestions for three lines in subset_data (ie doesn't come back 100% clear).

On cheyenne and izumi I executed:
ln -s ctsm5.1.dev104 ctsm5.1.dev105

@ekluzek I consider this PR ready to merge.

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 19, 2022

OK, awesome, you've done everything I see. I'm not able to tie this off today, but should be Wednesday night or Thursday.

@ekluzek
Copy link
Collaborator

ekluzek commented Jul 19, 2022

@slevisconsulting on the pylint issue, make sure you setup the ctsm_py environment and activate it, and that the error is seen under that environment. pylint is very sensitive to the exact version being used. If we see it in that environment we should fix it.

@wwieder
Copy link
Contributor

wwieder commented Jul 19, 2022

@ekluzek aren't you on PTO...?

@slevis-lmwg
Copy link
Contributor Author

@slevisconsulting on the pylint issue, make sure you setup the ctsm_py environment and activate it, and that the error is seen under that environment. pylint is very sensitive to the exact version being used. If we see it in that environment we should fix it.

Good news @ekluzek. As you expected, once I executed
conda activate ctsm_py
the pylint complaints disappeared!

Thanks!

@ekluzek ekluzek merged commit 9eb0666 into ESCOMP:master Jul 27, 2022
@ekluzek ekluzek deleted the reduce_redundancy branch July 27, 2022 06:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PR status: ready PR: this is ready to merge in, with all tests satisfactory and reviews complete
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants