Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
5 changes: 5 additions & 0 deletions .github/scripts/run-linkcheck.sh
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,11 @@
# Usage: run-linkcheck.sh BOOK_DIR FULL_LOG LINKCHECK_JSON
#
# Used by gh-page_builder.yml.
#
Comment thread
ekluzek marked this conversation as resolved.
Resolved
# Example: to run by hand outside of a github action on your local clone:
# ./.github/scripts/run-linkcheck.sh . full.log linkcheck.json
# # you then examine full.log and linkcheck.json if there were errors, but usually you don't care when run by hand
#

set -u -o pipefail
book_dir="$1"
Expand Down
29 changes: 14 additions & 15 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ sphinx:
linkcheck_anchors: false # skip checking #anchors, which is often flaky
linkcheck_report_timeouts_as_broken: False
#
# Have the copy button appear on code blocks including the above parse-literal blocks
# Have the copy button appear on code blocks including the Jinja parse-literal blocks talked about below
# (Commented out as discussed below)
#
copybutton_selector: "div.highlight pre, pre.literal-block"
#copybutton_selector: "div.highlight pre, pre.literal-block"

# Force re-execution of notebooks on each build.
# See https://jupyterbook.org/content/execute.html
Expand Down Expand Up @@ -73,19 +74,17 @@ html:
extra_navbar : ""

parse:
# Jinja-2 Substitutions to make throughout all notebooks
# For example add:
# {{ CTSM_TUTORIAL_TAG }}
# For code blocks (make the code block a parsed-literal and do this:
# {{ '`' + CTSM_TUTORIAL_TAG + '`' }}
# To have it substitute the above from the substitutions.yml file below
# NOTE: this won't work for raw HTML blocks in markdown, so make the substitution outside of raw HTML.
myst_substitutions:
CTSM_TUTORIAL_TAG: "`ctsm5.4.067`"
CLM_TUTORIAL_DIR: "/glade/campaign/cgd/tss/tutorials/clm_2026"
CTSM_CUPID_TAG: "`CUPiD.n01_ctsm5.4.017`"
PROJECT_CODE: "UCGD0011"
TUTORIAL_QUE: "tutorial"
# Jinja-2 Substitutions that was a failed experiment
# Leaving here commented-out so we can figure out what the substitutions were next time:
# See PR: https://github.com/NCAR/CLM-Tutorial/pull/141
# See Discussion: https://github.com/NCAR/CLM-Tutorial/discussions/142
#myst_substitutions:
# CTSM_TUTORIAL_TAG: "`ctsm5.4.067`"
# CLM_TUTORIAL_DIR: "/glade/campaign/cgd/tss/tutorials/clm_2026"
# CTSM_CUPID_TAG: "`CUPiD.n01_ctsm5.4.017`"
# PROJECT_CODE: "UCGD0011"
# TUTORIAL_QUE: "tutorial"
#END OF SUBSTITUTIONS:


