From b556a974021f4e3187bf65dd18d3aa1e26b1bc88 Mon Sep 17 00:00:00 2001 From: "linnia.hawkins" Date: Wed, 14 Oct 2026 15:46:33 -0600 Subject: [PATCH 1/3] Add basic exerciste to change compsets --- .../basics/exercises/change_compsets.ipynb | 201 ++++++++++++++++++ 1 file changed, 201 insertions(+) create mode 100644 notebooks/basics/exercises/change_compsets.ipynb diff --git a/notebooks/basics/exercises/change_compsets.ipynb b/notebooks/basics/exercises/change_compsets.ipynb new file mode 100644 index 0000000..6780115 --- /dev/null +++ b/notebooks/basics/exercises/change_compsets.ipynb @@ -0,0 +1,201 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "7013ccab-46dc-4a38-8039-7ec464251982", + "metadata": {}, + "source": [ + "# Your first CLM run" + ] + }, + { + "cell_type": "markdown", + "id": "30c6953e-8197-4fea-b398-5a090db1a762", + "metadata": {}, + "source": [ + "\n", + "
\n", + "Exercise: Run a basic, out-of-the-box (that is, no user changes are implemented) CLM experiment

\n", + " \n", + "Create a case called **i1850_sp.basics** using the compset ``I1850Clm60SpCrujra`` at ``f19_f19_mt233`` resolution. \n", + "\n", + "Note: You will need to use the \"--run-unsupported\" flag this year as we are using a very new version of CLM.\n", + "\n", + "Check the status of the run after submitting.\n", + "\n", + "Please ensure that you have completed the Tutorial One-Time Setup step before starting this exercise!\n", + "\n", + "
\n" + ] + }, + { + "cell_type": "markdown", + "id": "d7b8746d", + "metadata": {}, + "source": [] + }, + { + "cell_type": "markdown", + "id": "73e4cb02-1717-420c-8a28-f56c0078956c", + "metadata": {}, + "source": [ + "\n", + "
\n", + "
\n", + "\n", + " Click here for hints \n", + " \n", + "**Is my workspace set up?**\n", + "\n", + "Did you already create a `cases` directory where you will put all new cases\n", + "```\n", + "cd /glade/u/home/$USER\n", + "mkdir cases\n", + "```\n", + " \n", + "**Did you create a new case?**\n", + "\n", + "You can create a new case with the command:\n", + "```\n", + "./create_newcase --case /glade/u/home/$USER/cases/CASE --res RES --compset COMPSET --run-unsupported\n", + "```\n", + "\n", + "Change the queue to the 'tutorial' queue:\n", + "```\n", + "./xmlchange JOB_QUEUE=tutorial --force\n", + "```\n", + "\n", + "Make sure you use the correct information for the CASE, RES, and COMPSET inputs.\n", + "\n", + "**Did you set up the case?**\n", + "\n", + "You can invoke case set up as follows:\n", + "```\n", + "./case.setup\n", + "```\n", + "**How do I compile?**\n", + "\n", + "You can compile with the command:\n", + "```\n", + "qcmd -- ./case.build\n", + "```\n", + "**How do I check my job status?**\n", + "\n", + "You can check job status using the command:\n", + "```\n", + "qstat -u $USER\n", + "```\n", + " \n", + "
\n", + "
\n" + ] + }, + { + "cell_type": "markdown", + "id": "f7c918d3-6475-463d-a10e-2badb6728cb5", + "metadata": {}, + "source": [ + "\n", + "
\n", + "
\n", + "Click here for the solution
\n", + " \n", + "Create a new case i1850_sp.basics with the command:\n", + "```\n", + "cd /glade/u/home/$USER/code/my_clm_code/cime/scripts\n", + "./create_newcase --case /glade/u/home/$USER/cases/i1850_sp.basics --res f19_f19_mt233 --compset I1850Clm60SpCrujra --run-unsupported\n", + "```\n", + "\n", + "Case setup:\n", + "``` \n", + "cd /glade/u/home/$USER/cases/i1850_sp.basics \n", + "./case.setup\n", + "```\n", + "\n", + "Change the queue to the 'tutorial' queue:\n", + "```\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", + "\n", + "Build and submit:\n", + "```\n", + "qcmd -- ./case.build\n", + "./case.submit\n", + "```\n", + " \n", + "Remember that `qcmd` is used on derecho only.\n", + "\n", + "Check the status:\n", + "```\n", + "qstat -u $USER\n", + "``` \n", + "\n", + "When the run is completed, look into the archive directory for: \n", + "i1850_sp.basics. \n", + " \n", + "Check that your archive directory on derecho (The path will be different on other machines): \n", + "```\n", + "cd /glade/derecho/scratch/$USER/archive/i1850_sp.basics\n", + "ls \n", + "```\n", + "\n", + "
\n", + "
\n", + "\n" + ] + }, + { + "cell_type": "markdown", + "id": "9c66385f-055c-4b74-b6fe-6fc189c02690", + "metadata": { + "tags": [] + }, + "source": [ + "## Test your understanding" + ] + }, + { + "cell_type": "markdown", + "id": "8218314c-f299-4171-b0fe-bac655c2d4f5", + "metadata": { + "tags": [] + }, + "source": [ + "- Did your run complete successfully?\n", + "- What sorts of files did you get as output?\n", + "- How long is the simulation?" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "4a7b563b-7afd-4699-954b-8a3cc1e7bc4e", + "metadata": {}, + "outputs": [], + "source": [] + } + ], + "metadata": { + "kernelspec": { + "display_name": "Python 3 (ipykernel)", + "language": "python", + "name": "python3" + }, + "language_info": { + "codemirror_mode": { + "name": "ipython", + "version": 3 + }, + "file_extension": ".py", + "mimetype": "text/x-python", + "name": "python", + "nbconvert_exporter": "python", + "pygments_lexer": "ipython3", + "version": "3.10.13" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} From c9c244a147d1b6cc1a33f6e2f9bf804b13b01ed9 Mon Sep 17 00:00:00 2001 From: "linnia.hawkins" Date: Wed, 14 Oct 2026 15:54:31 -0600 Subject: [PATCH 2/3] add advanced section to change_compsets.ipynb --- .../basics/exercises/change_compsets.ipynb | 120 +++++++++++------- 1 file changed, 73 insertions(+), 47 deletions(-) diff --git a/notebooks/basics/exercises/change_compsets.ipynb b/notebooks/basics/exercises/change_compsets.ipynb index 6780115..96b6d65 100644 --- a/notebooks/basics/exercises/change_compsets.ipynb +++ b/notebooks/basics/exercises/change_compsets.ipynb @@ -5,7 +5,7 @@ "id": "7013ccab-46dc-4a38-8039-7ec464251982", "metadata": {}, "source": [ - "# Your first CLM run" + "# Change CLM component set" ] }, { @@ -15,15 +15,20 @@ "source": [ "\n", "
\n", - "Exercise: Run a basic, out-of-the-box (that is, no user changes are implemented) CLM experiment

\n", + "Exercise: Repeat the 1 month experiment with a different CLM component set ``compset``

\n", " \n", - "Create a case called **i1850_sp.basics** using the compset ``I1850Clm60SpCrujra`` at ``f19_f19_mt233`` resolution. \n", + "Choose which CLM component set to run:\n", + "
    \n", + "
  • CLM-BGC: I2000Clm60BgcCrujra
  • \n", + "
  • CLM-BGC Crop: I2000Clm60BgcCropCrujra
  • \n", + "
  • CLM-FATES SP: I2000Clm60FatesSpCruRsGs
  • \n", + "
\n", "\n", - "Note: You will need to use the \"--run-unsupported\" flag this year as we are using a very new version of CLM.\n", + "Create a case using the selected compset at ``f19_f19_mt233`` resolution. \n", "\n", - "Check the status of the run after submitting.\n", + "Note: You will still need to use the \"--run-unsupported\" flag. \n", "\n", - "Please ensure that you have completed the Tutorial One-Time Setup step before starting this exercise!\n", + "Check the status of the run after submitting.\n", "\n", "
\n" ] @@ -45,45 +50,34 @@ "\n", " Click here for hints \n", " \n", - "**Is my workspace set up?**\n", + "**Are you in the right workspace?**\n", "\n", - "Did you already create a `cases` directory where you will put all new cases\n", + "Navigate to CTSM/cime/scripts before running the `./create.case` command\n", "```\n", - "cd /glade/u/home/$USER\n", - "mkdir cases\n", + "cd /glade/u/home/$USER/code/my_clm_code/cime/scripts\n", "```\n", " \n", - "**Did you create a new case?**\n", + "**Did you give your new case a new name?**\n", "\n", "You can create a new case with the command:\n", "```\n", - "./create_newcase --case /glade/u/home/$USER/cases/CASE --res RES --compset COMPSET --run-unsupported\n", - "```\n", - "\n", - "Change the queue to the 'tutorial' queue:\n", - "```\n", - "./xmlchange JOB_QUEUE=tutorial --force\n", + "NEW_CASE_NAME='i2000_fates.basics'\n", + "./create_newcase --case /glade/u/home/$USER/cases/NEW_CASE_NAME --res RES --compset COMPSET --run-unsupported\n", "```\n", "\n", - "Make sure you use the correct information for the CASE, RES, and COMPSET inputs.\n", - "\n", - "**Did you set up the case?**\n", + "**Did you navigate to the case directory CASEDIR to set up the case?**\n", "\n", "You can invoke case set up as follows:\n", "```\n", + "cd /glade/u/home/$USER/cases/i2000_fates.basics\n", "./case.setup\n", "```\n", - "**How do I compile?**\n", "\n", - "You can compile with the command:\n", - "```\n", - "qcmd -- ./case.build\n", - "```\n", - "**How do I check my job status?**\n", + "**Did you remember to extend the length of the run to 1 month?**\n", "\n", - "You can check job status using the command:\n", "```\n", - "qstat -u $USER\n", + "./xmlchange STOP_OPTION=nmonths\n", + "./xmlchange STOP_N=1\n", "```\n", " \n", "\n", @@ -100,15 +94,15 @@ "
\n", "Click here for the solution
\n", " \n", - "Create a new case i1850_sp.basics with the command:\n", + "Create a new case i2000_fates.basics with the command:\n", "```\n", "cd /glade/u/home/$USER/code/my_clm_code/cime/scripts\n", - "./create_newcase --case /glade/u/home/$USER/cases/i1850_sp.basics --res f19_f19_mt233 --compset I1850Clm60SpCrujra --run-unsupported\n", + "./create_newcase --case /glade/u/home/$USER/cases/i2000_fates.basics --res f19_f19_mt233 --compset I2000Clm60FatesSpCruRsGs --run-unsupported\n", "```\n", "\n", "Case setup:\n", "``` \n", - "cd /glade/u/home/$USER/cases/i1850_sp.basics \n", + "cd /glade/u/home/$USER/cases/i2000_fates.basics \n", "./case.setup\n", "```\n", "\n", @@ -117,15 +111,17 @@ "./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", + "Extend the length of the run to 1 month:\n", + "```\n", + "./xmlchange STOP_OPTION=nmonths\n", + "./xmlchange STOP_N=1\n", + "```\n", "\n", "Build and submit:\n", "```\n", "qcmd -- ./case.build\n", "./case.submit\n", "```\n", - " \n", - "Remember that `qcmd` is used on derecho only.\n", "\n", "Check the status:\n", "```\n", @@ -133,11 +129,11 @@ "``` \n", "\n", "When the run is completed, look into the archive directory for: \n", - "i1850_sp.basics. \n", + "i2000_fates.basics. \n", " \n", "Check that your archive directory on derecho (The path will be different on other machines): \n", "```\n", - "cd /glade/derecho/scratch/$USER/archive/i1850_sp.basics\n", + "cd /glade/derecho/scratch/$USER/archive/i2000_fates.basics\n", "ls \n", "```\n", "\n", @@ -146,6 +142,43 @@ "\n" ] }, + { + "cell_type": "markdown", + "id": "3c1d2a40", + "metadata": {}, + "source": [ + "## Advanced: Comparing the namelist settings" + ] + }, + { + "cell_type": "markdown", + "id": "8c5eeecf", + "metadata": {}, + "source": [ + "When you create a case, CLM uses the compset to build the namelist for each component. The namelist, `lnd_in`, tells CLM which input files to read and which options to turn on. A copy of the final namelist is saved in each case's `CaseDocs/` directory.\n", + "\n", + "Because the compset determines these settings, comparing `lnd_in` between your two cases shows how the configurations differ. The `diff` command prints only the lines that differ between two files. Lines starting with `<` come from the first file and lines starting with `>` from the second.\n", + "\n", + "Look for differences in:\n", + "- **Input files**, such as the surface dataset (`fsurdat`), initial conditions (`finidat`), and parameter file (`paramfile`)\n", + "- **Model options**, such as `use_crop` or `use_fates`\n", + "\n", + "For each difference, ask: why would this compset need this setting?\n" + ] + }, + { + "cell_type": "markdown", + "id": "ecf96f6e", + "metadata": {}, + "source": [ + "
\n", + " \n", + "```\n", + "diff ~/cases/i1850_sp.basics/CaseDocs/lnd_in ~/cases/i2000_fates.basics/CaseDocs/lnd_in\n", + "```\n", + "
" + ] + }, { "cell_type": "markdown", "id": "9c66385f-055c-4b74-b6fe-6fc189c02690", @@ -163,18 +196,11 @@ "tags": [] }, "source": [ - "- Did your run complete successfully?\n", - "- What sorts of files did you get as output?\n", - "- How long is the simulation?" + "\n", + "- Where would you look to find out what other compsets are available? \n", + "- What to the Rs and Gs mean in the FATES compset name?\n", + "- What atmospheric meteorological forcing data is being used? Are there other options?" ] - }, - { - "cell_type": "code", - "execution_count": null, - "id": "4a7b563b-7afd-4699-954b-8a3cc1e7bc4e", - "metadata": {}, - "outputs": [], - "source": [] } ], "metadata": { From 3b2083232141f54c90c60d403d65be0631532286 Mon Sep 17 00:00:00 2001 From: "linnia.hawkins" Date: Wed, 14 Oct 2026 16:00:31 -0600 Subject: [PATCH 3/3] update toc --- _toc.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/_toc.yml b/_toc.yml index ac86611..654c649 100644 --- a/_toc.yml +++ b/_toc.yml @@ -44,6 +44,7 @@ chapters: sections: - file: notebooks/basics/exercises/first_I1850 - file: notebooks/basics/exercises/second_I1850 + - file: notebooks/basics/exercises/change_compsets - file: notebooks/basics/exercises/examine_history_I1850 - file: notebooks/basics/exercises/extra - file: notebooks/basics/exercises/review_questions