From c07e3969aeaaa0b9c666a152178b309c1400611f Mon Sep 17 00:00:00 2001 From: marius Date: Sun, 1 May 2022 18:50:46 +0200 Subject: [PATCH 1/3] add tools/site_and_regional/PTCLM/ --- tools/site_and_regional/PTCLM/.gitignore | 38 + .../PTCLM/CODE_OF_CONDUCT.md | 84 ++ tools/site_and_regional/PTCLM/ChangeLog | 1184 +++++++++++++++++ tools/site_and_regional/PTCLM/LICENSE | 34 + .../PTCLM_sitedata/PTCLMDATA_pftdata.txt | 44 + .../PTCLM_sitedata/PTCLMDATA_sitedata.txt | 44 + .../PTCLM_sitedata/PTCLMDATA_soildata.txt | 44 + .../PTCLM_sitedata/US-Ha1_dynpftdata.txt | 4 + ...vrt_trnsyrs2_landuse_timeseries_txtfile.pl | 261 ++++ tools/site_and_regional/PTCLM/PTCLMmkdata | 713 ++++++++++ tools/site_and_regional/PTCLM/PTCLMsublist | 16 + .../PTCLM/PTCLMsublist_prog.py | 214 +++ tools/site_and_regional/PTCLM/README | 118 ++ tools/site_and_regional/PTCLM/README.rst | 18 + tools/site_and_regional/PTCLM/batchque.py | 256 ++++ tools/site_and_regional/PTCLM/buildtools | 149 +++ 16 files changed, 3221 insertions(+) create mode 100644 tools/site_and_regional/PTCLM/.gitignore create mode 100644 tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md create mode 100644 tools/site_and_regional/PTCLM/ChangeLog create mode 100644 tools/site_and_regional/PTCLM/LICENSE create mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt create mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt create mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt create mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt create mode 100755 tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl create mode 100755 tools/site_and_regional/PTCLM/PTCLMmkdata create mode 100755 tools/site_and_regional/PTCLM/PTCLMsublist create mode 100644 tools/site_and_regional/PTCLM/PTCLMsublist_prog.py create mode 100644 tools/site_and_regional/PTCLM/README create mode 100644 tools/site_and_regional/PTCLM/README.rst create mode 100644 tools/site_and_regional/PTCLM/batchque.py create mode 100755 tools/site_and_regional/PTCLM/buildtools diff --git a/tools/site_and_regional/PTCLM/.gitignore b/tools/site_and_regional/PTCLM/.gitignore new file mode 100644 index 0000000000..cbfbc8c22a --- /dev/null +++ b/tools/site_and_regional/PTCLM/.gitignore @@ -0,0 +1,38 @@ +# ignore svn directories +**/.svn/** +.svn/ + +# binary files +*.nc + +# editor files +*.swp +*~ + +# mac files +.DS_Store + +# cmake generated files +build/ +CMakeFiles/ + +# don't ignore cism build utilities directory +!components/cism/**/build + +# build output +*.o +*.mod +core.* +core-* +*.gz +*.log !run.log +*.pyc + +# batch output +*.*.job + +# test and case directories +test/ +scripts/testreporter.pl + +mydatafiles/* diff --git a/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md b/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md new file mode 100644 index 0000000000..29205157f0 --- /dev/null +++ b/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md @@ -0,0 +1,84 @@ +# Contributor Code of Conduct +_The Contributor Code of Conduct is for participants in our software projects and community._ + +## Our Pledge +We, as contributors, creators, stewards, and maintainers (participants), of PTCLM (Point-Community Land Model) pledge to make participation in our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone. +All participants are required to abide by this Code of Conduct. +This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression, level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race, religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law. + +## Our Standards +Examples of behaviors that contribute to a positive environment include: + +* All participants are treated with respect and consideration, valuing a diversity of views and opinions +* Be considerate, respectful, and collaborative +* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism +* Acknowledging the contributions of others +* Avoid personal attacks directed toward other participants +* Be mindful of your surroundings and of your fellow participants +* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress +* Respect the rules and policies of the project and venue + +Examples of unacceptable behavior include, but are not limited to: + +* Harassment, intimidation, or discrimination in any form +* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested +* Unwelcome sexual attention or advances +* Personal attacks directed at other guests, members, participants, etc. +* Publishing others' private information, such as a physical or electronic address, without explicit permission +* Alarming, intimidating, threatening, or hostile comments or conduct +* Inappropriate use of nudity and/or sexual images +* Threatening or stalking anyone, including a participant +* Other conduct which could reasonably be considered inappropriate in a professional setting + +## Scope +This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face. +This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages, issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the community uses for communication. +In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them. +Representation of a project may be further defined and clarified by project maintainers. + +## Community Responsibilities +Everyone in the community is empowered to respond to people who are showing unacceptable behavior. +They can talk to them privately or publicly. +Anyone requested to stop unacceptable behavior is expected to comply immediately. +If the behavior continues concerns may be brought to the project administrators or to any other party listed in the [Reporting](#reporting) section below. + +## Project Administrator Responsibilities +Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate behavior and provide support when people in the community point out inappropriate behavior. +Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences) section below. + +Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in the [Attribution](#attribution) section. + +## Reporting +Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as outlined in the [Consequences](#consequences) section below. +However, making a report to a project administrator is not considered an 'official report' to UCAR. + +Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting). + +Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint Procedure. +Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who initiates a complaint or an inquiry about inappropriate behavior will not be tolerated. + +Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR. +The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs). + +## Consequences +Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the circumstances. +Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other behaviors that are deemed inappropriate, threatening, offensive, or harmful. +Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion (ODEI), as well as a participant's home institution and/or law enforcement. +In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure. + +## Process for Changes +All UCAR managed projects are required to adopt this Contributor Code of Conduct. +Adoption is assumed even if not expressly stated in the repository. +Projects should fill in sections where prompted with project-specific information, including, project name and adoption date. + +Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the [Attribution](#attribution) section below. +Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not contradict the UCAR Contributor Code of Conduct. + +## Attribution +This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version 1.4. +We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. +The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. +The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at https://doi.org/10.5065/6w2c-a132. +The date that it was adopted by this project was Jan/14th/2020 +When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. +Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above. diff --git a/tools/site_and_regional/PTCLM/ChangeLog b/tools/site_and_regional/PTCLM/ChangeLog new file mode 100644 index 0000000000..e222999ab1 --- /dev/null +++ b/tools/site_and_regional/PTCLM/ChangeLog @@ -0,0 +1,1184 @@ +================================================================================ +This file describes changes made to the PTCLM tool +================================================================================ + +================================================================================ +Originator: erik +Date: Aug/10/2021 +Tag: PTCLM2_20210810 +One-line: Move PTCLM to underneath tools/site_and_regional directory in CTSM +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Change the expected directory for PTCLM in a CTSM checkout to be under the +tools/site_and_regional subdirectory rather than under tools. + +Change python shebang lines to python3. Fix a couple python3 issues one with csv +and print statements. + +Add note about PTCLM being deprecated. This may be the last tag for PTCLM. + +================================================================================ +Originator: erik +Date: Sep/02/2020 +Tag: PTCLM2_20200902 +One-line: Fix problem +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +PTCLMmkdata was failing on running the mapping files with the export statement. +This fixes that, by removing that setting. + +Fixes #11 -- trouble running on cheyenne + +================================================================================ +Originator: erik +Date: Jan/20/2020 +Tag: PTCLM2_20200118 +One-line: Update to python3 add izumi support +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Update to python3 and add support for izumi for testing. Add code of conduct file. +Allow hostname check in buildtoools for cheyenne to have 2-digit numbers. + +Fixes #10 - Add izumi +Fixes #9 -- Update to python3 +Fixes #8 -- compiler versions on cheyenne +Fixes #7 -- change last xmlchange_cmnds files to shell_commands + +================================================================================ +Originator: erik +Date: Jun/11/2018 +Tag: PTCLM2_180611 +One-line: Fix a few bugs in latest PTCLMmkdata +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Fix so properly finds historical time-series files from 1850-2015 rather than ending in 2005. +Setup to handle CESM checkout as well as CTSM checkout better. +Better matching for cheyenne nodes. +More work on options for different machines. +Update README file. + +Fixes: #3, #4, #5 + +================================================================================ +Originator: erik +Date: Feb/14/2018 +Tag: PTCLM2_180214 +One-line: Get working with the new CTSM checkout on the move to git +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +CESM_DIR env variable gets turned into CTSM_DIR and CIME_DIR. Set defaults according +to a the new CTSM checkout in git. Update the testing files, and make sure everything +is working in a CTSM checkout with the standard testing. + +================================================================================ +Originator: erik +Date: Dec/16/2017 +Tag: PTCLM2_171216c +One-line: Add back in missing compare directories: std_US-Ha1 std_US-Var std_Us-Ne1 trans_US-Ha1 +Testing: Standard PTCLM test script on yellowstone/hobart/cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Missing compare directories: std_US-Ha1 std_US-Var std_Us-Ne1 trans_US-Ha1 + +A test/compdirs/* + +================================================================================ +Originator: erik +Date: Dec/16/2017 +Tag: PTCLM2_171216b +One-line: Add back in missing compare directory US-ARM +Testing: Standard PTCLM test script on yellowstone/hobart/cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Missing compare files: + + A test/compdirs/std_US-ARM/README.PTCLM + A test/compdirs/std_US-ARM/run.log + A test/compdirs/std_US-ARM/shell_commands + A test/compdirs/std_US-ARM/user_nl_clm + +================================================================================ +Originator: erik +Date: Dec/16/2017 +Tag: PTCLM2_171216 +One-line: Update compare files one more time to make generic +Testing: Standard PTCLM test script on yellowstone +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + + M test/PTCLMtestlist.py ----- Add replacement of absolute path of CESMDIR + and also ncl path. This should make it generic for different machines. + + Update the compare files + M test/compdirs/*/* + M test/listings/help + M test/listings/list + M test/listings/sitelist +================================================================================ +Originator: erik +Date: Dec/15/2017 +Tag: PTCLM2_171215 +One-line: Remove subversion keywords and make comparisons generic +Testing: Standard PTCLM test script on yellowstone +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Remove use of Subversion keywords, and substitute referring to the latest tagnmae +in the ChangeLog file. Also for testing replace strings that are very user or machine +specific with generic strings, so that comparisons can be done correctly. These +are for the: CESMDIR, version, inputdata directory, or current date. + + M PTCLMmkdata --- Remove svn keyword expansion for --version with latest tagname + in ChangeLog file + M PTCLMsublist_prog.py - Remove svn keyword expansion for --version with latest tagname + in ChangeLog file + + M test/PTCLMtesting_prog.py - Remove svn keyword expansion for --version with latest + tagname in ChangeLog file + M test/PTCLMtestlist.py ----- Add method ReplaceIDInfoInFile to replace specific + identifying information in a file with generic strings. Call it when appropriate + for comparisons. Add test for it. And correct default cesmdir. + + Update the compare files so they have generic strings for + user/machine/version/date identifying information. + M test/compdirs/*/* + M test/listings/help + M test/listings/list + M test/listings/sitelist + +================================================================================ +Originator: erik +Date: Oct/24/2017 +Tag: PTCLM2_171024b +One-line: Add needed ending single quote for CLM_BLDNML_OPTS setting in shell_commands +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + + A test/compdirs/crop_file_creation_US-Ne1/shell_commands - Add in missing file + + M PTCLMmkdata --- Add needed ending single quote in CLM_BLDNML_OPTS setting + M test/compdirs/*/shell_commands - Update with above fix + +================================================================================ +Originator: erik +Date: Oct/24/2017 +Tag: PTCLM2_171024 +One-line: Add --crop/--no-crop option (--no-crop is default) add US-Ne1 to test crop +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + + M PTCLMmkdata - Add note to MPILIB, add new option --crop/--no-crop that will be passed + to CLM_BLDNML_OPTS and mksurfdata.pl change CLM_BLDNML_OPTS so it uses --append + M test/PTCLMtestlist.xml + Add US-Ne1 site to test crop + M PTCLM_sitedata/PTCLMDATA_sitedata.txt + M PTCLM_sitedata/PTCLMDATA_soildata.txt + M PTCLM_sitedata/PTCLMDATA_pftdata.txt + A test/compdirs/crop_file_creation_US-Ne1/README.PTCLM + A test/compdirs/crop_file_creation_US-Ne1/user_nl_clm + A test/compdirs/crop_file_creation_US-Ne1/run.log + M test/compdirs/copyfiles.csh + +================================================================================ +Originator: erik +Date: Oct/16/2017 +Tag: PTCLM2_171016d +One-line: Update default walltime for cheyenne +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M PTCLMsublist_prog.py --- Update default walltime to cheyenne syntax for an hour and a half +M README -- Fix bug 1928 (documentation on compset to use) + +================================================================================ +Originator: erik +Date: Oct/16/2017 +Tag: PTCLM2_171016 +One-line: PTCLM update to clm4_5_16_r259 with cime5.4.0-alpha.03 + Get batch working on cheyenne, and make cheyenne default add --wall option to PCLMsublist +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Add --wall option to PTCLMsublist and get setup and working for cheyenne. Remove hopper and janus +as they are decommissioned. Correct the default CESM root directory for batch submission. Update +the compare listings for testing + +M PTCLMsublist_prog.py - Add --wall option, make default cheyenne, correct cesmdir default +M batchque.py ---------- Add cheyenne settings, remote hopper and janus, cheyenne has + to cd to run directory in job script, rather than set in batch +M PTCLMsublist --------- Update list of machines setup for +M README --------------- Update to work on cheyenne and demonstrate batch submission + + Update compare listings +M test/listings/help +M test/compdirs/*/run.log +M test/compdirs/*/user_nl_clm +M test/compdirs/*/shell_commands +M test/compdirs/*/README.PTCLM + + +================================================================================ +Originator: erik +Date: Jul/06/2017 +Tag: PTCLM2_170706 +One-line: Get PTCLM working again in clm4_5_14_r244 with cime5.3.0-alpha.21 and on + cheyenne and hobart +Testing: Standard PTCLM test script on cheyenne +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Test for cheyenne compute node hostnames as well +Remove hopper, make some changes to get closer to working on yongi +Add module load for hobart +Update README file, add a README file/script that runs on cheyenne +Correct path to modules for cheyenne +Add needed space for three more tests, now all, but one test passes as expected +Update compare files, and make sure have a space after mksurfdata options + +M test/README -- Add notes about loading ncl module +M buildtools --- Remove hopper, get working on hobart, and cheyenne + +M test/compdirs/*/* --------- Update compare directories +M test/listings/* ----------- Update compare listings +A test/README.run_cheyenne -- Add README/script to run on cheyenne + +================================================================================ +Originator: erik +Date: Mar/02/2017 +Tag: PTCLM2_170302 +One-line: Get PTCLM working again in clm4_5_14_r226 with cime5.2.0-alpha23 +Testing: Standard PTCLM test script on yellowstone and test_driver.sh in clm4_5_14_r226 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + 34 tests still fail in standard PTCLM test script + +Remove shared level directory. Remove options no longer needed phys and rcp option +sent to mksurfdata_map. Get build of tools working with latest cime. Remove +tests that don't apply anymore. Update ompare files. + +--- Remove tests that aren't options anymore +D test/compdirs/rcp26_US-Dk2/user_nl_clm +D test/compdirs/rcp26_US-Dk2/run.log +D test/compdirs/rcp26_US-Dk2/shell_commands +D test/compdirs/rcp26_US-Dk2/README.PTCLM +D test/compdirs/rcp26_US-Dk2 +D test/compdirs/rcp6_US-IB1/user_nl_clm +D test/compdirs/rcp6_US-IB1/run.log +D test/compdirs/rcp6_US-IB1/shell_commands +D test/compdirs/rcp6_US-IB1/README.PTCLM +D test/compdirs/rcp6_US-IB1 +D test/compdirs/rcp45_US-Dk3/run.log +D test/compdirs/rcp45_US-Dk3/shell_commands +D test/compdirs/rcp45_US-Dk3/README.PTCLM +D test/compdirs/rcp45_US-Dk3/user_nl_clm +D test/compdirs/rcp45_US-Dk3 +D test/compdirs/rcp85_US-Me4/user_nl_clm +D test/compdirs/rcp85_US-Me4/run.log +D test/compdirs/rcp85_US-Me4/shell_commands +D test/compdirs/rcp85_US-Me4/README.PTCLM +D test/compdirs/rcp85_US-Me4 + +M KnownBugs +M README +M test/PTCLMtestlist.xml +M test/PTCLMtesting_prog.py +M buildtools +M PTCLMmkdata +M mydatafiles/1x1pt_US-UMB/user_nl_clm +M mydatafiles/1x1pt_US-UMB/README.PTCLM +M PTCLMsublist_prog.py + +------ Update compare files +M test/listings/help +M test/listings/list +M test/listings/sitelist +M test/compdirs/std_BR-Sa3/user_nl_clm +M test/compdirs/std_BR-Sa3/run.log +M test/compdirs/std_BR-Sa3/shell_commands +M test/compdirs/std_BR-Sa3/README.PTCLM +M test/compdirs/std_quiet_US-MMS/run.log +M test/compdirs/std_quiet_US-MMS/shell_commands +M test/compdirs/std_quiet_US-MMS/README.PTCLM +M test/compdirs/std_quiet_US-MMS/user_nl_clm +M test/compdirs/notowyrs_US-WCr/user_nl_clm +M test/compdirs/notowyrs_US-WCr/run.log +M test/compdirs/notowyrs_US-WCr/shell_commands +M test/compdirs/notowyrs_US-WCr/README.PTCLM +M test/compdirs/std_2000_US-MOz/shell_commands +M test/compdirs/std_2000_US-MOz/README.PTCLM +M test/compdirs/std_2000_US-MOz/user_nl_clm +M test/compdirs/std_2000_US-MOz/run.log +M test/compdirs/noopt_US-CHATS/README.PTCLM +M test/compdirs/noopt_US-CHATS/user_nl_clm +M test/compdirs/noopt_US-CHATS/run.log +M test/compdirs/noopt_US-CHATS/shell_commands +M test/compdirs/std_ES-ES1/README.PTCLM +M test/compdirs/std_ES-ES1/user_nl_clm +M test/compdirs/std_ES-ES1/run.log +M test/compdirs/std_ES-ES1/shell_commands +M test/compdirs/trans_clm45_US-Ha1/shell_commands +M test/compdirs/trans_clm45_US-Ha1/README.PTCLM +M test/compdirs/trans_clm45_US-Ha1/user_nl_clm +M test/compdirs/trans_clm45_US-Ha1/run.log +M test/compdirs/std_LTER-Sev/shell_commands +M test/compdirs/std_LTER-Sev/README.PTCLM +M test/compdirs/std_LTER-Sev/user_nl_clm +M test/compdirs/std_LTER-Sev/run.log +M test/compdirs/std_clm45_US-Ha1/shell_commands +M test/compdirs/std_clm45_US-Ha1/README.PTCLM +M test/compdirs/std_clm45_US-Ha1/user_nl_clm +M test/compdirs/std_clm45_US-Ha1/run.log +M test/compdirs/std_DE-Tha/shell_commands +M test/compdirs/std_DE-Tha/README.PTCLM +M test/compdirs/std_DE-Tha/user_nl_clm +M test/compdirs/std_DE-Tha/run.log +M test/compdirs/soigrd_CA-Qfo/user_nl_clm +M test/compdirs/soigrd_CA-Qfo/run.log +M test/compdirs/soigrd_CA-Qfo/shell_commands +M test/compdirs/soigrd_CA-Qfo/README.PTCLM +M test/compdirs/std_IT-Cpz/user_nl_clm +M test/compdirs/std_IT-Cpz/run.log +M test/compdirs/std_IT-Cpz/shell_commands +M test/compdirs/std_IT-Cpz/README.PTCLM +M test/compdirs/soigrd_CA-Ojp/user_nl_clm +M test/compdirs/soigrd_CA-Ojp/run.log +M test/compdirs/soigrd_CA-Ojp/shell_commands +M test/compdirs/soigrd_CA-Ojp/README.PTCLM +M test/compdirs/std_FL-Hyy/shell_commands +M test/compdirs/std_FL-Hyy/README.PTCLM +M test/compdirs/std_FL-Hyy/user_nl_clm +M test/compdirs/std_FL-Hyy/run.log +M test/compdirs/std_RF-Bra/run.log +M test/compdirs/std_RF-Bra/shell_commands +M test/compdirs/std_RF-Bra/README.PTCLM +M test/compdirs/std_RF-Bra/user_nl_clm +M test/compdirs/std_clm45_US-Var/shell_commands +M test/compdirs/std_clm45_US-Var/README.PTCLM +M test/compdirs/std_clm45_US-Var/user_nl_clm +M test/compdirs/std_clm45_US-Var/run.log +M test/compdirs/std_1850_US-Me2/run.log +M test/compdirs/std_1850_US-Me2/shell_commands +M test/compdirs/std_1850_US-Me2/README.PTCLM +M test/compdirs/std_1850_US-Me2/user_nl_clm +M test/compdirs/stdurbpt_pftgrd_CA-Oas/user_nl_clm +M test/compdirs/stdurbpt_pftgrd_CA-Oas/run.log +M test/compdirs/stdurbpt_pftgrd_CA-Oas/shell_commands +M test/compdirs/stdurbpt_pftgrd_CA-Oas/README.PTCLM +M test/compdirs/std_IT-Col/shell_commands +M test/compdirs/std_IT-Col/README.PTCLM +M test/compdirs/std_IT-Col/user_nl_clm +M test/compdirs/std_IT-Col/run.log +M test/compdirs/std_FL-Kaa/run.log +M test/compdirs/std_FL-Kaa/shell_commands +M test/compdirs/std_FL-Kaa/README.PTCLM +M test/compdirs/std_FL-Kaa/user_nl_clm +M test/compdirs/std_soigrd_BR-Sa1/user_nl_clm +M test/compdirs/std_soigrd_BR-Sa1/run.log +M test/compdirs/std_soigrd_BR-Sa1/shell_commands +M test/compdirs/std_soigrd_BR-Sa1/README.PTCLM +M test/compdirs/pftgrd_CA-Obs/user_nl_clm +M test/compdirs/pftgrd_CA-Obs/run.log +M test/compdirs/pftgrd_CA-Obs/shell_commands +M test/compdirs/pftgrd_CA-Obs/README.PTCLM +M test/compdirs/trans_20th_US-Ne3/user_nl_clm +M test/compdirs/trans_20th_US-Ne3/run.log +M test/compdirs/trans_20th_US-Ne3/shell_commands +M test/compdirs/trans_20th_US-Ne3/README.PTCLM +M test/compdirs/notowyrs_CA-Man/user_nl_clm +M test/compdirs/notowyrs_CA-Man/run.log +M test/compdirs/notowyrs_CA-Man/shell_commands +M test/compdirs/notowyrs_CA-Man/README.PTCLM +M test/compdirs/std_BE-Vie/user_nl_clm +M test/compdirs/std_BE-Vie/run.log +M test/compdirs/std_BE-Vie/shell_commands +M test/compdirs/std_BE-Vie/README.PTCLM +M test/compdirs/std_LBA-Cax/shell_commands +M test/compdirs/std_LBA-Cax/README.PTCLM +M test/compdirs/std_LBA-Cax/user_nl_clm +M test/compdirs/std_LBA-Cax/run.log +M test/compdirs/std_US-UMB/user_nl_clm +M test/compdirs/std_US-UMB/run.log +M test/compdirs/std_US-UMB/shell_commands +M test/compdirs/std_US-UMB/README.PTCLM +M test/compdirs/std_clm45_US-ARM/shell_commands +M test/compdirs/std_clm45_US-ARM/README.PTCLM +M test/compdirs/std_clm45_US-ARM/user_nl_clm +M test/compdirs/std_clm45_US-ARM/run.log +M test/compdirs/crop_US-IB1/user_nl_clm +M test/compdirs/crop_US-IB1/run.log +M test/compdirs/crop_US-IB1/shell_commands +M test/compdirs/crop_US-IB1/README.PTCLM +M test/compdirs/std_quiet_US-Bo1/user_nl_clm +M test/compdirs/std_quiet_US-Bo1/run.log +M test/compdirs/std_quiet_US-Bo1/shell_commands +M test/compdirs/std_quiet_US-Bo1/README.PTCLM +M test/compdirs/global_US-UMB/run.log +M test/compdirs/global_US-UMB/shell_commands +M test/compdirs/global_US-UMB/README.PTCLM +M test/compdirs/global_US-UMB/user_nl_clm +M test/compdirs/cyc_TS-Ts1/user_nl_clm +M test/compdirs/cyc_TS-Ts1/run.log +M test/compdirs/cyc_TS-Ts1/shell_commands +M test/compdirs/cyc_TS-Ts1/README.PTCLM +M test/compdirs/notowyrs_CA-Let/user_nl_clm +M test/compdirs/notowyrs_CA-Let/run.log +M test/compdirs/notowyrs_CA-Let/shell_commands +M test/compdirs/notowyrs_CA-Let/README.PTCLM +M test/compdirs/cyc_TS-Ts2/user_nl_clm +M test/compdirs/cyc_TS-Ts2/run.log +M test/compdirs/cyc_TS-Ts2/shell_commands +M test/compdirs/cyc_TS-Ts2/README.PTCLM +M test/compdirs/cyc_TS-Ts3/README.PTCLM +M test/compdirs/cyc_TS-Ts3/user_nl_clm +M test/compdirs/cyc_TS-Ts3/run.log +M test/compdirs/cyc_TS-Ts3/shell_commands +M test/compdirs/pftgrd_CA-Ca1/user_nl_clm +M test/compdirs/pftgrd_CA-Ca1/run.log +M test/compdirs/pftgrd_CA-Ca1/shell_commands +M test/compdirs/pftgrd_CA-Ca1/README.PTCLM +M test/compdirs/std_quiet_US-Ho1/run.log +M test/compdirs/std_quiet_US-Ho1/shell_commands +M test/compdirs/std_quiet_US-Ho1/README.PTCLM +M test/compdirs/std_quiet_US-Ho1/user_nl_clm + +================================================================================ +Originator: erik +Date: Aug/18/2016 +Tag: PTCLM2_160818 +One-line: Update compare tests, and allow clm5_0 and make it the default +Testing: Standard PTCLM test script on yellowstone and test_driver.sh in clm4_5_11_r189 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M PTCLMmkdata ------------- Change so can work for clm5_0 and make clm5_0 the default +M test/compdirs/*/run.log +M test/listings/help +M test/listings/list +M test/listings/sitelist + +================================================================================ +Originator: sacks +Date: Jan/27/2016 +Tag: PTCLM2_160127a +One-line: Fix typos for building on geyser and pronghorn +Testing: NONE (but will run test_driver.sh from CLM) +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M buildtools --- Fix typos for geyser and pronghorn + +================================================================================ +Originator: sacks +Date: Jan/27/2016 +Tag: PTCLM2_160127 +One-line: Build on pronghorn same as for yellowstone +Testing: NONE (but will run test_driver.sh from CLM) +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M buildtools --- Extend conditional to apply to pronghorn + +================================================================================ +Originator: erik +Date: Oct/09/2015 +Tag: PTCLM2_151009 +One-line: +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_3_r136 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M buildtools --- Add softlink to Macros.make so can build gen_domain with + cime4.0.1 +M PTCLMmkdata -- Add a wildcard for PFT number in landuse timeseries file + print out wildcard when file isn't found. + +================================================================================ +Originator: erik +Date: Aug/26/2015 +Tag: PTCLM2_150826 +One-line: Allow for pft??_ in surface dataset filename +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r119 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +In clm4_5_1_r108, surface datasets change standard filenames to include the +PFT number. So PTCLMmkdata would no longer work for clm4_5. Add a wildcard for +the pft number, so both clm4_0 and clm4_5 will now work. + +Move goldbach to hobart. + +M buildtools +M PTCLMmkdata +M test/compdirs/*/* + +================================================================================ +Originator: erik +Date: Apr/14/2015 +Tag: PTCLM2_150414 +One-line: Send in cimeroot to buildtools +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M buildtools + +================================================================================ +Originator: erik +Date: Apr/13/2015 +Tag: PTCLM2_150413 +One-line: Change output filenames of xmlchange_cmnds to shell_commands +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +R test/compdirs/*/xmlchange_cmnds +A test/compdirs/*/shell_commands +M test/compdirs/*/* +M test/PTCLMtestlist.py +M PTCLMmkdata + +================================================================================ +Originator: erik +Date: Apr/10/2015 +Tag: PTCLM2_150410 +One-line: Update to new cime directory structure +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +Change the relative paths to the new cime directory structure where clm +source and tools are under components, and CESM scripts are under +cime/scripts. + + M PTCLMmkdata + M mydatafiles/1x1pt_US-UMB/xmlchange_cmnds + M mydatafiles/1x1pt_US-UMB/README.PTCLM + M mydatafiles/1x1pt_US-UMB/user_nl_clm + M KnownBugs + M README + M test/PTCLMtesting_prog.py + M test/listings/help + M test/listings/list + M test/listings/sitelist + M test/compdirs/* + M test/PTCLMtestlist.py + M buildtools + +================================================================================ +Originator: erik +Date: Jan/26/2015 +Tag: PTCLM2_150126 +One-line: Update test comparison and listings +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r104 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values +------- Update test comparison and listings +M test/compdirs/* +M test/listings/sitelist +M test/listings/help +M test/listings/list + +================================================================================ +Originator: erik +Date: Aug/16/2014 +Tag: PTCLM2_140816 +One-line: Add geyser/caldera to yellowstone +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r080 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +M buildtools -- Allow yellowstone to use geyser and/or caldera + +------- Update test comparison and listings +M test/compdirs/* +M test/listings/sitelist +M test/listings/help +M test/listings/list + +================================================================================ +Originator: sacks +Date: May/21/2014 +Tag: PTCLM2_140521 +One-line: rename fpftdyn to flanduse_timeseries, and do some other related variable renames +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in + dynlu_crops_n03_addclm50bld_n06_clm4_5_72 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +This is meant to go with an upcoming CLM tag, currently slated for clm4_5_74 + +A + PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl +D PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl +M PTCLMmkdata +M README +M test/compdirs/global_US-UMB/user_nl_clm +M test/compdirs/rcp26_US-Dk2/user_nl_clm +M test/compdirs/rcp45_US-Dk3/user_nl_clm +M test/compdirs/rcp6_US-IB1/user_nl_clm +M test/compdirs/rcp85_US-Me4/user_nl_clm +M test/compdirs/trans_20th_US-Ne3/user_nl_clm +M test/compdirs/trans_clm45_US-Ha1/user_nl_clm + +================================================================================ +Originator: erik +Date: Apr/23/2014 +Tag: PTCLM2_140423 +One-line: Fix documentation, set DIN_LOC_ROOT_CLMFORC, correct call to mkmapdata.sh + allow release_tags in version, add hopper/edison to machine list. +Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_71 +Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't + check for valid values + +A PTCLMsublist --------- Script to submit a list of sites to the batch queue +A PTCLMsublist_prog.py - Python code to handle the submision list +A batchque.py ---------- Python code to handle batch command submission for single processor + +M PTCLMmkdata -- Set DIN_LOC_ROOT_CLMFORC, Correct call to mkmapdata.sh + Also allow release_tags in version find. +M README ------- Correct compset used. +M buildtools --- Add edison/hopper to list of machines will work for + change frankfurt to goldbach, update netcdf version for yellowstone +M test/compdirs/* -------- Update the comparison files +M test/listings/sitelist - Update sitelist +M test/listings/help ----- Update help +M test/listings/list ----- Update list + +M test/PTCLMtestlist.py ----- Change result codes to be more consistent with + other testing mechanisms +M test/PTCLMtesting_prog.py - Change result codes, and set sdate/map_gdate so sdate won't + change with the day testing was run. +M test/PTCLMtestlist.xml ---- Add new tests for new sites + +------> Add new sites for Rosie, RF-Bra,LBA-Cax,LTER-Sev +------> And Jinyun US-Bol +M PTCLM_sitedata/PTCLMDATA_pftdata.txt +M PTCLM_sitedata/PTCLMDATA_sitedata.txt +M PTCLM_sitedata/PTCLMDATA_soildata.txt + + +------> Add new comparison files for testing +A test/compdirs/std_RF-Bra +A test/compdirs/std_RF-Bra/user_nl_clm +A test/compdirs/std_RF-Bra/run.log +A test/compdirs/std_RF-Bra/xmlchange_cmnds +A test/compdirs/std_RF-Bra/README.PTCLM +A test/compdirs/std_LBA-Cax +A test/compdirs/std_LBA-Cax/user_nl_clm +A test/compdirs/std_LBA-Cax/run.log +A test/compdirs/std_LBA-Cax/xmlchange_cmnds +A test/compdirs/std_LBA-Cax/README.PTCLM +A test/compdirs/std_LTER-Sev +A test/compdirs/std_LTER-Sev/user_nl_clm +A test/compdirs/std_LTER-Sev/run.log +A test/compdirs/std_LTER-Sev/xmlchange_cmnds +A test/compdirs/std_LTER-Sev/README.PTCLM + +================================================================================ +Originator: erik +Date: Feb/04/2014 +Tag: PTCLM2_140204 +One-line: Add testing directory, some reworking, and bug fixes, remove -mach + Remove --mach, --sitegroupname options add --map_gdate options. +Testing: Ran PTCLM tests in test directory, and test_driver.sh tests on + yellowstone. + + Add test directory and XML based test list + A test + A test/compdirs + A test/compdirs/* ----------- Compare directory files + A test/PTCLMtestlist.py ----- Class for reading the test list + A test/run_PTCLM_tests ------ Main test script + A test/PTCLMtestlist.xml ---- XML test list + A test/PTCLMtesting_prog.py - Main class for test script + A test/listings ------------- List option compare directory + A test/listings/sitelist ---- Site list compare + A test/listings/help -------- Help compare + A test/listings/list -------- List compare + A test/README + + M buildtools ---- Remove *.o files for gen_domain and gmake clean everything else + M PTCLMmkdata --- STARTDATE and ALIGNYR only set if using tower years. Add more metadata to filenames. + More work on debug option so works well. Also run mksurfdata.pl in debug mode with + --debug and --allownofile so will test it's usage. Remove -mach option, add --map_gdate + option so can use old maps easier. Add function to get filenames of created files, and + touch the file in debug mode. Fix some of the use-case logic. Fix directory logic, and + allow being able to run from a different directory. Exercise more commands in system + function for debug mode. + + Remove -m option + M mydatafiles/1x1pt_US-UMB/user_nl_clm + M mydatafiles/1x1pt_US-UMB/xmlchange_cmnds + M mydatafiles/1x1pt_US-UMB/README.PTCLM + + M README --- Remove -m option + + Add some test sites for testing: TS-Ts1, TS-Ts2, TS-Ts3 + M PTCLM_sitedata/PTCLMDATA_sitedata.txt ----- Add test sites, change align year as first year to use when cycle_forcing used + This is usually the first year, unless it's a leap year and it's the year after that. If the site has less than 3 years + it's "1". + M PTCLM_sitedata/PTCLMDATA_soildata.txt + M PTCLM_sitedata/PTCLMDATA_pftdata.txt + +================================================================================ +Originator: erik +Date: Nov/22/2013 +Tag: PTCLM2_131122c +One-line: Add some example files +Testing: limited setup for US-UMB case on yellowstone + +A mydatafiles/1x1pt_US-UMB/user_nl_clm +A mydatafiles/1x1pt_US-UMB/xmlchange_cmnds +A mydatafiles/1x1pt_US-UMB/README.PTCLM + +================================================================================ +Originator: erik +Date: Nov/22/2013 +Tag: PTCLM2_131122b +One-line: Rename a bunch of files, add US-UMB sample data +Testing: limited setup for US-UMB case on yellowstone + +Rename files to new names: + +A + PTCLMmkdata +A + PTCLM_sitedata/PTCLMDATA_pftdata.txt +A + PTCLM_sitedata/PTCLMDATA_sitedata.txt +A + PTCLM_sitedata/PTCLMDATA_soildata.txt + +A mydatafiles/1x1pt_US-UMB ---- sample directory for US-UMB site + +D PTCLM.py +D PTCLM_sitedata/EXAMPLE_sitedata.txt +D PTCLM_sitedata/EXAMPLE_soildata.txt +D PTCLM_sitedata/EXAMPLE_pftdata.txt + +>>>>> Remove other site data files as we already have + a lot of sample data in the PTCLMDATA file set. +D PTCLM_sitedata/LBA_pftdata.txt +D PTCLM_sitedata/LBA_sitedata.txt +D PTCLM_sitedata/LBA_soildata.txt +D PTCLM_sitedata/Fluxnet-Canada_sitedata.txt +D PTCLM_sitedata/Fluxnet-Canada_soildata.txt +D PTCLM_sitedata/Fluxnet-Canada_pftdata.txt +D PTCLM_sitedata/AmeriFlux_sitedata.txt +D PTCLM_sitedata/AmeriFlux_soildata.txt +D PTCLM_sitedata/AmeriFlux_pftdata.txt +D PTCLM_sitedata/CarboEurope_pftdata.txt +D PTCLM_sitedata/CarboEurope_sitedata.txt +D PTCLM_sitedata/CarboEurope_soildata.txt + +>>>>>> Update documentation +M KnownBugs +M README + +================================================================================ +Originator: erik +Date: Nov/22/2013 +Tag: PTCLM2_131122 +One-line: Add more documentation, remove some case settings not needed, make +work a bit cleaner +Testing: limited setup for US-UMB case on yellowstone + +>>>> Add README file for the sample mydatafiles directory +A https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/mydatafiles/README + +M https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/PTCLM.py +-- remove some options not needed. Fix directory, and setup user_nl_clm and +xmlchange_cmnds files. +M https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/README +-- update doc... + + +================================================================================ +Originator: erik +Date: Nov/19/2013 +Tag: PTCLM2_131119 +One-line: Remove create_newcase call from PTCLM, just create datasets +Testing: limited setup for US-UMB case on yellowstone +Requires: scripts4_131119 + +Change PTCLM to JUST be a tool that creates datasets rather than also +creates a case for you. Running create_newcase is now a seperate step +that you use the -user_mods_dir option with. + +There are some issues with this version. But, it has basic functionality. + +The xmlchange_xcmnds file that is created has many fields multiple times. The +dataset location is also screwy. + +Change name for CHATS datasite to US-CHATS so name is more similar to the +other FluxNet sites. CHATS is an experiment that NCAR ran. + +A buildtools -- new script to build all the tools needed for PTCLM +M PTCLM.py ---- Change so that only creates datasets, does NOT run create_newcase +M README ------ Update documentation + +M PTCLM_sitedata/EXAMPLE_sitedata.txt -- Add campaign name to end +M PTCLM_sitedata/EXAMPLE_soildata.txt -- Change CHATS to US-CHATS +M PTCLM_sitedata/EXAMPLE_pftdata.txt --- Change CHATS to US-CHATS + +================================================================================ +Originator: erik +Date: Sep/29/2013 +Tag: PTCLM1_130929 +cesm_baseline: scripts4_130929 +One-line: default compset: I1PTCLM45, files go under site subdir, add script to rename maps +Testing: limited ran mexicocity, US-UMB, US-Ha1, and BE-Vie cases + +M PTCLM.py -------------------- Make default compset: I1PTCLM45, make files in resolution + subdiretory (under mydatadir) +M README ---------------------- Update documentation +A mydatafiles/renamemapfiles -- Script to rename mapping files creation date, so don't have + to recreate mapping files again. + +Remove directory NOT needed anymore... + +D usr_files/mkgriddata.TEMPLATE +D usr_files + +================================================================================ +Originator: erik +Date: Sep/23/2013 +Tag: PTCLM1_130923 +cesm_baseline: scripts4_130916 +One-line: Add --cycle_forcing, and --mydatadir options, remove useQIAN, rename --QIAN_tower_yrs to --use_tower_yrs +Testing: limited ran a couple cases + +M PTCLM.py -------- Changes from Keith Oleson to cycle_forcing, check + what model version is being used (clm4_0 or clm4_5) + set time-step. +D testcases.csh --- Remove as not working well on yellowstone + +================================================================================ +Originator: erik +Date: Sep/20/2013 +Tag: PTCLM1_130920 +cesm_baseline: scripts4_130920 +One-line: Make datafiles in mydatafiles directory +Testing: Ran basic US-UMB, US-NR1 and 1x1_mexicocityMEX cases + +M PTCLM.py +---------------- File changes from Keith Oleson +M PTCLM_sitedata/Fluxnet-Canada_sitedata.txt +M PTCLM_sitedata/EXAMPLE_sitedata.txt +M PTCLM_sitedata/Fluxnet-Canada_soildata.txt +M PTCLM_sitedata/AmeriFlux_sitedata.txt +M PTCLM_sitedata/EXAMPLE_soildata.txt +M PTCLM_sitedata/AmeriFlux_soildata.txt +M PTCLM_sitedata/Fluxnet-Canada_pftdata.txt +M PTCLM_sitedata/EXAMPLE_pftdata.txt +M PTCLM_sitedata/AmeriFlux_pftdata.txt + +================================================================================ +Originator: erik +Date: Sep/10/2013 +Tag: PTCLM1_130910 +cesm_baseline: scripts4_130910 +One-line: Get rid of pft-phys file copy, fix mapping file names, correct domain file +Testing: Limited, basic test setup + +M PTCLM.py --------- Remove pft-phys file copy, fix mapping file name, correct + domain file path +M testcases.csh ---- change compsets testing, unzip log file to check status + +================================================================================ +Originator: erik +Date: Jul/24/2013 +Tag: PTCLM1_130724 +cesm_baseline: scripts4_130724 +One-line: Add some more error checking, more changes to get things working +Testing: Limited, basic test setup + +M PTCLM.py ------- error checking, correct mapfile name, get gen_domain working, + set ATM/LND_DOMAIN_FILE + +================================================================================ +Originator: erik +Date: May/29/2013 +Tag: PTCLM1_130529 +cesm_baseline: scripts4_130529 +One-line: Get PTCLM working with the new CLM tools +Testing: Limited, test mexicocity, and 1x1_US-UMB basic case setup + +M PTCLM.py ------- Remove spinup options, get working with new tools +M testcases.csh -- Remove spinup tests, get working again + +================================================================================ +Originator: erik +Date: Feb/16/2013 +Tag: PTCLM1_130216 +cesm_baseline: scripts4_130130 +One-line: Get supported compsets working and some progress with tools +Testing: Limited -- but surported res work on ys + +M PTCLM.py +M testcases.csh + +================================================================================ +Originator: erik +Date: Jan/30/2013 +Tag: PTCLM1_130130 +cesm_baseline: scripts4_130130 +One-line: Initial changes to get PTCLM working with new scripts and tools +Testing: Limited testing + +Initial add of yellowstone to testcases and switch frankfurt for edinburgh. +Remove generic stuff for userdefined. Remove ndep/aer grid. + +M PTCLM.py +M testcases.csh +D usr_files/mkdatadomain.TEMPLATE + +================================================================================ +Originator: erik +Date: Jan/11/2013 +Tag: PTCLM1_130111 +cesm_baseline: scripts4_120125 +One-line: Add some new sitedata from Keith Oleson +Testing: none + +A PTCLM_sitedata/LBA_pftdata.txt +M PTCLM_sitedata/Fluxnet-Canada_sitedata.txt +M PTCLM_sitedata/EXAMPLE_sitedata.txt +A PTCLM_sitedata/CarboEurope_pftdata.txt +M PTCLM_sitedata/AmeriFlux_sitedata.txt +M PTCLM_sitedata/Fluxnet-Canada_soildata.txt +M PTCLM_sitedata/EXAMPLE_soildata.txt +M PTCLM_sitedata/AmeriFlux_soildata.txt +A PTCLM_sitedata/LBA_sitedata.txt +A PTCLM_sitedata/LBA_soildata.txt +A PTCLM_sitedata/CarboEurope_sitedata.txt +A PTCLM_sitedata/CarboEurope_soildata.txt +M PTCLM_sitedata/Fluxnet-Canada_pftdata.txt +M PTCLM_sitedata/EXAMPLE_pftdata.txt +M PTCLM_sitedata/AmeriFlux_pftdata.txt + +================================================================================ +Originator: mvertens +Date: Jan/25/2012 +Tag: PTCLM1_120125 +cesm_baseline: scripts4_120125 +One-line: Remove USE_MPISERIAL replace with MPILIB + + +================================================================================ + +Originator: erik +Date: Nov/29/2011 +Tag: PTCLM1_111129 +cesm_baseline: clm4_0_39 / scripts4_111129 +One-line: Use CLM_USRDAT for resolution or supported single-point res name + so will work with latest scripts version +Bugs-fixed: +Known Bugs: (See KnownBugs file for details) + 1379 (All of the spinup tests fail for PTCLM) + 1364 (Problem running US-UMB case on Macintosh) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) +Testing: Limited testing + bluefire testing: All PASS + +M PTCLM.py -- Set res in create_newcase to either supported 1pt name + or to CLM_USRDAT. + +================================================================================ +Originator: erik +Date: Nov/14/2011 +Tag: PTCLM1_111114 +cesm_baseline: clm4_0_38 / scripts4_111108 +One-line: Update path for NetCDF4 +Bugs-fixed: +Known Bugs: (See KnownBugs file for details) + 1379 (All of the spinup tests fail for PTCLM) + 1364 (Problem running US-UMB case on Macintosh) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) +Testing: Limited testing + bluefire testing: All PASS + +Update path for NetCDF for bluefire, jaguar, lynx, and mirage. + +M testcases.csh + +================================================================================ +Originator: erik +Date: Sep/02/2011 +Tag: PTCLM1_110902 +cesm_baseline: clm4_0_35 / scripts4_110902 +One-line: Change name of mksurfdata to mksurfdata_map, fix soil texture of US-UMB +Bugs-fixed: + 1392 (US-UMB site has some incorrect data) +Known Bugs: (See KnownBugs file for details) + 1379 (All of the spinup tests fail for PTCLM) + 1364 (Problem running US-UMB case on Macintosh) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) +Testing: Limited testing + bluefire testing: All PASS + +Get basic script working with non2D grid version of clm. mksurfdata directory +was changed to mksurfdata_map, and tools directories now have a "src" subdirectory +to build the code in them. + +Also fix soil texture for US-UMB site (bug 1392). + +M PTCLM.py +M testcases.csh +M PTCLM_sitedata/EXAMPLE_soildata.txt +M PTCLM_sitedata/AmeriFlux_soildata.txt + +================================================================================ +Originator: erik +Date: Jul/26/2011 +Tag: PTCLM1_110726 +cesm_baseline: clm4_0_33 / scripts4_110724 +One-line: Test if should use skip_rundb option or not, fix transient problem +Bugs-fixed: + 1368 (PTCLM for US-UMB spins up with zero GPP) + 1361 (Problem with transient compsets for PTCLM) +Known Bugs: (See KnownBugs file for details) + 1392 (US-UMB site has some incorrect data) + 1379 (All of the spinup tests fail for PTCLM) + 1364 (Problem running US-UMB case on Macintosh) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) +Testing: All tests pass up to the spinup tests where they all fail + bluefire testing: + PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM + jaguar testing: + PTCLM._US_US-UMB_ICN_exit_spinup.PTCLM + edinburgh testing: + PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM + yong/intel testing: + PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM + + M PTCLM.py ------ Add check for finidat file, check if should use -skip_rundb option, fix transient issue + M testcases.csh - Change order of arguments for spinup tests, so more likely to die on an error with finidat file + M KnownBugs ----- Update list of bugs + +================================================================================ +Originator: erik +Date: May/04/2011 +Tag: PTCLM1_110504 +cesm_baseline: clm4_0_28 / scripts4_110428a +One-line: Move PTCLM to own external, and fix cnvrt script so can take year-range + allow it to use older versions of Python +Bugs-fixed: + 1279 (Latest version of PTCLM requires python2.5) + 1248 (PTCLM can only run until 2005) +Known Bugs: (See KnownBugs file for details) + 1392 (US-UMB site has some incorrect data) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) +Testing: + bluefire testing: All PASS + jaguar testing: All PASS + edinburgh testing: All PASS except +4 PTCLM.8696_US-UMB_I_1850.PTCLM FAIL 0 +5 PTCLM.8696_US-UMB_I20TR.PTCLM FAIL 0 +6 PTCLM.8696_US-UMB_I20TRCN.PTCLM FAIL 0 +7 PTCLM.8696_US-UMB_ICN.PTCLM FAIL 0 +8 PTCLM.8696_US-UMB_I1850CN.PTCLM FAIL 0 +9 PTCLM.8696_US-UMB_IRCP85CN.PTCLM FAIL 0 +10 PTCLM.8696_US-UMB_I.PTCLM FAIL 0 +11 PTCLM.8696_US-UMB_I_QIAN.PTCLM FAIL 0 +12 PTCLM.8696_US-UMB_I.PTCLM FAIL 0 +14 PTCLM.8696_US-UMB_ICN_exit_spinup.PTCLM FAIL 0 +15 PTCLM.8696_US-UMB_ICN_final_spinup.PTCLM FAIL 0 + yong/intel testing: All PASS + + Send a year range to the convert script and have years that start at the beginning + of the year range and go to the end of it. + Add a DEBUG option to testcases.csh so can just run tests quickly to debug test script. + + M PTCLM.py + M PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl + M testcases.csh + M KnownBugs + + M PTCLM_sitedata/EXAMPLE_sitedata.txt - Remove all but US-UMB + M PTCLM_sitedata/EXAMPLE_soildata.txt - Remove all but US-UMB + M PTCLM_sitedata/EXAMPLE_pftdata.txt -- Remove all but US-UMB + +================================================================================ +Originator: erik +Date: Feb/03/2011 +Tag: clm4_0_23 / scripts4_110111 +One-line: Fix --list and --cesm_root options, add --scratchroot, fix bugs + update use-cases and compset names, add CESM_ROOT/CLM_SOFF to testcases.csh +Bugs-fixed: + 1256 (fix PTCLM testcases.csh test script on jaguar to use netcdf/3.6.2) + 1254 (pft-physiology copy doesn't have .nc extension/can't handle new files) + 1250 (add ability to set scratchroot) + 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) +Known Bugs: (See KnownBugs file for details) + 1392 (US-UMB site has some incorrect data) + 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) + 1248 (PTCLM can only run until 2005) +Testing: + bluefire testing: All PASS + edinburgh testing: All Fail (Python is too old 2.4 when needs 2.5) + yong/intel testing: All PASS except... +myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 +myPTCLMtests_US-Ha1_I20TR.PTCLM FAIL 0 + +M PTCLM.py ------- Fix bugs, get --list and --cesm_root options working, add + --scratchroot, update CLM use-cases and how queried + add ability to add directory to caseprefix +M testcases.csh -- Add ability to use env vars CESM_ROOT and CLM_SOFF + set scratchroot for generic machines. Put case directories + under the PTCLM directory, so can delete it easier +M KnownBugs + +================================================================================ +Originator: erik +Date: Jan/12/2011 +Tag: clm4_0_21 / scripts4_110108 +One-line: Create ChangeLog file for PTCLM +Testing: + bluefire testing: All PASS + edinburgh testing: All PASS up to ... +myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 + yong/intel testing: All PASS up to... +myPTCLMtests_US-Ha1_I_QIAN.PTCLM PASS + +================================================================================ +Originator: erik +Date: Dec/06/2010 +Tag: scripts4_101206 +One-line: Add some documentation files + +M ccsm_utils/Tools/lnd/clm/PTCLM/testcases.csh Add USER_CC setting to yong +M ccsm_utils/Tools/lnd/clm/PTCLM/README ------- Add note about aerdepgrid/ndepgrid +A ccsm_utils/Tools/lnd/clm/PTCLM/KnownBugs ---- Add file with list of bugs + +================================================================================ +Originator: erik +Date: Dec/02/2010 +Tag: scripts4_101202 +One-line: Updates for script changes + +>>>>>>>>>>>> Get PTCLM working with changes +>>>>>>>>>>>> PTCLM updates from mpiserial branch +>>>>>>>>>>>> Add PTCLM tests for yong (Mac OS-X laptop) + M ccsm_utils/Tools/lnd/clm/PTCLM/PTCLM.py + M ccsm_utils/Tools/lnd/clm/PTCLM/testcases.csh + M ccsm_utils/Tools/lnd/clm/PTCLM/README + +================================================================================ +Originator: erik +Date: Aug/30/2010 +Tag: scripts4_100830 +One-line: Bring PTCLM branch to scripts trunk + +================================================================================ diff --git a/tools/site_and_regional/PTCLM/LICENSE b/tools/site_and_regional/PTCLM/LICENSE new file mode 100644 index 0000000000..cb8a9e9f5a --- /dev/null +++ b/tools/site_and_regional/PTCLM/LICENSE @@ -0,0 +1,34 @@ +Copyright (c) 2005-2017, University Corporation for Atmospheric Research (UCAR) +All rights reserved. + +Developed by: + University Corporation for Atmospheric Research - National Center for Atmospheric Research + https://www2.cesm.ucar.edu/working-groups/sewg + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), +to deal with the Software without restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, +and/or sell copies of the Software, and to permit persons to whom +the Software is furnished to do so, subject to the following conditions: + + - Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimers. + - Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimers in the documentation + and/or other materials provided with the distribution. + - Neither the names of [Name of Development Group, UCAR], + nor the names of its contributors may be used to endorse or promote + products derived from this Software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt new file mode 100644 index 0000000000..42d39edcc9 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt @@ -0,0 +1,44 @@ +site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 +US-Blo,100,1,0,0,0,0,0,0,0,0 +US-CHATS,100,7,0,0,0,0,0,0,0,0 +US-FPe,100,12,0,0,0,0,0,0,0,0 +US-NR1,100,1,0,0,0,0,0,0,0,0 +CA-Let,100,12,0,0,0,0,0,0,0,0 +CA-Man,100,2,0,0,0,0,0,0,0,0 +BR-Sa1,100,4,0,0,0,0,0,0,0,0 +BR-Sa3,100,4,0,0,0,0,0,0,0,0 +ES-ES1,100,1,0,0,0,0,0,0,0,0 +FL-Hyy,100,2,0,0,0,0,0,0,0,0 +FL-Kaa,100,14,0,0,0,0,0,0,0,0 +IT-Col,100,7,0,0,0,0,0,0,0,0 +IT-Cpz,100,5,0,0,0,0,0,0,0,0 +DE-Tha,100,1,0,0,0,0,0,0,0,0 +US-Brw,100,12,0,0,0,0,0,0,0,0 +BE-Vie,100,7,0,0,0,0,0,0,0,0 +US-ARM,100,15,0,0,0,0,0,0,0,0 +US-Var,100,13,0,0,0,0,0,0,0,0 +US-UMB,100,7,0,0,0,0,0,0,0,0 +US-Ha1,100,7,0,0,0,0,0,0,0,0 +US-Ho1,100,1,0,0,0,0,0,0,0,0 +US-MMS,100,7,0,0,0,0,0,0,0,0 +US-Bo1,100,15,0,0,0,0,0,0,0,0 +CA-Ca1,100,2,0,0,0,0,0,0,0,0 +CA-Oas,100,8,0,0,0,0,0,0,0,0 +CA-Obs,100,2,0,0,0,0,0,0,0,0 +CA-Ojp,100,2,0,0,0,0,0,0,0,0 +CA-Qfo,100,2,0,0,0,0,0,0,0,0 +US-Me4,100,1,0,0,0,0,0,0,0,0 +US-Me2,100,1,0,0,0,0,0,0,0,0 +US-MOz,100,7,0,0,0,0,0,0,0,0 +US-WCr,100,7,0,0,0,0,0,0,0,0 +US-Dk3,100,1,0,0,0,0,0,0,0,0 +US-Dk2,100,7,0,0,0,0,0,0,0,0 +US-IB1,100,15,0,0,0,0,0,0,0,0 +US-Ne1,100,18,0,0,0,0,0,0,0,0 +US-Ne3,100,15,0,0,0,0,0,0,0,0 +TS-Ts1,100,1,0,0,0,0,0,0,0,0 +TS-Ts2,100,1,0,0,0,0,0,0,0,0 +TS-Ts3,100,1,0,0,0,0,0,0,0,0 +LTER-Sev,100,1,0,0,0,0,0,0,0,0 +RF-Bra,-999,-999,0,0,0,0,0,0,0,0 +LBA-Cax,100,4,0,0,0,0,0,0,0,0 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt new file mode 100644 index 0000000000..e581754937 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt @@ -0,0 +1,44 @@ +site_code,name,state,lon,lat,elev,startyear,endyear,alignyear,timestep,campaign +US-Blo,"Blodgett Forest",CA,-120.6327,38.8952,1315,1997,2007,1997,30,AmeriFlux +US-CHATS,"Cilker Chandler walnut orchard",CA,-121.85,38.49,21,2007,2007,2007,30,CHATS +US-FPe,"Fort Peck",MT,-105.1019,48.3077,634,2000,2007,2001,30,AmeriFlux +CA-Let,"Lethbridge",CAN,-112.9402,49.7093,960,1998,2007,1998,30,Fluxnet-Canada +US-NR1,"Niwot Ridge",CO,-105.5464,40.0329,3050,1998,2007,1998,30,AmeriFlux +CA-Man,"BOREAS NSA - Old Black Spruce",CAN,-98.4808,55.8796,259,1994,2003,1994,30,Fluxnet-Canada +BR-Sa1,"SantaremKM67",BRAZIL,-54.9589,-2.85667,130,2002,2004,1,60,LBA +BR-Sa3,"SantaremKM83",BRAZIL,-54.9714,-3.01803,130,2001,2003,1,60,LBA +ES-ES1,"ElSaler",SPAIN,-0.31881,39.346,10,1999,2005,1999,30,CarboEurope +FL-Hyy,"Hyytiala",FINLAND,24.2948,61.8474,181,1997,2005,1997,30,CarboEurope +FL-Kaa,"Kaamanen",FINLAND,27.295,69.1407,155,2000,2005,2001,30,CarboEurope +IT-Col,"Collelongo",ITALY,13.5881,41.8494,1550,1996,2001,1997,30,CarboEurope +IT-Cpz,"CastelPorziano",ITALY,12.3761,41.7052,68,2001,2005,2001,30,CarboEurope +DE-Tha,"Tharandt",GERMANY,13.5669,50.9636,380,1998,2003,1998,30,CarboEurope +US-Brw,Barrow,AK,-156.6259,71.3225,1,1998,2006,1998,30,AmeriFlux +BE-Vie,"Vielsalm",BELGIUM,5.99683,50.3055,450,1997,2005,1997,30,CarboEurope +US-ARM,"ARM SGP Main",OK,-97.4888,36.6058,310,2000,2007,2001,30,AmeriFlux +US-Var,"Vaira Ranch",CA,-120.9507,38.4067,129,2000,2007,2001,30,AmeriFlux +US-UMB,UMBS,MI,-84.7138,45.5598,234,1999,2006,1999,60,AmeriFlux +US-Ha1,"Harvard Forest",MA,-72.1715,42.5378,303,1991,2006,1991,60,AmeriFlux +US-Ho1,"Howland Forest Main",ME,-68.7402,45.2041,60,1996,2004,1997,30,AmeriFlux +US-MMS,"Morgon Monroe State Forest",IN,-86.4131,39.3232,275,1999,2007,1999,60,AmeriFlux +US-Bo1,Bondville,IL,-88.2919,40.0061,300,1996,2008,1997,30,AmeriFlux +CA-Ca1,"British Columbia- Campbell River - Mature Forest Site",CAN,-125.3336,49.8673,300,1998,2006,1998,30,Fluxnet-Canada +CA-Oas,"Sask.- SSA Old Aspen",CAN,-106.19779,53.6289,530,1997,2006,1997,30,Fluxnet-Canada +CA-Obs,"Sask.- SSA Old Black Spruce",CAN,-105.1178,53.9872,629,2000,2006,2001,30,Fluxnet-Canada +CA-Ojp,"Sask.- SSA Old Jack Pine",CAN,-104.6920,53.9163,579,2000,2006,2001,30,Fluxnet-Canada +CA-Qfo,"Quebec Mature Boreal Forest Site",CAN,-74.3421,49.6925,382,2004,2006,2004,30,Fluxnet-Canada +US-Dk2,"Duke Forest Hardwoods",NC,-79.1004,35.9736,160,2003,2005,2003,30,AmeriFlux +US-Dk3,"Duke Forest Loblolly Pine",NC,-79.0942,35.9782,163,1998,2005,1998,30,AmeriFlux +US-IB1,"Fermi Agricultural",IL,-88.2227,41.8593,227,2005,2007,2005,30,AmeriFlux +US-Me4,"Metolius Old Pine",OR,-121.6224,44.4992,915,1996,2000,1996,30,AmeriFlux +US-Me2,"Metolius Intermediate Pine",OR,-121.5574,44.4523,1253,2002,2010,2002,30,AmeriFlux +US-MOz,"Missouri Ozark Site",MO,-92.2,38.7441,219,2004,2007,2005,30,AmeriFlux +US-Ne1,"Mead Irrigated Corn",NE,-96.4766,41.1651,361,2001,2013,2001,60,AmeriFlux +US-Ne3,"Mead Rainfed",NE,-96.4396,41.1797,361,2001,2006,2001,60,AmeriFlux +US-WCr,"Willow Creek",WI,-90.0799,45.8059,520,1998,2006,1998,30,AmeriFlux +TS-Ts1,"Test short yrs",TEST,-105.5464,40.0329,3050,1998,2001,1998,30,PTCLMTestSite +TS-Ts2,"Test short yrs start on leap-year",TEST,-105.5464,40.0329,3050,2004,2007,2005,30,PTCLMTestSite +TS-Ts3,"Test long yrs",TEST,-105.5464,40.0329,3050,2004,2008,2005,30,PTCLMTestSite +LTER-Sev,"Sevilleta Long Term Ecological Research (LTER) project (Meteorology from LTER Cerro Montoso #42)",NM,-106.529444,34.386389,1911,1996,1999,1996,30,LTER +RF-Bra,"Brasillia arbitrary site, no met-data",BR,-50.0,-15.0,-999,-999,-999,-999,60,RFisher +LBA-Cax,"Caxiauna Rainforest 'throughfall exclusion’ (TFE) experiment",BR,-51.46,1.717639,-999,1996,1999,1996,30,LBA diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt new file mode 100644 index 0000000000..414c44fe9a --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt @@ -0,0 +1,44 @@ +site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% +US-Blo,-999,1,-999,60.0,11.0 +US-CHATS,-999,1,-999,10.0,35.0 +US-FPe,-999,1,-999,47.0,21.0 +CA-Let,-999,1,-999,28.0,36.0 +US-NR1,-999,1,-999,43.13,21.43 +CA-Man,-999,1,-999,33.0,33.0 +BR-Sa1,-999,1,-999,19.0,65.0 +BR-Sa3,-999,1,-999,52.0,40.0 +ES-ES1,-999,1,-999,82.0,5.0 +FL-Hyy,-999,1,-999,82.0,5.0 +FL-Kaa,-999,1,-999,42.0,18.0 +IT-Col,-999,1,-999,22.0,13.0 +IT-Cpz,-999,1,-999,82.0,5.0 +DE-Tha,-999,1,-999,42.0,18.0 +US-Brw,-999,1,-999,50.0,25.0 +BE-Vie,-999,1,-999,42.0,18.0 +US-ARM,-999,1,-999,28.0,43.1 +US-Var,-999,1,-999,30.0,13.0 +US-UMB,-999,1,-999,92.6,0.6 +US-Ha1,-999,1,-999,66.0,6.0 +US-Ho1,0.8,1,-999,50.3,15.9 +US-MMS,-999,1,-999,34.0,63.0 +US-Bo1,-999,1,-999,5.0,25.0 +CA-Ca1,-999,1,-999,84.42,2.63 +CA-Oas,-999,1,-999,50.32,18.8 +CA-Obs,-999,1,-999,80.89,4.12 +CA-Ojp,-999,1,-999,94.47,2.5 +CA-Qfo,-999,1,-999,51.5,4.0 +US-Dk2,-999,1,-999,54.43,21.62 +US-Dk3,-999,1,-999,51.59,13.66 +US-IB1,-999,1,-999,7.8,37.2 +US-Me4,-999,1,-999,66.0,10.0 +US-Me2,-999,1,-999,67.0,7.0 +US-MOz,-999,1,-999,46.38,24.68 +US-Ne1,-999,1,-999,30.7,31.68 +US-Ne3,-999,1,-999,30.7,31.68 +US-WCr,-999,1,-999,42.52,20.17 +TS-Ts1,-999,1,-999,43.13,21.43 +TS-Ts2,-999,1,-999,43.13,21.43 +TS-Ts3,-999,1,-999,43.13,21.43 +LTER-Sev,-999,1,-999,52.,5. +RF-Bra,-999,1,-999,-999,-999 +LBA-Cax,-999,1,-999,75.00,20.00 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt new file mode 100644 index 0000000000..e94db29f8f --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt @@ -0,0 +1,4 @@ +trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze +1850,100,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 +1946,100,7,0,0,0,0,0,0,0,0,0.50,0,0,0,0,0,0,0 +2005,100,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl b/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl new file mode 100755 index 0000000000..51f0305ac1 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl @@ -0,0 +1,261 @@ +#!/usr/bin/env perl +# +# cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl Erik Kluzek +# Aug/5/2010 +# +# Convert the transition years files to landuse_timeseries text files. +# +use Cwd; +use strict; +use English; +use IO::File; +use Getopt::Long; + +# +# Some global constants +# +my $maxlen = 125; +my $numharv = 5; +my $numgraz = 1; +my $nbreak = 5*2; +my $numarray = 1 + $nbreak + $numharv + $numgraz + 2 - 1; +my @hd_pftarr; +my @hd_hrvarr; +my @hd_grzarr; + +sub parse_header { +# +# Parse the header and make sure it's correct +# + my $header = shift; + + my @harray = split( /,/, $header ); + if ( $#harray != $numarray ) { + die "** Number of elements in line is incorrect: $#harray should be: $numarray\n"; + } + if ( (my $hyear = shift( @harray )) ne "trans_year" ) { + die "** First header element is NOT trans_year as expected: $hyear\n"; + } + foreach my $var ( "hold_graze\n", "hold_harv" ) { + if ( (my $val = pop( @harray )) ne $var ) { + die "** Last header elements are NOT $var as expected: $val\n"; + } + } + for( my $i = 0; $i < $nbreak; $i++ ) { + push( @hd_pftarr, shift( @harray ) ); + } + for( my $i = 0; $i < $numharv; $i++ ) { + push( @hd_hrvarr, shift( @harray ) ); + } + for( my $i = 0; $i < $numgraz; $i++ ) { + push( @hd_grzarr, shift( @harray ) ); + } +} + +sub parse_pft { +# +# Parse the PFT array +# + my $frcname = shift; + my $idxname = shift; + my $head = shift; + my @pftarray = @_; + + my @header = split( /,/, $head ); + my $sum = 0.0; + my $frcline = "<$frcname>"; + my $idxline = "<$idxname>"; + my $n = 1; + my $endit= undef; + for( my $i = 0; $i <= $#pftarray; $i=$i+2 ) { + my $j = $i + 1; + my $expect = "pft_f$n"; + if ( $header[$i] ne $expect ) { + die "** PFT fraction header is wrong: $header[$i] expect $expect\n"; + } + if ( ! defined($endit) ) { $frcline .= $pftarray[$i]; } + $sum = $sum + $pftarray[$i]; + if ( $pftarray[$j] < 0 || $pftarray[$j] > 16 ) { + die "** PFT index is out of range: $pftarray[$j]\n"; + } + $expect = "pft_c$n"; + if ( $header[$j] ne $expect ) { + die "** PFT code header is wrong: $header[$j] expect $expect\n"; + } + if ( ! defined($endit) ) { $idxline .= $pftarray[$j]; } + if ( $sum > 100.0 ) { + die "** Sum of PFT fractions exceeds 100: $sum\n"; + } elsif ( $sum == 100.0 ) { + $endit = 1; + } + if ( ! defined($endit) && ($j < $#pftarray) ) { $frcline .= ","; } + if ( ! defined($endit) && ($j < $#pftarray) ) { $idxline .= ","; } + $n++; + } + if ( $sum != 100.0 ) { + die "** Sum of PFT fractions does NOT go to 100: $sum\n"; + } + $frcline .= ""; + $idxline .= ""; + + return( "$frcline$idxline" ); +} + +sub parse_hrv { +# +# Parse the harvesting array +# + my $name = shift; + my $head = shift; + my $exp = shift; + my @array = @_; + + my @exp = split( /,/, $exp ); + my @header = split( /,/, $head ); + my $line = "<$name>"; + for( my $i = 0; $i <= $#array; $i++ ) { + if ( $header[$i] ne $exp[$i] ) { + die "** harvesting header is wrong: $header[$i], expecting $exp[$i]\n"; + } + $line .= $array[$i]; + if ( $array[$i] < 0 || $array[$i] > 1 ) { + die "** Bad value for harvest value: $array[$i]\n"; + } + if ( $i < $#array ) { $line .= ","; } + } + $line .= ""; + + return( $line ); +} + +sub printoutline { +# +# Print the line out with the fill as well +# + my $pftline = shift; + my $harline = shift; + my $grzline = shift; + my $year = shift; + + my $outline = "$pftline$harline$grzline"; + my $length = length( $outline ); + if ( $length > $maxlen ) { + die "** line length is too long = $length\n"; + } + my $fill = ""; + for( my $i = 1; $i <= $maxlen - $length; $i++ ) { $fill .= " "; } + + print "$outline$fill $year\n"; + +} + +if ( $#ARGV != 1 ) { + die "** Wrong number of arguments: should just be filename and sim_year_range\n ". + "$0 "; +} +my $filename = $ARGV[0]; +my $sim_year_range = $ARGV[1]; +chomp( $sim_year_range ); +my $start_year; +my $end_year; +if ( $sim_year_range =~ /^([0-9]+)\-([0-9]+)$/ ) { + $start_year = $1; + $end_year = $2; +} else { + die "** bad format for sim_year_range (should be yyyy-yyyy): $sim_year_range\n"; +} + +my $fh = IO::File->new; +$fh->open( "<$filename" ) or die "** can't open file: $filename\n"; + +my $header = <$fh>; +my $last_year = undef; +my $frst_year = undef; + +&parse_header( $header ); + +my $pftline = ""; +my $harline = ""; +my $grzline = ""; +my $hold_h = undef; +my $hold_g = undef; +my $year = undef; +while( my $line = <$fh> ) { + my @array = split( /,/, $line ); + if ( $#array != $numarray ) { + die "** Number of elements in line is incorrect: $#array\n"; + } + $year = shift( @array ); + # + # Write out the years from last year until current year + # + if ( defined($last_year) ) { + for( my $yr = $last_year+1; $yr < $year; $yr++ ) { + if ( $yr >= $start_year ) { + &printoutline( $pftline, $harline, $grzline, $yr ); + } + } + } + # + # Last two parts of the array are harvesting and grazing hold values + # + $hold_g = pop( @array ); + chomp( $hold_g ); + $hold_h = pop( @array ); + # + # Separate out the array into the different sections + # + my @pftarray; + for( my $i = 0; $i < $nbreak; $i++ ) { + push( @pftarray, shift( @array ) ); + } + my @hrvarray; + for( my $i = 0; $i < $numharv; $i++ ) { + push( @hrvarray, shift( @array ) ); + } + my @grzarray; + for( my $i = 0; $i < $numgraz; $i++ ) { + push( @grzarray, shift( @array ) ); + } + # + # Parse the different sections + # + $pftline = &parse_pft( "pft_f", "pft_i", join( ",", @hd_pftarr ), @pftarray ); + $harline = &parse_hrv( "harv", join( ",", @hd_hrvarr ), "har_vh1,har_vh2,har_sh1,har_sh2,har_sh3", @hrvarray ); + $grzline = &parse_hrv( "graz", join( ",", @hd_grzarr ), "graze", @grzarray ); + + # + # Write out the years from start year until first year + # + if ( ! defined($frst_year) && ($year > $start_year) ) { + for( my $yr = $start_year; $yr < $year; $yr++ ) { + &printoutline( $pftline, $harline, $grzline, $yr ); + } + } + # + # Figure out the line length and the amount of fill to have and print it + # + if ( $year >= $start_year ) { + &printoutline( $pftline, $harline, $grzline, $year ); + } + # If NOT holding harvesting, set it to zero, for transition years + if ( ! $hold_h ) { + for( my $i = 0; $i <= $#hrvarray; $i++ ) { $hrvarray[$i] = 0; } + $harline = &parse_hrv( "harv", join( ",", @hd_hrvarr ), "har_vh1,har_vh2,har_sh1,har_sh2,har_sh3", @hrvarray ); + } + # If NOT holding grazing, set it to zero, for transition years + if ( ! $hold_g ) { + for( my $i = 0; $i <= $#grzarray; $i++ ) { $grzarray[$i] = 0; } + $grzline = &parse_hrv( "graz", join( ",", @hd_grzarr ), "graze", @grzarray ); + } + # Save last years value so can create transition years + $last_year = $year; + if ( ! defined($frst_year) ) { $frst_year = $year } +} +# +# Write out years from end to file to the end_year +# +for( my $yr = $year+1; $yr <= $end_year; $yr++ ) { + &printoutline( $pftline, $harline, $grzline, $yr ); +} +$fh->close(); diff --git a/tools/site_and_regional/PTCLM/PTCLMmkdata b/tools/site_and_regional/PTCLM/PTCLMmkdata new file mode 100755 index 0000000000..b72e4ff168 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLMmkdata @@ -0,0 +1,713 @@ +#!/usr/bin/env python3 +######################################################################################### +# +# PTCLMmkdata +# +# Python script to create datasets to run point simulations of CLM5 +# using Tower Datasets for Ameriflux tower sites, using the CESM2 +# framework. +# +# Python script originally created by: +# +# Daniel M. Riccciuto, Dali Wang, Peter E. Thornton, Wilfred M. Poist +# of Environmental Sciences Division, Oak Ridge National Lab. +# +# Quinn Thomas +# of Cornell University +# +# Modified by Erik Kluzek (NCAR) to be incorporated as a standard part of CLM5. +# +# For help on PTCLMmkdata type: +# +# PTCLMmkdata --help +# +# Also see the README file +# +# Requirements: +# +# python, UNIX shell, NCL (NCAR Command Language), +# GNU make, Fortran compiler, C compiler +# +# NOTE: mksurfdata_map, and gen_domain must be compiled! +# You should only have to compile them once. +# you must also have ncl installed. +# +######################################################################################### +description = 'Python script to create datasets to run single point simulations with tower site data.' +import os, csv, time, re, sys, shlex, subprocess +from xml.sax.handler import ContentHandler +from xml.sax import make_parser + +###### THE ERROR FUNCTION +############################################################## + +def error( desc ): + "error function" + print( "ERROR("+sys.argv[0]+"):: "+desc ) + os.abort() + +###### SET SOME VARIABLES ############################################################## + +#configure case options +#run time defaults +defSitesGroup = "PTCLMDATA" #default site group name + +global ptclm_dir +stdout = os.popen("pwd") +cwd = os.path.abspath( stdout.read().rstrip( ) ) +dirname = os.path.dirname(sys.argv[0]) +if ( dirname == "" ): + ptclm_dir = cwd +else: + ptclm_dir = os.path.abspath(dirname) + +base_ctsm = os.path.abspath(ptclm_dir+"/../../.." ) +wrkdir = cwd +cesm_input = " " +filen = " " +mydatadir = ptclm_dir+"/mydatafiles" +clmnmlusecase = "2000_control" +stdout = os.popen( "date +%y%m%d" ); +sdate = stdout.read().rstrip( ); + +###### GET VERSION INFORMATION ######################################################### + +if sys.version_info < (2, 4): + error( "The version of Python being used is too old for PTCLMmkdata" ) + + +tagvers = "" +clog = open( ptclm_dir+"/ChangeLog", "r" ); +for line in clog: + if ( line.find("Tag: ",0) == 0 ): + n = line.count("") + tagvers = line[5:n-2] + break + +clog.close +version=tagvers + +### PARSE THE COMMAND LINE INPUT ######################################################## + +from optparse import OptionParser, OptionGroup + +#parse arguments +cmdline = "" +for arg in sys.argv: + cmdline = cmdline+arg+" " +parser = OptionParser( usage="%prog [options] -d inputdatadir -s sitename", description=description, version=version ) +required = OptionGroup( parser, "Required Options" ) +required.add_option("-d", "--cesmdata", dest="cesm_input", default=" ", \ + help="Location of CCSM input data") +required.add_option("-s", "--site", dest="mysite", default="none", \ + help="Site-code to run, FLUXNET code (-s list to list valid names)") +parser.add_option_group(required) +options = OptionGroup( parser, "Configure and Run Options" ) +options.add_option("--crop", dest="crop", \ + action="store_true", help = \ + "Create datasets and run with prognostic crop on") +options.add_option("--no-crop", dest="crop", \ + action="store_false", default=False, help = \ + "Create datasets and run without prognostic crop on (DEFAULT)") +options.add_option("--ctsm_root", dest="base_ctsm", \ + default=base_ctsm, help = \ + "Root CTSM directory (top level directory CTSM src bld doc cime_config subdirs)") +options.add_option("--cime_root", dest="base_cime", \ + default=" ", help = \ + "Root CIME directory (top level directory of CIME infrastructure with " \ + + " scripts, doc, utils, tools, src, config subdirs)") +options.add_option("--debug", dest="debug", action="store_true", default=False, \ + help="Flag to turn on debug mode so won't run, but display what would happen") +options.add_option("--sdate", dest="sdate", default=sdate, \ + help="Use entered date string in all files"+\ + " (use the given date string in place of the current date:"+sdate+")" ) +options.add_option("--clmnmlusecase", dest="clmnmlusecase", default=clmnmlusecase, \ + help="CTSM namelist use case to use (default:"+clmnmlusecase+")" ) +options.add_option("--list", dest="list", default=False, action="store_true", \ + help="List all valid: sites") +options.add_option("--mydatadir", dest="mydatadir", default=mydatadir \ + ,help="Directory of where to put your data files (files will be under subdirectories for each site)"+\ + " (default: "+mydatadir+")" ) +options.add_option("--donot_use_tower_yrs",action="store_false",\ + dest="use_tower_yrs",default=True,\ + help="Do NOT use the data years that correspond to the tower years "+\ + "(when you plan on using global forcing)" ) +options.add_option("--quiet", action="store_true", \ + dest="quiet", default=False, \ + help="Print minimul information on what the script is doing") +options.add_option("--cycle_forcing", action="store_true", \ + dest="cycle_forcing", default=False, \ + help="Cycle over the forcing data rather than do one run through (modifies start/end year to get this to work)") +options.add_option("--verbose", action="store_true", \ + dest="verbose", default=False, \ + help="Print out extra information on what the script is doing") +parser.add_option_group(options) + +indatgengroup = OptionGroup( parser, "Input data generation options", \ + "These are options having to do with generation of input datasets. " ) +parser.add_option_group(indatgengroup) +indatgengroup.add_option("--pftgrid", dest="pftgrid", help = \ + "Use pft information from global gridded file (rather than site data)", \ + action="store_true", default=False) +indatgengroup.add_option("--soilgrid", dest="soilgrid", help = \ + "Use soil information from global gridded file (rather than site data)",\ + action="store_true", default=False) +indatgengroup.add_option("--map_gdate", dest="map_gdate", default=sdate, \ + help="Use existing mapping files with the given date string rather than create new ones with current date"+\ + " (if mapping files do NOT exist with this date, the script will abort)" ) +indatgengroup.add_option("--mksurfdata_opts", dest="mksurfdata_opts", help = \ + "Options to send directly to mksurfdata_map",\ + default="") +versiongroup = OptionGroup( parser, tagvers ) +parser.add_option_group(versiongroup) + +(options, args) = parser.parse_args() +if len(args) != 0: + parser.error("incorrect number of arguments") + +### END PARSE THE COMMAND LINE INPUT #################################################### + +### SOME FUNCTIONS ################################################################### + +def system( cmd ): + "system function with error checking and debug prining" + global plev + + if plev>0: print( "Run command: "+cmd ) + + # Check if this is a command to always do regardless of debug + cmdsallow = [ "create_newcase", "mkdir", "mv", "cat", "which", "chmod", "touch", "mksurfdata.pl" ] + allowed_cmd = False + for allow_cmd in cmdsallow: + if ( cmd.find( allow_cmd ) > 0 ): + allowed_cmd = True + + # Error check that command exists + if ( not options.debug or allowed_cmd ): + firstspace = cmd.index(" "); + if ( firstspace == -1 ): + justcmd = cmd + else: + justcmd = cmd[:firstspace] + + if ( cmd.index("/") != -1 ): + if ( not os.path.exists(justcmd) ): + error( "Error command does NOT exist: "+justcmd ); + else: + rcode = os.system( "which "+justcmd ) + if ( rcode != 0 ): + error( "Error command is NOT in path: "+justcmd ) + + # Now actually run the command + if ( not options.debug or allowed_cmd ): + if ( options.debug and cmd.find( "mksurfdata.pl" ) > 0): + rcode = os.system( cmd+" --debug --allownofile" ) + else: + rcode = os.system( cmd ) + else: rcode = 0 + if ( rcode != 0 ): + error( "Error running command: "+cmd ) + if ( os.path.isfile(filen) ): + output = open( filen,'a') + output.write(cmd+"\n") + output.close + +def queryFilename( queryopts, filetype ): + "query the XML database to get a filename" + global abs_base_ctsm + query = abs_base_ctsm+"/bld/queryDefaultNamelist.pl -silent " \ + +"-justvalue " + if ( cesm_input != " " ): + query = query + " -csmdata "+cesm_input + cmd = query+queryopts+" -var "+filetype + file = os.popen( cmd ) + filename = file.read() + if ( file.close() != None ): + print( "Query = "+cmd ) + error( "Error getting file from XML database" ) + # Remove the trailing new line from the filename + if ( (filename == None) or (filename == "") ): + print( "Query = "+cmd ) + error( "Trouble finding file from XML database: "+filetype ) + return( filename.replace( "\n", "" ) ) + +def setup_case_files( ): + "Setup the user_nl_clm and shell_commands files" + + global data_dir + global cmdline + filex = data_dir+"/shell_commands" + output = open( filex,'w') + output.write("# shell commands to execute xmlchange commands written by PTCLMmkdata:\n") + output.write("# "+cmdline+"\n") + output.close + system( "/bin/chmod +x "+filex ) + usernlclm = data_dir+"/user_nl_clm" + output = open( usernlclm,'w') + output.write("! user_nl_clm namelist options written by PTCLMmkdata:\n") + output.write("! "+cmdline+"\n") + output.close + return( filex, usernlclm ) + +def xmlchange_env_value( filex, var, value, note="", append=False ): + 'Function to set the value of a variable in one of the env_*.xml files' + change = "./xmlchange" + if ( append ): + change = change + " --append" + cmd = change+" "+var+"="+value + output = open( filex,'a') + if ( note != "" ): + output.write("# "+note+"\n") + output.write(cmd+"\n") + output.close + +def write_datm_namelistdefaults_file( dir ): + "Write namelist_defaults_datm.xml file" + global data_dir + datm_src_dir = data_dir+"/SourceMods/src.datm"; + os.system( "/bin/mkdir -p "+datm_src_dir ) + file = datm_src_dir+"/namelist_defaults_datm.xml" + output = open( file,'w') + filestrings = ( '', \ + ' ', \ + '', \ + ' ', \ + '', \ + ' ', \ + '' ) + # write out file + for line in filestrings: + output.write(line+"\n") + # Add data directory for files + if ( line.find( "" ) != -1 ): + output.write('\n') + value = ''+dir+'\n' + output.write(value) + + output.close + +def find_filename_created( wildcard, desc ): + "Find the filename of the file that was just created" + + global options + if ( not options.debug ): + # If NOT debug mode, get the filename from a directory listing + stdout = os.popen( "ls -1t1 "+wildcard+" | head -1" ); + filename = stdout.read().rstrip( ); + if ( not os.path.exists( filename) ): error( "filename does NOT exist:"+wildcard ) + else: + # For debug mode, create a file with current date replacing any wildcards + filename = wildcard.replace( "*", options.sdate ) + os.system( "touch "+filename ) + + print( desc+" = "+filename ) + return( filename ) + + +if sys.version_info < (2, 5): + def rpartition( string, sep ): + 'Reverse order of dividing string by seperator' + before = string[0:string.rfind(sep)]; + after = string[before.count(""):]; + return ( before, sep, after ) + +###### SET OPTIONS BASED ON INPUT FROM PARSER ########################################## + +mysite = options.mysite +SitesGroup = defSitesGroup +infohelp = "\n\n Use --help option for help on usage.\n"; +if(options.list): + mysite = "list" +if ( mysite == "none" ): parser.error("sitename is a required argument, set it to a valid value"+infohelp ) +if ( options.verbose and options.quiet ): + parser.error( "options quiet and verbose are mutually exclusive"+infohelp ) + +if ( options.verbose ): plev = 2 +elif ( options.quiet ): plev = 0 +else: plev = 1 + +sitedata=SitesGroup+"_sitedata.txt" +soildata=SitesGroup+"_soildata.txt" +pftdata=SitesGroup+"_pftdata.txt" + + +if plev>0: print( "---------------- PTCLMmkdata version "+str(version)+"-----------------------------\n" ) +if plev>0: print( " "+cmdline+"\n" ) +if plev>0: print( " OPTIONS:\n" ) +if plev>0: print( "Site name:\t\t\t\t\t\t"+mysite+"\n" ) + +base_ctsm = options.base_ctsm +if base_ctsm == " ": + #assume base directory is three levels up from where PTCLM script + # is executed, if not specified + stdout = os.popen("cd "+ptclm_dir+"/../../..; pwd") + base_ctsm = os.path.abspath( stdout.read().rstrip( ) ) + +abs_base_ctsm = os.path.abspath( base_ctsm ) +if plev>0: print( "Root CTSM directory:\t\t\t\t\t"+abs_base_ctsm ) + +base_cime = options.base_cime +if base_cime == " ": + #assume base directory is tunder the CTSM directory + # is executed, if not specified + stdout = os.popen("cd "+abs_base_ctsm+"/cime; pwd") + base_cime = os.path.abspath( stdout.read().rstrip( ) ) + +abs_base_cime = os.path.abspath( base_cime ) +if plev>0: print( "Root CIME directory:\t\t\t\t\t"+abs_base_cime ) + +if plev>0: print( "** Surface data file will be built using site-level data " + + "when available unless otherwise specified ** \n" ) +if plev>0: print( "\tExtract PFT data from gridded files:\t\t"+str(options.pftgrid) ) +if plev>0: print( "\tExtract soil data from gridded files:\t\t"+str(options.soilgrid) ) + +###### END SET OPTIONS BASED ON INPUT FROM PARSER ###################################### + +########## GET SITE LAT, LON, AND TOWER MET YEARS ####################################### + +siteDir = ptclm_dir+"/"+"PTCLM_sitedata" +#get lat/lon, start/end years from sitedata file +if plev>0: print( "\nOpen Site data file: "+siteDir+"/"+sitedata+"\n" ) +sitepath = siteDir+"/"+sitedata +AFdatareader = csv.reader(open(sitepath), dialect="unix") +if ( mysite == "list" ): plev = 2 +found=False +for row in AFdatareader: + if plev>1: print( " site = %9s name: %-55s Region: %12s Campaign: %s" % ( row[0], row[1], row[2], row[10] ) ) + if row[0] == mysite: + found=True + lon=float(row[3]) + if (lon < 0): + lon=360.0+float(row[3]) + lat=float(row[4]) + startyear=int(row[6]) + endyear=int(row[7]) + alignyear = int(row[8]) + timestep = int(row[9]) + +# Exit early for list options +if ( mysite == "list" ): + exit() +if ( not found ): + parser.error( "Entered site is NOT in the list of valid sites: "+mysite ) + +# inputdata directory -- set after list options +cesm_input=options.cesm_input +if cesm_input == " ": + parser.error( "inputdatadir is a required argument, set it to the directory where you have your inputdata"+infohelp ) +if plev>0: print( "CESM input data directory:\t\t\t\t"+cesm_input ) +#define data and utility directories +mask = "navy" +clmusrdatname = "1x1pt_"+mysite +clmusrdat = " -usrname "+clmusrdatname +clmres = clmusrdatname +clmmask = "navy" +myres = "CLM_USRDAT" #single-point mode (don't change) + +clm_tools = abs_base_ctsm+'/tools' +if ( not os.path.exists( clm_tools ) ): + error( "clm tools directory does NOT exist: "+clm_tools ) +gen_dom_dir = abs_base_cime+'/tools/mapping/gen_domain_files' +if ( not os.path.exists( gen_dom_dir ) ): + error( "generate domain directory does NOT exist: "+gen_dom_dir ) +mkmapgrd_dir= clm_tools+'/mkmapgrids' +if ( not os.path.exists( mkmapgrd_dir ) ): + error( "make map grid directory does NOT exist: "+mkmapgrd_dir ) +mkmapdat_dir= clm_tools+'/mkmapdata' +if ( not os.path.exists( mkmapdat_dir ) ): + error( "make map data directory does NOT exist: "+mkmapdat_dir ) +clm_input = cesm_input+'/lnd/clm2' +datm_input = cesm_input+'/atm/datm7' + +mydata_dir = os.path.abspath( options.mydatadir ) +data_dir = mydata_dir+"/"+clmusrdatname +if ( not os.path.exists( data_dir ) ): os.system( "/bin/mkdir -p "+data_dir ) + +if plev>0: print( "----------------------------------------------------------------\n" ) + +############# WRITE OUT README FILE ON DATA ############################################## + +opt = " " + +clmnmlusecase = options.clmnmlusecase + +filen = data_dir+"/README.PTCLM" +if plev>0: print( "Write "+filen+" with command line" ) +output = open( filen,'w') +output.write(cmdline+"\n") +output.close + +############# GET SIM_YEAR, RCP and SIM_YEAR_RANGE based on USE-CASE #################### +############# CLM configure ensures naming conventions are followed #################### +############# And setup Query options based on them ##################################### + +if ( clmnmlusecase.endswith("_transient") ): + transient = re.search('^([0-9]+-[0-9]+)_*(.*)_(transient$)', clmnmlusecase ) + if ( transient ): + sim_year_range = transient.group(1) + sim_year = re.search( '^([0-9]+)-', transient.group(1) ).group(1) + elif ( clmnmlusecase.startswith("20thC_") ): + sim_year_range = "1850-2000" + sim_year = "1850" + else: + error( "Can not parse use-case name, does not follow conventions: "+clmnmlusecase ) + + if ( sim_year_range == "1850-2000" ): actual_sim_year_range = "1850-2015" + else: actual_sim_year_range = sim_year_range +elif ( clmnmlusecase.endswith("_control") ): + control = re.search( '^([0-9]+)_', clmnmlusecase ) + if ( not control ): error( "Can NOT parse use-case name does NOT follow conventions: "+clmnmlusecase ) + sim_year = control.group(1) + if ( sim_year == None ): error( "Trouble finding sim_year from:"+clmnmlusecase ) + sim_year = str(sim_year) + sim_year_range = "constant" +elif ( clmnmlusecase.endswith("_pd") or clmnmlusecase == "UNSET" ): + sim_year = "2000" + sim_year_range = "constant" +else: + error( "Can not parse use-case name:, does not follow conventions: "+clmnmlusecase ) + +landuse_timeseries_type = "hist" + +qoptionsbase = " -options mask="+mask + +qoptions = qoptionsbase+",sim_year="+sim_year+",sim_year_range="+sim_year_range; +queryOpts = " -onlyfiles -res "+clmres+clmusrdat+qoptions +queryOptsNousr = qoptions +queryOptsNavy = " -res 0.33x0.33 "+qoptions + +# +# If you are trying to cycle the forcing years you need to be careful about +# the number of years cycling over and taking leap years into account. +# +if ( options.cycle_forcing ): + numyears = endyear - startyear + 1 + numfour = int(numyears/4) + # If have three years or less (numfour = 0) just repeat first year + # unless first year is leap year then use next year. + # Since just using one year that is not a leap year endyear is startyear + if (numfour == 0): + if (startyear % 4 == 0): + startyear = startyear + 1 + + endyear = startyear + else: + endyear = startyear + numfour * 4 - 1 + + # Use alignyear from file for cycle_forcing case +else: + # When NOT cycling forcing, use start year for the align year + alignyear = startyear + +if (options.crop == True): + mkcrop = " -crop" +else: + mkcrop = " -no-crop" + +####### ANY OTHER LAST SETTINGS BEFORE CREATING DATASETS ################################ + +##### ENV XML CHANGES ################################################################## +filex, usernlclm = setup_case_files( ) + +if ( clmusrdatname != "" ): + xmlchange_env_value( filex, "CLM_USRDAT_NAME", clmusrdatname ) + +if(options.use_tower_yrs): + xmlchange_env_value( filex, "DATM_CLMNCEP_YR_START", str(startyear) ) + xmlchange_env_value( filex, "DATM_CLMNCEP_YR_END", str(endyear) ) + +xmlchange_env_value( filex, "MPILIB", "mpi-serial", note="Comment this out if NINST_LND is greater than 1 (see: http://bugs.cgd.ucar.edu/show_bug.cgi?id=2521)" ) + +############# BEGIN CREATE POINT DATASETS ############################################### + + +if plev>0: print("Making input files for the point (this may take a while if creating transient datasets)") + +os.chdir(data_dir) +#make map grid file and atm to ocean map ############################################ +if plev>0: print( "Creating map file for a point with no ocean" ) +print( "lat="+str(lat) ) +ptstr = str(lat)+","+str(lon) +if ( os.system( "which ncl" ) != 0 ): error( "ncl is NOT in path" ) # check for ncl +system(mkmapdat_dir+"/mknoocnmap.pl -p "+ptstr+" -name "+clmres+" > "+data_dir+"/mknoocnmap.log") +mapfile = find_filename_created( data_dir+"/map_"+clmres+"_noocean_to_"+clmres+"_"+"nomask_aave_da_*.nc", "mapfile" ) +if plev>0: print( "mapfile = ", mapfile ) +scripgridfile = find_filename_created( data_dir+"/SCRIPgrid_"+clmres+"_nomask_c*.nc", "scripgridfile" ) +if plev>0: print( "scripgridfile = ", scripgridfile ) + +#make domain file needed by datm #################################################### +if plev>0: print( "Creating data domain" ) +cmd = gen_dom_dir+"/gen_domain -m "+mapfile+" -o "+clmmask+" -l "+clmres+" -c 'Running gen_domain from PTCLMmkdata' > "+data_dir+"/gen_domain.log" +system(cmd); +domainfile = find_filename_created( "domain.lnd."+clmres+"_"+clmmask+".*.nc", "domainfile" ) + +#make surface data and dynpft ####################################################### +if plev>0: print( "\n\nRe-create surface dataset:\t" ) +if ( sim_year_range == "constant" ): + mksrfyears = sim_year +else: + mksrfyears = sim_year_range + +#make mapping files needed for mksurfdata_map ####################################### + +mapdir = data_dir +if ( options.map_gdate == options.sdate ): + # mkmapdata.sh remembers where it is (although it starts over for a new date) + if plev>0: print( "\n\nRe-create mapping files for surface dataset:" ) + cmd = mkmapdat_dir+"/mkmapdata.sh --gridfile "+scripgridfile+" --res "+clmres+" --gridtype regional -v > "+mapdir+"/mkmapdata.log"; + system(cmd); +else: + mksrfmapfile = find_filename_created( mapdir+"/map_*"+"_c"+options.map_gdate+".nc", "mksrfmapfile" ) + if ( not os.path.exists( mksrfmapfile ) ): error( "mapping files with gdate of "+ \ + options.map_gdate+" do NOT exist, bad value for --map_gdate option" ) + +# --- use site-level data for mksurfdata_map when available ---- +#PFT information for the site +if (options.pftgrid == False): + if plev>0: print( "Replacing PFT information in surface data file" ) + os.chdir(siteDir) + AFdatareader = csv.reader(open(pftdata), dialect="unix") + os.chdir(data_dir) + pft_frac=[0,0,0,0,0] + pft_code=[0,0,0,0,0] + found=0 + for row in AFdatareader: + if plev>1: print( " site = %9s" % row[0] ) + if row[0] == mysite: + found=1 + output=open("./tempsitePFT.txt","w") + output.write(' '.join(row[1:11])) + output.close() + for thispft in range(0,5): + pft_frac[thispft]=float(row[1+2*thispft]) + pft_code[thispft]=int(row[2+2*thispft]) + if ( found == 0 ): + error( "Did NOT find input sitename:"+mysite+" in pftdata:"+pftdata+ \ + " run with pftgrid instead") + # Find index of first zero + for i in range(0,len(pft_frac)): + if ( pft_frac[i] == 0.0 ): + nzero = i + break + pftopts=" -pft_frc \""+str(pft_frac[0:nzero])+'"' \ + " -pft_idx \""+str(pft_code[0:nzero]) +'"' + mkcrop +else: + pftopts="" + +#Read in the soil conditions for the site ####################################### +if (options.soilgrid == False): + + #soil information + os.chdir(siteDir) + if plev>0: print( "Replacing soil information in surface data file" ) + AFdatareader = csv.reader(open(soildata), dialect="unix") + os.chdir(data_dir) + found=0 + for row in AFdatareader: + if plev>1: print( " site = %9s" % row[0] ) + if row[0] == mysite: + found=1 + output=open("./tempsitesoil.txt","w") + output.write(' '.join(row[1:7])) + output.close() + # The first three items are NOT used + soil_depth = float(row[1]) # This is ignored + n_layers = int(row[2]) # This is ignored + layer_depth = float(row[3]) # This is ignored + sandpct = float(row[4]) + claypct = float(row[5]) + if ( found == 0 ): + error( "Did NOT find input sitename:"+mysite+" in soildata:"+soildata+ \ + " run with soilgrid instead") + if plev>0: print( " sandpct="+str(sandpct)+" claypct="+str(claypct) ) + soilopts=" -soil_cly "+str(claypct)+" -soil_snd "+str(sandpct) +else: soilopts="" +#----- create dynamic pft input file --------------- ############################ +if (options.pftgrid == False) and (sim_year_range != "constant"): + + if plev>0: print( "Creating site-specific dynamics PFTs and harvesting" ) + + landuse_timeseries_site_filename = siteDir + \ + mysite + "_dynpftdata.txt" + + # only set dynpft file if the file exists + if ( os.path.exists( landuse_timeseries_site_filename ) ): + if plev>0: print( "Transition PFT file exists, so using it for changes in PFT" ) + # Convert the file from transition years format to mksurfdata_map landuse_timeseries_ format + cnv = siteDir + \ + "/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl " + \ + landuse_timeseries_site_filename+" "+sim_year_range + landuse_timeseries_outfile = data_dir+"/landuse_timeseries_"+mysite+".txt" + system( cnv+" > "+landuse_timeseries_outfile ) + dynpftopts = " -dynpft "+landuse_timeseries_outfile + else: + error( "Transition PFT file does NOT exist for this site, create one, use --pftgrid, or choose a non transient use-case" ) + +else: + dynpftopts = "" + +# Now run mksurfdata_map ########################################################### +mksurfopts = "-res usrspec -usr_gname "+clmres+" -usr_gdate "+options.map_gdate+ \ + " -usr_mapdir "+mapdir+" -dinlc "+cesm_input+" -y "+mksrfyears+ \ + soilopts+pftopts+dynpftopts+" "+options.mksurfdata_opts +system(clm_tools+"/mksurfdata_map/mksurfdata.pl "+mksurfopts+" > "+data_dir+"/mksurfdata_map.log") + +surffile = find_filename_created( data_dir+"/surfdata_"+clmres+"*_simyr"+sim_year+"_*.nc", "surface file" ) +logfile = find_filename_created( data_dir+"/surfdata_"+clmres+"*_simyr"+sim_year+"_*.log", "surface log file" ) +if ( sim_year_range != "constant" ): + landuse_timeseries_file = find_filename_created( data_dir+"/landuse.timeseries_"+clmres+"_"+landuse_timeseries_type+"*_simyr"+actual_sim_year_range+"_*.nc", "landuse_timeseries_file" ) +# rename files with clm version in the filename +mkopts = "" +if (options.pftgrid == True): mkopts += "_pftgrd" +if (options.soilgrid == True): mkopts += "_soigrd" +if (options.mksurfdata_opts != "" ): mkopts += "_"+options.mksurfdata_opts.replace(" ","+") + + + +####### END CREATE POINT DATASETS ####################################################### + + +###### SET ENV_RUN.XML VALUES ########################################################### + +os.chdir(data_dir) +xmlchange_env_value( filex, "ATM_DOMAIN_PATH", data_dir ) +xmlchange_env_value( filex, "LND_DOMAIN_PATH", data_dir ) +xmlchange_env_value( filex, "ATM_DOMAIN_FILE", domainfile ) +xmlchange_env_value( filex, "LND_DOMAIN_FILE", domainfile ) +xmlchange_env_value( filex, "CLM_BLDNML_OPTS", "'-mask "+mask+mkcrop+"'", append=True ); + +xmlchange_env_value( filex, "CALENDAR", "GREGORIAN" ) +xmlchange_env_value( filex, "DOUT_S", "FALSE" ) +hist_nhtfrq = 0 +hist_mfilt = 1200 + +atm_ncpl = int((60 // timestep) * 24) +xmlchange_env_value( filex, "ATM_NCPL", str(atm_ncpl) ) +if(options.use_tower_yrs): + xmlchange_env_value( filex, "RUN_STARTDATE", str(alignyear)+"-01-01" ) + xmlchange_env_value( filex, "DATM_CLMNCEP_YR_ALIGN", str(alignyear) ) + +xmlchange_env_value( filex, "DIN_LOC_ROOT", cesm_input ) +xmlchange_env_value( filex, "DIN_LOC_ROOT_CLMFORC", mydata_dir ) + +#### NAMELIST DEFAULTS FILE MODIFICATIONS ############################################## +datm_dir = data_dir+"/CLM1PT_data" +if ( os.path.isdir(datm_dir) ): + write_datm_namelistdefaults_file( datm_dir ) + +#### SET NAMELIST OPTIONS ############################################################## +output = open(usernlclm,'a') +output.write( " fsurdat = '"+surffile+"'\n" ) +if (sim_year_range != "constant"): + output.write( " flanduse_timeseries = "+landuse_timeseries_file+"\n" ) +output.write( " hist_nhtfrq = "+str(hist_nhtfrq)+"\n" ) +output.write( " hist_mfilt = "+str(hist_mfilt)+"\n" ) +output.close() +if plev>1: os.system( "/bin/cat user_nl_clm" ) + +###### END SET Spinup and ENV_RUN.XML VALUES ############################################ + +if plev>0: print( "Data created successfully in "+data_dir+"\n" ) + +### END PTCLM SCRIPT #################################################################### + diff --git a/tools/site_and_regional/PTCLM/PTCLMsublist b/tools/site_and_regional/PTCLM/PTCLMsublist new file mode 100755 index 0000000000..052e3018d5 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLMsublist @@ -0,0 +1,16 @@ +#!/usr/bin/env python3 +# +# Python program to submit a list of sites to the batch queue. +# Setup for: cheyenne, yellowstone, edison +# +from PTCLMsublist_prog import PTCLMsublist_prog + +bsub = PTCLMsublist_prog() +bsub.parse_cmdline_args() +print( "Submit a list of sites to the batch queue\n" ) +bsub.Initialize() + +for site in bsub.get_SiteList(): + print( "Submit for site: "+site+"\n" ) + bsub.Submit( site ) + diff --git a/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py b/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py new file mode 100644 index 0000000000..20fd9e7171 --- /dev/null +++ b/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py @@ -0,0 +1,214 @@ +######################################################################################### +# +# PTCLMsublist_prog +# +# Top level class to define the PTCLMsublist program. Parse's arguments and has Init, +# and run methods to submit a list of PTCLMmkdata sites to the batch queue. +# +######################################################################################### +import os, sys +from batchque import batchque + +class PTCLMsublist_prog: +#---------------------------------------------------------------------------------------- +# Class to handle command line input to the program +#---------------------------------------------------------------------------------------- + # Class data + name = "PTCLMsublist" + cmdline = "" + account = "P93300606" + ctsmdir_def = "../../../" + ctsmdir = os.getenv("CTSM_ROOT", ctsmdir_def ) + inputdir_def = "/glade/p/cesmdata/cseg/inputdata" + inputdir = os.getenv("DIN_LOC_ROOT", inputdir_def ) + sitelistcsv = "US-CHATS,US-FPe,CA-Let,US-NR1,CA-Man,BR-Sa1,BR-Sa3" + mach = "cheyenne" + wall = "02:00:00" + parse_args = False + ptclm_opts = "" + que = batchque() + setup = False + + # -- Error function --------------------------------- + def error( self, desc ): + "error function to abort with a message" + print( "ERROR("+self.name+"):: "+desc ) + sys.exit(100) + + def parse_cmdline_args( self ): + "Parse the command line arguments for the PTCLM batch submission script" + from optparse import OptionParser, OptionGroup + + for arg in sys.argv: + self.cmdline = self.cmdline+arg+" " + parser = OptionParser( usage="%prog [options]" ) + options = OptionGroup( parser, "Options" ) + options.add_option("-r", "--ctsm_root", dest="ctsm_root", default=self.ctsmdir, \ + help="Location of CTSM root directory (also set with CTSM_ROOT env variable)") + options.add_option("-d", "--inputdir", dest="inputdir", default=self.inputdir, \ + help="Location of CESM inputdata directory (also set with CSMDATA env variable)") + options.add_option("-o", "--PTCLM_options", dest="options", default=self.ptclm_opts, \ + help="PTCLM options to run with") + options.add_option("-l", "--list", dest="sitelist", default=self.sitelistcsv, \ + help="Comma seperated list of PTCLM sites to submit to batch") + options.add_option("--account", dest="account", default=self.account, \ + help="Account number to use for batch queue") + options.add_option("--wall", dest="wall", default=self.wall, \ + help="Wall clock time to submit in queue for") + options.add_option("--mach", dest="mach", default=self.mach, \ + help="Machine name to use for batch submital") + parser.add_option_group(options) + stdout = os.popen("pwd") + cwd = os.path.abspath( stdout.read().rstrip( ) ) + tagvers = "" + clog = open( cwd+"/ChangeLog", "r" ); + for line in clog: + if ( line.find("Tag: ",0) == 0 ): + n = line.count("") + tagvers = line[5:n-2] + break + + clog.close + versiongroup = OptionGroup( parser, tagvers ) + parser.add_option_group(versiongroup) + (options, args) = parser.parse_args() + if len(args) != 0: + parser.error("incorrect number of arguments") + + self.mach = options.mach + self.sitelistcsv = options.sitelist + self.account = options.account + self.options = options.options + self.ctsmdir = options.ctsm_root + self.inputdir = options.inputdir + # Initialize batch que object, will abort if bad machine + self.que.Initialize( self, mach=self.mach, account=self.account ) + # Error checking + if ( not os.path.isdir(self.ctsmdir) ): + self.error( "CTSM_root directory does NOT exist: "+self.ctsmdir ) + if ( not os.path.isdir(self.inputdir) ): + self.error( "CESM inputdata directory does NOT exist: "+self.inputdir ) + + # Get site list from csv formatted string list + if ( self.sitelistcsv.find( " " ) != -1 ): + self.error( "Site list has white space in it, just use comma's to seperate sites: "+self.sitelistcsv ) + if ( self.sitelistcsv.find( ",," ) != -1 or self.sitelistcsv.endswith( "," ) or self.sitelistcsv.startswith( "," ) ): + self.error( "Site list has empty site names, make sure comma's do not go after each other: "+self.sitelistcsv ) + self.sitelist = self.sitelistcsv.split( "," ) + + # Flag that parsing was accomplished + self.parse_args = True + + def ctsm_root( self ): + "Return the CTSM_ROOT directory" + if ( not self.parse_args ): + self.error( "parse_cmdline_args was NOT run first" ) + return( self.ctsmdir ) + + def get_SiteList( self ): + "Return the Site list" + if ( not self.parse_args ): + self.error( "parse_cmdline_args was NOT run first" ) + return( self.sitelist ) + + def Initialize( self ): + "Initialize the PTCLM batch submission" + if ( not self.parse_args ): + self.error( "parse_cmdline_args was NOT run first" ) + + self.que.Initialize( self, self.mach, self.account ) + self.setup = True + + + def Submit( self, site, submit=True ): + "Submit the PTCLMmkdata job to the batch queue" + if ( not self.setup ): + self.error( "Initialize was NOT run first" ) + + jobcommand = "./PTCLMmkdata --ctsm_root "+self.ctsmdir+" -s "+site+" -d "+self.inputdir+" "+self.options + print( jobcommand ); + bsub = self.que.Submit( self, jobcommand, jobname="PTCLM_"+site, submit=submit, wall=self.wall ) + return( bsub ) + +# +# Unit testing for above classes +# +import unittest + +class test_PTCLMsublist_prog(unittest.TestCase): + + def setUp( self ): + self.prog = PTCLMsublist_prog() + + def test_badinit( self ): + # Bad option will fail + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "--zztop" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + # Test that doing stuff before parse_args fails + self.prog = PTCLMsublist_prog() + self.assertRaises(SystemExit, self.prog.ctsm_root ) + self.assertRaises(SystemExit, self.prog.Initialize ) + self.assertRaises(SystemExit, self.prog.Submit, "US-UMB" ) + # Test that doing stuff after parse_args before Initialize fails + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ ] + self.prog.parse_cmdline_args( ) + self.assertRaises(SystemExit, self.prog.Submit, "US-UMB" ) + # Test that a non existant directory for ctsm_root fails + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "--ctsm_root", "zztop" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + # Test that a non existant directory for inputdata fails + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "-d", "inpzztop" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + # Test that a bad site list fails + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "-l", "thing thing2 thing3" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "-l", "thing,thing2,,thing3" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "-l", "thing,thing2,thing3," ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + self.prog = PTCLMsublist_prog() + sys.argv[1:] = [ "-l", ",thing,thing2,thing3" ] + self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) + + def test_init( self ): + # check that setting ctsm_root works + sys.argv[1:] = [ ] + self.prog.parse_cmdline_args( ) + ctsmdir_def = os.getenv("CTSM_ROOT", self.prog.ctsmdir_def ) + self.assertTrue( self.prog.ctsm_root( ) == ctsmdir_def ) + cwd = os.getcwd() + sys.argv[1:] = [ "--ctsm_root", cwd ] + self.prog.parse_cmdline_args( ) + self.assertTrue( self.prog.ctsm_root( ) == cwd ) + # Initialize and submit + self.prog.Initialize( ) + site = "US-UMB" + bsub = self.prog.Submit( site, submit=False ) + jobid = str(os.getpid()) + checkstring = "qsub -o PTCLM_US-UMB."+jobid+".stdout.out -N PTCLM_US-UMB -l walltime=02:00:00 " + \ + "-A P93300606 -l select=3:ncpus=1:mpiprocs=1:mem=109GB -q regular " + \ + "-V -m ae -j oe PTCLM_"+site+"."+jobid+".job" + print( "\n" ) + print( "bsubcm:"+bsub+":end" ) + print( "expect:"+checkstring+":end" ) + self.assertTrue( bsub == checkstring ) + + def test_sitelist( self ): + sitelistcsv = "US-UMB,US-Ha1" + sitelist = [ "US-UMB", "US-Ha1" ] + sys.argv[1:] = [ "-l", sitelistcsv ] + self.prog.parse_cmdline_args( ) + self.prog.Initialize( ) + slist = self.prog.get_SiteList( ) + self.assertTrue( slist == sitelist ) + + +if __name__ == '__main__': + unittest.main() diff --git a/tools/site_and_regional/PTCLM/README b/tools/site_and_regional/PTCLM/README new file mode 100644 index 0000000000..033474f748 --- /dev/null +++ b/tools/site_and_regional/PTCLM/README @@ -0,0 +1,118 @@ +PTCLM/README 04/10/2015 + +NOTE PTCLM is DEPRECATED! + +NOTE, PTCLM is being deprecated to make way for new faster tools that will create datasets +based on existing global datasets rather than use the same process for global datasets. Those +scripts are under tools/site_and_regional in a CTSM checkout. There is a high memory requirement +for the process with PTCLM because of the need to make mapping files from global grids. The simpler +process of extracting just the data needed from existing global files is much faster and easier +to do on even simple systems such as a laptop. + +PTCLMmkdata is a python tool built on top of CLM tools and CESM scripts +for building datasets to run CLM "I" cases for data from Ameriflux Tower-sites, +or other user-supplied single-point datasets. + +Original Authors: + +Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post + +Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) + +R. Quinn Thomas + +Cornell University + +Modified by: + +Erik Kluzek (NCAR) + +General Directory structure: + + PTCLM/PTCLMmkdata ----- Main script + PTCLM/PTCLM_sitedata - Site data files of + static information latitude, longitude, soil info., and PFT information + for each site Also different "groups" of site-data lists, and the script to + convert the transient years landuse_timeseries files into landuse_timeseries text files that + mksurfdata can use. + PTCLM/mydatafiles ----- Default location of + data files that will be created by PTCLMmkdata. Sites will be built + in their own subdirectories under here. Optionally you can give your + own location you'd like to use for your data. + + PTCLM/PTCLMsublist --------- Script to submit a list of PTCLM + sites to the batch que (only setup for a few machines). + PTCLM/PTCLMsublist_prog.py - Python module to support submit + list script. Handles command line arguments and such. + PTCLM/batchque.py ---------- Python module for batch submital. + PTCLM/buildtools ----------- Script to build the CLM + tools needed to run PTCLMmkdata (mksurfdata_map and gen_domain). Works on cheyenne. + +Quickstart: + +# ASSUMPTIONS: +# For this example I'm running a I1PtClm50SpGs case on cheyenne using +# CSMDATA in the standard location +# Finally we use the 6-digit AmeriFlux site code for the University of Mich. Biological +# Station US-UMB (data for this station is checked into the inputdata repository). +# I also assume you are using UNIX C-shell, and GNU make is called gmake +setenv CSMDATA /glade/p/cesm/cseg/inputdata +setenv SITE US-UMB + + +cd PTCLM +setenv MYDATAFILES `pwd`/mydatafiles + +# Next build all of the clm tools you will need +# The following script assumes cheyenne, hobart, or izumi for other machines +# you'll need to build each tool by hand +./buildtools +# next run PTCLMsublist which will submit PTCLMmkdata to batch queue (NOTE -- MAKE SURE python, NCO AND NCL IS IN YOUR PATH) +# PTCLMsublist is only setup for a few batch machines, you'll need to update them to add new machines +# or create your own batch submission script. +# NOTE: Every day you run PTCLMmkdata it will remake the map called +# renamemapfiles to rename files with todays creation date. +# This makes running PTCLMmkdata a reasonable amount of time. +# However, you can use the script in mydatafiles +# +qcmd -l walltime=02:00:00 -- ./PTCLMsublist -l $SITE -d $CSMDATA --account=XXXXXXXXX --mach=cheyenne + +# NOTE: To submit several sites at once, make the "-l" option a comma delimited +# list of site names. + +# Next copy the towersite meterology datafiles into your $MYDATAFILES space +# (For the US-UMB station you can skip this step as the .build step will bring the data over) +cd $MYDATAFILES/1x1pt_$SITE +mkdir $MYDATAFILES/1x1pt_$SITE/CLM1PT_data +# Copy meteorology data NetCDF files into 1x1pt_$SITE sub-directory +# (with filenames of yyyy-mm.nc) +# The variables assumed to be on the files are: +# ZBOT, TBOT, RH, WIND, PRECTmms, FSDS, PSRF, FLDS +# (if other fields are available or with different names this can be changed by +# adding a user_nl_datm.streams.txt file as we outline below) +# Make sure your data has time with the attribute: calendar="gregorian" + +# Make sure the forcing directory points to the location of your data +# (PTCLMmkdata should already do this) +./xmlchange DIN_LOC_ROOT_CLMFORC=$MYDATAFILES/1x1pt_$SITE + +# Then create a case using the data you just created +setenv MYCASE "testPTCLM" +cd $CTSMROOT/cime +setenv CIMEROOT `pwd` +cd $CIMEROOT/scripts +./create_newcase --user-mods-dir $MYDATAFILES/1x1pt_$SITE --case $MYCASE --res CLM_USRDAT --compset I1PtClm50SpGs --mach cheyenne + +# Next setup as normal +cd $MYCASE +./case.setup + +# If you need to customize your list of fields uncomment and do the following... +# cp CaseDocs/datm.streams.txt.CLM1PT.CLM_USRDAT user_datm.streams.txt.CLM1PT.CLM_USRDAT +# chmod u+w user_datm.streams.txt.CLM1PT.CLM_USRDAT +# $EDITOR user_datm.streams.txt.CLM1PT.CLM_USRDAT +# ./preview_namelists + +# Finally build, and run the case as normal +./case.build +./case.submit diff --git a/tools/site_and_regional/PTCLM/README.rst b/tools/site_and_regional/PTCLM/README.rst new file mode 100644 index 0000000000..96f6514b87 --- /dev/null +++ b/tools/site_and_regional/PTCLM/README.rst @@ -0,0 +1,18 @@ +===== +PTCLM +===== + +The PTCLM tool to set up PoinT CLM simulations, +is part of the Community Earth System Model. + +See the CESM web site for documentation and information: + +http://www.cesm.ucar.edu + +NOTE: PTCLM is being deprecated and replaced by a different process + +A limitation of PTCLM was speed and computing requirements. By doing the +same process as for global datasets mapping files for high resolution +datasets needed to be created which even for a single point requires +large computing platforms. The new process modifies existing global datasets +and as such can be done simply even on a laptop. diff --git a/tools/site_and_regional/PTCLM/batchque.py b/tools/site_and_regional/PTCLM/batchque.py new file mode 100644 index 0000000000..37bea8a207 --- /dev/null +++ b/tools/site_and_regional/PTCLM/batchque.py @@ -0,0 +1,256 @@ +######################################################################################### +# +# batchque.py +# +# Python class to handle batch submission of single-processor command-line jobs. +# +######################################################################################### +import os, sys + +class batchque: +#---------------------------------------------------------------------------------------- +# Class to handle batch queue submission +#---------------------------------------------------------------------------------------- + # Class data + setup = False + mach = "" + account = "" + submit = False + jobscript = "" + # + # hash's keyed off the list of machines known + # + # Basic options giving queue name, number of processors (1) and walltime + # yellowstone(LSF): -n 1=1 task, -R=Number of tasks on node, -q=queue name, -N=, -a=process type, -W=wallclock time + # cheyenne(PBS): -l=tasks, processors per node, and wallclock time, -q=queue name, -V=use ALL env variables, + # -m=mail options (ae send mail on submit and exit) + # edison(PBS): -l=tasks, processors per node, and wallclock time, -q=queue name, -V=use ALL env variables, + # -m=mail options (ae send mail on submit and exit) + # -j oe on edison and -oo on yellowstone (without -e/-eo means combine stderr and stdout + opts = { 'yellowstone':"-n 1 -R 'span[ptile=15]' -q geyser -N -a poe ", \ + 'cheyenne' :"-l select=3:ncpus=1:mpiprocs=1:mem=109GB -q regular -V -m ae -j oe ", \ + 'edison' :"-l nodes=1:ppn=1 -q regular -V -m ae -j oe " } + # batch submission command + bsub = { 'yellowstone':"bsub", 'cheyenne':"qsub" , 'edison':"qsub" } + # Option to give file for standard output + bs_stdout = { 'yellowstone':" -oo ", 'cheyenne':" -o " , 'edison':" -o " } + # Option to give job name to use + bs_jobnam = { 'yellowstone':" -J ", 'cheyenne':" -N " , 'edison':" -N " } + # Option to give current directory to use + bs_curdir = { 'yellowstone':" -cwd ", 'cheyenne':"" , 'edison':" -d " } + # Option to give account name to use + bs_accnt = { 'yellowstone':" -P ", 'cheyenne':" -A " , 'edison':"" } + # If jobcommand needs to be script file + bs_script = { 'yellowstone':False, 'cheyenne':True , 'edison':True } + # Option to give wallclock time to use + bs_wtime = { 'yellowstone':" -W ", 'cheyenne':" -l walltime=", 'edison':" -l walltime=" } + + def Initialize( self, prog, mach="cheyenne", account="" ): + "Initialize the batchque" + if ( self.bsub.get(mach) == None ): + print( "List of valid machines: "+str(self.bsub.keys()) ) + prog.error( "Machine NOT in list of valid machines for batch queue: "+mach ) + + self.mach = mach + if ( self.bs_accnt[mach] == "" and account != "" ): + prog.error( "Account entered but this machine does NOT have an account option: "+mach ) + + self.account = account + + self.setup = True + self.submit = False + + def Get_OutFilename( self, prog ): + "Get the output log filename" + if ( not self.setup ): + prog.error( "Trying to get the output filename and Initialize was NOT run first!" ) + if ( not self.submit ): + prog.error( "Trying to get the output filename and Submit was NOT run first!" ) + + return( self.stdout ) + + def Submit( self, prog, jobcommand, curdir=os.getcwd(), jobname="batchjob", wall="4:00", submit=True ): + "Get the command to submit the job to the batch queue" + if ( not self.setup ): + prog.error( "Initialize was NOT run first!" ) + + if ( not os.path.exists(curdir) ): + prog.error( "Input current directory does NOT exist: "+curdir ) + + cmd = self.bsub[self.mach] + opts = "" + pid = str(os.getpid()) + stdout = str(jobname)+"."+pid+".stdout.out" + self.stdout = stdout + opts += self.bs_stdout[self.mach]+stdout+" " + opts += self.bs_jobnam[self.mach]+str(jobname)+" " + if ( self.bs_curdir[self.mach] != "" ): + opts += self.bs_curdir[self.mach]+curdir+" " + opts += self.bs_wtime[self.mach]+wall+" " + if ( self.account != "" and self.bs_accnt[self.mach] != "" ): + opts += self.bs_accnt[self.mach]+self.account+" " + opts += self.opts[self.mach]+" " + if ( self.bs_script[self.mach] ): + self.jobscript = jobname+"."+pid+".job" + if ( os.path.exists( self.jobscript ) ): + os.system( "/bin/rm -rf "+self.jobscript ) + js = open(self.jobscript,"w") + if ( self.bs_curdir[self.mach] == "" ): + js.write( "cd "+curdir+"\n" ) + js.write( jobcommand+"\n" ) + js.close() + os.chmod(self.jobscript,0o555) + cmd += " "+opts+self.jobscript + else: + cmd += " "+opts+jobcommand + + if ( os.path.exists( self.stdout ) ): + os.system( "/bin/rm "+self.stdout ) + if ( submit ): + status = os.system( cmd ) + if ( status != 0 ): + prog.error( "Batch submit returns an error" ) + + self.submit = True + + return( cmd ) + + def SubmitCleanup( self, prog, rmout=False ): + "Cleanup any files made in submit and reset output filename -- only DO AFTER BATCH HAS RUN!" + if ( not self.setup ): + prog.error( "Initialize was NOT run first!" ) + if ( not self.submit ): + prog.error( "Submit was NOT run first!" ) + outfile = self.Get_OutFilename( prog ) + if ( not os.path.exists(outfile) ): + prog.error( "SubmitCleanup called before batch output was returned" ) + + if ( self.bs_script[self.mach] ): + os.system( "/bin/rm -rf "+self.jobscript ) + if ( rmout ): + os.system( "/bin/rm "+outfile ) + + self.submit = False + +# +# Unit testing for above classes +# +import unittest + +class error_prog: + def error( self, desc ): + print( desc ) + sys.exit( 100 ) + +class test_batchque(unittest.TestCase): + + def setUp( self ): + "Setup tests" + self.prog = error_prog() + self.que = batchque() + + def test_badinit( self ): + "test bad initialization" + # Bad machine name + self.assertRaises(SystemExit, self.que.Initialize, self.prog, mach="zztop" ) + # account given on machine without account + self.assertRaises(SystemExit, self.que.Initialize, self.prog, mach="edison", account="thing" ) + # test using submit and Get_OutFilename before Initialization + self.assertRaises(SystemExit, self.que.Submit, self.prog, "ls" ) + self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) + # Test that all hashes have the same list of keys + keylist = str(self.que.opts.keys()) + self.assertTrue(keylist == str(self.que.bsub.keys()) ) + self.assertTrue(keylist == str(self.que.bs_stdout.keys()) ) + self.assertTrue(keylist == str(self.que.bs_jobnam.keys()) ) + self.assertTrue(keylist == str(self.que.bs_accnt.keys()) ) + self.assertTrue(keylist == str(self.que.bs_curdir.keys()) ) + + def test_init( self ): + "test initialization and submit" + + machlist = self.que.opts.keys() + for mach in machlist: + print( "Test initialization for: "+mach ) + self.que.Initialize( self.prog, mach=mach ) + cmd = self.que.Submit( self.prog, "ls", jobname=mach, submit=False ) + print( cmd+"\n" ) + outfile = self.que.Get_OutFilename( self.prog ) + os.system( "touch "+outfile ) + self.que.SubmitCleanup( self.prog, rmout=True ) + + mach = "cheyenne" + self.que.Initialize( self.prog, mach=mach, account="account" ) + cmd = self.que.Submit( self.prog, "ls", jobname=mach, submit=False ) + print( cmd+"\n" ) + outfile = self.que.Get_OutFilename( self.prog ) + os.system( "touch "+outfile ) + print( "outfile: "+outfile ) + self.que.SubmitCleanup( self.prog, rmout=True ) + + def test_bad_submit( self ): + "test bad submit" + mach = "cheyenne" + self.que.Initialize( self.prog, mach=mach, account="account" ) + self.assertRaises(SystemExit, self.que.Submit, self.prog, "ls", curdir="zztop", jobname=mach, submit=False ) + self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) + + def test_submit( self ): + "test submitting to local machine if on list" + stdout = os.popen("hostname") + host = stdout.read().rstrip( ) + startname = { 'ys':'yellowstone', 'cheyenne':'cheyenne', 'edison':'edison' } + mach = "" + for sname in startname: + if ( host.startswith(sname) ): + mach = startname[sname] + if ( mach != "" ): + if ( mach == "yellowstone" ): + account = "CESM0008" + elif ( mach == "cheyenne" ): + account = "P93300606" + else: + account = "" + self.que.Initialize( self.prog, mach=mach, account=account ) + else: + print( "Machine not known, so NOT trying a test submit" ) + return + + print( "Submit ls to batch queue" ) + # Submit and get the output filename + scmd = "ls PTCLMmkdata" + wall = "0:01" + cmd = self.que.Submit( self.prog, scmd, jobname=mach, wall=wall, submit=False ) + print( "submit: "+cmd ) + outfile = self.que.Get_OutFilename( self.prog ) + # make sure SubmitCleanup will fail since it wasn't submitted yet and output not returned + self.assertRaises(SystemExit, self.que.SubmitCleanup, self.prog ) + status = os.system( cmd ) + self.assertTrue( status == 0 ) + iter = 0 + exists = os.path.exists(outfile) + while( status == 0 and iter < 100 and not exists ): + iter += 1 + exists = os.path.exists(outfile) + if ( not exists ): + print( "Sleep for a bit to check if outfile was created yet" ) + os.system( "sleep 20" ) + else: + print( "Out file created cat it... should be ls of PTCLMmkdata" ) + self.assertTrue( os.path.exists(outfile) ) + os.system( "cat "+outfile ) + + # Cleanup after the submital + self.que.SubmitCleanup( self.prog, rmout=True ) + + # make sure files were deleted and submit status changed + self.assertTrue( not self.que.submit ) + self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) + self.assertTrue( not os.path.exists(outfile) ) + if ( self.que.jobscript != "" ): + self.assertTrue( not os.path.exists(self.que.jobscript) ) + # Now test that a bad submit returns an error (give bad walltime) + self.assertRaises(SystemExit, self.que.Submit, self.prog, scmd, jobname=mach, wall="--zztop" ) + +if __name__ == '__main__': + unittest.main() diff --git a/tools/site_and_regional/PTCLM/buildtools b/tools/site_and_regional/PTCLM/buildtools new file mode 100755 index 0000000000..a3579e38c0 --- /dev/null +++ b/tools/site_and_regional/PTCLM/buildtools @@ -0,0 +1,149 @@ +#!/bin/bash +# +# buildtools +# +# Build the clm tools that PTCLM will need to run when creating files. +# +# Environment variables to set: +# +# CTSM_ROOT: To build with a separate root to CTSM component set the +# env variable CTSM_ROOT to the root directory to use. +# +# CIME_ROOT: To build with a separate root to CIME scripts set the +# env variable CIME_ROOT to the root directory to use. +# + +pwd=`pwd` +host=`hostname` +echo "Build clm tools for PTCLM on "$host"" + +# +# Get path to root +# +if [ -z "$CTSM_ROOT" ]; then + cd "../../.." + CTSM_ROOT=`pwd` + cd - +fi +if [ ! -d "$CTSM_ROOT" ];then + echo "Directory $CTSM_ROOT does not exist" + echo "Set env variable CTSM_ROOT" + exit -1 +fi +if [ ! -d "$CTSM_ROOT/src/biogeophys" ];then + echo "Directory $CTSM_ROOT/src/biogeophys does not exist as expected" + echo "Set env variable CTSM_ROOT to directory at head of CTSM code" + exit -1 +fi +if [ -z "$CIME_ROOT" ]; then + if [ ! -d "$CTSM_ROOT/cime" ]; then + cd "$CTSM_ROOT/../../cime" + CIME_ROOT=`pwd` + cd - + else + cd "$CTSM_ROOT/cime" + CIME_ROOT=`pwd` + cd - + fi +fi +if [ ! -d "$CIME_ROOT" ];then + echo "Directory $CIME_ROOT does not exist" + echo "Set env variable CIME_ROOT" + exit -1 +fi +# +# Machine dependent stuff +# +CIME_MODEL="cesm" +export CIME_MODEL +toolsmake="" +if [[ "$host" =~ cheyenne ]] || [[ "$host" =~ r[0-9]+i[0-9]+n[0-9]+ ]]|| [[ "$host" =~ caldera ]] || [[ "$host" =~ geyser ]] || [[ "$host" =~ pronghorn ]]; then + echo "Setup for cheyenne" + . /glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh + + gmake="gmake" + parcmp=36 + machine="cheyenne" + compiler="intel" + netcdf=$NETCDF + module load $compiler + module load mkl + module load netcdf + module load ncl +elif [[ "$host" =~ hobart ]] || [[ "$host" =~ h[0-9]+.cgd.ucar.edu ]]; then + echo "Setup for hobart" + . /usr/share/Modules/init/sh + gmake="gmake" + parcmp=2 + machine="hobart" + compiler="intel" + module load compiler/intel + netcdf=$NETCDF_PATH + export PATH="${PATH}:/usr/bin" +elif [[ "$host" =~ izumi ]] || [[ "$host" =~ i[0-9]+.unified ]]; then + echo "Setup for izumi" + . /usr/share/Modules/init/sh + gmake="gmake" + parcmp=2 + machine="izumi" + compiler="intel" + module load compiler/intel + netcdf=$NETCDF_PATH + export PATH="${PATH}:/usr/bin" +elif [[ "$host" =~ eureka ]] || [[ "$host" =~ vpn ]]; then + echo "Setup for eureka" + gmake="make" + parcmp=12 + machine="homebrew" + compiler="gnu" + netcdf="/opt/local" + toolsmake="USER_FC=gfortran-mp-4.8 USER_LINKER=gfortran-mp-4.8 USER_CC=gcc " + case='$CASE' + export NETCDF_PATH=$netcdf +else + echo "Bad host to run on: know about cheyenne, hobart, izumi or eureka" + exit -3 +fi +export INC_NETCDF=${netcdf}/include +export LIB_NETCDF=${netcdf}/lib +# +# Build the tools +# +echo "Build the tools" +dirs=( \ + $CTSM_ROOT/tools/mksurfdata_map/src \ + $CIME_ROOT/tools/mapping/gen_domain_files/src \ + ) +for dir in ${dirs[*]}; do + echo "Build in $dir" + cd $dir + if [[ "$dir" =~ gen_domain ]]; then + rm env_mach_specific.xml + cmd="$CIME_ROOT/tools/configure --machine $machine --macros-format Makefile" + echo "$cmd" + $cmd + if [ $? != 0 ]; then + echo "Problem with configure: $?" + exit -1 + fi + #. ./.env_mach_specific.sh # don't use this as it currently doesn't work for mpi-serial + #cmd="ln -s $dirs/Macros.make $dirs/Macros" + #echo "$cmd" + #$cmd + fi + $gmake clean + cmd="$gmake OPT=TRUE SMP=TRUE -j $parcmp COMPILER=$compiler OS=LINUX MPILIB=mpi-serial $toolsmake" + echo "$cmd" + $cmd + if [ $? != 0 ]; then + echo "Problem with build: $?" + exit -1 + fi + if [[ "$dir" =~ gen_domain ]]; then + /bin/rm *.o + else + $gmake clean + fi +done + +echo -e "\n\nSuccessfully built CLM tools needed to create datasets for PTCLM\n" From 62cf74a6bee4df6620faf6a7450301d648e31f0d Mon Sep 17 00:00:00 2001 From: marius Date: Mon, 10 Oct 2022 16:10:20 +0200 Subject: [PATCH 2/3] All changes required to the use of frosthard and hydrohard in FATES (optionf the hardening of plants) --- bld/CLMBuildNamelist.pm | 5 +- bld/namelist_files/namelist_defaults_ctsm.xml | 2 + .../namelist_definition_ctsm.xml | 12 ++ src/main/atm2lndType.F90 | 130 +++++++++++++++++- src/main/clm_varctl.F90 | 2 + src/main/controlMod.F90 | 7 +- src/utils/clmfates_interfaceMod.F90 | 35 +++++ 7 files changed, 188 insertions(+), 5 deletions(-) diff --git a/bld/CLMBuildNamelist.pm b/bld/CLMBuildNamelist.pm index d9eeb1e5a0..92c10b2234 100755 --- a/bld/CLMBuildNamelist.pm +++ b/bld/CLMBuildNamelist.pm @@ -773,7 +773,7 @@ sub setup_cmdl_fates_mode { } else { # dis-allow fates specific namelist items with non-fates runs my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", - "use_fates_cohort_age_tracking", + "use_fates_cohort_age_tracking","use_fates_hydrohard","use_fates_frosthard", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp","use_fates_sp","fates_inventory_ctrl_filename","use_fates_logging","fates_parteh_mode","use_fates_tree_damage" ); # dis-allow fates specific namelist items with non-fates runs foreach my $var ( @list ) { @@ -4114,7 +4114,8 @@ sub setup_logic_fates { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, 'fates_paramfile', 'phys'=>$nl_flags->{'phys'}); my @list = ( "fates_spitfire_mode", "use_fates_planthydro", "use_fates_ed_st3", "use_fates_ed_prescribed_phys", "use_fates_inventory_init","use_fates_fixed_biogeog","use_fates_nocomp", - "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage" ); + "use_fates_logging","fates_parteh_mode", "use_fates_cohort_age_tracking","use_fates_tree_damage", + "use_fates_hydrohard","use_fates_frosthard"); foreach my $var ( @list ) { add_default($opts, $nl_flags->{'inputdata_rootdir'}, $definition, $defaults, $nl, $var, 'use_fates'=>$nl_flags->{'use_fates'}, 'use_fates_sp'=>$nl_flags->{'use_fates_sp'} ); diff --git a/bld/namelist_files/namelist_defaults_ctsm.xml b/bld/namelist_files/namelist_defaults_ctsm.xml index 2686d62b9a..45ecc4ee87 100644 --- a/bld/namelist_files/namelist_defaults_ctsm.xml +++ b/bld/namelist_files/namelist_defaults_ctsm.xml @@ -2541,6 +2541,8 @@ lnd/clm2/surfdata_map/release-clm5.0.30/surfdata_ne0np4.CONUS.ne30x8_hist_78pfts 0 .false. +.false. +.false. .false. .false. .false. diff --git a/bld/namelist_files/namelist_definition_ctsm.xml b/bld/namelist_files/namelist_definition_ctsm.xml index a08795dd1f..8dabe6842e 100644 --- a/bld/namelist_files/namelist_definition_ctsm.xml +++ b/bld/namelist_files/namelist_definition_ctsm.xml @@ -687,6 +687,18 @@ Toggle to turn on plant hydraulics (Only relevant if FATES is on) + + Toggle to turn on plant hydrohard (only relevant if FATES is on). + (use_fates_hydrohard=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) + + + + Toggle to turn on plant frosthard (only relevant if FATES is on). + (use_fates_frosthard=".true." is EXPERIMENTAL NOT SUPPORTED! Nor is it Tested!) + + Toggle to turn on cohort age tracking (by default FATES only tracks age of patches) diff --git a/src/main/atm2lndType.F90 b/src/main/atm2lndType.F90 index 53013caf24..0459e63874 100644 --- a/src/main/atm2lndType.F90 +++ b/src/main/atm2lndType.F90 @@ -11,6 +11,7 @@ module atm2lndType use clm_varpar , only : numrad, ndst, nlevgrnd !ndst = number of dust bins. use clm_varcon , only : rair, grav, cpair, hfus, tfrz, spval use clm_varctl , only : iulog, use_c13, use_cn, use_lch4, use_cndv, use_fates, use_luna + use clm_varctl , only : use_fates_hydrohard,use_fates_frosthard use decompMod , only : bounds_type use abortutils , only : endrun use PatchType , only : patch @@ -114,6 +115,12 @@ module atm2lndType real(r8) , pointer :: wind24_patch (:) => null() ! patch 24-hour running mean of wind real(r8) , pointer :: t_mo_patch (:) => null() ! patch 30-day average temperature (Kelvin) real(r8) , pointer :: t_mo_min_patch (:) => null() ! patch annual min of t_mo (Kelvin) + real(r8) , pointer :: temp24_patch (:) => null() ! patch 24hr average of temperature + real(r8) , pointer :: tmin24_patch (:) => null() ! patch 24hr average of minimum temperature + real(r8) , pointer :: tmin24_inst_patch (:) => null() ! patch 24hr average of temprary temperature + real(r8) , pointer :: t_mean_5yr_patch (:) => null() ! patch 5 year mean of minimum yearly 2 m height surface air temperature (K) + real(r8) , pointer :: t_min_yr_patch (:) => null() + real(r8) , pointer :: t_min_yr_inst_patch (:) => null() contains @@ -508,6 +515,14 @@ subroutine InitAllocate(this, bounds) allocate(this%fsd240_patch (begp:endp)) ; this%fsd240_patch (:) = nan allocate(this%fsi24_patch (begp:endp)) ; this%fsi24_patch (:) = nan allocate(this%fsi240_patch (begp:endp)) ; this%fsi240_patch (:) = nan + if (use_fates_hydrohard .or. use_fates_frosthard) then + allocate(this%temp24_patch (begp:endp)) ; this%temp24_patch (:) = nan + allocate(this%tmin24_patch (begp:endp)) ; this%tmin24_patch (:) = nan + allocate(this%tmin24_inst_patch (begp:endp)) ; this%tmin24_inst_patch (:) = nan + allocate(this%t_min_yr_patch (begp:endp)) ; this%t_min_yr_patch (:) = nan + allocate(this%t_min_yr_inst_patch (begp:endp)) ; this%t_min_yr_inst_patch (:) = nan + allocate(this%t_mean_5yr_patch (begp:endp)) ; this%t_mean_5yr_patch (:) = nan + end if if (use_fates) then allocate(this%wind24_patch (begp:endp)) ; this%wind24_patch (:) = nan end if @@ -664,6 +679,17 @@ subroutine InitHistory(this, bounds) ptr_patch=this%forc_pbot240_downscaled_patch, default='inactive') endif + if (use_fates_hydrohard .or. use_fates_frosthard) then + this%temp24_patch(begp:endp) = spval + call hist_addfld1d (fname='TEMP24_CLM', units='K', & + avgflag='A', long_name='mean temp for hardening', & + ptr_patch=this%temp24_patch, default='active') + this%tmin24_patch(begp:endp) = spval + call hist_addfld1d (fname='TMIN24_CLM', units='K', & + avgflag='A', long_name='min temp for hardening', & + ptr_patch=this%tmin24_patch, default='active') + endif + end subroutine InitHistory !----------------------------------------------------------------------- @@ -724,6 +750,18 @@ subroutine InitAccBuffer (this, bounds) call init_accum_field (name='pbot240', units='Pa', & desc='10-day running mean of air pressure', accum_type='runmean', accum_period=-10, & subgrid_type='pft', numlev=1, init_value=101325._r8) + endif + + if (use_fates_hydrohard .or. use_fates_frosthard) then + this%temp24_patch(bounds%begp:bounds%endp) = spval + call init_accum_field (name='TEMP24', units='K', & + desc='24hr average temperature', accum_type='timeavg', accum_period=-1, & + subgrid_type='pft', numlev=1, init_value=0.0_r8) + + this%t_mean_5yr_patch(bounds%begp:bounds%endp) = spval + call init_accum_field (name='THARD5', units='K', & + desc='5 year average of yearly min 2-m temperature for hardening', accum_type='runmean', accum_period=-5, & + subgrid_type='pft', numlev=1, init_value=0.0_r8) endif @@ -741,6 +779,7 @@ subroutine InitAccVars(this, bounds) ! !USES use accumulMod , only : extract_accum_field use clm_time_manager , only : get_nstep + use clm_varctl , only : nsrest, nsrStartup ! ! !ARGUMENTS: class(atm2lnd_type) :: this @@ -810,6 +849,20 @@ subroutine InitAccVars(this, bounds) endif + if (use_fates_hydrohard .or. use_fates_frosthard) then + call extract_accum_field ('TEMP24', rbufslp, nstep) + this%temp24_patch(begp:endp) = rbufslp(begp:endp) + + call extract_accum_field ('THARD5', rbufslp, nstep) + this%t_mean_5yr_patch(begp:endp) = rbufslp(begp:endp) + + if (nsrest == nsrStartup) then + this%t_min_yr_patch(begp:endp) = spval + this%tmin24_patch(begp:endp) = spval + this%t_min_yr_inst_patch(begp:endp) = spval + end if + end if + deallocate(rbufslp) deallocate(rbufslc) @@ -819,7 +872,8 @@ end subroutine InitAccVars subroutine UpdateAccVars (this, bounds) ! ! USES - use clm_time_manager, only : get_nstep + use clm_time_manager, only : get_nstep,get_step_size + use clm_time_manager, only : is_end_curr_year,is_end_curr_day,get_curr_date use accumulMod , only : update_accum_field, extract_accum_field ! ! !ARGUMENTS: @@ -831,16 +885,23 @@ subroutine UpdateAccVars (this, bounds) integer :: dtime ! timestep size [seconds] integer :: nstep ! timestep number integer :: ier ! error status + integer :: year ! year (0, ...) for nstep + integer :: month ! month (1, ..., 12) for nstep + integer :: day ! day of month (1, ..., 31) for nstep + integer :: secs ! seconds into current date for nstep integer :: begp, endp integer :: begc, endc real(r8), pointer :: rbufslp(:) ! temporary single level - patch level real(r8), pointer :: rbufslc(:) ! temporary single level - column level + logical :: end_cd ! temporary for is_end_curr_day() value + logical :: end_yr ! temporary for is_end_curr_year() value !--------------------------------------------------------------------- begp = bounds%begp; endp = bounds%endp begc = bounds%begc; endc = bounds%endc - + dtime = get_step_size() nstep = get_nstep() + call get_curr_date (year, month, day, secs) ! Allocate needed dynamic memory for single level patch field allocate(rbufslp(begp:endp), stat=ier) @@ -876,6 +937,48 @@ subroutine UpdateAccVars (this, bounds) call extract_accum_field ('FSI240', this%fsi240_patch , nstep) + if (use_fates_hydrohard .or. use_fates_frosthard) then + do p = begp,endp + c = patch%column(p) + rbufslp(p) = this%forc_t_downscaled_col(c) + end do + call update_accum_field ('TEMP24' , rbufslp , nstep) + call extract_accum_field ('TEMP24' , this%temp24_patch , nstep) + end_cd = is_end_curr_day() + do p = begp,endp + if (rbufslp(p) /= spval) then + this%tmin24_inst_patch(p) = min(rbufslp(p), this%tmin24_inst_patch(p)) + endif + if (end_cd) then + this%tmin24_patch(p) = this%tmin24_inst_patch(p) + this%tmin24_inst_patch(p) = spval + else if (secs == dtime) then + this%tmin24_patch(p) = spval + endif + end do + do p = begp,endp + this%temp24_patch(p) = rbufslp(p) + end do + ! Start 1 year minimum temperature loop for hardening + end_yr = is_end_curr_year() + do p = begp,endp + if (rbufslp(p) /= spval) then + this%t_min_yr_inst_patch(p) = min(rbufslp(p), this%t_min_yr_inst_patch(p)) + endif + if (end_yr) then + this%t_min_yr_patch(p) = this%t_min_yr_inst_patch(p) + rbufslp(p)=this%t_min_yr_inst_patch(p) + this%t_min_yr_inst_patch(p) = spval + else if (secs == dtime) then + this%t_min_yr_patch(p) = spval + endif + end do + if (end_yr) then + call update_accum_field ('THARD5', rbufslp, nstep) + call extract_accum_field ('THARD5', this%t_mean_5yr_patch, nstep) + end if + endif + if (use_cndv) then ! Accumulate and extract TDA (accumulates TBOT as 30-day average) and @@ -968,6 +1071,21 @@ subroutine Restart(this, bounds, ncid, flag) interpinic_flag='interp', readvar=readvar, data=this%forc_pbot240_downscaled_patch ) endif + if (use_fates_hydrohard .or. use_fates_frosthard) then + call restartvar(ncid=ncid, flag=flag, varname='THARD5', xtype=ncd_double, & + dim1name='pft', & + long_name='5 year average of min yearly 2-m temperature for hardening', units='K', & + interpinic_flag='interp', readvar=readvar, data=this%t_mean_5yr_patch) + call restartvar(ncid=ncid, flag=flag, varname='T1yrinst', xtype=ncd_double, & + dim1name='pft', & + long_name='instantenious 1yr min temperature', units='K', & + interpinic_flag='interp', readvar=readvar, data=this%t_min_yr_inst_patch) + call restartvar(ncid=ncid, flag=flag, varname='TEMP24', xtype=ncd_double, & + dim1name='pft', & + long_name='24h average temperature', units='K', & + interpinic_flag='interp', readvar=readvar, data=this%temp24_patch) + end if + end subroutine Restart !----------------------------------------------------------------------- @@ -1027,6 +1145,14 @@ subroutine Clean(this) deallocate(this%fsi240_patch) if (use_fates) then deallocate(this%wind24_patch) + if (use_fates_hydrohard .or. use_fates_frosthard) then + deallocate(this%temp24_patch) + deallocate(this%tmin24_patch) + deallocate(this%tmin24_inst_patch) + deallocate(this%t_mean_5yr_patch) + deallocate(this%t_min_yr_inst_patch) + deallocate(this%t_min_yr_patch) + end if end if deallocate(this%t_mo_patch) deallocate(this%t_mo_min_patch) diff --git a/src/main/clm_varctl.F90 b/src/main/clm_varctl.F90 index 9be9af2f73..b4e39a1812 100644 --- a/src/main/clm_varctl.F90 +++ b/src/main/clm_varctl.F90 @@ -261,6 +261,8 @@ module clm_varctl logical, public :: use_fates_tree_damage = .false. ! true => turn on tree damage module logical, public :: use_fates_logging = .false. ! true => turn on logging module logical, public :: use_fates_planthydro = .false. ! true => turn on fates hydro + logical, public :: use_fates_hydrohard = .false. ! true => turn on fates hydrohard + logical, public :: use_fates_frosthard = .false. ! true => turn on fates frosthard logical, public :: use_fates_cohort_age_tracking = .false. ! true => turn on cohort age tracking logical, public :: use_fates_ed_st3 = .false. ! true => static stand structure logical, public :: use_fates_ed_prescribed_phys = .false. ! true => prescribed physiology diff --git a/src/main/controlMod.F90 b/src/main/controlMod.F90 index a07228aa0d..52f558721b 100644 --- a/src/main/controlMod.F90 +++ b/src/main/controlMod.F90 @@ -230,7 +230,8 @@ subroutine control_init(dtime) use_fates_sp, & fates_inventory_ctrl_filename, & fates_parteh_mode, & - use_fates_tree_damage + use_fates_tree_damage, & + use_fates_hydrohard,use_fates_frosthard ! Ozone vegetation stress method namelist / clm_inparam / o3_veg_stress_method @@ -706,6 +707,8 @@ subroutine control_spmd() call mpi_bcast (fates_spitfire_mode, 1, MPI_INTEGER, 0, mpicom, ier) call mpi_bcast (use_fates_logging, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_planthydro, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_hydrohard, 1, MPI_LOGICAL, 0, mpicom, ier) + call mpi_bcast (use_fates_frosthard, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_tree_damage, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_cohort_age_tracking, 1, MPI_LOGICAL, 0, mpicom, ier) call mpi_bcast (use_fates_ed_st3, 1, MPI_LOGICAL, 0, mpicom, ier) @@ -1050,6 +1053,8 @@ subroutine control_print () write(iulog, *) ' fates_paramfile = ', fates_paramfile write(iulog, *) ' fates_parteh_mode = ', fates_parteh_mode write(iulog, *) ' use_fates_planthydro = ', use_fates_planthydro + write(iulog, *) ' use_fates_hydrohard = ', use_fates_hydrohard + write(iulog, *) ' use_fates_frosthard = ', use_fates_frosthard write(iulog, *) ' use_fates_tree_damage = ', use_fates_tree_damage write(iulog, *) ' use_fates_cohort_age_tracking = ', use_fates_cohort_age_tracking write(iulog, *) ' use_fates_ed_st3 = ',use_fates_ed_st3 diff --git a/src/utils/clmfates_interfaceMod.F90 b/src/utils/clmfates_interfaceMod.F90 index 9a04a9d66f..5c2bbfe328 100644 --- a/src/utils/clmfates_interfaceMod.F90 +++ b/src/utils/clmfates_interfaceMod.F90 @@ -52,6 +52,8 @@ module CLMFatesInterfaceMod use clm_varctl , only : fates_spitfire_mode use clm_varctl , only : use_fates_tree_damage use clm_varctl , only : use_fates_planthydro + use clm_varctl , only : use_fates_hydrohard + use clm_varctl , only : use_fates_frosthard use clm_varctl , only : use_fates_cohort_age_tracking use clm_varctl , only : use_fates_ed_st3 use clm_varctl , only : use_fates_ed_prescribed_phys @@ -349,6 +351,8 @@ subroutine CLMFatesGlobals2() integer :: pass_logging integer :: pass_ed_prescribed_phys integer :: pass_planthydro + integer :: pass_hydrohard + integer :: pass_frosthard integer :: pass_inventory_init integer :: pass_is_restart integer :: pass_cohort_age_tracking @@ -463,6 +467,20 @@ subroutine CLMFatesGlobals2() pass_planthydro = 0 end if call set_fates_ctrlparms('use_planthydro',ival=pass_planthydro) + + if(use_fates_hydrohard) then + pass_hydrohard = 1 + else + pass_hydrohard = 0 + end if + call set_fates_ctrlparms('use_hydrohard',ival=pass_hydrohard) + + if(use_fates_frosthard) then + pass_frosthard = 1 + else + pass_frosthard = 0 + end if + call set_fates_ctrlparms('use_frosthard',ival=pass_frosthard) if(use_fates_cohort_age_tracking) then pass_cohort_age_tracking = 1 @@ -974,6 +992,23 @@ subroutine dynamics_driv(this, nc, bounds_clump, & this%fates(nc)%bc_in(s)%h2o_liq_sisl(1:nlevsoil) = waterstatebulk_inst%h2osoi_liq_col(c,1:nlevsoil) end if + if (use_fates_hydrohard .or. use_fates_frosthard) then + this%fates(nc)%bc_in(s)%temp24_si = & + atm2lnd_inst%temp24_patch(col%patchi(c)) + + this%fates(nc)%bc_in(s)%t_mean_5yr_si = & + atm2lnd_inst%t_mean_5yr_patch(col%patchi(c)) + + this%fates(nc)%bc_in(s)%t_min_yr_inst_si = & + atm2lnd_inst%t_min_yr_inst_patch(col%patchi(c)) + + this%fates(nc)%bc_in(s)%tmin24_si = & + atm2lnd_inst%tmin24_patch(col%patchi(c)) + + this%fates(nc)%bc_in(s)%dayl_si = grc%dayl(col%gridcell(c)) + this%fates(nc)%bc_in(s)%prev_dayl_si = grc%prev_dayl(col%gridcell(c)) + endif + ! get the harvest data, which is by gridcell ! for now there is one veg column per gridcell, so store all harvest data in each site ! this will eventually change From 5440b8f22d8be5efca0121414f3c15424c492f22 Mon Sep 17 00:00:00 2001 From: marius Date: Mon, 10 Oct 2022 16:17:54 +0200 Subject: [PATCH 3/3] Revert "add tools/site_and_regional/PTCLM/" This reverts commit c07e3969aeaaa0b9c666a152178b309c1400611f. --- tools/site_and_regional/PTCLM/.gitignore | 38 - .../PTCLM/CODE_OF_CONDUCT.md | 84 -- tools/site_and_regional/PTCLM/ChangeLog | 1184 ----------------- tools/site_and_regional/PTCLM/LICENSE | 34 - .../PTCLM_sitedata/PTCLMDATA_pftdata.txt | 44 - .../PTCLM_sitedata/PTCLMDATA_sitedata.txt | 44 - .../PTCLM_sitedata/PTCLMDATA_soildata.txt | 44 - .../PTCLM_sitedata/US-Ha1_dynpftdata.txt | 4 - ...vrt_trnsyrs2_landuse_timeseries_txtfile.pl | 261 ---- tools/site_and_regional/PTCLM/PTCLMmkdata | 713 ---------- tools/site_and_regional/PTCLM/PTCLMsublist | 16 - .../PTCLM/PTCLMsublist_prog.py | 214 --- tools/site_and_regional/PTCLM/README | 118 -- tools/site_and_regional/PTCLM/README.rst | 18 - tools/site_and_regional/PTCLM/batchque.py | 256 ---- tools/site_and_regional/PTCLM/buildtools | 149 --- 16 files changed, 3221 deletions(-) delete mode 100644 tools/site_and_regional/PTCLM/.gitignore delete mode 100644 tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md delete mode 100644 tools/site_and_regional/PTCLM/ChangeLog delete mode 100644 tools/site_and_regional/PTCLM/LICENSE delete mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt delete mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt delete mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt delete mode 100644 tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt delete mode 100755 tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl delete mode 100755 tools/site_and_regional/PTCLM/PTCLMmkdata delete mode 100755 tools/site_and_regional/PTCLM/PTCLMsublist delete mode 100644 tools/site_and_regional/PTCLM/PTCLMsublist_prog.py delete mode 100644 tools/site_and_regional/PTCLM/README delete mode 100644 tools/site_and_regional/PTCLM/README.rst delete mode 100644 tools/site_and_regional/PTCLM/batchque.py delete mode 100755 tools/site_and_regional/PTCLM/buildtools diff --git a/tools/site_and_regional/PTCLM/.gitignore b/tools/site_and_regional/PTCLM/.gitignore deleted file mode 100644 index cbfbc8c22a..0000000000 --- a/tools/site_and_regional/PTCLM/.gitignore +++ /dev/null @@ -1,38 +0,0 @@ -# ignore svn directories -**/.svn/** -.svn/ - -# binary files -*.nc - -# editor files -*.swp -*~ - -# mac files -.DS_Store - -# cmake generated files -build/ -CMakeFiles/ - -# don't ignore cism build utilities directory -!components/cism/**/build - -# build output -*.o -*.mod -core.* -core-* -*.gz -*.log !run.log -*.pyc - -# batch output -*.*.job - -# test and case directories -test/ -scripts/testreporter.pl - -mydatafiles/* diff --git a/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md b/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md deleted file mode 100644 index 29205157f0..0000000000 --- a/tools/site_and_regional/PTCLM/CODE_OF_CONDUCT.md +++ /dev/null @@ -1,84 +0,0 @@ -# Contributor Code of Conduct -_The Contributor Code of Conduct is for participants in our software projects and community._ - -## Our Pledge -We, as contributors, creators, stewards, and maintainers (participants), of PTCLM (Point-Community Land Model) pledge to make participation in our software, system or hardware project and community a safe, productive, welcoming and inclusive experience for everyone. -All participants are required to abide by this Code of Conduct. -This includes respectful treatment of everyone regardless of age, body size, disability, ethnicity, gender identity or expression, level of experience, nationality, political affiliation, veteran status, pregnancy, genetic information, physical appearance, race, religion, or sexual orientation, as well as any other characteristic protected under applicable US federal or state law. - -## Our Standards -Examples of behaviors that contribute to a positive environment include: - -* All participants are treated with respect and consideration, valuing a diversity of views and opinions -* Be considerate, respectful, and collaborative -* Communicate openly with respect for others, critiquing ideas rather than individuals and gracefully accepting criticism -* Acknowledging the contributions of others -* Avoid personal attacks directed toward other participants -* Be mindful of your surroundings and of your fellow participants -* Alert UCAR staff and suppliers/vendors if you notice a dangerous situation or someone in distress -* Respect the rules and policies of the project and venue - -Examples of unacceptable behavior include, but are not limited to: - -* Harassment, intimidation, or discrimination in any form -* Physical, verbal, or written abuse by anyone to anyone, including repeated use of pronouns other than those requested -* Unwelcome sexual attention or advances -* Personal attacks directed at other guests, members, participants, etc. -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Alarming, intimidating, threatening, or hostile comments or conduct -* Inappropriate use of nudity and/or sexual images -* Threatening or stalking anyone, including a participant -* Other conduct which could reasonably be considered inappropriate in a professional setting - -## Scope -This Code of Conduct applies to all spaces managed by the Project whether they be physical, online or face-to-face. -This includes project code, code repository, associated web pages, documentation, mailing lists, project websites and wiki pages, issue tracker, meetings, telecons, events, project social media accounts, and any other forums created by the project team which the community uses for communication. -In addition, violations of this Code of Conduct outside these spaces may affect a person's ability to participate within them. -Representation of a project may be further defined and clarified by project maintainers. - -## Community Responsibilities -Everyone in the community is empowered to respond to people who are showing unacceptable behavior. -They can talk to them privately or publicly. -Anyone requested to stop unacceptable behavior is expected to comply immediately. -If the behavior continues concerns may be brought to the project administrators or to any other party listed in the [Reporting](#reporting) section below. - -## Project Administrator Responsibilities -Project administrators are responsible for clarifying the standards of acceptable behavior and are encouraged to model appropriate behavior and provide support when people in the community point out inappropriate behavior. -Project administrator(s) are normally the ones that would be tasked to carry out the actions in the [Consequences](#consequences) section below. - -Project administrators are also expected to keep this Code of Conduct updated with the main one housed at UCAR, as listed below in the [Attribution](#attribution) section. - -## Reporting -Instances of unacceptable behavior can be brought to the attention of the project administrator(s) who may take any action as outlined in the [Consequences](#consequences) section below. -However, making a report to a project administrator is not considered an 'official report' to UCAR. - -Instances of unacceptable behavior may also be reported directly to UCAR pursuant to [UCAR's Harassment Reporting and Complaint Procedure](https://www2.fin.ucar.edu/procedures/hr/harassment-reporting-and-complaint-procedure), or anonymously through [UCAR's EthicsPoint Hotline](https://www2.fin.ucar.edu/ethics/anonymous-reporting). - -Complaints received by UCAR will be handled pursuant to the procedures outlined in UCAR's Harassment Reporting and Complaint Procedure. -Complaints to UCAR will be held as confidential as practicable under the circumstances, and retaliation against a person who initiates a complaint or an inquiry about inappropriate behavior will not be tolerated. - -Any Contributor can use these reporting methods even if they are not directly affiliated with UCAR. -The Frequently Asked Questions (FAQ) page for reporting is [here](https://www2.fin.ucar.edu/procedures/hr/reporting-faqs). - -## Consequences -Upon receipt of a complaint, the project administrator(s) may take any action deemed necessary and appropriate under the circumstances. -Such action can include things such as: removing, editing, or rejecting comments, commits, code, wiki edits, email, issues, and other contributions that are not aligned to this Code of Conduct, or banning temporarily or permanently any contributor for other behaviors that are deemed inappropriate, threatening, offensive, or harmful. -Project administrators also have the right to report violations to UCAR HR and/or UCAR's Office of Diversity, Equity and Inclusion (ODEI), as well as a participant's home institution and/or law enforcement. -In the event an incident is reported to UCAR, UCAR will follow its Harassment Reporting and Complaint Procedure. - -## Process for Changes -All UCAR managed projects are required to adopt this Contributor Code of Conduct. -Adoption is assumed even if not expressly stated in the repository. -Projects should fill in sections where prompted with project-specific information, including, project name and adoption date. - -Projects that adopt this Code of Conduct need to stay up to date with UCAR's Contributor Code of Conduct, linked with a DOI in the [Attribution](#attribution) section below. -Projects can make limited substantive changes to the Code of Conduct, however, the changes must be limited in scope and may not contradict the UCAR Contributor Code of Conduct. - -## Attribution -This Code of Conduct was originally adapted from the [Contributor Covenant](http://contributor-covenant.org/version/1/4), version 1.4. -We then aligned it with the UCAR Participant Code of Conduct, which also borrows from the American Geophysical Union (AGU) Code of Conduct. -The UCAR Participant Code of Conduct applies to both UCAR employees as well as participants in activities run by UCAR. -The original version of this for all software projects that have strong management from UCAR or UCAR staff is available on the UCAR website at https://doi.org/10.5065/6w2c-a132. -The date that it was adopted by this project was Jan/14th/2020 -When responding to complaints, UCAR HR and ODEI will do so based on the latest published version. -Therefore, any project-specific changes should follow the [Process for Changes](#process-for-changes) section above. diff --git a/tools/site_and_regional/PTCLM/ChangeLog b/tools/site_and_regional/PTCLM/ChangeLog deleted file mode 100644 index e222999ab1..0000000000 --- a/tools/site_and_regional/PTCLM/ChangeLog +++ /dev/null @@ -1,1184 +0,0 @@ -================================================================================ -This file describes changes made to the PTCLM tool -================================================================================ - -================================================================================ -Originator: erik -Date: Aug/10/2021 -Tag: PTCLM2_20210810 -One-line: Move PTCLM to underneath tools/site_and_regional directory in CTSM -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Change the expected directory for PTCLM in a CTSM checkout to be under the -tools/site_and_regional subdirectory rather than under tools. - -Change python shebang lines to python3. Fix a couple python3 issues one with csv -and print statements. - -Add note about PTCLM being deprecated. This may be the last tag for PTCLM. - -================================================================================ -Originator: erik -Date: Sep/02/2020 -Tag: PTCLM2_20200902 -One-line: Fix problem -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -PTCLMmkdata was failing on running the mapping files with the export statement. -This fixes that, by removing that setting. - -Fixes #11 -- trouble running on cheyenne - -================================================================================ -Originator: erik -Date: Jan/20/2020 -Tag: PTCLM2_20200118 -One-line: Update to python3 add izumi support -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Update to python3 and add support for izumi for testing. Add code of conduct file. -Allow hostname check in buildtoools for cheyenne to have 2-digit numbers. - -Fixes #10 - Add izumi -Fixes #9 -- Update to python3 -Fixes #8 -- compiler versions on cheyenne -Fixes #7 -- change last xmlchange_cmnds files to shell_commands - -================================================================================ -Originator: erik -Date: Jun/11/2018 -Tag: PTCLM2_180611 -One-line: Fix a few bugs in latest PTCLMmkdata -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Fix so properly finds historical time-series files from 1850-2015 rather than ending in 2005. -Setup to handle CESM checkout as well as CTSM checkout better. -Better matching for cheyenne nodes. -More work on options for different machines. -Update README file. - -Fixes: #3, #4, #5 - -================================================================================ -Originator: erik -Date: Feb/14/2018 -Tag: PTCLM2_180214 -One-line: Get working with the new CTSM checkout on the move to git -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -CESM_DIR env variable gets turned into CTSM_DIR and CIME_DIR. Set defaults according -to a the new CTSM checkout in git. Update the testing files, and make sure everything -is working in a CTSM checkout with the standard testing. - -================================================================================ -Originator: erik -Date: Dec/16/2017 -Tag: PTCLM2_171216c -One-line: Add back in missing compare directories: std_US-Ha1 std_US-Var std_Us-Ne1 trans_US-Ha1 -Testing: Standard PTCLM test script on yellowstone/hobart/cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Missing compare directories: std_US-Ha1 std_US-Var std_Us-Ne1 trans_US-Ha1 - -A test/compdirs/* - -================================================================================ -Originator: erik -Date: Dec/16/2017 -Tag: PTCLM2_171216b -One-line: Add back in missing compare directory US-ARM -Testing: Standard PTCLM test script on yellowstone/hobart/cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Missing compare files: - - A test/compdirs/std_US-ARM/README.PTCLM - A test/compdirs/std_US-ARM/run.log - A test/compdirs/std_US-ARM/shell_commands - A test/compdirs/std_US-ARM/user_nl_clm - -================================================================================ -Originator: erik -Date: Dec/16/2017 -Tag: PTCLM2_171216 -One-line: Update compare files one more time to make generic -Testing: Standard PTCLM test script on yellowstone -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - - M test/PTCLMtestlist.py ----- Add replacement of absolute path of CESMDIR - and also ncl path. This should make it generic for different machines. - - Update the compare files - M test/compdirs/*/* - M test/listings/help - M test/listings/list - M test/listings/sitelist -================================================================================ -Originator: erik -Date: Dec/15/2017 -Tag: PTCLM2_171215 -One-line: Remove subversion keywords and make comparisons generic -Testing: Standard PTCLM test script on yellowstone -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Remove use of Subversion keywords, and substitute referring to the latest tagnmae -in the ChangeLog file. Also for testing replace strings that are very user or machine -specific with generic strings, so that comparisons can be done correctly. These -are for the: CESMDIR, version, inputdata directory, or current date. - - M PTCLMmkdata --- Remove svn keyword expansion for --version with latest tagname - in ChangeLog file - M PTCLMsublist_prog.py - Remove svn keyword expansion for --version with latest tagname - in ChangeLog file - - M test/PTCLMtesting_prog.py - Remove svn keyword expansion for --version with latest - tagname in ChangeLog file - M test/PTCLMtestlist.py ----- Add method ReplaceIDInfoInFile to replace specific - identifying information in a file with generic strings. Call it when appropriate - for comparisons. Add test for it. And correct default cesmdir. - - Update the compare files so they have generic strings for - user/machine/version/date identifying information. - M test/compdirs/*/* - M test/listings/help - M test/listings/list - M test/listings/sitelist - -================================================================================ -Originator: erik -Date: Oct/24/2017 -Tag: PTCLM2_171024b -One-line: Add needed ending single quote for CLM_BLDNML_OPTS setting in shell_commands -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - - A test/compdirs/crop_file_creation_US-Ne1/shell_commands - Add in missing file - - M PTCLMmkdata --- Add needed ending single quote in CLM_BLDNML_OPTS setting - M test/compdirs/*/shell_commands - Update with above fix - -================================================================================ -Originator: erik -Date: Oct/24/2017 -Tag: PTCLM2_171024 -One-line: Add --crop/--no-crop option (--no-crop is default) add US-Ne1 to test crop -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - - M PTCLMmkdata - Add note to MPILIB, add new option --crop/--no-crop that will be passed - to CLM_BLDNML_OPTS and mksurfdata.pl change CLM_BLDNML_OPTS so it uses --append - M test/PTCLMtestlist.xml - Add US-Ne1 site to test crop - M PTCLM_sitedata/PTCLMDATA_sitedata.txt - M PTCLM_sitedata/PTCLMDATA_soildata.txt - M PTCLM_sitedata/PTCLMDATA_pftdata.txt - A test/compdirs/crop_file_creation_US-Ne1/README.PTCLM - A test/compdirs/crop_file_creation_US-Ne1/user_nl_clm - A test/compdirs/crop_file_creation_US-Ne1/run.log - M test/compdirs/copyfiles.csh - -================================================================================ -Originator: erik -Date: Oct/16/2017 -Tag: PTCLM2_171016d -One-line: Update default walltime for cheyenne -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M PTCLMsublist_prog.py --- Update default walltime to cheyenne syntax for an hour and a half -M README -- Fix bug 1928 (documentation on compset to use) - -================================================================================ -Originator: erik -Date: Oct/16/2017 -Tag: PTCLM2_171016 -One-line: PTCLM update to clm4_5_16_r259 with cime5.4.0-alpha.03 - Get batch working on cheyenne, and make cheyenne default add --wall option to PCLMsublist -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Add --wall option to PTCLMsublist and get setup and working for cheyenne. Remove hopper and janus -as they are decommissioned. Correct the default CESM root directory for batch submission. Update -the compare listings for testing - -M PTCLMsublist_prog.py - Add --wall option, make default cheyenne, correct cesmdir default -M batchque.py ---------- Add cheyenne settings, remote hopper and janus, cheyenne has - to cd to run directory in job script, rather than set in batch -M PTCLMsublist --------- Update list of machines setup for -M README --------------- Update to work on cheyenne and demonstrate batch submission - - Update compare listings -M test/listings/help -M test/compdirs/*/run.log -M test/compdirs/*/user_nl_clm -M test/compdirs/*/shell_commands -M test/compdirs/*/README.PTCLM - - -================================================================================ -Originator: erik -Date: Jul/06/2017 -Tag: PTCLM2_170706 -One-line: Get PTCLM working again in clm4_5_14_r244 with cime5.3.0-alpha.21 and on - cheyenne and hobart -Testing: Standard PTCLM test script on cheyenne -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Test for cheyenne compute node hostnames as well -Remove hopper, make some changes to get closer to working on yongi -Add module load for hobart -Update README file, add a README file/script that runs on cheyenne -Correct path to modules for cheyenne -Add needed space for three more tests, now all, but one test passes as expected -Update compare files, and make sure have a space after mksurfdata options - -M test/README -- Add notes about loading ncl module -M buildtools --- Remove hopper, get working on hobart, and cheyenne - -M test/compdirs/*/* --------- Update compare directories -M test/listings/* ----------- Update compare listings -A test/README.run_cheyenne -- Add README/script to run on cheyenne - -================================================================================ -Originator: erik -Date: Mar/02/2017 -Tag: PTCLM2_170302 -One-line: Get PTCLM working again in clm4_5_14_r226 with cime5.2.0-alpha23 -Testing: Standard PTCLM test script on yellowstone and test_driver.sh in clm4_5_14_r226 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - 34 tests still fail in standard PTCLM test script - -Remove shared level directory. Remove options no longer needed phys and rcp option -sent to mksurfdata_map. Get build of tools working with latest cime. Remove -tests that don't apply anymore. Update ompare files. - ---- Remove tests that aren't options anymore -D test/compdirs/rcp26_US-Dk2/user_nl_clm -D test/compdirs/rcp26_US-Dk2/run.log -D test/compdirs/rcp26_US-Dk2/shell_commands -D test/compdirs/rcp26_US-Dk2/README.PTCLM -D test/compdirs/rcp26_US-Dk2 -D test/compdirs/rcp6_US-IB1/user_nl_clm -D test/compdirs/rcp6_US-IB1/run.log -D test/compdirs/rcp6_US-IB1/shell_commands -D test/compdirs/rcp6_US-IB1/README.PTCLM -D test/compdirs/rcp6_US-IB1 -D test/compdirs/rcp45_US-Dk3/run.log -D test/compdirs/rcp45_US-Dk3/shell_commands -D test/compdirs/rcp45_US-Dk3/README.PTCLM -D test/compdirs/rcp45_US-Dk3/user_nl_clm -D test/compdirs/rcp45_US-Dk3 -D test/compdirs/rcp85_US-Me4/user_nl_clm -D test/compdirs/rcp85_US-Me4/run.log -D test/compdirs/rcp85_US-Me4/shell_commands -D test/compdirs/rcp85_US-Me4/README.PTCLM -D test/compdirs/rcp85_US-Me4 - -M KnownBugs -M README -M test/PTCLMtestlist.xml -M test/PTCLMtesting_prog.py -M buildtools -M PTCLMmkdata -M mydatafiles/1x1pt_US-UMB/user_nl_clm -M mydatafiles/1x1pt_US-UMB/README.PTCLM -M PTCLMsublist_prog.py - ------- Update compare files -M test/listings/help -M test/listings/list -M test/listings/sitelist -M test/compdirs/std_BR-Sa3/user_nl_clm -M test/compdirs/std_BR-Sa3/run.log -M test/compdirs/std_BR-Sa3/shell_commands -M test/compdirs/std_BR-Sa3/README.PTCLM -M test/compdirs/std_quiet_US-MMS/run.log -M test/compdirs/std_quiet_US-MMS/shell_commands -M test/compdirs/std_quiet_US-MMS/README.PTCLM -M test/compdirs/std_quiet_US-MMS/user_nl_clm -M test/compdirs/notowyrs_US-WCr/user_nl_clm -M test/compdirs/notowyrs_US-WCr/run.log -M test/compdirs/notowyrs_US-WCr/shell_commands -M test/compdirs/notowyrs_US-WCr/README.PTCLM -M test/compdirs/std_2000_US-MOz/shell_commands -M test/compdirs/std_2000_US-MOz/README.PTCLM -M test/compdirs/std_2000_US-MOz/user_nl_clm -M test/compdirs/std_2000_US-MOz/run.log -M test/compdirs/noopt_US-CHATS/README.PTCLM -M test/compdirs/noopt_US-CHATS/user_nl_clm -M test/compdirs/noopt_US-CHATS/run.log -M test/compdirs/noopt_US-CHATS/shell_commands -M test/compdirs/std_ES-ES1/README.PTCLM -M test/compdirs/std_ES-ES1/user_nl_clm -M test/compdirs/std_ES-ES1/run.log -M test/compdirs/std_ES-ES1/shell_commands -M test/compdirs/trans_clm45_US-Ha1/shell_commands -M test/compdirs/trans_clm45_US-Ha1/README.PTCLM -M test/compdirs/trans_clm45_US-Ha1/user_nl_clm -M test/compdirs/trans_clm45_US-Ha1/run.log -M test/compdirs/std_LTER-Sev/shell_commands -M test/compdirs/std_LTER-Sev/README.PTCLM -M test/compdirs/std_LTER-Sev/user_nl_clm -M test/compdirs/std_LTER-Sev/run.log -M test/compdirs/std_clm45_US-Ha1/shell_commands -M test/compdirs/std_clm45_US-Ha1/README.PTCLM -M test/compdirs/std_clm45_US-Ha1/user_nl_clm -M test/compdirs/std_clm45_US-Ha1/run.log -M test/compdirs/std_DE-Tha/shell_commands -M test/compdirs/std_DE-Tha/README.PTCLM -M test/compdirs/std_DE-Tha/user_nl_clm -M test/compdirs/std_DE-Tha/run.log -M test/compdirs/soigrd_CA-Qfo/user_nl_clm -M test/compdirs/soigrd_CA-Qfo/run.log -M test/compdirs/soigrd_CA-Qfo/shell_commands -M test/compdirs/soigrd_CA-Qfo/README.PTCLM -M test/compdirs/std_IT-Cpz/user_nl_clm -M test/compdirs/std_IT-Cpz/run.log -M test/compdirs/std_IT-Cpz/shell_commands -M test/compdirs/std_IT-Cpz/README.PTCLM -M test/compdirs/soigrd_CA-Ojp/user_nl_clm -M test/compdirs/soigrd_CA-Ojp/run.log -M test/compdirs/soigrd_CA-Ojp/shell_commands -M test/compdirs/soigrd_CA-Ojp/README.PTCLM -M test/compdirs/std_FL-Hyy/shell_commands -M test/compdirs/std_FL-Hyy/README.PTCLM -M test/compdirs/std_FL-Hyy/user_nl_clm -M test/compdirs/std_FL-Hyy/run.log -M test/compdirs/std_RF-Bra/run.log -M test/compdirs/std_RF-Bra/shell_commands -M test/compdirs/std_RF-Bra/README.PTCLM -M test/compdirs/std_RF-Bra/user_nl_clm -M test/compdirs/std_clm45_US-Var/shell_commands -M test/compdirs/std_clm45_US-Var/README.PTCLM -M test/compdirs/std_clm45_US-Var/user_nl_clm -M test/compdirs/std_clm45_US-Var/run.log -M test/compdirs/std_1850_US-Me2/run.log -M test/compdirs/std_1850_US-Me2/shell_commands -M test/compdirs/std_1850_US-Me2/README.PTCLM -M test/compdirs/std_1850_US-Me2/user_nl_clm -M test/compdirs/stdurbpt_pftgrd_CA-Oas/user_nl_clm -M test/compdirs/stdurbpt_pftgrd_CA-Oas/run.log -M test/compdirs/stdurbpt_pftgrd_CA-Oas/shell_commands -M test/compdirs/stdurbpt_pftgrd_CA-Oas/README.PTCLM -M test/compdirs/std_IT-Col/shell_commands -M test/compdirs/std_IT-Col/README.PTCLM -M test/compdirs/std_IT-Col/user_nl_clm -M test/compdirs/std_IT-Col/run.log -M test/compdirs/std_FL-Kaa/run.log -M test/compdirs/std_FL-Kaa/shell_commands -M test/compdirs/std_FL-Kaa/README.PTCLM -M test/compdirs/std_FL-Kaa/user_nl_clm -M test/compdirs/std_soigrd_BR-Sa1/user_nl_clm -M test/compdirs/std_soigrd_BR-Sa1/run.log -M test/compdirs/std_soigrd_BR-Sa1/shell_commands -M test/compdirs/std_soigrd_BR-Sa1/README.PTCLM -M test/compdirs/pftgrd_CA-Obs/user_nl_clm -M test/compdirs/pftgrd_CA-Obs/run.log -M test/compdirs/pftgrd_CA-Obs/shell_commands -M test/compdirs/pftgrd_CA-Obs/README.PTCLM -M test/compdirs/trans_20th_US-Ne3/user_nl_clm -M test/compdirs/trans_20th_US-Ne3/run.log -M test/compdirs/trans_20th_US-Ne3/shell_commands -M test/compdirs/trans_20th_US-Ne3/README.PTCLM -M test/compdirs/notowyrs_CA-Man/user_nl_clm -M test/compdirs/notowyrs_CA-Man/run.log -M test/compdirs/notowyrs_CA-Man/shell_commands -M test/compdirs/notowyrs_CA-Man/README.PTCLM -M test/compdirs/std_BE-Vie/user_nl_clm -M test/compdirs/std_BE-Vie/run.log -M test/compdirs/std_BE-Vie/shell_commands -M test/compdirs/std_BE-Vie/README.PTCLM -M test/compdirs/std_LBA-Cax/shell_commands -M test/compdirs/std_LBA-Cax/README.PTCLM -M test/compdirs/std_LBA-Cax/user_nl_clm -M test/compdirs/std_LBA-Cax/run.log -M test/compdirs/std_US-UMB/user_nl_clm -M test/compdirs/std_US-UMB/run.log -M test/compdirs/std_US-UMB/shell_commands -M test/compdirs/std_US-UMB/README.PTCLM -M test/compdirs/std_clm45_US-ARM/shell_commands -M test/compdirs/std_clm45_US-ARM/README.PTCLM -M test/compdirs/std_clm45_US-ARM/user_nl_clm -M test/compdirs/std_clm45_US-ARM/run.log -M test/compdirs/crop_US-IB1/user_nl_clm -M test/compdirs/crop_US-IB1/run.log -M test/compdirs/crop_US-IB1/shell_commands -M test/compdirs/crop_US-IB1/README.PTCLM -M test/compdirs/std_quiet_US-Bo1/user_nl_clm -M test/compdirs/std_quiet_US-Bo1/run.log -M test/compdirs/std_quiet_US-Bo1/shell_commands -M test/compdirs/std_quiet_US-Bo1/README.PTCLM -M test/compdirs/global_US-UMB/run.log -M test/compdirs/global_US-UMB/shell_commands -M test/compdirs/global_US-UMB/README.PTCLM -M test/compdirs/global_US-UMB/user_nl_clm -M test/compdirs/cyc_TS-Ts1/user_nl_clm -M test/compdirs/cyc_TS-Ts1/run.log -M test/compdirs/cyc_TS-Ts1/shell_commands -M test/compdirs/cyc_TS-Ts1/README.PTCLM -M test/compdirs/notowyrs_CA-Let/user_nl_clm -M test/compdirs/notowyrs_CA-Let/run.log -M test/compdirs/notowyrs_CA-Let/shell_commands -M test/compdirs/notowyrs_CA-Let/README.PTCLM -M test/compdirs/cyc_TS-Ts2/user_nl_clm -M test/compdirs/cyc_TS-Ts2/run.log -M test/compdirs/cyc_TS-Ts2/shell_commands -M test/compdirs/cyc_TS-Ts2/README.PTCLM -M test/compdirs/cyc_TS-Ts3/README.PTCLM -M test/compdirs/cyc_TS-Ts3/user_nl_clm -M test/compdirs/cyc_TS-Ts3/run.log -M test/compdirs/cyc_TS-Ts3/shell_commands -M test/compdirs/pftgrd_CA-Ca1/user_nl_clm -M test/compdirs/pftgrd_CA-Ca1/run.log -M test/compdirs/pftgrd_CA-Ca1/shell_commands -M test/compdirs/pftgrd_CA-Ca1/README.PTCLM -M test/compdirs/std_quiet_US-Ho1/run.log -M test/compdirs/std_quiet_US-Ho1/shell_commands -M test/compdirs/std_quiet_US-Ho1/README.PTCLM -M test/compdirs/std_quiet_US-Ho1/user_nl_clm - -================================================================================ -Originator: erik -Date: Aug/18/2016 -Tag: PTCLM2_160818 -One-line: Update compare tests, and allow clm5_0 and make it the default -Testing: Standard PTCLM test script on yellowstone and test_driver.sh in clm4_5_11_r189 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M PTCLMmkdata ------------- Change so can work for clm5_0 and make clm5_0 the default -M test/compdirs/*/run.log -M test/listings/help -M test/listings/list -M test/listings/sitelist - -================================================================================ -Originator: sacks -Date: Jan/27/2016 -Tag: PTCLM2_160127a -One-line: Fix typos for building on geyser and pronghorn -Testing: NONE (but will run test_driver.sh from CLM) -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M buildtools --- Fix typos for geyser and pronghorn - -================================================================================ -Originator: sacks -Date: Jan/27/2016 -Tag: PTCLM2_160127 -One-line: Build on pronghorn same as for yellowstone -Testing: NONE (but will run test_driver.sh from CLM) -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M buildtools --- Extend conditional to apply to pronghorn - -================================================================================ -Originator: erik -Date: Oct/09/2015 -Tag: PTCLM2_151009 -One-line: -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_3_r136 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M buildtools --- Add softlink to Macros.make so can build gen_domain with - cime4.0.1 -M PTCLMmkdata -- Add a wildcard for PFT number in landuse timeseries file - print out wildcard when file isn't found. - -================================================================================ -Originator: erik -Date: Aug/26/2015 -Tag: PTCLM2_150826 -One-line: Allow for pft??_ in surface dataset filename -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r119 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -In clm4_5_1_r108, surface datasets change standard filenames to include the -PFT number. So PTCLMmkdata would no longer work for clm4_5. Add a wildcard for -the pft number, so both clm4_0 and clm4_5 will now work. - -Move goldbach to hobart. - -M buildtools -M PTCLMmkdata -M test/compdirs/*/* - -================================================================================ -Originator: erik -Date: Apr/14/2015 -Tag: PTCLM2_150414 -One-line: Send in cimeroot to buildtools -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M buildtools - -================================================================================ -Originator: erik -Date: Apr/13/2015 -Tag: PTCLM2_150413 -One-line: Change output filenames of xmlchange_cmnds to shell_commands -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -R test/compdirs/*/xmlchange_cmnds -A test/compdirs/*/shell_commands -M test/compdirs/*/* -M test/PTCLMtestlist.py -M PTCLMmkdata - -================================================================================ -Originator: erik -Date: Apr/10/2015 -Tag: PTCLM2_150410 -One-line: Update to new cime directory structure -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r105 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -Change the relative paths to the new cime directory structure where clm -source and tools are under components, and CESM scripts are under -cime/scripts. - - M PTCLMmkdata - M mydatafiles/1x1pt_US-UMB/xmlchange_cmnds - M mydatafiles/1x1pt_US-UMB/README.PTCLM - M mydatafiles/1x1pt_US-UMB/user_nl_clm - M KnownBugs - M README - M test/PTCLMtesting_prog.py - M test/listings/help - M test/listings/list - M test/listings/sitelist - M test/compdirs/* - M test/PTCLMtestlist.py - M buildtools - -================================================================================ -Originator: erik -Date: Jan/26/2015 -Tag: PTCLM2_150126 -One-line: Update test comparison and listings -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r104 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values -------- Update test comparison and listings -M test/compdirs/* -M test/listings/sitelist -M test/listings/help -M test/listings/list - -================================================================================ -Originator: erik -Date: Aug/16/2014 -Tag: PTCLM2_140816 -One-line: Add geyser/caldera to yellowstone -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_1_r080 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -M buildtools -- Allow yellowstone to use geyser and/or caldera - -------- Update test comparison and listings -M test/compdirs/* -M test/listings/sitelist -M test/listings/help -M test/listings/list - -================================================================================ -Originator: sacks -Date: May/21/2014 -Tag: PTCLM2_140521 -One-line: rename fpftdyn to flanduse_timeseries, and do some other related variable renames -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in - dynlu_crops_n03_addclm50bld_n06_clm4_5_72 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -This is meant to go with an upcoming CLM tag, currently slated for clm4_5_74 - -A + PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl -D PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl -M PTCLMmkdata -M README -M test/compdirs/global_US-UMB/user_nl_clm -M test/compdirs/rcp26_US-Dk2/user_nl_clm -M test/compdirs/rcp45_US-Dk3/user_nl_clm -M test/compdirs/rcp6_US-IB1/user_nl_clm -M test/compdirs/rcp85_US-Me4/user_nl_clm -M test/compdirs/trans_20th_US-Ne3/user_nl_clm -M test/compdirs/trans_clm45_US-Ha1/user_nl_clm - -================================================================================ -Originator: erik -Date: Apr/23/2014 -Tag: PTCLM2_140423 -One-line: Fix documentation, set DIN_LOC_ROOT_CLMFORC, correct call to mkmapdata.sh - allow release_tags in version, add hopper/edison to machine list. -Testing: Standard PTCLM test script on yellowstone, and test_driver.sh in clm4_5_71 -Known Bugs: RF-Bra will work even without --donot_use_tower_yrs since it doesn't - check for valid values - -A PTCLMsublist --------- Script to submit a list of sites to the batch queue -A PTCLMsublist_prog.py - Python code to handle the submision list -A batchque.py ---------- Python code to handle batch command submission for single processor - -M PTCLMmkdata -- Set DIN_LOC_ROOT_CLMFORC, Correct call to mkmapdata.sh - Also allow release_tags in version find. -M README ------- Correct compset used. -M buildtools --- Add edison/hopper to list of machines will work for - change frankfurt to goldbach, update netcdf version for yellowstone -M test/compdirs/* -------- Update the comparison files -M test/listings/sitelist - Update sitelist -M test/listings/help ----- Update help -M test/listings/list ----- Update list - -M test/PTCLMtestlist.py ----- Change result codes to be more consistent with - other testing mechanisms -M test/PTCLMtesting_prog.py - Change result codes, and set sdate/map_gdate so sdate won't - change with the day testing was run. -M test/PTCLMtestlist.xml ---- Add new tests for new sites - -------> Add new sites for Rosie, RF-Bra,LBA-Cax,LTER-Sev -------> And Jinyun US-Bol -M PTCLM_sitedata/PTCLMDATA_pftdata.txt -M PTCLM_sitedata/PTCLMDATA_sitedata.txt -M PTCLM_sitedata/PTCLMDATA_soildata.txt - - -------> Add new comparison files for testing -A test/compdirs/std_RF-Bra -A test/compdirs/std_RF-Bra/user_nl_clm -A test/compdirs/std_RF-Bra/run.log -A test/compdirs/std_RF-Bra/xmlchange_cmnds -A test/compdirs/std_RF-Bra/README.PTCLM -A test/compdirs/std_LBA-Cax -A test/compdirs/std_LBA-Cax/user_nl_clm -A test/compdirs/std_LBA-Cax/run.log -A test/compdirs/std_LBA-Cax/xmlchange_cmnds -A test/compdirs/std_LBA-Cax/README.PTCLM -A test/compdirs/std_LTER-Sev -A test/compdirs/std_LTER-Sev/user_nl_clm -A test/compdirs/std_LTER-Sev/run.log -A test/compdirs/std_LTER-Sev/xmlchange_cmnds -A test/compdirs/std_LTER-Sev/README.PTCLM - -================================================================================ -Originator: erik -Date: Feb/04/2014 -Tag: PTCLM2_140204 -One-line: Add testing directory, some reworking, and bug fixes, remove -mach - Remove --mach, --sitegroupname options add --map_gdate options. -Testing: Ran PTCLM tests in test directory, and test_driver.sh tests on - yellowstone. - - Add test directory and XML based test list - A test - A test/compdirs - A test/compdirs/* ----------- Compare directory files - A test/PTCLMtestlist.py ----- Class for reading the test list - A test/run_PTCLM_tests ------ Main test script - A test/PTCLMtestlist.xml ---- XML test list - A test/PTCLMtesting_prog.py - Main class for test script - A test/listings ------------- List option compare directory - A test/listings/sitelist ---- Site list compare - A test/listings/help -------- Help compare - A test/listings/list -------- List compare - A test/README - - M buildtools ---- Remove *.o files for gen_domain and gmake clean everything else - M PTCLMmkdata --- STARTDATE and ALIGNYR only set if using tower years. Add more metadata to filenames. - More work on debug option so works well. Also run mksurfdata.pl in debug mode with - --debug and --allownofile so will test it's usage. Remove -mach option, add --map_gdate - option so can use old maps easier. Add function to get filenames of created files, and - touch the file in debug mode. Fix some of the use-case logic. Fix directory logic, and - allow being able to run from a different directory. Exercise more commands in system - function for debug mode. - - Remove -m option - M mydatafiles/1x1pt_US-UMB/user_nl_clm - M mydatafiles/1x1pt_US-UMB/xmlchange_cmnds - M mydatafiles/1x1pt_US-UMB/README.PTCLM - - M README --- Remove -m option - - Add some test sites for testing: TS-Ts1, TS-Ts2, TS-Ts3 - M PTCLM_sitedata/PTCLMDATA_sitedata.txt ----- Add test sites, change align year as first year to use when cycle_forcing used - This is usually the first year, unless it's a leap year and it's the year after that. If the site has less than 3 years - it's "1". - M PTCLM_sitedata/PTCLMDATA_soildata.txt - M PTCLM_sitedata/PTCLMDATA_pftdata.txt - -================================================================================ -Originator: erik -Date: Nov/22/2013 -Tag: PTCLM2_131122c -One-line: Add some example files -Testing: limited setup for US-UMB case on yellowstone - -A mydatafiles/1x1pt_US-UMB/user_nl_clm -A mydatafiles/1x1pt_US-UMB/xmlchange_cmnds -A mydatafiles/1x1pt_US-UMB/README.PTCLM - -================================================================================ -Originator: erik -Date: Nov/22/2013 -Tag: PTCLM2_131122b -One-line: Rename a bunch of files, add US-UMB sample data -Testing: limited setup for US-UMB case on yellowstone - -Rename files to new names: - -A + PTCLMmkdata -A + PTCLM_sitedata/PTCLMDATA_pftdata.txt -A + PTCLM_sitedata/PTCLMDATA_sitedata.txt -A + PTCLM_sitedata/PTCLMDATA_soildata.txt - -A mydatafiles/1x1pt_US-UMB ---- sample directory for US-UMB site - -D PTCLM.py -D PTCLM_sitedata/EXAMPLE_sitedata.txt -D PTCLM_sitedata/EXAMPLE_soildata.txt -D PTCLM_sitedata/EXAMPLE_pftdata.txt - ->>>>> Remove other site data files as we already have - a lot of sample data in the PTCLMDATA file set. -D PTCLM_sitedata/LBA_pftdata.txt -D PTCLM_sitedata/LBA_sitedata.txt -D PTCLM_sitedata/LBA_soildata.txt -D PTCLM_sitedata/Fluxnet-Canada_sitedata.txt -D PTCLM_sitedata/Fluxnet-Canada_soildata.txt -D PTCLM_sitedata/Fluxnet-Canada_pftdata.txt -D PTCLM_sitedata/AmeriFlux_sitedata.txt -D PTCLM_sitedata/AmeriFlux_soildata.txt -D PTCLM_sitedata/AmeriFlux_pftdata.txt -D PTCLM_sitedata/CarboEurope_pftdata.txt -D PTCLM_sitedata/CarboEurope_sitedata.txt -D PTCLM_sitedata/CarboEurope_soildata.txt - ->>>>>> Update documentation -M KnownBugs -M README - -================================================================================ -Originator: erik -Date: Nov/22/2013 -Tag: PTCLM2_131122 -One-line: Add more documentation, remove some case settings not needed, make -work a bit cleaner -Testing: limited setup for US-UMB case on yellowstone - ->>>> Add README file for the sample mydatafiles directory -A https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/mydatafiles/README - -M https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/PTCLM.py --- remove some options not needed. Fix directory, and setup user_nl_clm and -xmlchange_cmnds files. -M https://svn-ccsm-models.cgd.ucar.edu/PTCLM/trunk_tags/PTCLM2_131119/README --- update doc... - - -================================================================================ -Originator: erik -Date: Nov/19/2013 -Tag: PTCLM2_131119 -One-line: Remove create_newcase call from PTCLM, just create datasets -Testing: limited setup for US-UMB case on yellowstone -Requires: scripts4_131119 - -Change PTCLM to JUST be a tool that creates datasets rather than also -creates a case for you. Running create_newcase is now a seperate step -that you use the -user_mods_dir option with. - -There are some issues with this version. But, it has basic functionality. - -The xmlchange_xcmnds file that is created has many fields multiple times. The -dataset location is also screwy. - -Change name for CHATS datasite to US-CHATS so name is more similar to the -other FluxNet sites. CHATS is an experiment that NCAR ran. - -A buildtools -- new script to build all the tools needed for PTCLM -M PTCLM.py ---- Change so that only creates datasets, does NOT run create_newcase -M README ------ Update documentation - -M PTCLM_sitedata/EXAMPLE_sitedata.txt -- Add campaign name to end -M PTCLM_sitedata/EXAMPLE_soildata.txt -- Change CHATS to US-CHATS -M PTCLM_sitedata/EXAMPLE_pftdata.txt --- Change CHATS to US-CHATS - -================================================================================ -Originator: erik -Date: Sep/29/2013 -Tag: PTCLM1_130929 -cesm_baseline: scripts4_130929 -One-line: default compset: I1PTCLM45, files go under site subdir, add script to rename maps -Testing: limited ran mexicocity, US-UMB, US-Ha1, and BE-Vie cases - -M PTCLM.py -------------------- Make default compset: I1PTCLM45, make files in resolution - subdiretory (under mydatadir) -M README ---------------------- Update documentation -A mydatafiles/renamemapfiles -- Script to rename mapping files creation date, so don't have - to recreate mapping files again. - -Remove directory NOT needed anymore... - -D usr_files/mkgriddata.TEMPLATE -D usr_files - -================================================================================ -Originator: erik -Date: Sep/23/2013 -Tag: PTCLM1_130923 -cesm_baseline: scripts4_130916 -One-line: Add --cycle_forcing, and --mydatadir options, remove useQIAN, rename --QIAN_tower_yrs to --use_tower_yrs -Testing: limited ran a couple cases - -M PTCLM.py -------- Changes from Keith Oleson to cycle_forcing, check - what model version is being used (clm4_0 or clm4_5) - set time-step. -D testcases.csh --- Remove as not working well on yellowstone - -================================================================================ -Originator: erik -Date: Sep/20/2013 -Tag: PTCLM1_130920 -cesm_baseline: scripts4_130920 -One-line: Make datafiles in mydatafiles directory -Testing: Ran basic US-UMB, US-NR1 and 1x1_mexicocityMEX cases - -M PTCLM.py ----------------- File changes from Keith Oleson -M PTCLM_sitedata/Fluxnet-Canada_sitedata.txt -M PTCLM_sitedata/EXAMPLE_sitedata.txt -M PTCLM_sitedata/Fluxnet-Canada_soildata.txt -M PTCLM_sitedata/AmeriFlux_sitedata.txt -M PTCLM_sitedata/EXAMPLE_soildata.txt -M PTCLM_sitedata/AmeriFlux_soildata.txt -M PTCLM_sitedata/Fluxnet-Canada_pftdata.txt -M PTCLM_sitedata/EXAMPLE_pftdata.txt -M PTCLM_sitedata/AmeriFlux_pftdata.txt - -================================================================================ -Originator: erik -Date: Sep/10/2013 -Tag: PTCLM1_130910 -cesm_baseline: scripts4_130910 -One-line: Get rid of pft-phys file copy, fix mapping file names, correct domain file -Testing: Limited, basic test setup - -M PTCLM.py --------- Remove pft-phys file copy, fix mapping file name, correct - domain file path -M testcases.csh ---- change compsets testing, unzip log file to check status - -================================================================================ -Originator: erik -Date: Jul/24/2013 -Tag: PTCLM1_130724 -cesm_baseline: scripts4_130724 -One-line: Add some more error checking, more changes to get things working -Testing: Limited, basic test setup - -M PTCLM.py ------- error checking, correct mapfile name, get gen_domain working, - set ATM/LND_DOMAIN_FILE - -================================================================================ -Originator: erik -Date: May/29/2013 -Tag: PTCLM1_130529 -cesm_baseline: scripts4_130529 -One-line: Get PTCLM working with the new CLM tools -Testing: Limited, test mexicocity, and 1x1_US-UMB basic case setup - -M PTCLM.py ------- Remove spinup options, get working with new tools -M testcases.csh -- Remove spinup tests, get working again - -================================================================================ -Originator: erik -Date: Feb/16/2013 -Tag: PTCLM1_130216 -cesm_baseline: scripts4_130130 -One-line: Get supported compsets working and some progress with tools -Testing: Limited -- but surported res work on ys - -M PTCLM.py -M testcases.csh - -================================================================================ -Originator: erik -Date: Jan/30/2013 -Tag: PTCLM1_130130 -cesm_baseline: scripts4_130130 -One-line: Initial changes to get PTCLM working with new scripts and tools -Testing: Limited testing - -Initial add of yellowstone to testcases and switch frankfurt for edinburgh. -Remove generic stuff for userdefined. Remove ndep/aer grid. - -M PTCLM.py -M testcases.csh -D usr_files/mkdatadomain.TEMPLATE - -================================================================================ -Originator: erik -Date: Jan/11/2013 -Tag: PTCLM1_130111 -cesm_baseline: scripts4_120125 -One-line: Add some new sitedata from Keith Oleson -Testing: none - -A PTCLM_sitedata/LBA_pftdata.txt -M PTCLM_sitedata/Fluxnet-Canada_sitedata.txt -M PTCLM_sitedata/EXAMPLE_sitedata.txt -A PTCLM_sitedata/CarboEurope_pftdata.txt -M PTCLM_sitedata/AmeriFlux_sitedata.txt -M PTCLM_sitedata/Fluxnet-Canada_soildata.txt -M PTCLM_sitedata/EXAMPLE_soildata.txt -M PTCLM_sitedata/AmeriFlux_soildata.txt -A PTCLM_sitedata/LBA_sitedata.txt -A PTCLM_sitedata/LBA_soildata.txt -A PTCLM_sitedata/CarboEurope_sitedata.txt -A PTCLM_sitedata/CarboEurope_soildata.txt -M PTCLM_sitedata/Fluxnet-Canada_pftdata.txt -M PTCLM_sitedata/EXAMPLE_pftdata.txt -M PTCLM_sitedata/AmeriFlux_pftdata.txt - -================================================================================ -Originator: mvertens -Date: Jan/25/2012 -Tag: PTCLM1_120125 -cesm_baseline: scripts4_120125 -One-line: Remove USE_MPISERIAL replace with MPILIB - - -================================================================================ - -Originator: erik -Date: Nov/29/2011 -Tag: PTCLM1_111129 -cesm_baseline: clm4_0_39 / scripts4_111129 -One-line: Use CLM_USRDAT for resolution or supported single-point res name - so will work with latest scripts version -Bugs-fixed: -Known Bugs: (See KnownBugs file for details) - 1379 (All of the spinup tests fail for PTCLM) - 1364 (Problem running US-UMB case on Macintosh) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) -Testing: Limited testing - bluefire testing: All PASS - -M PTCLM.py -- Set res in create_newcase to either supported 1pt name - or to CLM_USRDAT. - -================================================================================ -Originator: erik -Date: Nov/14/2011 -Tag: PTCLM1_111114 -cesm_baseline: clm4_0_38 / scripts4_111108 -One-line: Update path for NetCDF4 -Bugs-fixed: -Known Bugs: (See KnownBugs file for details) - 1379 (All of the spinup tests fail for PTCLM) - 1364 (Problem running US-UMB case on Macintosh) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) -Testing: Limited testing - bluefire testing: All PASS - -Update path for NetCDF for bluefire, jaguar, lynx, and mirage. - -M testcases.csh - -================================================================================ -Originator: erik -Date: Sep/02/2011 -Tag: PTCLM1_110902 -cesm_baseline: clm4_0_35 / scripts4_110902 -One-line: Change name of mksurfdata to mksurfdata_map, fix soil texture of US-UMB -Bugs-fixed: - 1392 (US-UMB site has some incorrect data) -Known Bugs: (See KnownBugs file for details) - 1379 (All of the spinup tests fail for PTCLM) - 1364 (Problem running US-UMB case on Macintosh) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) -Testing: Limited testing - bluefire testing: All PASS - -Get basic script working with non2D grid version of clm. mksurfdata directory -was changed to mksurfdata_map, and tools directories now have a "src" subdirectory -to build the code in them. - -Also fix soil texture for US-UMB site (bug 1392). - -M PTCLM.py -M testcases.csh -M PTCLM_sitedata/EXAMPLE_soildata.txt -M PTCLM_sitedata/AmeriFlux_soildata.txt - -================================================================================ -Originator: erik -Date: Jul/26/2011 -Tag: PTCLM1_110726 -cesm_baseline: clm4_0_33 / scripts4_110724 -One-line: Test if should use skip_rundb option or not, fix transient problem -Bugs-fixed: - 1368 (PTCLM for US-UMB spins up with zero GPP) - 1361 (Problem with transient compsets for PTCLM) -Known Bugs: (See KnownBugs file for details) - 1392 (US-UMB site has some incorrect data) - 1379 (All of the spinup tests fail for PTCLM) - 1364 (Problem running US-UMB case on Macintosh) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) -Testing: All tests pass up to the spinup tests where they all fail - bluefire testing: - PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM - jaguar testing: - PTCLM._US_US-UMB_ICN_exit_spinup.PTCLM - edinburgh testing: - PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM - yong/intel testing: - PTCLM.*_US-UMB_ICN_exit_spinup.PTCLM - - M PTCLM.py ------ Add check for finidat file, check if should use -skip_rundb option, fix transient issue - M testcases.csh - Change order of arguments for spinup tests, so more likely to die on an error with finidat file - M KnownBugs ----- Update list of bugs - -================================================================================ -Originator: erik -Date: May/04/2011 -Tag: PTCLM1_110504 -cesm_baseline: clm4_0_28 / scripts4_110428a -One-line: Move PTCLM to own external, and fix cnvrt script so can take year-range - allow it to use older versions of Python -Bugs-fixed: - 1279 (Latest version of PTCLM requires python2.5) - 1248 (PTCLM can only run until 2005) -Known Bugs: (See KnownBugs file for details) - 1392 (US-UMB site has some incorrect data) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) -Testing: - bluefire testing: All PASS - jaguar testing: All PASS - edinburgh testing: All PASS except -4 PTCLM.8696_US-UMB_I_1850.PTCLM FAIL 0 -5 PTCLM.8696_US-UMB_I20TR.PTCLM FAIL 0 -6 PTCLM.8696_US-UMB_I20TRCN.PTCLM FAIL 0 -7 PTCLM.8696_US-UMB_ICN.PTCLM FAIL 0 -8 PTCLM.8696_US-UMB_I1850CN.PTCLM FAIL 0 -9 PTCLM.8696_US-UMB_IRCP85CN.PTCLM FAIL 0 -10 PTCLM.8696_US-UMB_I.PTCLM FAIL 0 -11 PTCLM.8696_US-UMB_I_QIAN.PTCLM FAIL 0 -12 PTCLM.8696_US-UMB_I.PTCLM FAIL 0 -14 PTCLM.8696_US-UMB_ICN_exit_spinup.PTCLM FAIL 0 -15 PTCLM.8696_US-UMB_ICN_final_spinup.PTCLM FAIL 0 - yong/intel testing: All PASS - - Send a year range to the convert script and have years that start at the beginning - of the year range and go to the end of it. - Add a DEBUG option to testcases.csh so can just run tests quickly to debug test script. - - M PTCLM.py - M PTCLM_sitedata/cnvrt_trnsyrs2_pftdyntxtfile.pl - M testcases.csh - M KnownBugs - - M PTCLM_sitedata/EXAMPLE_sitedata.txt - Remove all but US-UMB - M PTCLM_sitedata/EXAMPLE_soildata.txt - Remove all but US-UMB - M PTCLM_sitedata/EXAMPLE_pftdata.txt -- Remove all but US-UMB - -================================================================================ -Originator: erik -Date: Feb/03/2011 -Tag: clm4_0_23 / scripts4_110111 -One-line: Fix --list and --cesm_root options, add --scratchroot, fix bugs - update use-cases and compset names, add CESM_ROOT/CLM_SOFF to testcases.csh -Bugs-fixed: - 1256 (fix PTCLM testcases.csh test script on jaguar to use netcdf/3.6.2) - 1254 (pft-physiology copy doesn't have .nc extension/can't handle new files) - 1250 (add ability to set scratchroot) - 1224 (Fix -aerdepgrid/ndepgrid options in PTCLM.py) -Known Bugs: (See KnownBugs file for details) - 1392 (US-UMB site has some incorrect data) - 1251 (Test case aborts on Macintosh with seq-fault in US-Ha1 I_QIAN case) - 1248 (PTCLM can only run until 2005) -Testing: - bluefire testing: All PASS - edinburgh testing: All Fail (Python is too old 2.4 when needs 2.5) - yong/intel testing: All PASS except... -myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 -myPTCLMtests_US-Ha1_I20TR.PTCLM FAIL 0 - -M PTCLM.py ------- Fix bugs, get --list and --cesm_root options working, add - --scratchroot, update CLM use-cases and how queried - add ability to add directory to caseprefix -M testcases.csh -- Add ability to use env vars CESM_ROOT and CLM_SOFF - set scratchroot for generic machines. Put case directories - under the PTCLM directory, so can delete it easier -M KnownBugs - -================================================================================ -Originator: erik -Date: Jan/12/2011 -Tag: clm4_0_21 / scripts4_110108 -One-line: Create ChangeLog file for PTCLM -Testing: - bluefire testing: All PASS - edinburgh testing: All PASS up to ... -myPTCLMtests_US-Ha1_I_1850.PTCLM FAIL 0 - yong/intel testing: All PASS up to... -myPTCLMtests_US-Ha1_I_QIAN.PTCLM PASS - -================================================================================ -Originator: erik -Date: Dec/06/2010 -Tag: scripts4_101206 -One-line: Add some documentation files - -M ccsm_utils/Tools/lnd/clm/PTCLM/testcases.csh Add USER_CC setting to yong -M ccsm_utils/Tools/lnd/clm/PTCLM/README ------- Add note about aerdepgrid/ndepgrid -A ccsm_utils/Tools/lnd/clm/PTCLM/KnownBugs ---- Add file with list of bugs - -================================================================================ -Originator: erik -Date: Dec/02/2010 -Tag: scripts4_101202 -One-line: Updates for script changes - ->>>>>>>>>>>> Get PTCLM working with changes ->>>>>>>>>>>> PTCLM updates from mpiserial branch ->>>>>>>>>>>> Add PTCLM tests for yong (Mac OS-X laptop) - M ccsm_utils/Tools/lnd/clm/PTCLM/PTCLM.py - M ccsm_utils/Tools/lnd/clm/PTCLM/testcases.csh - M ccsm_utils/Tools/lnd/clm/PTCLM/README - -================================================================================ -Originator: erik -Date: Aug/30/2010 -Tag: scripts4_100830 -One-line: Bring PTCLM branch to scripts trunk - -================================================================================ diff --git a/tools/site_and_regional/PTCLM/LICENSE b/tools/site_and_regional/PTCLM/LICENSE deleted file mode 100644 index cb8a9e9f5a..0000000000 --- a/tools/site_and_regional/PTCLM/LICENSE +++ /dev/null @@ -1,34 +0,0 @@ -Copyright (c) 2005-2017, University Corporation for Atmospheric Research (UCAR) -All rights reserved. - -Developed by: - University Corporation for Atmospheric Research - National Center for Atmospheric Research - https://www2.cesm.ucar.edu/working-groups/sewg - -Permission is hereby granted, free of charge, to any person obtaining -a copy of this software and associated documentation files (the "Software"), -to deal with the Software without restriction, including without limitation -the rights to use, copy, modify, merge, publish, distribute, sublicense, -and/or sell copies of the Software, and to permit persons to whom -the Software is furnished to do so, subject to the following conditions: - - - Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the documentation - and/or other materials provided with the distribution. - - Neither the names of [Name of Development Group, UCAR], - nor the names of its contributors may be used to endorse or promote - products derived from this Software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE -ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE -LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR -CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF -SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN -CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) -ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE -POSSIBILITY OF SUCH DAMAGE. diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt deleted file mode 100644 index 42d39edcc9..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_pftdata.txt +++ /dev/null @@ -1,44 +0,0 @@ -site_code,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5 -US-Blo,100,1,0,0,0,0,0,0,0,0 -US-CHATS,100,7,0,0,0,0,0,0,0,0 -US-FPe,100,12,0,0,0,0,0,0,0,0 -US-NR1,100,1,0,0,0,0,0,0,0,0 -CA-Let,100,12,0,0,0,0,0,0,0,0 -CA-Man,100,2,0,0,0,0,0,0,0,0 -BR-Sa1,100,4,0,0,0,0,0,0,0,0 -BR-Sa3,100,4,0,0,0,0,0,0,0,0 -ES-ES1,100,1,0,0,0,0,0,0,0,0 -FL-Hyy,100,2,0,0,0,0,0,0,0,0 -FL-Kaa,100,14,0,0,0,0,0,0,0,0 -IT-Col,100,7,0,0,0,0,0,0,0,0 -IT-Cpz,100,5,0,0,0,0,0,0,0,0 -DE-Tha,100,1,0,0,0,0,0,0,0,0 -US-Brw,100,12,0,0,0,0,0,0,0,0 -BE-Vie,100,7,0,0,0,0,0,0,0,0 -US-ARM,100,15,0,0,0,0,0,0,0,0 -US-Var,100,13,0,0,0,0,0,0,0,0 -US-UMB,100,7,0,0,0,0,0,0,0,0 -US-Ha1,100,7,0,0,0,0,0,0,0,0 -US-Ho1,100,1,0,0,0,0,0,0,0,0 -US-MMS,100,7,0,0,0,0,0,0,0,0 -US-Bo1,100,15,0,0,0,0,0,0,0,0 -CA-Ca1,100,2,0,0,0,0,0,0,0,0 -CA-Oas,100,8,0,0,0,0,0,0,0,0 -CA-Obs,100,2,0,0,0,0,0,0,0,0 -CA-Ojp,100,2,0,0,0,0,0,0,0,0 -CA-Qfo,100,2,0,0,0,0,0,0,0,0 -US-Me4,100,1,0,0,0,0,0,0,0,0 -US-Me2,100,1,0,0,0,0,0,0,0,0 -US-MOz,100,7,0,0,0,0,0,0,0,0 -US-WCr,100,7,0,0,0,0,0,0,0,0 -US-Dk3,100,1,0,0,0,0,0,0,0,0 -US-Dk2,100,7,0,0,0,0,0,0,0,0 -US-IB1,100,15,0,0,0,0,0,0,0,0 -US-Ne1,100,18,0,0,0,0,0,0,0,0 -US-Ne3,100,15,0,0,0,0,0,0,0,0 -TS-Ts1,100,1,0,0,0,0,0,0,0,0 -TS-Ts2,100,1,0,0,0,0,0,0,0,0 -TS-Ts3,100,1,0,0,0,0,0,0,0,0 -LTER-Sev,100,1,0,0,0,0,0,0,0,0 -RF-Bra,-999,-999,0,0,0,0,0,0,0,0 -LBA-Cax,100,4,0,0,0,0,0,0,0,0 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt deleted file mode 100644 index e581754937..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_sitedata.txt +++ /dev/null @@ -1,44 +0,0 @@ -site_code,name,state,lon,lat,elev,startyear,endyear,alignyear,timestep,campaign -US-Blo,"Blodgett Forest",CA,-120.6327,38.8952,1315,1997,2007,1997,30,AmeriFlux -US-CHATS,"Cilker Chandler walnut orchard",CA,-121.85,38.49,21,2007,2007,2007,30,CHATS -US-FPe,"Fort Peck",MT,-105.1019,48.3077,634,2000,2007,2001,30,AmeriFlux -CA-Let,"Lethbridge",CAN,-112.9402,49.7093,960,1998,2007,1998,30,Fluxnet-Canada -US-NR1,"Niwot Ridge",CO,-105.5464,40.0329,3050,1998,2007,1998,30,AmeriFlux -CA-Man,"BOREAS NSA - Old Black Spruce",CAN,-98.4808,55.8796,259,1994,2003,1994,30,Fluxnet-Canada -BR-Sa1,"SantaremKM67",BRAZIL,-54.9589,-2.85667,130,2002,2004,1,60,LBA -BR-Sa3,"SantaremKM83",BRAZIL,-54.9714,-3.01803,130,2001,2003,1,60,LBA -ES-ES1,"ElSaler",SPAIN,-0.31881,39.346,10,1999,2005,1999,30,CarboEurope -FL-Hyy,"Hyytiala",FINLAND,24.2948,61.8474,181,1997,2005,1997,30,CarboEurope -FL-Kaa,"Kaamanen",FINLAND,27.295,69.1407,155,2000,2005,2001,30,CarboEurope -IT-Col,"Collelongo",ITALY,13.5881,41.8494,1550,1996,2001,1997,30,CarboEurope -IT-Cpz,"CastelPorziano",ITALY,12.3761,41.7052,68,2001,2005,2001,30,CarboEurope -DE-Tha,"Tharandt",GERMANY,13.5669,50.9636,380,1998,2003,1998,30,CarboEurope -US-Brw,Barrow,AK,-156.6259,71.3225,1,1998,2006,1998,30,AmeriFlux -BE-Vie,"Vielsalm",BELGIUM,5.99683,50.3055,450,1997,2005,1997,30,CarboEurope -US-ARM,"ARM SGP Main",OK,-97.4888,36.6058,310,2000,2007,2001,30,AmeriFlux -US-Var,"Vaira Ranch",CA,-120.9507,38.4067,129,2000,2007,2001,30,AmeriFlux -US-UMB,UMBS,MI,-84.7138,45.5598,234,1999,2006,1999,60,AmeriFlux -US-Ha1,"Harvard Forest",MA,-72.1715,42.5378,303,1991,2006,1991,60,AmeriFlux -US-Ho1,"Howland Forest Main",ME,-68.7402,45.2041,60,1996,2004,1997,30,AmeriFlux -US-MMS,"Morgon Monroe State Forest",IN,-86.4131,39.3232,275,1999,2007,1999,60,AmeriFlux -US-Bo1,Bondville,IL,-88.2919,40.0061,300,1996,2008,1997,30,AmeriFlux -CA-Ca1,"British Columbia- Campbell River - Mature Forest Site",CAN,-125.3336,49.8673,300,1998,2006,1998,30,Fluxnet-Canada -CA-Oas,"Sask.- SSA Old Aspen",CAN,-106.19779,53.6289,530,1997,2006,1997,30,Fluxnet-Canada -CA-Obs,"Sask.- SSA Old Black Spruce",CAN,-105.1178,53.9872,629,2000,2006,2001,30,Fluxnet-Canada -CA-Ojp,"Sask.- SSA Old Jack Pine",CAN,-104.6920,53.9163,579,2000,2006,2001,30,Fluxnet-Canada -CA-Qfo,"Quebec Mature Boreal Forest Site",CAN,-74.3421,49.6925,382,2004,2006,2004,30,Fluxnet-Canada -US-Dk2,"Duke Forest Hardwoods",NC,-79.1004,35.9736,160,2003,2005,2003,30,AmeriFlux -US-Dk3,"Duke Forest Loblolly Pine",NC,-79.0942,35.9782,163,1998,2005,1998,30,AmeriFlux -US-IB1,"Fermi Agricultural",IL,-88.2227,41.8593,227,2005,2007,2005,30,AmeriFlux -US-Me4,"Metolius Old Pine",OR,-121.6224,44.4992,915,1996,2000,1996,30,AmeriFlux -US-Me2,"Metolius Intermediate Pine",OR,-121.5574,44.4523,1253,2002,2010,2002,30,AmeriFlux -US-MOz,"Missouri Ozark Site",MO,-92.2,38.7441,219,2004,2007,2005,30,AmeriFlux -US-Ne1,"Mead Irrigated Corn",NE,-96.4766,41.1651,361,2001,2013,2001,60,AmeriFlux -US-Ne3,"Mead Rainfed",NE,-96.4396,41.1797,361,2001,2006,2001,60,AmeriFlux -US-WCr,"Willow Creek",WI,-90.0799,45.8059,520,1998,2006,1998,30,AmeriFlux -TS-Ts1,"Test short yrs",TEST,-105.5464,40.0329,3050,1998,2001,1998,30,PTCLMTestSite -TS-Ts2,"Test short yrs start on leap-year",TEST,-105.5464,40.0329,3050,2004,2007,2005,30,PTCLMTestSite -TS-Ts3,"Test long yrs",TEST,-105.5464,40.0329,3050,2004,2008,2005,30,PTCLMTestSite -LTER-Sev,"Sevilleta Long Term Ecological Research (LTER) project (Meteorology from LTER Cerro Montoso #42)",NM,-106.529444,34.386389,1911,1996,1999,1996,30,LTER -RF-Bra,"Brasillia arbitrary site, no met-data",BR,-50.0,-15.0,-999,-999,-999,-999,60,RFisher -LBA-Cax,"Caxiauna Rainforest 'throughfall exclusion’ (TFE) experiment",BR,-51.46,1.717639,-999,1996,1999,1996,30,LBA diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt deleted file mode 100644 index 414c44fe9a..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLM_sitedata/PTCLMDATA_soildata.txt +++ /dev/null @@ -1,44 +0,0 @@ -site_code,soil_depth,n_layers,layer_depth,layer_sand%,layer_clay% -US-Blo,-999,1,-999,60.0,11.0 -US-CHATS,-999,1,-999,10.0,35.0 -US-FPe,-999,1,-999,47.0,21.0 -CA-Let,-999,1,-999,28.0,36.0 -US-NR1,-999,1,-999,43.13,21.43 -CA-Man,-999,1,-999,33.0,33.0 -BR-Sa1,-999,1,-999,19.0,65.0 -BR-Sa3,-999,1,-999,52.0,40.0 -ES-ES1,-999,1,-999,82.0,5.0 -FL-Hyy,-999,1,-999,82.0,5.0 -FL-Kaa,-999,1,-999,42.0,18.0 -IT-Col,-999,1,-999,22.0,13.0 -IT-Cpz,-999,1,-999,82.0,5.0 -DE-Tha,-999,1,-999,42.0,18.0 -US-Brw,-999,1,-999,50.0,25.0 -BE-Vie,-999,1,-999,42.0,18.0 -US-ARM,-999,1,-999,28.0,43.1 -US-Var,-999,1,-999,30.0,13.0 -US-UMB,-999,1,-999,92.6,0.6 -US-Ha1,-999,1,-999,66.0,6.0 -US-Ho1,0.8,1,-999,50.3,15.9 -US-MMS,-999,1,-999,34.0,63.0 -US-Bo1,-999,1,-999,5.0,25.0 -CA-Ca1,-999,1,-999,84.42,2.63 -CA-Oas,-999,1,-999,50.32,18.8 -CA-Obs,-999,1,-999,80.89,4.12 -CA-Ojp,-999,1,-999,94.47,2.5 -CA-Qfo,-999,1,-999,51.5,4.0 -US-Dk2,-999,1,-999,54.43,21.62 -US-Dk3,-999,1,-999,51.59,13.66 -US-IB1,-999,1,-999,7.8,37.2 -US-Me4,-999,1,-999,66.0,10.0 -US-Me2,-999,1,-999,67.0,7.0 -US-MOz,-999,1,-999,46.38,24.68 -US-Ne1,-999,1,-999,30.7,31.68 -US-Ne3,-999,1,-999,30.7,31.68 -US-WCr,-999,1,-999,42.52,20.17 -TS-Ts1,-999,1,-999,43.13,21.43 -TS-Ts2,-999,1,-999,43.13,21.43 -TS-Ts3,-999,1,-999,43.13,21.43 -LTER-Sev,-999,1,-999,52.,5. -RF-Bra,-999,1,-999,-999,-999 -LBA-Cax,-999,1,-999,75.00,20.00 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt b/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt deleted file mode 100644 index e94db29f8f..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLM_sitedata/US-Ha1_dynpftdata.txt +++ /dev/null @@ -1,4 +0,0 @@ -trans_year,pft_f1,pft_c1,pft_f2,pft_c2,pft_f3,pft_c3,pft_f4,pft_c4,pft_f5,pft_c5,har_vh1,har_vh2,har_sh1,har_sh2,har_sh3,graze,hold_harv,hold_graze -1850,100,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 -1946,100,7,0,0,0,0,0,0,0,0,0.50,0,0,0,0,0,0,0 -2005,100,7,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 diff --git a/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl b/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl deleted file mode 100755 index 51f0305ac1..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLM_sitedata/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl +++ /dev/null @@ -1,261 +0,0 @@ -#!/usr/bin/env perl -# -# cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl Erik Kluzek -# Aug/5/2010 -# -# Convert the transition years files to landuse_timeseries text files. -# -use Cwd; -use strict; -use English; -use IO::File; -use Getopt::Long; - -# -# Some global constants -# -my $maxlen = 125; -my $numharv = 5; -my $numgraz = 1; -my $nbreak = 5*2; -my $numarray = 1 + $nbreak + $numharv + $numgraz + 2 - 1; -my @hd_pftarr; -my @hd_hrvarr; -my @hd_grzarr; - -sub parse_header { -# -# Parse the header and make sure it's correct -# - my $header = shift; - - my @harray = split( /,/, $header ); - if ( $#harray != $numarray ) { - die "** Number of elements in line is incorrect: $#harray should be: $numarray\n"; - } - if ( (my $hyear = shift( @harray )) ne "trans_year" ) { - die "** First header element is NOT trans_year as expected: $hyear\n"; - } - foreach my $var ( "hold_graze\n", "hold_harv" ) { - if ( (my $val = pop( @harray )) ne $var ) { - die "** Last header elements are NOT $var as expected: $val\n"; - } - } - for( my $i = 0; $i < $nbreak; $i++ ) { - push( @hd_pftarr, shift( @harray ) ); - } - for( my $i = 0; $i < $numharv; $i++ ) { - push( @hd_hrvarr, shift( @harray ) ); - } - for( my $i = 0; $i < $numgraz; $i++ ) { - push( @hd_grzarr, shift( @harray ) ); - } -} - -sub parse_pft { -# -# Parse the PFT array -# - my $frcname = shift; - my $idxname = shift; - my $head = shift; - my @pftarray = @_; - - my @header = split( /,/, $head ); - my $sum = 0.0; - my $frcline = "<$frcname>"; - my $idxline = "<$idxname>"; - my $n = 1; - my $endit= undef; - for( my $i = 0; $i <= $#pftarray; $i=$i+2 ) { - my $j = $i + 1; - my $expect = "pft_f$n"; - if ( $header[$i] ne $expect ) { - die "** PFT fraction header is wrong: $header[$i] expect $expect\n"; - } - if ( ! defined($endit) ) { $frcline .= $pftarray[$i]; } - $sum = $sum + $pftarray[$i]; - if ( $pftarray[$j] < 0 || $pftarray[$j] > 16 ) { - die "** PFT index is out of range: $pftarray[$j]\n"; - } - $expect = "pft_c$n"; - if ( $header[$j] ne $expect ) { - die "** PFT code header is wrong: $header[$j] expect $expect\n"; - } - if ( ! defined($endit) ) { $idxline .= $pftarray[$j]; } - if ( $sum > 100.0 ) { - die "** Sum of PFT fractions exceeds 100: $sum\n"; - } elsif ( $sum == 100.0 ) { - $endit = 1; - } - if ( ! defined($endit) && ($j < $#pftarray) ) { $frcline .= ","; } - if ( ! defined($endit) && ($j < $#pftarray) ) { $idxline .= ","; } - $n++; - } - if ( $sum != 100.0 ) { - die "** Sum of PFT fractions does NOT go to 100: $sum\n"; - } - $frcline .= ""; - $idxline .= ""; - - return( "$frcline$idxline" ); -} - -sub parse_hrv { -# -# Parse the harvesting array -# - my $name = shift; - my $head = shift; - my $exp = shift; - my @array = @_; - - my @exp = split( /,/, $exp ); - my @header = split( /,/, $head ); - my $line = "<$name>"; - for( my $i = 0; $i <= $#array; $i++ ) { - if ( $header[$i] ne $exp[$i] ) { - die "** harvesting header is wrong: $header[$i], expecting $exp[$i]\n"; - } - $line .= $array[$i]; - if ( $array[$i] < 0 || $array[$i] > 1 ) { - die "** Bad value for harvest value: $array[$i]\n"; - } - if ( $i < $#array ) { $line .= ","; } - } - $line .= ""; - - return( $line ); -} - -sub printoutline { -# -# Print the line out with the fill as well -# - my $pftline = shift; - my $harline = shift; - my $grzline = shift; - my $year = shift; - - my $outline = "$pftline$harline$grzline"; - my $length = length( $outline ); - if ( $length > $maxlen ) { - die "** line length is too long = $length\n"; - } - my $fill = ""; - for( my $i = 1; $i <= $maxlen - $length; $i++ ) { $fill .= " "; } - - print "$outline$fill $year\n"; - -} - -if ( $#ARGV != 1 ) { - die "** Wrong number of arguments: should just be filename and sim_year_range\n ". - "$0 "; -} -my $filename = $ARGV[0]; -my $sim_year_range = $ARGV[1]; -chomp( $sim_year_range ); -my $start_year; -my $end_year; -if ( $sim_year_range =~ /^([0-9]+)\-([0-9]+)$/ ) { - $start_year = $1; - $end_year = $2; -} else { - die "** bad format for sim_year_range (should be yyyy-yyyy): $sim_year_range\n"; -} - -my $fh = IO::File->new; -$fh->open( "<$filename" ) or die "** can't open file: $filename\n"; - -my $header = <$fh>; -my $last_year = undef; -my $frst_year = undef; - -&parse_header( $header ); - -my $pftline = ""; -my $harline = ""; -my $grzline = ""; -my $hold_h = undef; -my $hold_g = undef; -my $year = undef; -while( my $line = <$fh> ) { - my @array = split( /,/, $line ); - if ( $#array != $numarray ) { - die "** Number of elements in line is incorrect: $#array\n"; - } - $year = shift( @array ); - # - # Write out the years from last year until current year - # - if ( defined($last_year) ) { - for( my $yr = $last_year+1; $yr < $year; $yr++ ) { - if ( $yr >= $start_year ) { - &printoutline( $pftline, $harline, $grzline, $yr ); - } - } - } - # - # Last two parts of the array are harvesting and grazing hold values - # - $hold_g = pop( @array ); - chomp( $hold_g ); - $hold_h = pop( @array ); - # - # Separate out the array into the different sections - # - my @pftarray; - for( my $i = 0; $i < $nbreak; $i++ ) { - push( @pftarray, shift( @array ) ); - } - my @hrvarray; - for( my $i = 0; $i < $numharv; $i++ ) { - push( @hrvarray, shift( @array ) ); - } - my @grzarray; - for( my $i = 0; $i < $numgraz; $i++ ) { - push( @grzarray, shift( @array ) ); - } - # - # Parse the different sections - # - $pftline = &parse_pft( "pft_f", "pft_i", join( ",", @hd_pftarr ), @pftarray ); - $harline = &parse_hrv( "harv", join( ",", @hd_hrvarr ), "har_vh1,har_vh2,har_sh1,har_sh2,har_sh3", @hrvarray ); - $grzline = &parse_hrv( "graz", join( ",", @hd_grzarr ), "graze", @grzarray ); - - # - # Write out the years from start year until first year - # - if ( ! defined($frst_year) && ($year > $start_year) ) { - for( my $yr = $start_year; $yr < $year; $yr++ ) { - &printoutline( $pftline, $harline, $grzline, $yr ); - } - } - # - # Figure out the line length and the amount of fill to have and print it - # - if ( $year >= $start_year ) { - &printoutline( $pftline, $harline, $grzline, $year ); - } - # If NOT holding harvesting, set it to zero, for transition years - if ( ! $hold_h ) { - for( my $i = 0; $i <= $#hrvarray; $i++ ) { $hrvarray[$i] = 0; } - $harline = &parse_hrv( "harv", join( ",", @hd_hrvarr ), "har_vh1,har_vh2,har_sh1,har_sh2,har_sh3", @hrvarray ); - } - # If NOT holding grazing, set it to zero, for transition years - if ( ! $hold_g ) { - for( my $i = 0; $i <= $#grzarray; $i++ ) { $grzarray[$i] = 0; } - $grzline = &parse_hrv( "graz", join( ",", @hd_grzarr ), "graze", @grzarray ); - } - # Save last years value so can create transition years - $last_year = $year; - if ( ! defined($frst_year) ) { $frst_year = $year } -} -# -# Write out years from end to file to the end_year -# -for( my $yr = $year+1; $yr <= $end_year; $yr++ ) { - &printoutline( $pftline, $harline, $grzline, $yr ); -} -$fh->close(); diff --git a/tools/site_and_regional/PTCLM/PTCLMmkdata b/tools/site_and_regional/PTCLM/PTCLMmkdata deleted file mode 100755 index b72e4ff168..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLMmkdata +++ /dev/null @@ -1,713 +0,0 @@ -#!/usr/bin/env python3 -######################################################################################### -# -# PTCLMmkdata -# -# Python script to create datasets to run point simulations of CLM5 -# using Tower Datasets for Ameriflux tower sites, using the CESM2 -# framework. -# -# Python script originally created by: -# -# Daniel M. Riccciuto, Dali Wang, Peter E. Thornton, Wilfred M. Poist -# of Environmental Sciences Division, Oak Ridge National Lab. -# -# Quinn Thomas -# of Cornell University -# -# Modified by Erik Kluzek (NCAR) to be incorporated as a standard part of CLM5. -# -# For help on PTCLMmkdata type: -# -# PTCLMmkdata --help -# -# Also see the README file -# -# Requirements: -# -# python, UNIX shell, NCL (NCAR Command Language), -# GNU make, Fortran compiler, C compiler -# -# NOTE: mksurfdata_map, and gen_domain must be compiled! -# You should only have to compile them once. -# you must also have ncl installed. -# -######################################################################################### -description = 'Python script to create datasets to run single point simulations with tower site data.' -import os, csv, time, re, sys, shlex, subprocess -from xml.sax.handler import ContentHandler -from xml.sax import make_parser - -###### THE ERROR FUNCTION -############################################################## - -def error( desc ): - "error function" - print( "ERROR("+sys.argv[0]+"):: "+desc ) - os.abort() - -###### SET SOME VARIABLES ############################################################## - -#configure case options -#run time defaults -defSitesGroup = "PTCLMDATA" #default site group name - -global ptclm_dir -stdout = os.popen("pwd") -cwd = os.path.abspath( stdout.read().rstrip( ) ) -dirname = os.path.dirname(sys.argv[0]) -if ( dirname == "" ): - ptclm_dir = cwd -else: - ptclm_dir = os.path.abspath(dirname) - -base_ctsm = os.path.abspath(ptclm_dir+"/../../.." ) -wrkdir = cwd -cesm_input = " " -filen = " " -mydatadir = ptclm_dir+"/mydatafiles" -clmnmlusecase = "2000_control" -stdout = os.popen( "date +%y%m%d" ); -sdate = stdout.read().rstrip( ); - -###### GET VERSION INFORMATION ######################################################### - -if sys.version_info < (2, 4): - error( "The version of Python being used is too old for PTCLMmkdata" ) - - -tagvers = "" -clog = open( ptclm_dir+"/ChangeLog", "r" ); -for line in clog: - if ( line.find("Tag: ",0) == 0 ): - n = line.count("") - tagvers = line[5:n-2] - break - -clog.close -version=tagvers - -### PARSE THE COMMAND LINE INPUT ######################################################## - -from optparse import OptionParser, OptionGroup - -#parse arguments -cmdline = "" -for arg in sys.argv: - cmdline = cmdline+arg+" " -parser = OptionParser( usage="%prog [options] -d inputdatadir -s sitename", description=description, version=version ) -required = OptionGroup( parser, "Required Options" ) -required.add_option("-d", "--cesmdata", dest="cesm_input", default=" ", \ - help="Location of CCSM input data") -required.add_option("-s", "--site", dest="mysite", default="none", \ - help="Site-code to run, FLUXNET code (-s list to list valid names)") -parser.add_option_group(required) -options = OptionGroup( parser, "Configure and Run Options" ) -options.add_option("--crop", dest="crop", \ - action="store_true", help = \ - "Create datasets and run with prognostic crop on") -options.add_option("--no-crop", dest="crop", \ - action="store_false", default=False, help = \ - "Create datasets and run without prognostic crop on (DEFAULT)") -options.add_option("--ctsm_root", dest="base_ctsm", \ - default=base_ctsm, help = \ - "Root CTSM directory (top level directory CTSM src bld doc cime_config subdirs)") -options.add_option("--cime_root", dest="base_cime", \ - default=" ", help = \ - "Root CIME directory (top level directory of CIME infrastructure with " \ - + " scripts, doc, utils, tools, src, config subdirs)") -options.add_option("--debug", dest="debug", action="store_true", default=False, \ - help="Flag to turn on debug mode so won't run, but display what would happen") -options.add_option("--sdate", dest="sdate", default=sdate, \ - help="Use entered date string in all files"+\ - " (use the given date string in place of the current date:"+sdate+")" ) -options.add_option("--clmnmlusecase", dest="clmnmlusecase", default=clmnmlusecase, \ - help="CTSM namelist use case to use (default:"+clmnmlusecase+")" ) -options.add_option("--list", dest="list", default=False, action="store_true", \ - help="List all valid: sites") -options.add_option("--mydatadir", dest="mydatadir", default=mydatadir \ - ,help="Directory of where to put your data files (files will be under subdirectories for each site)"+\ - " (default: "+mydatadir+")" ) -options.add_option("--donot_use_tower_yrs",action="store_false",\ - dest="use_tower_yrs",default=True,\ - help="Do NOT use the data years that correspond to the tower years "+\ - "(when you plan on using global forcing)" ) -options.add_option("--quiet", action="store_true", \ - dest="quiet", default=False, \ - help="Print minimul information on what the script is doing") -options.add_option("--cycle_forcing", action="store_true", \ - dest="cycle_forcing", default=False, \ - help="Cycle over the forcing data rather than do one run through (modifies start/end year to get this to work)") -options.add_option("--verbose", action="store_true", \ - dest="verbose", default=False, \ - help="Print out extra information on what the script is doing") -parser.add_option_group(options) - -indatgengroup = OptionGroup( parser, "Input data generation options", \ - "These are options having to do with generation of input datasets. " ) -parser.add_option_group(indatgengroup) -indatgengroup.add_option("--pftgrid", dest="pftgrid", help = \ - "Use pft information from global gridded file (rather than site data)", \ - action="store_true", default=False) -indatgengroup.add_option("--soilgrid", dest="soilgrid", help = \ - "Use soil information from global gridded file (rather than site data)",\ - action="store_true", default=False) -indatgengroup.add_option("--map_gdate", dest="map_gdate", default=sdate, \ - help="Use existing mapping files with the given date string rather than create new ones with current date"+\ - " (if mapping files do NOT exist with this date, the script will abort)" ) -indatgengroup.add_option("--mksurfdata_opts", dest="mksurfdata_opts", help = \ - "Options to send directly to mksurfdata_map",\ - default="") -versiongroup = OptionGroup( parser, tagvers ) -parser.add_option_group(versiongroup) - -(options, args) = parser.parse_args() -if len(args) != 0: - parser.error("incorrect number of arguments") - -### END PARSE THE COMMAND LINE INPUT #################################################### - -### SOME FUNCTIONS ################################################################### - -def system( cmd ): - "system function with error checking and debug prining" - global plev - - if plev>0: print( "Run command: "+cmd ) - - # Check if this is a command to always do regardless of debug - cmdsallow = [ "create_newcase", "mkdir", "mv", "cat", "which", "chmod", "touch", "mksurfdata.pl" ] - allowed_cmd = False - for allow_cmd in cmdsallow: - if ( cmd.find( allow_cmd ) > 0 ): - allowed_cmd = True - - # Error check that command exists - if ( not options.debug or allowed_cmd ): - firstspace = cmd.index(" "); - if ( firstspace == -1 ): - justcmd = cmd - else: - justcmd = cmd[:firstspace] - - if ( cmd.index("/") != -1 ): - if ( not os.path.exists(justcmd) ): - error( "Error command does NOT exist: "+justcmd ); - else: - rcode = os.system( "which "+justcmd ) - if ( rcode != 0 ): - error( "Error command is NOT in path: "+justcmd ) - - # Now actually run the command - if ( not options.debug or allowed_cmd ): - if ( options.debug and cmd.find( "mksurfdata.pl" ) > 0): - rcode = os.system( cmd+" --debug --allownofile" ) - else: - rcode = os.system( cmd ) - else: rcode = 0 - if ( rcode != 0 ): - error( "Error running command: "+cmd ) - if ( os.path.isfile(filen) ): - output = open( filen,'a') - output.write(cmd+"\n") - output.close - -def queryFilename( queryopts, filetype ): - "query the XML database to get a filename" - global abs_base_ctsm - query = abs_base_ctsm+"/bld/queryDefaultNamelist.pl -silent " \ - +"-justvalue " - if ( cesm_input != " " ): - query = query + " -csmdata "+cesm_input - cmd = query+queryopts+" -var "+filetype - file = os.popen( cmd ) - filename = file.read() - if ( file.close() != None ): - print( "Query = "+cmd ) - error( "Error getting file from XML database" ) - # Remove the trailing new line from the filename - if ( (filename == None) or (filename == "") ): - print( "Query = "+cmd ) - error( "Trouble finding file from XML database: "+filetype ) - return( filename.replace( "\n", "" ) ) - -def setup_case_files( ): - "Setup the user_nl_clm and shell_commands files" - - global data_dir - global cmdline - filex = data_dir+"/shell_commands" - output = open( filex,'w') - output.write("# shell commands to execute xmlchange commands written by PTCLMmkdata:\n") - output.write("# "+cmdline+"\n") - output.close - system( "/bin/chmod +x "+filex ) - usernlclm = data_dir+"/user_nl_clm" - output = open( usernlclm,'w') - output.write("! user_nl_clm namelist options written by PTCLMmkdata:\n") - output.write("! "+cmdline+"\n") - output.close - return( filex, usernlclm ) - -def xmlchange_env_value( filex, var, value, note="", append=False ): - 'Function to set the value of a variable in one of the env_*.xml files' - change = "./xmlchange" - if ( append ): - change = change + " --append" - cmd = change+" "+var+"="+value - output = open( filex,'a') - if ( note != "" ): - output.write("# "+note+"\n") - output.write(cmd+"\n") - output.close - -def write_datm_namelistdefaults_file( dir ): - "Write namelist_defaults_datm.xml file" - global data_dir - datm_src_dir = data_dir+"/SourceMods/src.datm"; - os.system( "/bin/mkdir -p "+datm_src_dir ) - file = datm_src_dir+"/namelist_defaults_datm.xml" - output = open( file,'w') - filestrings = ( '', \ - ' ', \ - '', \ - ' ', \ - '', \ - ' ', \ - '' ) - # write out file - for line in filestrings: - output.write(line+"\n") - # Add data directory for files - if ( line.find( "" ) != -1 ): - output.write('\n') - value = ''+dir+'\n' - output.write(value) - - output.close - -def find_filename_created( wildcard, desc ): - "Find the filename of the file that was just created" - - global options - if ( not options.debug ): - # If NOT debug mode, get the filename from a directory listing - stdout = os.popen( "ls -1t1 "+wildcard+" | head -1" ); - filename = stdout.read().rstrip( ); - if ( not os.path.exists( filename) ): error( "filename does NOT exist:"+wildcard ) - else: - # For debug mode, create a file with current date replacing any wildcards - filename = wildcard.replace( "*", options.sdate ) - os.system( "touch "+filename ) - - print( desc+" = "+filename ) - return( filename ) - - -if sys.version_info < (2, 5): - def rpartition( string, sep ): - 'Reverse order of dividing string by seperator' - before = string[0:string.rfind(sep)]; - after = string[before.count(""):]; - return ( before, sep, after ) - -###### SET OPTIONS BASED ON INPUT FROM PARSER ########################################## - -mysite = options.mysite -SitesGroup = defSitesGroup -infohelp = "\n\n Use --help option for help on usage.\n"; -if(options.list): - mysite = "list" -if ( mysite == "none" ): parser.error("sitename is a required argument, set it to a valid value"+infohelp ) -if ( options.verbose and options.quiet ): - parser.error( "options quiet and verbose are mutually exclusive"+infohelp ) - -if ( options.verbose ): plev = 2 -elif ( options.quiet ): plev = 0 -else: plev = 1 - -sitedata=SitesGroup+"_sitedata.txt" -soildata=SitesGroup+"_soildata.txt" -pftdata=SitesGroup+"_pftdata.txt" - - -if plev>0: print( "---------------- PTCLMmkdata version "+str(version)+"-----------------------------\n" ) -if plev>0: print( " "+cmdline+"\n" ) -if plev>0: print( " OPTIONS:\n" ) -if plev>0: print( "Site name:\t\t\t\t\t\t"+mysite+"\n" ) - -base_ctsm = options.base_ctsm -if base_ctsm == " ": - #assume base directory is three levels up from where PTCLM script - # is executed, if not specified - stdout = os.popen("cd "+ptclm_dir+"/../../..; pwd") - base_ctsm = os.path.abspath( stdout.read().rstrip( ) ) - -abs_base_ctsm = os.path.abspath( base_ctsm ) -if plev>0: print( "Root CTSM directory:\t\t\t\t\t"+abs_base_ctsm ) - -base_cime = options.base_cime -if base_cime == " ": - #assume base directory is tunder the CTSM directory - # is executed, if not specified - stdout = os.popen("cd "+abs_base_ctsm+"/cime; pwd") - base_cime = os.path.abspath( stdout.read().rstrip( ) ) - -abs_base_cime = os.path.abspath( base_cime ) -if plev>0: print( "Root CIME directory:\t\t\t\t\t"+abs_base_cime ) - -if plev>0: print( "** Surface data file will be built using site-level data " + - "when available unless otherwise specified ** \n" ) -if plev>0: print( "\tExtract PFT data from gridded files:\t\t"+str(options.pftgrid) ) -if plev>0: print( "\tExtract soil data from gridded files:\t\t"+str(options.soilgrid) ) - -###### END SET OPTIONS BASED ON INPUT FROM PARSER ###################################### - -########## GET SITE LAT, LON, AND TOWER MET YEARS ####################################### - -siteDir = ptclm_dir+"/"+"PTCLM_sitedata" -#get lat/lon, start/end years from sitedata file -if plev>0: print( "\nOpen Site data file: "+siteDir+"/"+sitedata+"\n" ) -sitepath = siteDir+"/"+sitedata -AFdatareader = csv.reader(open(sitepath), dialect="unix") -if ( mysite == "list" ): plev = 2 -found=False -for row in AFdatareader: - if plev>1: print( " site = %9s name: %-55s Region: %12s Campaign: %s" % ( row[0], row[1], row[2], row[10] ) ) - if row[0] == mysite: - found=True - lon=float(row[3]) - if (lon < 0): - lon=360.0+float(row[3]) - lat=float(row[4]) - startyear=int(row[6]) - endyear=int(row[7]) - alignyear = int(row[8]) - timestep = int(row[9]) - -# Exit early for list options -if ( mysite == "list" ): - exit() -if ( not found ): - parser.error( "Entered site is NOT in the list of valid sites: "+mysite ) - -# inputdata directory -- set after list options -cesm_input=options.cesm_input -if cesm_input == " ": - parser.error( "inputdatadir is a required argument, set it to the directory where you have your inputdata"+infohelp ) -if plev>0: print( "CESM input data directory:\t\t\t\t"+cesm_input ) -#define data and utility directories -mask = "navy" -clmusrdatname = "1x1pt_"+mysite -clmusrdat = " -usrname "+clmusrdatname -clmres = clmusrdatname -clmmask = "navy" -myres = "CLM_USRDAT" #single-point mode (don't change) - -clm_tools = abs_base_ctsm+'/tools' -if ( not os.path.exists( clm_tools ) ): - error( "clm tools directory does NOT exist: "+clm_tools ) -gen_dom_dir = abs_base_cime+'/tools/mapping/gen_domain_files' -if ( not os.path.exists( gen_dom_dir ) ): - error( "generate domain directory does NOT exist: "+gen_dom_dir ) -mkmapgrd_dir= clm_tools+'/mkmapgrids' -if ( not os.path.exists( mkmapgrd_dir ) ): - error( "make map grid directory does NOT exist: "+mkmapgrd_dir ) -mkmapdat_dir= clm_tools+'/mkmapdata' -if ( not os.path.exists( mkmapdat_dir ) ): - error( "make map data directory does NOT exist: "+mkmapdat_dir ) -clm_input = cesm_input+'/lnd/clm2' -datm_input = cesm_input+'/atm/datm7' - -mydata_dir = os.path.abspath( options.mydatadir ) -data_dir = mydata_dir+"/"+clmusrdatname -if ( not os.path.exists( data_dir ) ): os.system( "/bin/mkdir -p "+data_dir ) - -if plev>0: print( "----------------------------------------------------------------\n" ) - -############# WRITE OUT README FILE ON DATA ############################################## - -opt = " " - -clmnmlusecase = options.clmnmlusecase - -filen = data_dir+"/README.PTCLM" -if plev>0: print( "Write "+filen+" with command line" ) -output = open( filen,'w') -output.write(cmdline+"\n") -output.close - -############# GET SIM_YEAR, RCP and SIM_YEAR_RANGE based on USE-CASE #################### -############# CLM configure ensures naming conventions are followed #################### -############# And setup Query options based on them ##################################### - -if ( clmnmlusecase.endswith("_transient") ): - transient = re.search('^([0-9]+-[0-9]+)_*(.*)_(transient$)', clmnmlusecase ) - if ( transient ): - sim_year_range = transient.group(1) - sim_year = re.search( '^([0-9]+)-', transient.group(1) ).group(1) - elif ( clmnmlusecase.startswith("20thC_") ): - sim_year_range = "1850-2000" - sim_year = "1850" - else: - error( "Can not parse use-case name, does not follow conventions: "+clmnmlusecase ) - - if ( sim_year_range == "1850-2000" ): actual_sim_year_range = "1850-2015" - else: actual_sim_year_range = sim_year_range -elif ( clmnmlusecase.endswith("_control") ): - control = re.search( '^([0-9]+)_', clmnmlusecase ) - if ( not control ): error( "Can NOT parse use-case name does NOT follow conventions: "+clmnmlusecase ) - sim_year = control.group(1) - if ( sim_year == None ): error( "Trouble finding sim_year from:"+clmnmlusecase ) - sim_year = str(sim_year) - sim_year_range = "constant" -elif ( clmnmlusecase.endswith("_pd") or clmnmlusecase == "UNSET" ): - sim_year = "2000" - sim_year_range = "constant" -else: - error( "Can not parse use-case name:, does not follow conventions: "+clmnmlusecase ) - -landuse_timeseries_type = "hist" - -qoptionsbase = " -options mask="+mask - -qoptions = qoptionsbase+",sim_year="+sim_year+",sim_year_range="+sim_year_range; -queryOpts = " -onlyfiles -res "+clmres+clmusrdat+qoptions -queryOptsNousr = qoptions -queryOptsNavy = " -res 0.33x0.33 "+qoptions - -# -# If you are trying to cycle the forcing years you need to be careful about -# the number of years cycling over and taking leap years into account. -# -if ( options.cycle_forcing ): - numyears = endyear - startyear + 1 - numfour = int(numyears/4) - # If have three years or less (numfour = 0) just repeat first year - # unless first year is leap year then use next year. - # Since just using one year that is not a leap year endyear is startyear - if (numfour == 0): - if (startyear % 4 == 0): - startyear = startyear + 1 - - endyear = startyear - else: - endyear = startyear + numfour * 4 - 1 - - # Use alignyear from file for cycle_forcing case -else: - # When NOT cycling forcing, use start year for the align year - alignyear = startyear - -if (options.crop == True): - mkcrop = " -crop" -else: - mkcrop = " -no-crop" - -####### ANY OTHER LAST SETTINGS BEFORE CREATING DATASETS ################################ - -##### ENV XML CHANGES ################################################################## -filex, usernlclm = setup_case_files( ) - -if ( clmusrdatname != "" ): - xmlchange_env_value( filex, "CLM_USRDAT_NAME", clmusrdatname ) - -if(options.use_tower_yrs): - xmlchange_env_value( filex, "DATM_CLMNCEP_YR_START", str(startyear) ) - xmlchange_env_value( filex, "DATM_CLMNCEP_YR_END", str(endyear) ) - -xmlchange_env_value( filex, "MPILIB", "mpi-serial", note="Comment this out if NINST_LND is greater than 1 (see: http://bugs.cgd.ucar.edu/show_bug.cgi?id=2521)" ) - -############# BEGIN CREATE POINT DATASETS ############################################### - - -if plev>0: print("Making input files for the point (this may take a while if creating transient datasets)") - -os.chdir(data_dir) -#make map grid file and atm to ocean map ############################################ -if plev>0: print( "Creating map file for a point with no ocean" ) -print( "lat="+str(lat) ) -ptstr = str(lat)+","+str(lon) -if ( os.system( "which ncl" ) != 0 ): error( "ncl is NOT in path" ) # check for ncl -system(mkmapdat_dir+"/mknoocnmap.pl -p "+ptstr+" -name "+clmres+" > "+data_dir+"/mknoocnmap.log") -mapfile = find_filename_created( data_dir+"/map_"+clmres+"_noocean_to_"+clmres+"_"+"nomask_aave_da_*.nc", "mapfile" ) -if plev>0: print( "mapfile = ", mapfile ) -scripgridfile = find_filename_created( data_dir+"/SCRIPgrid_"+clmres+"_nomask_c*.nc", "scripgridfile" ) -if plev>0: print( "scripgridfile = ", scripgridfile ) - -#make domain file needed by datm #################################################### -if plev>0: print( "Creating data domain" ) -cmd = gen_dom_dir+"/gen_domain -m "+mapfile+" -o "+clmmask+" -l "+clmres+" -c 'Running gen_domain from PTCLMmkdata' > "+data_dir+"/gen_domain.log" -system(cmd); -domainfile = find_filename_created( "domain.lnd."+clmres+"_"+clmmask+".*.nc", "domainfile" ) - -#make surface data and dynpft ####################################################### -if plev>0: print( "\n\nRe-create surface dataset:\t" ) -if ( sim_year_range == "constant" ): - mksrfyears = sim_year -else: - mksrfyears = sim_year_range - -#make mapping files needed for mksurfdata_map ####################################### - -mapdir = data_dir -if ( options.map_gdate == options.sdate ): - # mkmapdata.sh remembers where it is (although it starts over for a new date) - if plev>0: print( "\n\nRe-create mapping files for surface dataset:" ) - cmd = mkmapdat_dir+"/mkmapdata.sh --gridfile "+scripgridfile+" --res "+clmres+" --gridtype regional -v > "+mapdir+"/mkmapdata.log"; - system(cmd); -else: - mksrfmapfile = find_filename_created( mapdir+"/map_*"+"_c"+options.map_gdate+".nc", "mksrfmapfile" ) - if ( not os.path.exists( mksrfmapfile ) ): error( "mapping files with gdate of "+ \ - options.map_gdate+" do NOT exist, bad value for --map_gdate option" ) - -# --- use site-level data for mksurfdata_map when available ---- -#PFT information for the site -if (options.pftgrid == False): - if plev>0: print( "Replacing PFT information in surface data file" ) - os.chdir(siteDir) - AFdatareader = csv.reader(open(pftdata), dialect="unix") - os.chdir(data_dir) - pft_frac=[0,0,0,0,0] - pft_code=[0,0,0,0,0] - found=0 - for row in AFdatareader: - if plev>1: print( " site = %9s" % row[0] ) - if row[0] == mysite: - found=1 - output=open("./tempsitePFT.txt","w") - output.write(' '.join(row[1:11])) - output.close() - for thispft in range(0,5): - pft_frac[thispft]=float(row[1+2*thispft]) - pft_code[thispft]=int(row[2+2*thispft]) - if ( found == 0 ): - error( "Did NOT find input sitename:"+mysite+" in pftdata:"+pftdata+ \ - " run with pftgrid instead") - # Find index of first zero - for i in range(0,len(pft_frac)): - if ( pft_frac[i] == 0.0 ): - nzero = i - break - pftopts=" -pft_frc \""+str(pft_frac[0:nzero])+'"' \ - " -pft_idx \""+str(pft_code[0:nzero]) +'"' + mkcrop -else: - pftopts="" - -#Read in the soil conditions for the site ####################################### -if (options.soilgrid == False): - - #soil information - os.chdir(siteDir) - if plev>0: print( "Replacing soil information in surface data file" ) - AFdatareader = csv.reader(open(soildata), dialect="unix") - os.chdir(data_dir) - found=0 - for row in AFdatareader: - if plev>1: print( " site = %9s" % row[0] ) - if row[0] == mysite: - found=1 - output=open("./tempsitesoil.txt","w") - output.write(' '.join(row[1:7])) - output.close() - # The first three items are NOT used - soil_depth = float(row[1]) # This is ignored - n_layers = int(row[2]) # This is ignored - layer_depth = float(row[3]) # This is ignored - sandpct = float(row[4]) - claypct = float(row[5]) - if ( found == 0 ): - error( "Did NOT find input sitename:"+mysite+" in soildata:"+soildata+ \ - " run with soilgrid instead") - if plev>0: print( " sandpct="+str(sandpct)+" claypct="+str(claypct) ) - soilopts=" -soil_cly "+str(claypct)+" -soil_snd "+str(sandpct) -else: soilopts="" -#----- create dynamic pft input file --------------- ############################ -if (options.pftgrid == False) and (sim_year_range != "constant"): - - if plev>0: print( "Creating site-specific dynamics PFTs and harvesting" ) - - landuse_timeseries_site_filename = siteDir + \ - mysite + "_dynpftdata.txt" - - # only set dynpft file if the file exists - if ( os.path.exists( landuse_timeseries_site_filename ) ): - if plev>0: print( "Transition PFT file exists, so using it for changes in PFT" ) - # Convert the file from transition years format to mksurfdata_map landuse_timeseries_ format - cnv = siteDir + \ - "/cnvrt_trnsyrs2_landuse_timeseries_txtfile.pl " + \ - landuse_timeseries_site_filename+" "+sim_year_range - landuse_timeseries_outfile = data_dir+"/landuse_timeseries_"+mysite+".txt" - system( cnv+" > "+landuse_timeseries_outfile ) - dynpftopts = " -dynpft "+landuse_timeseries_outfile - else: - error( "Transition PFT file does NOT exist for this site, create one, use --pftgrid, or choose a non transient use-case" ) - -else: - dynpftopts = "" - -# Now run mksurfdata_map ########################################################### -mksurfopts = "-res usrspec -usr_gname "+clmres+" -usr_gdate "+options.map_gdate+ \ - " -usr_mapdir "+mapdir+" -dinlc "+cesm_input+" -y "+mksrfyears+ \ - soilopts+pftopts+dynpftopts+" "+options.mksurfdata_opts -system(clm_tools+"/mksurfdata_map/mksurfdata.pl "+mksurfopts+" > "+data_dir+"/mksurfdata_map.log") - -surffile = find_filename_created( data_dir+"/surfdata_"+clmres+"*_simyr"+sim_year+"_*.nc", "surface file" ) -logfile = find_filename_created( data_dir+"/surfdata_"+clmres+"*_simyr"+sim_year+"_*.log", "surface log file" ) -if ( sim_year_range != "constant" ): - landuse_timeseries_file = find_filename_created( data_dir+"/landuse.timeseries_"+clmres+"_"+landuse_timeseries_type+"*_simyr"+actual_sim_year_range+"_*.nc", "landuse_timeseries_file" ) -# rename files with clm version in the filename -mkopts = "" -if (options.pftgrid == True): mkopts += "_pftgrd" -if (options.soilgrid == True): mkopts += "_soigrd" -if (options.mksurfdata_opts != "" ): mkopts += "_"+options.mksurfdata_opts.replace(" ","+") - - - -####### END CREATE POINT DATASETS ####################################################### - - -###### SET ENV_RUN.XML VALUES ########################################################### - -os.chdir(data_dir) -xmlchange_env_value( filex, "ATM_DOMAIN_PATH", data_dir ) -xmlchange_env_value( filex, "LND_DOMAIN_PATH", data_dir ) -xmlchange_env_value( filex, "ATM_DOMAIN_FILE", domainfile ) -xmlchange_env_value( filex, "LND_DOMAIN_FILE", domainfile ) -xmlchange_env_value( filex, "CLM_BLDNML_OPTS", "'-mask "+mask+mkcrop+"'", append=True ); - -xmlchange_env_value( filex, "CALENDAR", "GREGORIAN" ) -xmlchange_env_value( filex, "DOUT_S", "FALSE" ) -hist_nhtfrq = 0 -hist_mfilt = 1200 - -atm_ncpl = int((60 // timestep) * 24) -xmlchange_env_value( filex, "ATM_NCPL", str(atm_ncpl) ) -if(options.use_tower_yrs): - xmlchange_env_value( filex, "RUN_STARTDATE", str(alignyear)+"-01-01" ) - xmlchange_env_value( filex, "DATM_CLMNCEP_YR_ALIGN", str(alignyear) ) - -xmlchange_env_value( filex, "DIN_LOC_ROOT", cesm_input ) -xmlchange_env_value( filex, "DIN_LOC_ROOT_CLMFORC", mydata_dir ) - -#### NAMELIST DEFAULTS FILE MODIFICATIONS ############################################## -datm_dir = data_dir+"/CLM1PT_data" -if ( os.path.isdir(datm_dir) ): - write_datm_namelistdefaults_file( datm_dir ) - -#### SET NAMELIST OPTIONS ############################################################## -output = open(usernlclm,'a') -output.write( " fsurdat = '"+surffile+"'\n" ) -if (sim_year_range != "constant"): - output.write( " flanduse_timeseries = "+landuse_timeseries_file+"\n" ) -output.write( " hist_nhtfrq = "+str(hist_nhtfrq)+"\n" ) -output.write( " hist_mfilt = "+str(hist_mfilt)+"\n" ) -output.close() -if plev>1: os.system( "/bin/cat user_nl_clm" ) - -###### END SET Spinup and ENV_RUN.XML VALUES ############################################ - -if plev>0: print( "Data created successfully in "+data_dir+"\n" ) - -### END PTCLM SCRIPT #################################################################### - diff --git a/tools/site_and_regional/PTCLM/PTCLMsublist b/tools/site_and_regional/PTCLM/PTCLMsublist deleted file mode 100755 index 052e3018d5..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLMsublist +++ /dev/null @@ -1,16 +0,0 @@ -#!/usr/bin/env python3 -# -# Python program to submit a list of sites to the batch queue. -# Setup for: cheyenne, yellowstone, edison -# -from PTCLMsublist_prog import PTCLMsublist_prog - -bsub = PTCLMsublist_prog() -bsub.parse_cmdline_args() -print( "Submit a list of sites to the batch queue\n" ) -bsub.Initialize() - -for site in bsub.get_SiteList(): - print( "Submit for site: "+site+"\n" ) - bsub.Submit( site ) - diff --git a/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py b/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py deleted file mode 100644 index 20fd9e7171..0000000000 --- a/tools/site_and_regional/PTCLM/PTCLMsublist_prog.py +++ /dev/null @@ -1,214 +0,0 @@ -######################################################################################### -# -# PTCLMsublist_prog -# -# Top level class to define the PTCLMsublist program. Parse's arguments and has Init, -# and run methods to submit a list of PTCLMmkdata sites to the batch queue. -# -######################################################################################### -import os, sys -from batchque import batchque - -class PTCLMsublist_prog: -#---------------------------------------------------------------------------------------- -# Class to handle command line input to the program -#---------------------------------------------------------------------------------------- - # Class data - name = "PTCLMsublist" - cmdline = "" - account = "P93300606" - ctsmdir_def = "../../../" - ctsmdir = os.getenv("CTSM_ROOT", ctsmdir_def ) - inputdir_def = "/glade/p/cesmdata/cseg/inputdata" - inputdir = os.getenv("DIN_LOC_ROOT", inputdir_def ) - sitelistcsv = "US-CHATS,US-FPe,CA-Let,US-NR1,CA-Man,BR-Sa1,BR-Sa3" - mach = "cheyenne" - wall = "02:00:00" - parse_args = False - ptclm_opts = "" - que = batchque() - setup = False - - # -- Error function --------------------------------- - def error( self, desc ): - "error function to abort with a message" - print( "ERROR("+self.name+"):: "+desc ) - sys.exit(100) - - def parse_cmdline_args( self ): - "Parse the command line arguments for the PTCLM batch submission script" - from optparse import OptionParser, OptionGroup - - for arg in sys.argv: - self.cmdline = self.cmdline+arg+" " - parser = OptionParser( usage="%prog [options]" ) - options = OptionGroup( parser, "Options" ) - options.add_option("-r", "--ctsm_root", dest="ctsm_root", default=self.ctsmdir, \ - help="Location of CTSM root directory (also set with CTSM_ROOT env variable)") - options.add_option("-d", "--inputdir", dest="inputdir", default=self.inputdir, \ - help="Location of CESM inputdata directory (also set with CSMDATA env variable)") - options.add_option("-o", "--PTCLM_options", dest="options", default=self.ptclm_opts, \ - help="PTCLM options to run with") - options.add_option("-l", "--list", dest="sitelist", default=self.sitelistcsv, \ - help="Comma seperated list of PTCLM sites to submit to batch") - options.add_option("--account", dest="account", default=self.account, \ - help="Account number to use for batch queue") - options.add_option("--wall", dest="wall", default=self.wall, \ - help="Wall clock time to submit in queue for") - options.add_option("--mach", dest="mach", default=self.mach, \ - help="Machine name to use for batch submital") - parser.add_option_group(options) - stdout = os.popen("pwd") - cwd = os.path.abspath( stdout.read().rstrip( ) ) - tagvers = "" - clog = open( cwd+"/ChangeLog", "r" ); - for line in clog: - if ( line.find("Tag: ",0) == 0 ): - n = line.count("") - tagvers = line[5:n-2] - break - - clog.close - versiongroup = OptionGroup( parser, tagvers ) - parser.add_option_group(versiongroup) - (options, args) = parser.parse_args() - if len(args) != 0: - parser.error("incorrect number of arguments") - - self.mach = options.mach - self.sitelistcsv = options.sitelist - self.account = options.account - self.options = options.options - self.ctsmdir = options.ctsm_root - self.inputdir = options.inputdir - # Initialize batch que object, will abort if bad machine - self.que.Initialize( self, mach=self.mach, account=self.account ) - # Error checking - if ( not os.path.isdir(self.ctsmdir) ): - self.error( "CTSM_root directory does NOT exist: "+self.ctsmdir ) - if ( not os.path.isdir(self.inputdir) ): - self.error( "CESM inputdata directory does NOT exist: "+self.inputdir ) - - # Get site list from csv formatted string list - if ( self.sitelistcsv.find( " " ) != -1 ): - self.error( "Site list has white space in it, just use comma's to seperate sites: "+self.sitelistcsv ) - if ( self.sitelistcsv.find( ",," ) != -1 or self.sitelistcsv.endswith( "," ) or self.sitelistcsv.startswith( "," ) ): - self.error( "Site list has empty site names, make sure comma's do not go after each other: "+self.sitelistcsv ) - self.sitelist = self.sitelistcsv.split( "," ) - - # Flag that parsing was accomplished - self.parse_args = True - - def ctsm_root( self ): - "Return the CTSM_ROOT directory" - if ( not self.parse_args ): - self.error( "parse_cmdline_args was NOT run first" ) - return( self.ctsmdir ) - - def get_SiteList( self ): - "Return the Site list" - if ( not self.parse_args ): - self.error( "parse_cmdline_args was NOT run first" ) - return( self.sitelist ) - - def Initialize( self ): - "Initialize the PTCLM batch submission" - if ( not self.parse_args ): - self.error( "parse_cmdline_args was NOT run first" ) - - self.que.Initialize( self, self.mach, self.account ) - self.setup = True - - - def Submit( self, site, submit=True ): - "Submit the PTCLMmkdata job to the batch queue" - if ( not self.setup ): - self.error( "Initialize was NOT run first" ) - - jobcommand = "./PTCLMmkdata --ctsm_root "+self.ctsmdir+" -s "+site+" -d "+self.inputdir+" "+self.options - print( jobcommand ); - bsub = self.que.Submit( self, jobcommand, jobname="PTCLM_"+site, submit=submit, wall=self.wall ) - return( bsub ) - -# -# Unit testing for above classes -# -import unittest - -class test_PTCLMsublist_prog(unittest.TestCase): - - def setUp( self ): - self.prog = PTCLMsublist_prog() - - def test_badinit( self ): - # Bad option will fail - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "--zztop" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - # Test that doing stuff before parse_args fails - self.prog = PTCLMsublist_prog() - self.assertRaises(SystemExit, self.prog.ctsm_root ) - self.assertRaises(SystemExit, self.prog.Initialize ) - self.assertRaises(SystemExit, self.prog.Submit, "US-UMB" ) - # Test that doing stuff after parse_args before Initialize fails - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ ] - self.prog.parse_cmdline_args( ) - self.assertRaises(SystemExit, self.prog.Submit, "US-UMB" ) - # Test that a non existant directory for ctsm_root fails - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "--ctsm_root", "zztop" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - # Test that a non existant directory for inputdata fails - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "-d", "inpzztop" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - # Test that a bad site list fails - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "-l", "thing thing2 thing3" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "-l", "thing,thing2,,thing3" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "-l", "thing,thing2,thing3," ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - self.prog = PTCLMsublist_prog() - sys.argv[1:] = [ "-l", ",thing,thing2,thing3" ] - self.assertRaises(SystemExit, self.prog.parse_cmdline_args ) - - def test_init( self ): - # check that setting ctsm_root works - sys.argv[1:] = [ ] - self.prog.parse_cmdline_args( ) - ctsmdir_def = os.getenv("CTSM_ROOT", self.prog.ctsmdir_def ) - self.assertTrue( self.prog.ctsm_root( ) == ctsmdir_def ) - cwd = os.getcwd() - sys.argv[1:] = [ "--ctsm_root", cwd ] - self.prog.parse_cmdline_args( ) - self.assertTrue( self.prog.ctsm_root( ) == cwd ) - # Initialize and submit - self.prog.Initialize( ) - site = "US-UMB" - bsub = self.prog.Submit( site, submit=False ) - jobid = str(os.getpid()) - checkstring = "qsub -o PTCLM_US-UMB."+jobid+".stdout.out -N PTCLM_US-UMB -l walltime=02:00:00 " + \ - "-A P93300606 -l select=3:ncpus=1:mpiprocs=1:mem=109GB -q regular " + \ - "-V -m ae -j oe PTCLM_"+site+"."+jobid+".job" - print( "\n" ) - print( "bsubcm:"+bsub+":end" ) - print( "expect:"+checkstring+":end" ) - self.assertTrue( bsub == checkstring ) - - def test_sitelist( self ): - sitelistcsv = "US-UMB,US-Ha1" - sitelist = [ "US-UMB", "US-Ha1" ] - sys.argv[1:] = [ "-l", sitelistcsv ] - self.prog.parse_cmdline_args( ) - self.prog.Initialize( ) - slist = self.prog.get_SiteList( ) - self.assertTrue( slist == sitelist ) - - -if __name__ == '__main__': - unittest.main() diff --git a/tools/site_and_regional/PTCLM/README b/tools/site_and_regional/PTCLM/README deleted file mode 100644 index 033474f748..0000000000 --- a/tools/site_and_regional/PTCLM/README +++ /dev/null @@ -1,118 +0,0 @@ -PTCLM/README 04/10/2015 - -NOTE PTCLM is DEPRECATED! - -NOTE, PTCLM is being deprecated to make way for new faster tools that will create datasets -based on existing global datasets rather than use the same process for global datasets. Those -scripts are under tools/site_and_regional in a CTSM checkout. There is a high memory requirement -for the process with PTCLM because of the need to make mapping files from global grids. The simpler -process of extracting just the data needed from existing global files is much faster and easier -to do on even simple systems such as a laptop. - -PTCLMmkdata is a python tool built on top of CLM tools and CESM scripts -for building datasets to run CLM "I" cases for data from Ameriflux Tower-sites, -or other user-supplied single-point datasets. - -Original Authors: - -Daniel M. Ricciuto, Dali Wang, Peter E. Thornton, Wilfred M. Post - -Environmental Sciences Division, Oak Ridge National Laboratory (ORNL) - -R. Quinn Thomas - -Cornell University - -Modified by: - -Erik Kluzek (NCAR) - -General Directory structure: - - PTCLM/PTCLMmkdata ----- Main script - PTCLM/PTCLM_sitedata - Site data files of - static information latitude, longitude, soil info., and PFT information - for each site Also different "groups" of site-data lists, and the script to - convert the transient years landuse_timeseries files into landuse_timeseries text files that - mksurfdata can use. - PTCLM/mydatafiles ----- Default location of - data files that will be created by PTCLMmkdata. Sites will be built - in their own subdirectories under here. Optionally you can give your - own location you'd like to use for your data. - - PTCLM/PTCLMsublist --------- Script to submit a list of PTCLM - sites to the batch que (only setup for a few machines). - PTCLM/PTCLMsublist_prog.py - Python module to support submit - list script. Handles command line arguments and such. - PTCLM/batchque.py ---------- Python module for batch submital. - PTCLM/buildtools ----------- Script to build the CLM - tools needed to run PTCLMmkdata (mksurfdata_map and gen_domain). Works on cheyenne. - -Quickstart: - -# ASSUMPTIONS: -# For this example I'm running a I1PtClm50SpGs case on cheyenne using -# CSMDATA in the standard location -# Finally we use the 6-digit AmeriFlux site code for the University of Mich. Biological -# Station US-UMB (data for this station is checked into the inputdata repository). -# I also assume you are using UNIX C-shell, and GNU make is called gmake -setenv CSMDATA /glade/p/cesm/cseg/inputdata -setenv SITE US-UMB - - -cd PTCLM -setenv MYDATAFILES `pwd`/mydatafiles - -# Next build all of the clm tools you will need -# The following script assumes cheyenne, hobart, or izumi for other machines -# you'll need to build each tool by hand -./buildtools -# next run PTCLMsublist which will submit PTCLMmkdata to batch queue (NOTE -- MAKE SURE python, NCO AND NCL IS IN YOUR PATH) -# PTCLMsublist is only setup for a few batch machines, you'll need to update them to add new machines -# or create your own batch submission script. -# NOTE: Every day you run PTCLMmkdata it will remake the map called -# renamemapfiles to rename files with todays creation date. -# This makes running PTCLMmkdata a reasonable amount of time. -# However, you can use the script in mydatafiles -# -qcmd -l walltime=02:00:00 -- ./PTCLMsublist -l $SITE -d $CSMDATA --account=XXXXXXXXX --mach=cheyenne - -# NOTE: To submit several sites at once, make the "-l" option a comma delimited -# list of site names. - -# Next copy the towersite meterology datafiles into your $MYDATAFILES space -# (For the US-UMB station you can skip this step as the .build step will bring the data over) -cd $MYDATAFILES/1x1pt_$SITE -mkdir $MYDATAFILES/1x1pt_$SITE/CLM1PT_data -# Copy meteorology data NetCDF files into 1x1pt_$SITE sub-directory -# (with filenames of yyyy-mm.nc) -# The variables assumed to be on the files are: -# ZBOT, TBOT, RH, WIND, PRECTmms, FSDS, PSRF, FLDS -# (if other fields are available or with different names this can be changed by -# adding a user_nl_datm.streams.txt file as we outline below) -# Make sure your data has time with the attribute: calendar="gregorian" - -# Make sure the forcing directory points to the location of your data -# (PTCLMmkdata should already do this) -./xmlchange DIN_LOC_ROOT_CLMFORC=$MYDATAFILES/1x1pt_$SITE - -# Then create a case using the data you just created -setenv MYCASE "testPTCLM" -cd $CTSMROOT/cime -setenv CIMEROOT `pwd` -cd $CIMEROOT/scripts -./create_newcase --user-mods-dir $MYDATAFILES/1x1pt_$SITE --case $MYCASE --res CLM_USRDAT --compset I1PtClm50SpGs --mach cheyenne - -# Next setup as normal -cd $MYCASE -./case.setup - -# If you need to customize your list of fields uncomment and do the following... -# cp CaseDocs/datm.streams.txt.CLM1PT.CLM_USRDAT user_datm.streams.txt.CLM1PT.CLM_USRDAT -# chmod u+w user_datm.streams.txt.CLM1PT.CLM_USRDAT -# $EDITOR user_datm.streams.txt.CLM1PT.CLM_USRDAT -# ./preview_namelists - -# Finally build, and run the case as normal -./case.build -./case.submit diff --git a/tools/site_and_regional/PTCLM/README.rst b/tools/site_and_regional/PTCLM/README.rst deleted file mode 100644 index 96f6514b87..0000000000 --- a/tools/site_and_regional/PTCLM/README.rst +++ /dev/null @@ -1,18 +0,0 @@ -===== -PTCLM -===== - -The PTCLM tool to set up PoinT CLM simulations, -is part of the Community Earth System Model. - -See the CESM web site for documentation and information: - -http://www.cesm.ucar.edu - -NOTE: PTCLM is being deprecated and replaced by a different process - -A limitation of PTCLM was speed and computing requirements. By doing the -same process as for global datasets mapping files for high resolution -datasets needed to be created which even for a single point requires -large computing platforms. The new process modifies existing global datasets -and as such can be done simply even on a laptop. diff --git a/tools/site_and_regional/PTCLM/batchque.py b/tools/site_and_regional/PTCLM/batchque.py deleted file mode 100644 index 37bea8a207..0000000000 --- a/tools/site_and_regional/PTCLM/batchque.py +++ /dev/null @@ -1,256 +0,0 @@ -######################################################################################### -# -# batchque.py -# -# Python class to handle batch submission of single-processor command-line jobs. -# -######################################################################################### -import os, sys - -class batchque: -#---------------------------------------------------------------------------------------- -# Class to handle batch queue submission -#---------------------------------------------------------------------------------------- - # Class data - setup = False - mach = "" - account = "" - submit = False - jobscript = "" - # - # hash's keyed off the list of machines known - # - # Basic options giving queue name, number of processors (1) and walltime - # yellowstone(LSF): -n 1=1 task, -R=Number of tasks on node, -q=queue name, -N=, -a=process type, -W=wallclock time - # cheyenne(PBS): -l=tasks, processors per node, and wallclock time, -q=queue name, -V=use ALL env variables, - # -m=mail options (ae send mail on submit and exit) - # edison(PBS): -l=tasks, processors per node, and wallclock time, -q=queue name, -V=use ALL env variables, - # -m=mail options (ae send mail on submit and exit) - # -j oe on edison and -oo on yellowstone (without -e/-eo means combine stderr and stdout - opts = { 'yellowstone':"-n 1 -R 'span[ptile=15]' -q geyser -N -a poe ", \ - 'cheyenne' :"-l select=3:ncpus=1:mpiprocs=1:mem=109GB -q regular -V -m ae -j oe ", \ - 'edison' :"-l nodes=1:ppn=1 -q regular -V -m ae -j oe " } - # batch submission command - bsub = { 'yellowstone':"bsub", 'cheyenne':"qsub" , 'edison':"qsub" } - # Option to give file for standard output - bs_stdout = { 'yellowstone':" -oo ", 'cheyenne':" -o " , 'edison':" -o " } - # Option to give job name to use - bs_jobnam = { 'yellowstone':" -J ", 'cheyenne':" -N " , 'edison':" -N " } - # Option to give current directory to use - bs_curdir = { 'yellowstone':" -cwd ", 'cheyenne':"" , 'edison':" -d " } - # Option to give account name to use - bs_accnt = { 'yellowstone':" -P ", 'cheyenne':" -A " , 'edison':"" } - # If jobcommand needs to be script file - bs_script = { 'yellowstone':False, 'cheyenne':True , 'edison':True } - # Option to give wallclock time to use - bs_wtime = { 'yellowstone':" -W ", 'cheyenne':" -l walltime=", 'edison':" -l walltime=" } - - def Initialize( self, prog, mach="cheyenne", account="" ): - "Initialize the batchque" - if ( self.bsub.get(mach) == None ): - print( "List of valid machines: "+str(self.bsub.keys()) ) - prog.error( "Machine NOT in list of valid machines for batch queue: "+mach ) - - self.mach = mach - if ( self.bs_accnt[mach] == "" and account != "" ): - prog.error( "Account entered but this machine does NOT have an account option: "+mach ) - - self.account = account - - self.setup = True - self.submit = False - - def Get_OutFilename( self, prog ): - "Get the output log filename" - if ( not self.setup ): - prog.error( "Trying to get the output filename and Initialize was NOT run first!" ) - if ( not self.submit ): - prog.error( "Trying to get the output filename and Submit was NOT run first!" ) - - return( self.stdout ) - - def Submit( self, prog, jobcommand, curdir=os.getcwd(), jobname="batchjob", wall="4:00", submit=True ): - "Get the command to submit the job to the batch queue" - if ( not self.setup ): - prog.error( "Initialize was NOT run first!" ) - - if ( not os.path.exists(curdir) ): - prog.error( "Input current directory does NOT exist: "+curdir ) - - cmd = self.bsub[self.mach] - opts = "" - pid = str(os.getpid()) - stdout = str(jobname)+"."+pid+".stdout.out" - self.stdout = stdout - opts += self.bs_stdout[self.mach]+stdout+" " - opts += self.bs_jobnam[self.mach]+str(jobname)+" " - if ( self.bs_curdir[self.mach] != "" ): - opts += self.bs_curdir[self.mach]+curdir+" " - opts += self.bs_wtime[self.mach]+wall+" " - if ( self.account != "" and self.bs_accnt[self.mach] != "" ): - opts += self.bs_accnt[self.mach]+self.account+" " - opts += self.opts[self.mach]+" " - if ( self.bs_script[self.mach] ): - self.jobscript = jobname+"."+pid+".job" - if ( os.path.exists( self.jobscript ) ): - os.system( "/bin/rm -rf "+self.jobscript ) - js = open(self.jobscript,"w") - if ( self.bs_curdir[self.mach] == "" ): - js.write( "cd "+curdir+"\n" ) - js.write( jobcommand+"\n" ) - js.close() - os.chmod(self.jobscript,0o555) - cmd += " "+opts+self.jobscript - else: - cmd += " "+opts+jobcommand - - if ( os.path.exists( self.stdout ) ): - os.system( "/bin/rm "+self.stdout ) - if ( submit ): - status = os.system( cmd ) - if ( status != 0 ): - prog.error( "Batch submit returns an error" ) - - self.submit = True - - return( cmd ) - - def SubmitCleanup( self, prog, rmout=False ): - "Cleanup any files made in submit and reset output filename -- only DO AFTER BATCH HAS RUN!" - if ( not self.setup ): - prog.error( "Initialize was NOT run first!" ) - if ( not self.submit ): - prog.error( "Submit was NOT run first!" ) - outfile = self.Get_OutFilename( prog ) - if ( not os.path.exists(outfile) ): - prog.error( "SubmitCleanup called before batch output was returned" ) - - if ( self.bs_script[self.mach] ): - os.system( "/bin/rm -rf "+self.jobscript ) - if ( rmout ): - os.system( "/bin/rm "+outfile ) - - self.submit = False - -# -# Unit testing for above classes -# -import unittest - -class error_prog: - def error( self, desc ): - print( desc ) - sys.exit( 100 ) - -class test_batchque(unittest.TestCase): - - def setUp( self ): - "Setup tests" - self.prog = error_prog() - self.que = batchque() - - def test_badinit( self ): - "test bad initialization" - # Bad machine name - self.assertRaises(SystemExit, self.que.Initialize, self.prog, mach="zztop" ) - # account given on machine without account - self.assertRaises(SystemExit, self.que.Initialize, self.prog, mach="edison", account="thing" ) - # test using submit and Get_OutFilename before Initialization - self.assertRaises(SystemExit, self.que.Submit, self.prog, "ls" ) - self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) - # Test that all hashes have the same list of keys - keylist = str(self.que.opts.keys()) - self.assertTrue(keylist == str(self.que.bsub.keys()) ) - self.assertTrue(keylist == str(self.que.bs_stdout.keys()) ) - self.assertTrue(keylist == str(self.que.bs_jobnam.keys()) ) - self.assertTrue(keylist == str(self.que.bs_accnt.keys()) ) - self.assertTrue(keylist == str(self.que.bs_curdir.keys()) ) - - def test_init( self ): - "test initialization and submit" - - machlist = self.que.opts.keys() - for mach in machlist: - print( "Test initialization for: "+mach ) - self.que.Initialize( self.prog, mach=mach ) - cmd = self.que.Submit( self.prog, "ls", jobname=mach, submit=False ) - print( cmd+"\n" ) - outfile = self.que.Get_OutFilename( self.prog ) - os.system( "touch "+outfile ) - self.que.SubmitCleanup( self.prog, rmout=True ) - - mach = "cheyenne" - self.que.Initialize( self.prog, mach=mach, account="account" ) - cmd = self.que.Submit( self.prog, "ls", jobname=mach, submit=False ) - print( cmd+"\n" ) - outfile = self.que.Get_OutFilename( self.prog ) - os.system( "touch "+outfile ) - print( "outfile: "+outfile ) - self.que.SubmitCleanup( self.prog, rmout=True ) - - def test_bad_submit( self ): - "test bad submit" - mach = "cheyenne" - self.que.Initialize( self.prog, mach=mach, account="account" ) - self.assertRaises(SystemExit, self.que.Submit, self.prog, "ls", curdir="zztop", jobname=mach, submit=False ) - self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) - - def test_submit( self ): - "test submitting to local machine if on list" - stdout = os.popen("hostname") - host = stdout.read().rstrip( ) - startname = { 'ys':'yellowstone', 'cheyenne':'cheyenne', 'edison':'edison' } - mach = "" - for sname in startname: - if ( host.startswith(sname) ): - mach = startname[sname] - if ( mach != "" ): - if ( mach == "yellowstone" ): - account = "CESM0008" - elif ( mach == "cheyenne" ): - account = "P93300606" - else: - account = "" - self.que.Initialize( self.prog, mach=mach, account=account ) - else: - print( "Machine not known, so NOT trying a test submit" ) - return - - print( "Submit ls to batch queue" ) - # Submit and get the output filename - scmd = "ls PTCLMmkdata" - wall = "0:01" - cmd = self.que.Submit( self.prog, scmd, jobname=mach, wall=wall, submit=False ) - print( "submit: "+cmd ) - outfile = self.que.Get_OutFilename( self.prog ) - # make sure SubmitCleanup will fail since it wasn't submitted yet and output not returned - self.assertRaises(SystemExit, self.que.SubmitCleanup, self.prog ) - status = os.system( cmd ) - self.assertTrue( status == 0 ) - iter = 0 - exists = os.path.exists(outfile) - while( status == 0 and iter < 100 and not exists ): - iter += 1 - exists = os.path.exists(outfile) - if ( not exists ): - print( "Sleep for a bit to check if outfile was created yet" ) - os.system( "sleep 20" ) - else: - print( "Out file created cat it... should be ls of PTCLMmkdata" ) - self.assertTrue( os.path.exists(outfile) ) - os.system( "cat "+outfile ) - - # Cleanup after the submital - self.que.SubmitCleanup( self.prog, rmout=True ) - - # make sure files were deleted and submit status changed - self.assertTrue( not self.que.submit ) - self.assertRaises(SystemExit, self.que.Get_OutFilename, self.prog ) - self.assertTrue( not os.path.exists(outfile) ) - if ( self.que.jobscript != "" ): - self.assertTrue( not os.path.exists(self.que.jobscript) ) - # Now test that a bad submit returns an error (give bad walltime) - self.assertRaises(SystemExit, self.que.Submit, self.prog, scmd, jobname=mach, wall="--zztop" ) - -if __name__ == '__main__': - unittest.main() diff --git a/tools/site_and_regional/PTCLM/buildtools b/tools/site_and_regional/PTCLM/buildtools deleted file mode 100755 index a3579e38c0..0000000000 --- a/tools/site_and_regional/PTCLM/buildtools +++ /dev/null @@ -1,149 +0,0 @@ -#!/bin/bash -# -# buildtools -# -# Build the clm tools that PTCLM will need to run when creating files. -# -# Environment variables to set: -# -# CTSM_ROOT: To build with a separate root to CTSM component set the -# env variable CTSM_ROOT to the root directory to use. -# -# CIME_ROOT: To build with a separate root to CIME scripts set the -# env variable CIME_ROOT to the root directory to use. -# - -pwd=`pwd` -host=`hostname` -echo "Build clm tools for PTCLM on "$host"" - -# -# Get path to root -# -if [ -z "$CTSM_ROOT" ]; then - cd "../../.." - CTSM_ROOT=`pwd` - cd - -fi -if [ ! -d "$CTSM_ROOT" ];then - echo "Directory $CTSM_ROOT does not exist" - echo "Set env variable CTSM_ROOT" - exit -1 -fi -if [ ! -d "$CTSM_ROOT/src/biogeophys" ];then - echo "Directory $CTSM_ROOT/src/biogeophys does not exist as expected" - echo "Set env variable CTSM_ROOT to directory at head of CTSM code" - exit -1 -fi -if [ -z "$CIME_ROOT" ]; then - if [ ! -d "$CTSM_ROOT/cime" ]; then - cd "$CTSM_ROOT/../../cime" - CIME_ROOT=`pwd` - cd - - else - cd "$CTSM_ROOT/cime" - CIME_ROOT=`pwd` - cd - - fi -fi -if [ ! -d "$CIME_ROOT" ];then - echo "Directory $CIME_ROOT does not exist" - echo "Set env variable CIME_ROOT" - exit -1 -fi -# -# Machine dependent stuff -# -CIME_MODEL="cesm" -export CIME_MODEL -toolsmake="" -if [[ "$host" =~ cheyenne ]] || [[ "$host" =~ r[0-9]+i[0-9]+n[0-9]+ ]]|| [[ "$host" =~ caldera ]] || [[ "$host" =~ geyser ]] || [[ "$host" =~ pronghorn ]]; then - echo "Setup for cheyenne" - . /glade/u/apps/ch/opt/lmod/8.1.7/lmod/lmod/init/sh - - gmake="gmake" - parcmp=36 - machine="cheyenne" - compiler="intel" - netcdf=$NETCDF - module load $compiler - module load mkl - module load netcdf - module load ncl -elif [[ "$host" =~ hobart ]] || [[ "$host" =~ h[0-9]+.cgd.ucar.edu ]]; then - echo "Setup for hobart" - . /usr/share/Modules/init/sh - gmake="gmake" - parcmp=2 - machine="hobart" - compiler="intel" - module load compiler/intel - netcdf=$NETCDF_PATH - export PATH="${PATH}:/usr/bin" -elif [[ "$host" =~ izumi ]] || [[ "$host" =~ i[0-9]+.unified ]]; then - echo "Setup for izumi" - . /usr/share/Modules/init/sh - gmake="gmake" - parcmp=2 - machine="izumi" - compiler="intel" - module load compiler/intel - netcdf=$NETCDF_PATH - export PATH="${PATH}:/usr/bin" -elif [[ "$host" =~ eureka ]] || [[ "$host" =~ vpn ]]; then - echo "Setup for eureka" - gmake="make" - parcmp=12 - machine="homebrew" - compiler="gnu" - netcdf="/opt/local" - toolsmake="USER_FC=gfortran-mp-4.8 USER_LINKER=gfortran-mp-4.8 USER_CC=gcc " - case='$CASE' - export NETCDF_PATH=$netcdf -else - echo "Bad host to run on: know about cheyenne, hobart, izumi or eureka" - exit -3 -fi -export INC_NETCDF=${netcdf}/include -export LIB_NETCDF=${netcdf}/lib -# -# Build the tools -# -echo "Build the tools" -dirs=( \ - $CTSM_ROOT/tools/mksurfdata_map/src \ - $CIME_ROOT/tools/mapping/gen_domain_files/src \ - ) -for dir in ${dirs[*]}; do - echo "Build in $dir" - cd $dir - if [[ "$dir" =~ gen_domain ]]; then - rm env_mach_specific.xml - cmd="$CIME_ROOT/tools/configure --machine $machine --macros-format Makefile" - echo "$cmd" - $cmd - if [ $? != 0 ]; then - echo "Problem with configure: $?" - exit -1 - fi - #. ./.env_mach_specific.sh # don't use this as it currently doesn't work for mpi-serial - #cmd="ln -s $dirs/Macros.make $dirs/Macros" - #echo "$cmd" - #$cmd - fi - $gmake clean - cmd="$gmake OPT=TRUE SMP=TRUE -j $parcmp COMPILER=$compiler OS=LINUX MPILIB=mpi-serial $toolsmake" - echo "$cmd" - $cmd - if [ $? != 0 ]; then - echo "Problem with build: $?" - exit -1 - fi - if [[ "$dir" =~ gen_domain ]]; then - /bin/rm *.o - else - $gmake clean - fi -done - -echo -e "\n\nSuccessfully built CLM tools needed to create datasets for PTCLM\n"