-
Notifications
You must be signed in to change notification settings - Fork 353
Update single point docs (and improve subset_data etc. erroring) #3002
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
samsrabin
merged 24 commits into
ESCOMP:b4b-dev
from
samsrabin:single-point-docs-202503
Mar 27, 2025
Merged
Changes from all commits
Commits
Show all changes
24 commits
Select commit
Hold shift + click to select a range
af86105
Add new-single-point-docs.md with notes.
samsrabin a8f93c2
Throw error if Python tool detects negative longitude. Improve help m…
samsrabin 2350b69
Improve subset_data error msg for non-1850 --create-landuse.
samsrabin f9f4b81
subset_data: Error when --create-datm given for a region.
samsrabin d6a4067
Rename a .rst file to reflect replacement of PTS_MODE with subset_data.
samsrabin 7e82378
Update new-single-point-docs.md with Adrianna's instructions.
samsrabin 14de359
Move new doc from markdown to rst.
samsrabin d1b65a0
Add a docs TODO.
samsrabin 685e08e
Replace docs refs to pts_mode with single_point_subset_data.
samsrabin 77d9cf9
subset_data now adds ./xmlchange DATM_YR_* stuff to shell_commands.
samsrabin 4143319
Remove extraneous headings in subset_data doc.
samsrabin 47c68b0
subset_data doc: Remove dead link to CTSM tutorial.
samsrabin 82dbf66
subset_data doc: Formatting fixes.
samsrabin 68ac42d
Reformat with black.
samsrabin 7c1d2dc
Add previous commit to .git-blame-ignore-revs.
samsrabin b471c29
Single-point docs: Remove refs to PTS_MODE.
samsrabin 49efaf8
Document how to change the default DATM data from CRUJRA2024 to GSWP3
slevis-lmwg b1b2e63
Merge branch 'b4b-dev' into single-point-docs-202503
samsrabin 09abff1
Restore PTS_MODE instructions for SCAM usage.
samsrabin 3fb4f7b
Replace "parameters" with "settings" in one place.
samsrabin 3d1f673
Minor correction in summary of single_point_subset_data.
samsrabin d153990
Update summary of CLM_USRDAT_NAME.
samsrabin c2e56f6
Add --inputdata-dir instructions.
samsrabin dd26bf8
subset_data.py: Clarify use of global DATM.
samsrabin File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
60 changes: 60 additions & 0 deletions
60
doc/source/users_guide/running-single-points/running-single-point-subset-data.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| .. include:: ../substitutions.rst | ||
|
|
||
| .. _single_point_subset_data: | ||
|
|
||
| **************************************** | ||
| Running a single point using global data | ||
| **************************************** | ||
|
|
||
| ``subset_data`` enables you to run the model using global datasets, but just picking a single point from those datasets and operating on it. It can be a very quick way to do fast simulations and get a quick turnaround. | ||
|
|
||
| Subset the data | ||
| ------------------ | ||
|
|
||
| For single-point cases, you need to subset a surface dataset and (optionally) DATM data. The Python script to subset this data can be found in the CTSM repository at ``tools/site_and_regional/subset_data``. | ||
|
|
||
| Note that you will need to have a python environment set up that includes the packages ``scipy``, ``xarray``, and ``numpy``. If you have conda or miniconda installed, you can create a conda environment for this and other CTSM python tools using the script ``py_env_create`` at the top level of your CTSM checkout. | ||
|
samsrabin marked this conversation as resolved.
|
||
|
|
||
| To subset surface data and climate forcings (DATM) for a single point, use the command: | ||
|
|
||
| .. code:: shell | ||
|
|
||
| tools/site_and_regional/subset_data point \ | ||
| --lat $my_lat --lon $my_lon --site $my_site_name \ | ||
| --create-surface --create-datm \ | ||
| --datm-syr $my_start_year --datm-eyr $my_end_year \ | ||
| --create-user-mods --outdir $my_output_dir | ||
|
|
||
| - ``$my_lat``: latitude of point, *must be between -90 and 90 degrees*. E.g., Boulder, CO, USA: 40. | ||
| - ``$my_lon``: longitude of point, *must be between 0 and 360 degrees*. E.g., Boulder, CO, USA: 55. | ||
| - ``$my_site_name``: name of site, *used for file naming* | ||
| - ``$my_start_year``: start year for DATM data to subset, *default between 1901 and 2014* | ||
| - ``$my_end_year``: end year for DATM data to subset, *default between 1901 and 2014; the default CRUJRA2024 DATM data ends in 2023, while the old default GSWP3 ends in 2015; see note below about switching the default DATM data* | ||
| - ``$my_output_dir``: output directory to place the subset data and user_mods directory. This should be something specific to *just* your data for ``$my_site_name``. | ||
|
|
||
| You can also have the script subset land-use data. See the help (``tools/site_and_regional/subset_data --help``) for all argument options. | ||
|
|
||
| **Note that this script defaults to subsetting specific surface, domain, and land-use files and the CRUJRA2024 DATM data, and can currently only be run as-is on Derecho. If you're not on Derecho, use the ``--inputdata-dir`` to specify where the top level of your CESM input data is. Also, to subset GSWP3 instead of CRUJRA2024 DATM data, you currently need to hardwire datm_type = "datm_gswp3" (instead of the default "datm_crujra") in python/ctsm/subset_data.py.** | ||
|
|
||
| The ``--create-user-mods`` command tells the script to set up a user mods directory in your specified ``$my_output_dir`` and to specify the required ``PTS_LAT`` and ``PTS_LON`` settings. You can then use this user mods directory to set up your CTSM case, as described below. | ||
|
|
||
| Create the case | ||
| ------------------ | ||
|
|
||
| You can use the user mods directory set up in the previous subset data step to tell CIME/CTSM where your subset files are located. | ||
|
|
||
| .. code:: shell | ||
|
|
||
| cime/scripts/create_newcase --case $my_case_name --res CLM_USRDAT \ | ||
| --compset $compset --run-unsupported \ | ||
| --user-mods-dirs $my_output_dir/user_mods | ||
|
|
||
| - ``$my_case_name``: the path of the case directory you want to create | ||
| - ``$compset``: the compset you would like to use (for example, ``I2000Clm60Bgc``) | ||
| - Note the use of ``$my_output_dir/user_mods`` which is the ``user_mods/`` directory that the subset data script set up within your specified ``$my_output_dir``. | ||
|
|
||
| Note that ``./case.setup`` on Derecho will automatically set queue to ``develop`` and walltime to one hour. You might need a longer walltime, but the maximum walltime for ``develop`` is one hour. To change it to two hours on Derecho: | ||
|
|
||
| .. code:: shell | ||
|
|
||
| ./xmlchange --subgroup case.run JOB_QUEUE=main,JOB_WALLCLOCK_TIME=2:00:00 | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.