Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
198 commits
Select commit Hold shift + click to select a range
af111d1
Add representative-hillslopes external (optional) in tools/external/.
samsrabin Feb 20, 2024
f00c21c
UNTESTED! Bring in CTSM-specific hillslope Python scripts.
samsrabin Feb 20, 2024
697559b
synthetic_hillslope: Remove unused bits.
samsrabin Mar 18, 2024
e6e3b38
synthetic_hillslope: Add basic input arguments.
samsrabin Mar 18, 2024
8c9024c
synthetic_hillslope: Save settings as netCDF attributes.
samsrabin Mar 18, 2024
f662e56
synthetic_hillslope: Change hard-coded settings to command-line options.
samsrabin Mar 18, 2024
bc9ed36
synthetic_hillslope: Remove check_file_permissions().
samsrabin Mar 18, 2024
5d54aeb
synthetic_hillslope: Remove unused code re: timetag.
samsrabin Mar 18, 2024
a7515e0
synthetic_hillslope: Use shutil.copyfile() instead of subprocess.
samsrabin Mar 18, 2024
f05fcbc
synthetic_hillslope: Format with black.
samsrabin Mar 18, 2024
66e6045
Add previous commit to .git-blame-ignore-revs.
samsrabin Mar 18, 2024
86aa9a3
synthetic_hillslope: Factor out create_variables(), write_to_file().
samsrabin Mar 18, 2024
60b71b0
synthetic_hillslope: Rename f and w to infile and outfile.
samsrabin Mar 18, 2024
e021680
synthetic_hillslope: Add docstrings.
samsrabin Mar 18, 2024
d4b1bcb
Simplify calculation of aspect.
samsrabin Mar 18, 2024
92e655f
synthetic_hillslope: Reduce nesting in i-j loop.
samsrabin Mar 18, 2024
e28e757
synthetic_hillslope: Define *cosp_height() functions outside main().
samsrabin Mar 18, 2024
4a7377c
synthetic_hillslope: Don't check hcase is slope_aspect; that's handle…
samsrabin Mar 19, 2024
d87ab72
synthetic_hillslope: More refactoring to reduce size of main().
samsrabin Mar 19, 2024
cc47ddd
synthetic_hillslope: Resolve pylint complaint about netCDF4.Dataset().
samsrabin Mar 19, 2024
db46dce
synthetic_hillslope: Actually close outfile.
samsrabin Mar 19, 2024
ddd2790
synthetic_hillslope: Suppress a pointless-string-statement warning.
samsrabin Mar 19, 2024
8a2fda7
synthetic_hillslope: Functionize define_hillslope_geom_arrays().
samsrabin Mar 19, 2024
65ed60d
synthetic_hillslope: Rename im and jm to n_lon and n_lat.
samsrabin Mar 19, 2024
eb4906d
Run python/ctsm/hillslopes/ through black formatter.
samsrabin Mar 20, 2024
e57d3f0
Add previous commit to .git-blame-ignore-revs.
samsrabin Mar 20, 2024
92b761c
combine_gridcell_files: Clean up top of module.
samsrabin Mar 20, 2024
077b131
combine_gridcell_files: Split into parse_args() and main().
samsrabin Mar 20, 2024
37b0718
Hillslope scripts: Replace use of stop.
samsrabin Mar 20, 2024
51b7b9c
combine_gridcell_files: Split out write_to_file() and create_variable…
samsrabin Mar 21, 2024
c80f08d
combine_gridcell_files: Move options to arguments.
samsrabin Mar 21, 2024
3f60e61
combine_gridcell_files: Fix variable names in read-in netCDF.
samsrabin Mar 21, 2024
02318dd
Share create_variables code between hillslope scripts.
samsrabin Mar 21, 2024
08b8f7a
combine_gridcell_files: Suppress pylint warning about netCDF4.Dataset.
samsrabin Mar 21, 2024
fa98b49
combine_gridcell_files: Add a docstring.
samsrabin Mar 21, 2024
bfceccb
combine_gridcell_files: Don't use subprocess.
samsrabin Mar 21, 2024
6530250
synthetic_hillslope: Use LANDFRAC_PFT instead of PFTDATA_MASK.
samsrabin Mar 21, 2024
017a06e
combine_gridcell_files: Simplify some booleans.
samsrabin Mar 21, 2024
a0784ab
combine_gridcell_files: Improve variable names.
samsrabin Mar 21, 2024
0982051
combine_gridcell_files: Don't assume Unix filepath separators.
samsrabin Mar 21, 2024
fa96067
Replace loop_call.py with functionality in combine_gridcell_files.
samsrabin Mar 21, 2024
2aa15f3
combine_chunk_files: Remove some unneeded stuff.
samsrabin Mar 21, 2024
34c59cd
combine_chunk_files: Turn options into arguments.
samsrabin Mar 21, 2024
f34c261
combine_chunk_files: Add --overwrite flag.
samsrabin Mar 21, 2024
21ca682
combine_chunk_files: Add --verbose flag.
samsrabin Mar 21, 2024
f0d34eb
combine_chunk_files: Reduce nesting.
samsrabin Mar 21, 2024
79b0a0d
combine_chunk_files: Include dem_source.
samsrabin Mar 21, 2024
5a54585
combine_chunk_files: Fix an error msg.
samsrabin Mar 22, 2024
50d298f
combine_chunk_files: Don't use subprocess.
samsrabin Mar 22, 2024
a816cf6
Point representative-hillslopes external at Sean's branch.
samsrabin Mar 22, 2024
e0395d1
combine_gridcell_files: 58 statements is OK.
samsrabin Mar 22, 2024
2bf1fc6
"pylint: disable=no-name-in-module" for importing netCDF4.Dataset.
samsrabin Apr 2, 2024
63c4873
combine_chunk_files: Reformat with black.
samsrabin Apr 2, 2024
65ecbeb
Add previous commit to .git-blame-ignore-revs.
samsrabin Apr 2, 2024
c74d848
combine_chunk_files: Reduce nesting.
samsrabin Apr 2, 2024
54e5abb
Convenience functions for making hillslope variables.
samsrabin Apr 2, 2024
9a94ab0
combine_chunk_files: Remove unused variable 'command'.
samsrabin Apr 2, 2024
dc0add9
combine_chunk_files: Simplify top of loop thru chunks.
samsrabin Apr 2, 2024
f1ce7e6
combine_chunk_files: Rename initializeArrays to arrays_uninitialized.
samsrabin Apr 2, 2024
27c2567
combine_chunk_files: Simplify some booleans.
samsrabin Apr 2, 2024
eb03d81
combine_chunk_files: Rename addBedrock and addStream for pylint.
samsrabin Apr 2, 2024
c931942
combine_chunk_files: Move variable fill to immediately after creation.
samsrabin Apr 2, 2024
68b17cc
combine_chunk_files: Save just hillslope_file. Use xarray.
samsrabin Apr 3, 2024
7b67d61
Add --n-bins arg to combine_chunk_files and combine_gridcell_files.
samsrabin Apr 3, 2024
75c9ca4
combine_chunk_files: Use trapezoid instead of section_quad files.
samsrabin Apr 3, 2024
752a1c7
combine_chunk_files: Remove coordinate vars nmaxhillcol and nhillslope.
samsrabin Apr 3, 2024
8f108b8
combine_chunk_files: Save as netCDF4-classic.
samsrabin Apr 3, 2024
060a66d
combine_gridcell_files: Improve --n-bins description.
samsrabin Apr 3, 2024
589877b
Add --hillslope-form to combine_gridcell_files and combine_chunk_files.
samsrabin Apr 3, 2024
89e25bd
combine_chunk_files: Functionize read_hillslope_vars().
samsrabin Apr 3, 2024
f27f7de
combine_chunk_files: Remove unused variable h_pftndx.
samsrabin Apr 3, 2024
712c566
combine_chunk_files: Refactor into class HillslopeVars.
samsrabin Apr 4, 2024
8f92840
combine_chunk_files: Resolve variable name pylint complaints.
samsrabin Apr 4, 2024
a880ed7
Split HillslopeVars.read() into versions for old/new varnames.
samsrabin Apr 4, 2024
9e8fae1
combine_chunk_files: Remove unused imports.
samsrabin Apr 4, 2024
fee572c
Add wrapper script tools/hillslopes/combine_chunk_files.
samsrabin Apr 4, 2024
ef103b1
Add tools/external/ to .gitignore.
samsrabin Apr 4, 2024
063a6d9
synthetic_hillslope now saves hillslope_file instead of fsurdat.
samsrabin Apr 4, 2024
bc4304c
combine_chunk_files: Don't use xarray.
samsrabin Apr 4, 2024
3a4fe27
Move HillslopeVars to hillslope_utils.
samsrabin Apr 4, 2024
66eba03
combine_gridcell_files: Use HillslopeVars.
samsrabin Apr 4, 2024
1958107
combine_gridcell_files: Only read hillslope data dimensions/settings …
samsrabin Apr 4, 2024
0eb3ad1
HillslopeVars: Mark internal functions with leading underscore.
samsrabin Apr 4, 2024
6218aee
Rename sjm and sim to n_lat and n_lon.
samsrabin Apr 5, 2024
6789c15
Bugfix for HillslopeVars.update() default arg.
samsrabin Apr 5, 2024
fb53d01
Bugfix: Use of chunk_mask in HillslopeVars.update().
samsrabin Apr 5, 2024
d3e9a43
combine_chunk_files.py: Bugfix for --n-chunks argparse.
samsrabin Apr 16, 2024
ec82aa3
hillslope_utils.py: Use NETCDF_FORMAT constant.
samsrabin Apr 16, 2024
a9e05b0
hillslope_utils.py: Functionize add_longxy_latixy_nc().
samsrabin Apr 16, 2024
c89600c
combine_chunk_files.py: Save LATIXY and LONGXY.
samsrabin Apr 16, 2024
a3287e1
hillslope_utils.py: Change LONGXY/LATIXY metadata to match fsurdat.
samsrabin Apr 16, 2024
ff58969
combine_chunk_files.py: Save AREA.
samsrabin Apr 16, 2024
fb2caaf
combine_chunk_files.py: Add input_file and creation_date.
samsrabin Apr 16, 2024
0fc80f5
combine_chunk_files.py: Functionize finish_saving().
samsrabin Apr 16, 2024
0261c18
hillslope_utils.py: Functionize _remove_hillslope_data().
samsrabin Apr 16, 2024
7053b29
Reformat hillslope scripts with black.
samsrabin Apr 16, 2024
71be2e7
Add previous commit to .git-blame-ignore-revs.
samsrabin Apr 16, 2024
a981e69
synthetic_hillslope.py: Remove unused import shutil.
samsrabin Apr 16, 2024
90e4810
synthetic_hillslope.py: Resolve a few pylint complaints.
samsrabin Apr 16, 2024
b4a78e7
synthetic_hillslope.py: Add default info to --help.
samsrabin Apr 16, 2024
90e1dfe
synthetic_hillslopes: Use HillslopeVars.
samsrabin Apr 25, 2024
5643e3f
synthetic_hillslope: Use context manager to open input file.
samsrabin Apr 25, 2024
dc2cd68
Improve hillslope script --help outputs.
samsrabin Apr 25, 2024
179e2ee
Format with black.
samsrabin Sep 9, 2024
8be2c38
Add previous commit to .git-blame-ignore-revs.
samsrabin Sep 9, 2024
d7bd49c
Refactor: New functions in synthetic_hillslope to satisfy pylint.
samsrabin Sep 9, 2024
5bbdf89
Resolve or ignore invalid-name pylint warning in synthetic_hillslope.
samsrabin Sep 9, 2024
25292b6
synthetic_hillslopes: Copy Dataset_Version from original.
samsrabin Sep 9, 2024
7ad47fd
synthetic_hillslope: Add optional --fsurdat flag to save fsurdat inst…
samsrabin Sep 9, 2024
005b7fa
Dataset_Version no longer needed manually.
samsrabin Sep 9, 2024
2918296
combine_gridcell_files: Improve description of --overwrite.
samsrabin Sep 23, 2024
8fdd12a
combine_gridcell_files: Remove --n-chunks argument.
samsrabin Sep 23, 2024
f391c75
combine_gridcell_files: Improve description.
samsrabin Sep 23, 2024
0fac7b9
combine_chunk_files: Improve description.
samsrabin Sep 23, 2024
9920c82
Functionize get_chunks_to_process(); move to hillslope_utils.
samsrabin Sep 23, 2024
04217bc
combine_chunk_files: Remove --n-chunks argument.
samsrabin Sep 23, 2024
39e1841
Bugfix to make get_mask_var work in combine_chunk_files.
samsrabin Sep 23, 2024
c3d1bbc
combine_chunk_files: Throw error if no files found.
samsrabin Sep 23, 2024
b868d05
combine_chunk_files: Work on surface datasets w/o PFTDATA_MASK.
samsrabin Sep 23, 2024
737d6dc
Remove a troubleshooting print().
samsrabin Sep 23, 2024
9105ca8
combine_chunk_files: Work on surface datasets w/o AREA.
samsrabin Sep 23, 2024
54a93ed
combine_chunk_files: Add a docstring.
samsrabin Sep 23, 2024
3fdea34
synthetic_hillslope.py: Add date suffix to default output.
samsrabin Oct 1, 2024
f510b4d
synthetic_hillslope.py: Copy LATIXY/LONGXY to output.
samsrabin Oct 1, 2024
bca4618
Point doc-builder to my fork. Avoid old fork of sphinx_rtd_theme.
samsrabin Oct 3, 2024
4c2361d
Resolve some sphinx warnings.
samsrabin Oct 3, 2024
490d229
Fix MOSART conceptual figure references.
samsrabin Oct 3, 2024
4a9e1a2
Replace a reference to RTM with MOSART.
samsrabin Oct 3, 2024
497e991
Resolve "WARNING: unsupported theme option 'versions' given"
samsrabin Oct 3, 2024
3511baa
Add sphinx_mdinclude.
samsrabin Oct 3, 2024
dcb2f0f
Add ctsm-docs.yml.
samsrabin Oct 3, 2024
94874d2
Replace ctsm-docs.yml with equivalent requirements.txt.
samsrabin Oct 3, 2024
5f54b61
Copy CIME's docs.yml workflow to our repo.
samsrabin Oct 3, 2024
18598eb
Update docs.yml with our URL.
samsrabin Oct 3, 2024
e95c291
Pare down doc/requirements.txt.
samsrabin Oct 3, 2024
c3788bb
Have PR preview actions run even on branches from forks
samsrabin Oct 3, 2024
674ab46
Add pages:write perms to build-and-deploy action.
samsrabin Oct 3, 2024
a5063f6
Update peaceiris/actions-gh-pages from v3 to v4.
samsrabin Oct 3, 2024
a5f4573
Set gibberish publish_branch.
samsrabin Oct 3, 2024
442f13d
Set external_repository to hopefully publish to user's fork.
samsrabin Oct 3, 2024
76c3238
Remove pages preview/push stuff; only check docs build.
samsrabin Oct 3, 2024
03857ff
Remove write perms for test-build action.
samsrabin Oct 3, 2024
dccbcdd
Delete cleanup job.
samsrabin Oct 3, 2024
868e0d0
If PR branch is from ESCOMP/CTSM (not fork), run build-and-deploy.
samsrabin Oct 3, 2024
1fa1eb5
Only do test-build if the PR branch is from a fork, not ESCOMP/CTSM.
samsrabin Oct 3, 2024
9d5a455
build_docs will now fail if sphinx warnings are generated.
samsrabin Oct 3, 2024
ee94753
TEST: Introduce Sphinx errors. Github workflow should fail.
samsrabin Oct 3, 2024
a893eb5
docs.yml now fails when sphinx has warnings.
samsrabin Oct 4, 2024
dc8dd92
Revert "Only do test-build if the PR branch is from a fork, not ESCOM…
samsrabin Oct 4, 2024
adb99fc
Add docs.yml job to test doc-builder.
samsrabin Oct 4, 2024
da0a8bd
Fix SPHINXOPTS in test-build-makefile.
samsrabin Oct 4, 2024
3575ea4
Fix working dir of test-doc-builder.
samsrabin Oct 4, 2024
6fb71bc
Revert "TEST: Introduce Sphinx errors. Github workflow should fail."
samsrabin Oct 4, 2024
8bbdf94
TEST: Introduce Sphinx errors. Github workflow should fail.
samsrabin Oct 3, 2024
eb74874
Revert "TEST: Introduce Sphinx errors. Github workflow should fail."
samsrabin Oct 4, 2024
6a3049e
Disable "Push new docs."
samsrabin Oct 4, 2024
259ad13
Disable "needs: cleanup" for build-and-deploy.
samsrabin Oct 4, 2024
afd87b6
Publish preview to gh-pages-preview instead of gh-pages.
samsrabin Oct 4, 2024
71c4386
Delete docs cleanup and build-and-deploy jobs.
samsrabin Oct 7, 2024
76e2c6e
Docs workflow should run on PRs going to b4b-dev too.
samsrabin Oct 7, 2024
2d60500
Remove action version specifiers from docs workflow.
samsrabin Oct 7, 2024
b7c888e
Remove branches specifiers from docs workflow.
samsrabin Oct 7, 2024
0752bec
Revert "Remove action version specifiers from docs workflow."
samsrabin Oct 7, 2024
5fed746
Revert doc-builder to canonical v1.0.8.
samsrabin Oct 7, 2024
490f88f
Merge branch 'update-docs-builder-2' into hillslope-scripts-2
samsrabin Oct 8, 2024
3a0394c
Point doc-builder at my branch.
samsrabin Oct 8, 2024
5f8f958
Point representative-hillslopes submodule at my branch.
samsrabin Oct 8, 2024
46fbfce
Add User's Guide page: creating-hillslope-datasets.rst.
samsrabin Oct 8, 2024
9ab3e6b
Actually add representative-hillslopes external.
samsrabin Oct 11, 2024
4b03f5a
Format hillslopes scripts with black.
samsrabin Oct 11, 2024
cb2363a
Add previous commit to .git-blame-ignore-revs.
samsrabin Oct 11, 2024
2c5f3ea
build_docs script now exits with error if anything goes wrong.
samsrabin Oct 11, 2024
96f7ac5
Download submods in docs.yml.
samsrabin Oct 13, 2024
b7b9183
Update git-fleximod to v0.9.2; fixes g-f update -o call.
samsrabin Oct 13, 2024
e12bd1e
Docs build test: Call git-fleximod in its own step.
samsrabin Oct 13, 2024
4bce938
Docs build check: Remove .git/hooks to avoid git-lfs error.
samsrabin Oct 13, 2024
c6df412
Add system tests for CTSM hillslope scripts.
samsrabin Oct 14, 2024
61122a2
Hillslope scripts now use CTSM logging.
samsrabin Oct 15, 2024
ae15b23
Exercise a bit more of the CTSM-specific hillslope scripts.
samsrabin Oct 15, 2024
c7dbb53
Add another check to test_combine_gridcell_files().
samsrabin Oct 15, 2024
a6af9ac
Edit paths in creating-hillslope-datasets.rst.
samsrabin Oct 15, 2024
9899a33
Merge tag 'ctsm5.3.055' into hillslope-scripts-2
samsrabin Jun 11, 2025
7f7a219
Hillslopes submodule: Update readme.
samsrabin Jun 11, 2025
9a4bd6b
Docs workflows: Include hillslope readme.
samsrabin Jun 11, 2025
8046892
creating-hillslope-datasets.rst: Improve instruction and link.
samsrabin Jun 12, 2025
7fcf6e3
Reformat with black.
samsrabin Jun 16, 2025
97f8226
Add previous commit to .git-blame-ignore-revs.
samsrabin Jun 16, 2025
fcead52
Merge tag 'ctsm5.3.058' into hillslope-scripts-2
samsrabin Jun 16, 2025
3af39f4
hillslope_utils.py: Delete unused add_variable_xr().
samsrabin Jun 16, 2025
1b983ff
Hillslope scripts: Resolve some easy pylint complaints.
samsrabin Jun 16, 2025
12dc2db
Hillslope scripts: Resolve "too many positional arguments" warnings.
samsrabin Jun 16, 2025
818dd63
Hillslope scripts: Resolve possibly-used-before-assignment warnings.
samsrabin Jun 16, 2025
01d170d
Ignore all .coverage directories.
samsrabin Jun 17, 2025
542af94
Move HillslopeVars class to its own file.
samsrabin Jun 17, 2025
83ff7b6
hillslope_utils.py: Delete unused functions.
samsrabin Jun 17, 2025
29543c6
Reformat with black.
samsrabin Jun 17, 2025
8e53e67
Add previous commit to .git-blame-ignore-revs.
samsrabin Jun 17, 2025
2055a54
Update representative-hillslopes to Sean's latest.
samsrabin Aug 1, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,12 @@ e4d38681df23ccca0ae29581a45f8362574e0630
a9d96219902cf609636886c7073a84407f450d9a
d866510188d26d51bcd6d37239283db690af7e82
0dcd0a3c1abcaffe5529f8d79a6bc34734b195c7
179e2eeb1ad919539e21f92947fcc80c9b054869
e096358c832ab292ddfd22dd5878826c7c788968
475831f0fb0e31e97f630eac4e078c886558b61c
fd5f177131d63d39e79a13918390bdfb642d781e
4b03f5a93d781d8ef0ca58fa88fc510784ba9b1a
# Ran SystemTests and python/ctsm through black python formatter
a51816e0de380300b69db9fc3e2c7fa83b267b64
5364ad66eaceb55dde2d3d598fe4ce37ac83a93c
8056ae649c1b37f5e10aaaac79005d6e3a8b2380
Expand All @@ -37,6 +40,11 @@ a51816e0de380300b69db9fc3e2c7fa83b267b64
183fc26a6691bbdf87f515dc47924a64be3ced9b
6fccf682eaf718615407d9bacdd3903b8786a03d
2500534eb0a83cc3aff94b30fb62e915054030bf
# Ran individual files through black python formatter
f05fcbc10eda44e574de7554c8ac2b0417215b61
eb4906d8ee78b4f5ad5b3b990c414f6e113b661f
63c4873eab8af9fdd1f89bfe0a5416dcc53394fa
7053b2980da08bb46f82d9cf1a5c4c63b98b37f6
78d05967c2b027dc9776a884716597db6ef7f57c
47839a77229c61555e3b8932927bb54cdc511b27
a0d014fae9550dd9ffbc934abd29ef16176f8208
Expand Down Expand Up @@ -67,3 +75,5 @@ cdf40d265cc82775607a1bf25f5f527bacc97405
3b7a2876933263f8986e4069f5d23bd45635756f
3dd489af7ebe06566e2c6a1c7ade18550f1eb4ba
742cfa606039ab89602fde5fef46458516f56fd4
7fcf6e393377158bd4764e0c5c0698036b0f7879
29543c6f5e56bfcd1da5e86f622059274aafa365
1 change: 1 addition & 0 deletions .github/workflows/docs-build-and-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'tools/external/representative-hillslopes/shell_scripts/README.md'

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs-omnibus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ on:
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'tools/external/representative-hillslopes/shell_scripts/README.md'

