Fix plumber2_surf_wrapper#14
Closed
samsrabin wants to merge 27 commits into
Closed
Conversation
4 tasks
samsrabin
commented
Jun 20, 2025
|
|
||
| import pandas as pd | ||
| # Get the ctsm tools | ||
| _CTSM_PYTHON = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "python")) |
samsrabin
commented
Jun 20, 2025
| parser.add_argument( | ||
| "--16pft", | ||
| help="Create and/or modify 16-PFT surface datasets (e.g. for a FATES run) ", | ||
| "--78pft", |
Owner
Author
There was a problem hiding this comment.
Change to --crop for consistency with flags in other scripts.
samsrabin
commented
Jun 20, 2025
| """ | ||
| Given a number, check whether it represents a valid PFT | ||
| """ | ||
| return pft_num >= 1 |
Owner
Author
There was a problem hiding this comment.
Change to 0; bare ground is OK.
Owner
Author
There was a problem hiding this comment.
Also check that it's <= 78 (as read in as constant).
samsrabin
commented
Jun 20, 2025
| #ATM_NCPL is specified so that the time step of the model matches the time interval specified by the atm forcing data. | ||
| #longitudes must be in the range [-180,180] | ||
| ,Site,Lat,Lon,pft1,pft1-%,pft1-cth,pft1-cbh,pft2,pft2-%,pft2-cth,pft2-cbh,start_year,end_year,RUN_STARTDATE,START_TOD,ATM_NCPL | ||
| 26,Invalid-Pft,51.309166, 4.520560,0,19.22,21.00,10.50,7,80.78,21.00,12.08,2004,2014,2003-12-31,82800,48 |
Owner
Author
There was a problem hiding this comment.
Change invalid PFT to -1, because 0 will soon be valid.
samsrabin
commented
Jun 20, 2025
| # Check | ||
| self.assertEqual(n_files_expected, n_files) | ||
|
|
||
| def test_plumber2_surf_wrapper_78pft(self): |
Owner
Author
There was a problem hiding this comment.
Combine shared code between this and above.
samsrabin
commented
Jun 20, 2025
|
|
||
| def test_plumber2_surf_wrapper_78pft(self): | ||
| """ | ||
| Run the entire tool with --78pft. |
Owner
Author
There was a problem hiding this comment.
Add testing: Should abort if given PFT > 16 in a 16-pft run.
Owner
Author
|
722504e to
63d61f4
Compare
- Replace NAT_PFT=15 with MAX_NAT_PFT=14 - Replace NUM_PFT=17 with MAX_PFT_GENERICCROPS=16 - Rename MAX_PFT to MAX_PFT_MANAGEDCROPS
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.
Just a mirror of ESCOMP#3264, but pointing at my
subset_data-lon-fixesbranch so we can see just the diffs from that.