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
1 change: 1 addition & 0 deletions _toc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
227 changes: 227 additions & 0 deletions notebooks/basics/exercises/change_compsets.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
{
"cells": [
{
"cell_type": "markdown",
"id": "7013ccab-46dc-4a38-8039-7ec464251982",
"metadata": {},
"source": [
"# Change CLM component set"
]
},
{
"cell_type": "markdown",
"id": "30c6953e-8197-4fea-b398-5a090db1a762",
"metadata": {},
"source": [
"\n",
"<div class=\"alert alert-info\">\n",
"<strong>Exercise: Repeat the 1 month experiment with a different CLM component set ``compset``</strong><br><br>\n",
" \n",
"Choose which CLM component set to run:\n",
"<ul>\n",
" <li>CLM-BGC: <code>I2000Clm60BgcCrujra</code></li>\n",
" <li>CLM-BGC Crop: <code>I2000Clm60BgcCropCrujra</code></li>\n",
" <li>CLM-FATES SP: <code>I2000Clm60FatesSpCruRsGs</code></li>\n",
"</ul>\n",
"\n",
"Create a case using the selected compset at ``f19_f19_mt233`` resolution. \n",
"\n",
"Note: You will still need to use the \"--run-unsupported\" flag. \n",
"\n",
"Check the status of the run after submitting.\n",
"\n",
"</div>\n"
]
},
{
"cell_type": "markdown",
"id": "d7b8746d",
"metadata": {},
"source": []
},
{
"cell_type": "markdown",
"id": "73e4cb02-1717-420c-8a28-f56c0078956c",
"metadata": {},
"source": [
"\n",
"<div class=\"alert alert-warning\"> \n",
"<details>\n",
"\n",
"<summary> <font face=\"Times New Roman\" color='blue'>Click here for hints</font> </summary>\n",
" \n",
"**Are you in the right workspace?**\n",
"\n",
"Navigate to CTSM/cime/scripts before running the `./create.case` command\n",
"```\n",
"cd /glade/u/home/$USER/code/my_clm_code/cime/scripts\n",
"```\n",
" \n",
"**Did you give your new case a new name?**\n",
"\n",
"You can create a new case with the command:\n",
"```\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",
"**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",
"\n",
"**Did you remember to extend the length of the run to 1 month?**\n",
"\n",
"```\n",
"./xmlchange STOP_OPTION=nmonths\n",
"./xmlchange STOP_N=1\n",
"```\n",
" \n",
"</details>\n",
"</div>\n"
]
},
{
"cell_type": "markdown",
"id": "f7c918d3-6475-463d-a10e-2badb6728cb5",
"metadata": {},
"source": [
"\n",
"<div class=\"alert alert-success\"> \n",
"<details>\n",
"<summary><font face=\"Times New Roman\" color='blue'>Click here for the solution</font></summary><br>\n",
" \n",
"Create a new case <font face=\"Courier\" color='purple'><strong>i2000_fates.basics </strong></font> 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/i2000_fates.basics --res f19_f19_mt233 --compset I2000Clm60FatesSpCruRsGs --run-unsupported\n",
"```\n",
"\n",
"Case <font face=\"Courier\" color='purple'><strong>setup</strong></font>:\n",
"``` \n",
"cd /glade/u/home/$USER/cases/i2000_fates.basics \n",
"./case.setup\n",
"```\n",
"\n",
"Change the queue to the 'tutorial' queue:\n",
"```\n",
"./xmlchange JOB_QUEUE=tutorial --force\n",
"```\n",
"\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",
"Check the status:\n",
"```\n",
"qstat -u $USER\n",
"``` \n",
"\n",
"When the run is completed, look into the archive directory for: \n",
"<font face=\"Courier\" color='purple'><strong>i2000_fates.basics</strong></font>. \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/i2000_fates.basics\n",
"ls \n",
"```\n",
"\n",
"</details>\n",
"</div>\n",
"\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": [
"<div class=\"alert alert-info\">\n",
" \n",
"```\n",
"diff ~/cases/i1850_sp.basics/CaseDocs/lnd_in ~/cases/i2000_fates.basics/CaseDocs/lnd_in\n",
"```\n",
"</div>"
]
},
{
"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": [
"\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?"
]
}
],
"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
}
Loading