pull_request:
# Run on pull requests that change the listed files
Expand All @@ -23,6 +24,7 @@ on:
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'tools/external/representative-hillslopes/shell_scripts/README.md'

workflow_dispatch:

Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ on:
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'tools/external/representative-hillslopes/shell_scripts/README.md'

pull_request:
# Run on pull requests that change the listed files
Expand All @@ -26,6 +27,7 @@ on:
# Include all include::ed files outside doc/ directory!
- 'src/README.unit_testing'
- 'tools/README'
- 'tools/external/representative-hillslopes/shell_scripts/README.md'

workflow_dispatch:

Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ buildnmlc
td.*.status
td.*.log
td.*.status.xFail
.coverage

# mksurfdata output
surfdata_*.log
Expand Down Expand Up @@ -115,4 +116,3 @@ Depends
# Docs build and testing output
_build*/
_publish*/
doc/.coverage
8 changes: 8 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -128,3 +128,11 @@ fxtag = v2.2.6
fxrequired = ToplevelOptional
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/ESMCI/doc-builder

[submodule "representative-hillslopes"]
path = tools/external/representative-hillslopes
url = https://github.com/swensosc/Representative_Hillslopes
fxtag = f3f980fc40783b9a86143e97bb3773f7761ed29b
fxrequired = ToplevelOptional
# Standard Fork to compare to with "git fleximod test" to ensure personal forks aren't committed
fxDONOTUSEurl = https://github.com/swensosc/Representative_Hillslopes
Empty file modified .lib/git-fleximod/escomp_install
100644 → 100755
Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
.. _rst_creating_hillslope_datasets:

