-
Notifications
You must be signed in to change notification settings - Fork 1
Fix plumber2_surf_wrapper #14
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
Conversation
|
|
||
| import pandas as pd | ||
| # Get the ctsm tools | ||
| _CTSM_PYTHON = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", "..", "python")) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Replace .. with pardir
| parser.add_argument( | ||
| "--16pft", | ||
| help="Create and/or modify 16-PFT surface datasets (e.g. for a FATES run) ", | ||
| "--78pft", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to --crop for consistency with flags in other scripts.
| """ | ||
| Given a number, check whether it represents a valid PFT | ||
| """ | ||
| return pft_num >= 1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change to 0; bare ground is OK.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also check that it's <= 78 (as read in as constant).
| #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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change invalid PFT to -1, because 0 will soon be valid.
| # Check | ||
| self.assertEqual(n_files_expected, n_files) | ||
|
|
||
| def test_plumber2_surf_wrapper_78pft(self): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Combine shared code between this and above.
|
|
||
| def test_plumber2_surf_wrapper_78pft(self): | ||
| """ | ||
| Run the entire tool with --78pft. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add testing: Should abort if given PFT > 16 in a 16-pft run.
|
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
Just a mirror of ESCOMP#3264, but pointing at my
subset_data-lon-fixesbranch so we can see just the diffs from that.