launch_buttons:
Expand Down
10 changes: 5 additions & 5 deletions notebooks/basics/code/git_download_ctsm.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@
"source": [
"<div class=\"alert alert-warning\">\n",
"\n",
"**We will use the CLM6 tutorial tag: {{ CTSM_TUTORIAL_TAG }}**\n",
"**We will use the CLM6 tutorial tag: `ctsm5.4.067`**\n",
"\n",
"**Note: **At the time of the tutorial, the final CLM6 release has not yet been completed. Therefore, we will use a preliminary tag ({{ CTSM_TUTORIAL_TAG }}) that contains the CLM6 code base and configuration needed for the exercises. The exact tag used in the tutorial may differ from the final CLM6 release.\n",
"**Note: **At the time of the tutorial, the final CLM6 release has not yet been completed. Therefore, we will use a preliminary tag (`ctsm5.4.067`) that contains the CLM6 code base and configuration needed for the exercises. The exact tag used in the tutorial may differ from the final CLM6 release.\n",
"\n",
"</div>"
]
Expand Down Expand Up @@ -101,10 +101,10 @@
" \n",
"- **Download the CLM code to your code workspace directory as `my_clm_code`:**\n",
"\n",
"```{parsed-literal}\n",
"```bash\n",
"git clone https://github.com/ESCOMP/CTSM.git my_clm_code\n",
"cd my_clm_code\n",
"git checkout {{ '`' + CTSM_TUTORIAL_TAG + '`' }}\n",
"git checkout ctsm5.4.067\n",
"```\n",
"The directory name `my_clm_code` is only an example. You may choose any directory name you prefer. Outside of this tutorial, many users choose names that identify the CLM version they are working with (for example, `ctsm6.0`, `ctsm5.5` or `clm6.0_Tutorial2026`).\n",
"\n",
Expand All @@ -118,7 +118,7 @@
"\n",
"which should return:\n",
"\n",
" {{ CTSM_TUTORIAL_TAG }}\n",
" `ctsm5.4.067`\n",
"</div>"
]
},
Expand Down
4 changes: 2 additions & 2 deletions notebooks/basics/exercises/change_compsets.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,8 @@
"```\n",
"\n",
"Change the queue to the 'tutorial' queue:\n",
"``` {parsed-literal}\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"```bash\n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\n",
"Extend the length of the run to 1 month:\n",
Expand Down
8 changes: 4 additions & 4 deletions notebooks/basics/exercises/first_I1850.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -61,8 +61,8 @@
"```\n",
"\n",
"Change the queue to the 'tutorial' queue:\n",
"``` {parsed-literal}\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"```bash\n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\n",
"Make sure you use the correct information for the CASE, RES, and COMPSET inputs.\n",
Expand Down Expand Up @@ -113,8 +113,8 @@
"```\n",
"\n",
"Change the queue to the 'tutorial' queue:\n",
"``` {parsed-literal}\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"```bash\n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\n",
"Do not make any other changes since we are running an out-of-the-box simulation.\n",
Expand Down
11 changes: 6 additions & 5 deletions notebooks/diagnostics/cupid/clm_cupid_ldf_ilamb.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
"We hope to eventually release a version of the CLM that includes CUPiD. For now we have you clone a branch that tests this idea in a recent version of the CLM.\n",
"\n",
"The following lines:\n",
"- clone the branch into a new directory {{ CTSM_CUPID_TAG }}\n",
"- clone the branch into a new directory `CUPiD.n01_ctsm5.4.017`\n",
"- enter the directory just created\n",
"- update submodules, one of which is CUPiD\n",
"- enter the directory tools/CUPiD\n",
Expand All @@ -79,11 +79,12 @@
"id": "943f6b99-58d0-4cb2-8abe-2255e0b1cebb",
"metadata": {},
"source": [
"```{parsed-literal}\n",
"git clone -b branch_tags/{{ '`' + CTSM_CUPID_TAG + '`' }} https\\://github.com/ESCOMP/ctsm.git {{ '`' + CTSM_CUPID_TAG + '`' }}\n",
"cd {{ '`' + CTSM_CUPID_TAG + '`' }}\n",
"```bash\n",
"git clone -b branch_tags/CUPiD.n01_ctsm5.4.017 https://github.com/ESCOMP/ctsm.git CUPiD.n01_ctsm5.4.017\n",
"cd CUPiD.n01_ctsm5.4.017\n",
"./bin/git-fleximod update\n",
"cd tools/CUPiD"
"cd tools/CUPiD\n",
"```"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion notebooks/diagnostics/diagnostics_intro.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
"|---|---|\n",
"| **Resource Selection** | Casper PBS Batch |\n",
"| **Queue or Reservation** | casper |\n",
"| **Project Account** | {{ PROJECT_CODE }} |\n",
"| **Project Account** | UCGD0011 |\n",
"| **Wall Time in Hours** | 3 |"
]
},
Expand Down
5 changes: 3 additions & 2 deletions notebooks/diagnostics/ldf/ldf_basics.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -100,8 +100,9 @@
"id": "da9828ff-197c-4309-b038-cc0a53ae4b4f",
"metadata": {},
"source": [
"``` {parsed-literal}\n",
"qsub -I -X -l select=1:ncpus=8:mem=64GB -A {{ PROJECT_CODE }} -q casper@casper-pbs -l walltime=02:00:00\n"
"```bash\n",
"qsub -I -X -l select=1:ncpus=8:mem=64GB -A UCGD0011 -q casper@casper-pbs -l walltime=02:00:00\n",
"```\n"
]
},
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,12 +111,12 @@
"**Change the wallclock time, job queue, and account number**\n",
"\n",
"Change the wallclock time. If needed, change `job queue` and `account number`. <br>\n",
"For instance, to run in the queue `tutorial` and the project number {{ PROJECT_CODE }} (You should use the project number given for this tutorial), use the command:\n",
"For instance, to run in the queue `tutorial` and the project number UCGD0011 (You should use the project number given for this tutorial), use the command:\n",
"\n",
"``` {parsed-literal}\n",
"```bash\n",
"./xmlchange JOB_WALLCLOCK_TIME=01:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }}\n",
"./xmlchange PROJECT={{ '`' + PROJECT_CODE + '`' }} --force\n",
"./xmlchange JOB_QUEUE=tutorial\n",
"./xmlchange PROJECT=UCGD0011 --force\n",
"```\n",
"\n",
"**Build and submit**\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@
"\n",
"Create a new case called `i2000_bgc_hist_update`:\n",
"\n",
"``` {parsed-literal}\n",
"```bash\n",
"cd /glade/u/home/$USER/code/my_clm_code/cime/scripts/\n",
"\n",
"./create_newcase --case ~/cases/i2000_bgc_hist_update \\\n",
Expand Down Expand Up @@ -122,12 +122,12 @@
"\n",
"**Change the job queue, wallclock time, and account number**\n",
"\n",
"Update the wallclock time. If needed, change the job queue and project number. For example, to run in the {{ '`' + TUTORIAL_QUE + '`' }} queue using project {{ '`' + PROJECT_CODE + '`' }}, use:\n",
"Update the wallclock time. If needed, change the job queue and project number. For example, to run in the `tutorial` queue using project `UCGD0011`, use:\n",
"\n",
"``` {parsed-literal}\n",
"```bash\n",
"./xmlchange JOB_WALLCLOCK_TIME=01:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }}\n",
"./xmlchange PROJECT={{ '`' + PROJECT_CODE + '`' }} --force\n",
"./xmlchange JOB_QUEUE=tutorial\n",
"./xmlchange PROJECT=UCGD0011 --force\n",
"```\n",
"\n",
"Use the project number provided for the tutorial.\n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -138,10 +138,10 @@
"\n",
"If needed:\n",
"\n",
"``` {parsed-literal}\n",
"```bash\n",
"./xmlchange JOB_WALLCLOCK_TIME=01:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }}\n",
"./xmlchange PROJECT={{ '`' + PROJECT_CODE + '`' }} --force\n",
"./xmlchange JOB_QUEUE=tutorial\n",
"./xmlchange PROJECT=UCGD0011 --force\n",
"```\n",
"\n",
"Use the project number provided for the tutorial.\n",
Expand Down
6 changes: 3 additions & 3 deletions notebooks/modifications/xml/exercises/xml_datm_exercise.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -82,16 +82,16 @@
" \n",
"2. In your case directory, change the runtime variables:\n",
" \n",
"``` {parsed-literal}\n",
"```bash\n",
"cd /glade/u/home/$USER/cases/i2000_forcing_years\n",
"./xmlchange DATM_YR_START=2005\n",
"./xmlchange DATM_YR_END=2009\n",
"./xmlchange DATM_YR_ALIGN=2000\n",
"./xmlchange STOP_N=1\n",
"./xmlchange STOP_OPTION='nyears'\n",
"./xmlchange JOB_WALLCLOCK_TIME=1:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"``` \n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\n",
"3. Set up the case:\n",
" \n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,11 @@
" \n",
"In your case directory, change debugging levels and set runtime variables:\n",
"\n",
"``` {parsed-literal}\n",
"```bash\n",
"cd /glade/u/home/$USER/cases/i1850_sp.length\n",
"./xmlchange PIO_DEBUG_LEVEL=1,STOP_N=6,STOP_OPTION=nmonths\n",
"./xmlchange --subgroup case.run JOB_WALLCLOCK_TIME=2:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"<br> \n",
" \n",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,13 +86,13 @@
"\n",
"3. Set run time variables: \n",
" \n",
"``` {parsed-literal}\n",
"```bash\n",
"./xmlchange STOP_OPTION=nmonths\n",
"./xmlchange STOP_N=1\n",
"./xmlchange RESUBMIT=1\n",
"./xmlchange JOB_WALLCLOCK_TIME=02:00:00\n",
"./xmlchange JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }} --force\n",
"``` \n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\n",
"4. Set up the case:\n",
" \n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/prereqs/prereqs_overview.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@
"\n",
"![Entering options for server on JupyterHub](../../images/resources/OnDemand_launch_Jupyter_batch.png)\n",
"*<p style=\"text-align: center;\"> Figure: Entering options for server on JupyterHub. </p>*\n",
"Select the “Casper PBS Batch” option in the drop-down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account {{ '`' + PROJECT_CODE + '`' }}. Now launch the server.\n",
"Select the “Casper PBS Batch” option in the drop-down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account `UCGD0011`. Now launch the server.\n",
"\n",
"**Step 5. Connect to Jupyter**\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/resources/ncar_hpc.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"\n",
"![Entering options for server on JupyterHub](../../images/resources/OnDemand_launch_Jupyter_batch.png)\n",
"*<p style=\"text-align: center;\"> Figure: Entering options for server on JupyterHub. </p>*\n",
"Select the “Casper PBS Batch” option in the drop down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account {{ '`' + PROJECT_CODE + '`' }}. Now launch the server.\n",
"Select the “Casper PBS Batch” option in the drop down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account `UCGD0011`. Now launch the server.\n",
"\n",
"**Step 5. Connect to Jupyter**\n",
"\n",
Expand Down
2 changes: 1 addition & 1 deletion notebooks/resources/ncar_hpc_login.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@
"\n",
"![Entering options for server on JupyterHub](../../images/resources/OnDemand_launch_Jupyter_batch.png)\n",
"*<p style=\"text-align: center;\"> Figure: Entering options for server on JupyterHub. </p>*\n",
"Select the “Casper PBS Batch” option in the drop down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account {{ '`' + PROJECT_CODE + '`' }}. Now launch the server.\n",
"Select the “Casper PBS Batch” option in the drop down menu. Afterward, you will need to make other choices to select the right resources: 3 hours wall time to ensure your server is active for the entire hands-on activity session and Project Account `UCGD0011`. Now launch the server.\n",
"\n",
"**Step 5. Connect to Jupyter**\n",
"\n",
Expand Down
32 changes: 15 additions & 17 deletions notebooks/resources/profile.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"\n",
"<div class=\"alert alert-warning\">\n",
"\n",
"You should have access to project account **{{ PROJECT_CODE }}** and use this for your simulations.\n",
"You should have access to project account **UCGD0011** and use this for your simulations.\n",
"</div>\n",
"\n"
]
Expand Down Expand Up @@ -50,13 +50,11 @@
"source": [
"In theory, you _should_ be able to automatically use this account and the reservation queues if you correctly set up your NCAR HPC environment using your `.profile` or `.tcshrc` files, as described below. If you need to change the values for a run, you can change the account and reservation queue in your case directory using the following command:\n",
"\n",
":::{container} highlight\n",
"``` {parsed-literal}\n",
"./xmlchange --force JOB_QUEUE={{ '`' + TUTORIAL_QUE + '`' }}\n",
"./xmlchange PROJECT={{ '`' + PROJECT_CODE + '`' }}\n",
"```bash\n",
"./xmlchange --force JOB_QUEUE=tutorial\n",
"./xmlchange PROJECT=UCGD0011\n",
"```\n",
"\n",
":::\n",
"\n",
"You should not have to set the `PROJECT` more than once during the tutorial if your profile is set up, as described below, but we include it for your reference in case you are having trouble."
]
Expand Down Expand Up @@ -175,8 +173,8 @@
"\n",
"Copy over the `.profile` file into your home directory: \n",
" \n",
"``` {parsed-literal}\n",
"cp {{ '`' + CLM_TUTORIAL_DIR + '`' }}/tutorial_env//profile ~/.profile\n",
"```bash\n",
"cp /glade/campaign/cgd/tss/tutorials/clm_2026/tutorial_env//profile ~/.profile\n",
"```\n",
"<br>\n",
"\n",
Expand Down Expand Up @@ -224,7 +222,7 @@
"id": "42432d90-eaef-4205-b4fe-39cf3c7b5881",
"metadata": {},
"source": [
"**NOTE:** You should already have a `.tcshrc` file in your home directory. If you do not wish to overwrite the existing `.tcshrc` file, please save this file to a new name OR copy the contents of the {{ CLM_TUTORIAL_DIR }}/tutorial_env//tcshrc file to your `.tcshrc` file using a text editor."
"**NOTE:** You should already have a `.tcshrc` file in your home directory. If you do not wish to overwrite the existing `.tcshrc` file, please save this file to a new name OR copy the contents of the /glade/campaign/cgd/tss/tutorials/clm_2026/tutorial_env//tcshrc file to your `.tcshrc` file using a text editor."
]
},
{
Expand All @@ -247,8 +245,8 @@
"<br>\n",
"\n",
"Copy over the `.tcshrc` file to your home directory:\n",
"``` {parsed-literal}\n",
"cp {{ '`' + CLM_TUTORIAL_DIR + '`' }}/tutorial_env//tcshrc ~/.tcshrc\n",
"```bash\n",
"cp /glade/campaign/cgd/tss/tutorials/clm_2026/tutorial_env//tcshrc ~/.tcshrc\n",
"```\n",
" \n",
"<br>\n",
Expand Down Expand Up @@ -319,9 +317,9 @@
"\n",
"Add to your .profile: \n",
"\n",
"``` {parsed-literal}\n",
"export PROJECT={{ '`' + PROJECT_CODE + '`' }} #<- This should never change over the course of the tutorial\n",
"export TUTORIAL_QUEUE={{ '`' + TUTORIAL_QUE + '`' }}\n",
"```bash\n",
"export PROJECT=UCGD0011 #<- This should never change over the course of the tutorial\n",
"export TUTORIAL_QUEUE=tutorial\n",
"```\n",
"\n",
"Source the file:<br> \n",
Expand All @@ -336,9 +334,9 @@
"<div class=\"alert alert-info\">\n",
"\n",
"Add to your .tcshrc: \n",
"``` {parsed-literal}\n",
"setenv PROJECT {{ '`' + PROJECT_CODE + '`' }} #<-This should never change over the course of the tutorial\n",
"setenv TUTORIAL_QUEUE {{ '`' + TUTORIAL_QUE + '`' }}\n",
"```tcsh\n",
"setenv PROJECT UCGD0011 #<-This should never change over the course of the tutorial\n",
"setenv TUTORIAL_QUEUE tutorial\n",
"```\n",
" \n",
"Source the file:<br>\n",
Expand Down
Loading
Loading