===========================
Creating hillslope datasets
===========================

Creating hillslope datasets for use in CTSM is a multi-step process:

#. Perform the Height Above Nearest Drainage (HAND) analysis, which processes the DEM data for each gridcell, breaking the work into a number of "chunks."
#. Combine the per-gridcell files from the HAND analysis into one file per chunk.
#. Combine the per-chunk files into a ``hillslope_file`` for use in CTSM.

HAND analysis
===============

The HAND analysis uses the optional ``Representative_Hillslopes`` submodule. Before following these instructions, do ``bin/git-fleximod update representative-hillslopes`` to make sure that's been downloaded. Then the instructions assume:

#. You've installed the ``Representative_Hillslopes`` Conda environment, if needed (``conda env create -f tools/external/representative-hillslopes/conda_yml/casper.yml``).
#. You've activated that environment (``conda activate Representative_Hillslopes``).
#. You've changed your working directory to ``tools/external/representative-hillslopes/shell_scripts/``.

.. mdinclude:: ../../../../tools/external/representative-hillslopes/shell_scripts/README.md

Gridcell files to chunk files
=============================

(Instructions here assume you have activated the :ref:`ctsm_pylib<using-ctsm-pylib>` Conda environment.)

This is performed by the ``tools/hillslopes/combine_gridcell_files`` script; do ``tools/hillslopes/combine_gridcell_files --help`` for usage help. Briefly, you need to provide three things:

* ``-i``, input surface dataset: The CTSM surface dataset (``fsurdat``) you used in the HAND analysis above.
* ``-d``, input directory: The directory the HAND analysis above saved files to (``outdir`` in those instructions).
* ``-o``, output directory: The directory where you want the chunk files generated by ``combine_gridcell_files`` to be saved.

Example
--------

This example can be run on the NSF NCAR Casper machine; it assumes you've activated the ``ctsm_pylib`` Conda environment.

.. code-block:: bash

fsurdat=python/ctsm/test/testinputs/surfdata_5x5_amazon_hist_16pfts_CMIP6_2000_c231031.nc
indir=$SCRATCH/hillslopes_5x5_amazon/hand_analysis_global
outdir=$SCRATCH/hillslopes_5x5_amazon/hand_analysis_global/combined

python tools/hillslopes/combine_gridcell_files \
-i $fsurdat \
-d $indir \
-o $outdir


Chunk files to ``hillslope_file``
=================================

(Instructions here assume you have activated the ``ctsm_pylib`` Conda environment.)

This is performed by the ``tools/hillslopes/combine_chunk_files`` script; do ``tools/hillslopes/combine_chunk_files --help`` for usage help. Briefly, you need to provide three things:

* ``-i``, input surface dataset: The CTSM surface dataset (``fsurdat``) you used in the steps above.
* ``-d``, input directory: The directory where ``combine_gridcell_files`` saved the chunk files (``-o`` in those instructions above).
* ``-o``, output file: The file path where you want the output ``hillslope_file`` to be saved.

Example
--------

This example can be run on the NSF NCAR Casper machine; it assumes you've activated the ``ctsm_pylib`` Conda environment.

.. code-block:: bash

fsurdat=python/ctsm/test/testinputs/surfdata_5x5_amazon_hist_16pfts_CMIP6_2000_c231031.nc
indir=$SCRATCH/hillslopes_5x5_amazon/hand_analysis_global/combined
outfile=${indir}/$(basename ${fsurdat} | sed "s@surfdata@hilldata@")

python tools/hillslopes/combine_chunk_files \
-i $fsurdat \
-d $indir \
-o $outfile
1 change: 1 addition & 0 deletions doc/source/users_guide/using-clm-tools/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Using CLM tools
using-ctsm-pylib.rst
creating-input-for-surface-dataset-generation.rst
creating-surface-datasets.rst
creating-hillslope-datasets.rst
creating-domain-files.rst
observational-sites-datasets.rst
cprnc.rst
Empty file.
Loading