From 3101f1a2129f8b2b244e7a509ef6221726905cd1 Mon Sep 17 00:00:00 2001 From: Cecile Hannay Date: Thu, 2 Jul 2026 22:11:52 -0600 Subject: [PATCH] cleaning cam challenge --- notebooks/challenge/cam/exercise_1.ipynb | 1 + notebooks/challenge/cam/exercise_2.ipynb | 85 ++++++++++++++---------- notebooks/challenge/cam/exercise_3.ipynb | 48 ++++++++----- notebooks/challenge/cam/exercise_4.ipynb | 79 +++++++++++++--------- 4 files changed, 126 insertions(+), 87 deletions(-) diff --git a/notebooks/challenge/cam/exercise_1.ipynb b/notebooks/challenge/cam/exercise_1.ipynb index f902e685..ac29972f 100644 --- a/notebooks/challenge/cam/exercise_1.ipynb +++ b/notebooks/challenge/cam/exercise_1.ipynb @@ -172,6 +172,7 @@ "To improve throughput, change the task layout before running `case.setup`:\n", "\n", "```bash\n", + "cd $CASEDIR\n", "./xmlchange NTASKS=-6\n", "```\n", "\n", diff --git a/notebooks/challenge/cam/exercise_2.ipynb b/notebooks/challenge/cam/exercise_2.ipynb index bcbc361f..e8a69083 100644 --- a/notebooks/challenge/cam/exercise_2.ipynb +++ b/notebooks/challenge/cam/exercise_2.ipynb @@ -206,9 +206,9 @@ "qcmd -- ./case.build\n", "./case.submit\n", "```\n", - "------------\n", + "___\n", "\n", - "### Verify the Configuration\n", + "### **Verify the Configuration**\n", "\n", "Before or after the run, compare key settings with your historical control case.\n", "\n", @@ -258,9 +258,9 @@ "These differences are the primary reason the two simulations represent different climate states.\n", "\n", "\n", - "------------\n", + "____\n", "\n", - "### Check your solution\n", + "### **Check your solution**\n", "\n", "When the run is completed, look at the history files into the archive directory. \n", " \n", @@ -278,37 +278,50 @@ " \n", "- The file should contain the instantaneous output in the file ``h1`` for the variables:\n", "```\n", - " float FLNS(time, lat, lon) ;\n", - " FLNS:Sampling_Sequence = \"rad_lwsw\" ;\n", - " FLNS:units = \"W/m2\" ;\n", - " FLNS:long_name = \"Net longwave flux at surface\" ;\n", - " float FLNT(time, lat, lon) ;\n", - " FLNT:Sampling_Sequence = \"rad_lwsw\" ;\n", - " FLNT:units = \"W/m2\" ;\n", - " FLNT:long_name = \"Net longwave flux at top of model\" ;\n", - " float LHFLX(time, lat, lon) ;\n", - " LHFLX:units = \"W/m2\" ;\n", - " LHFLX:long_name = \"Surface latent heat flux\" ;\n", - " float PRECT(time, lat, lon) ;\n", - " PRECT:units = \"m/s\" ;\n", - " PRECT:long_name = \"Total (convective and large-scale) precipitation rate (liq + ice)\" ;\n", - " float PS(time, lat, lon) ;\n", - " PS:units = \"Pa\" ;\n", - " PS:long_name = \"Surface pressure\" ;\n", - " float SHFLX(time, lat, lon) ;\n", - " SHFLX:units = \"W/m2\" ;\n", - " SHFLX:long_name = \"Surface sensible heat flux\" ;\n", - " float T850(time, lat, lon) ;\n", - " T850:units = \"K\" ;\n", - " T850:long_name = \"Temperature at 850 mbar pressure surface\" ;\n", - " float TS(time, lat, lon) ;\n", - " TS:units = \"K\" ;\n", - " TS:long_name = \"Surface temperature (radiative)\" ;\n", - " float U850(time, lat, lon) ;\n", - " U850:units = \"m/s\" ;\n", - " U850:long_name = \"Zonal wind at 850 mbar pressure surface\" ;\n", - "```\n", - "Note that these variables have no ``cell_methods`` attribute because the output is instantaneous. \n", + "\tfloat FLNS(time, lat, lon) ;\n", + "\t\tFLNS:Sampling_Sequence = \"rad_lwsw\" ;\n", + "\t\tFLNS:units = \"W/m2\" ;\n", + "\t\tFLNS:long_name = \"Net longwave flux at surface\" ;\n", + "\t\tFLNS:cell_methods = \"time: point\" ;\n", + "\tfloat FLNT(time, lat, lon) ;\n", + "\t\tFLNT:Sampling_Sequence = \"rad_lwsw\" ;\n", + "\t\tFLNT:units = \"W/m2\" ;\n", + "\t\tFLNT:long_name = \"Net longwave flux at top of model\" ;\n", + "\t\tFLNT:cell_methods = \"time: point\" ;\n", + "\tfloat LHFLX(time, lat, lon) ;\n", + "\t\tLHFLX:units = \"W/m2\" ;\n", + "\t\tLHFLX:long_name = \"Surface latent heat flux\" ;\n", + "\t\tLHFLX:cell_methods = \"time: point\" ;\n", + "\tfloat PRECT(time, lat, lon) ;\n", + "\t\tPRECT:units = \"m/s\" ;\n", + "\t\tPRECT:long_name = \"Total (convective and large-scale) precipitation rate (liq + ice)\" ;\n", + "\t\tPRECT:cell_methods = \"time: point\" ;\n", + "\tfloat PS(time, lat, lon) ;\n", + "\t\tPS:units = \"Pa\" ;\n", + "\t\tPS:long_name = \"Surface pressure\" ;\n", + "\t\tPS:cell_methods = \"time: point\" ;\n", + "\tfloat SHFLX(time, lat, lon) ;\n", + "\t\tSHFLX:units = \"W/m2\" ;\n", + "\t\tSHFLX:long_name = \"Surface sensible heat flux\" ;\n", + "\t\tSHFLX:cell_methods = \"time: point\" ;\n", + "\tfloat T850(time, lat, lon) ;\n", + "\t\tT850:units = \"K\" ;\n", + "\t\tT850:long_name = \"Temperature at 850 mbar pressure surface\" ;\n", + "\t\tT850:cell_methods = \"time: point\" ;\n", + "\tfloat TS(time, lat, lon) ;\n", + "\t\tTS:units = \"K\" ;\n", + "\t\tTS:long_name = \"Surface temperature (radiative)\" ;\n", + "\t\tTS:cell_methods = \"time: point\" ;\n", + "\tfloat U850(time, lat, lon) ;\n", + "\t\tU850:units = \"m/s\" ;\n", + "\t\tU850:long_name = \"Zonal wind at 850 mbar pressure surface\" ;\n", + "\t\tU850:cell_methods = \"time: point\" ;\n", + "\tfloat V850(time, lat, lon) ;\n", + "\t\tV850:units = \"m/s\" ;\n", + "\t\tV850:long_name = \"Meridional wind at 850 mbar pressure surface\" ;\n", + "\t\tV850:cell_methods = \"time: point\" ;\n", + "```\n", + "Note that cell_methods = \"time: point\" because the output is **instantaneous**. \n", "\n", "\n", "**# What Changed Relative to the Historical Control?**\n", @@ -336,7 +349,7 @@ "| Sea Ice | Historical, time-varying | Pre-industrial climatology | Changes surface boundary conditions |\n", "| Greenhouse Gases | Historical concentrations | 1850 concentrations | Changes radiative forcing |\n", "| Aerosols | Historical forcing | 1850 forcing | Changes clouds and radiation |\n", - "| Start Date | Modern historical period | Year 0001 | Different model calendar |\n", + "| Start Date | Modern historical period (1979) | Year 0001 | Different model calendar |\n", "\n", "\n", " \n", diff --git a/notebooks/challenge/cam/exercise_3.ipynb b/notebooks/challenge/cam/exercise_3.ipynb index 6eb546ce..f7691bd6 100644 --- a/notebooks/challenge/cam/exercise_3.ipynb +++ b/notebooks/challenge/cam/exercise_3.ipynb @@ -17,13 +17,13 @@ "\n", "**Why Start from a Spun-Up State?**\n", "\n", - "In the control exercise, you ran `FHISTC_LTso` using its default setup, which starts around 1979.\n", + "In the control exercise, you ran `FHISTC_LTso` using its default setup, which starts on 1979-01-01.\n", "\n", "In this exercise, you will run the same compset, `FHISTC_LTso`, but start the simulation in 1850 using initial conditions from a spun-up pre-industrial simulation.\n", "\n", "This allows you to compare two historical atmosphere-only simulations:\n", "\n", - "- fhist.control: `FHISTC_LTso` starting from the default initial conditions, around 1979.\n", + "- fhist.control: `FHISTC_LTso` starting from the default initial conditions, in 1979.\n", "- fhist.1850: `FHISTC_LTso` starting in 1850 from spun-up pre-industrial initial conditions.\n", "\n", "Both cases use `FHISTC_LTso`. The main differences are the model start date and the initial condition source.\n", @@ -45,11 +45,12 @@ "
\n", "Exercise: Customize your CAM history files

\n", " \n", - "Create, configure, build, and run a case called fhist.1850 using:\n", + "Create, configure, build, and run a case called **fhist.1850** using:\n", "\n", + "```\n", "Compset: FHISTC_LTso\n", "Resolution: ne16pg3_ne16pg3_mg17\n", - "\n", + "```\n", "Use the same CAM history output settings as in the control case.\n", "Improve the throughput by changing the task layout as in the control case. \n", "\n", @@ -62,8 +63,8 @@ "\n", "Run for 5 days.\n", "\n", - "Check your solution:\n", - "- How can you check that there is a difference between the set up of this and your control?\n", + "**Check your solution:**\n", + "- How can you check that there is a difference between the set up of this run and your control?\n", "- How can you check that it is running the way you intended: using ssts & ghg forcings from time-varying, historical files?\n", "- What year is the model running?\n", "\n", @@ -100,19 +101,15 @@ "\n", "For this exercise, you will create a hybrid run, which allows the model to:\n", "\n", - "Use restart files from another simulation.\n", - "Start from a different calendar date.\n", - "Use a different forcing period than the source simulation.\n", + "- Use restart files from another simulation.\n", + "- Start from a different calendar date.\n", + "- Use a different forcing period than the source simulation.\n", "\n", "**Where are restart files located?**\n", "\n", "Many spun-up simulations are available through the CESM inputdata repository (DIN_LOC_ROOT).\n", "\n", - "For this exercise, the restart files are referenced through:\n", - "\n", - "b1850_interp\n", - "\n", - "- Data from spun-up model runs can be found in inputdata (DIN_LOC_ROOT) . \n", + "For this exercise, data from spun-up model run can be found in inputdata (DIN_LOC_ROOT). \n", " \n", "**How do I start my run in 1850?**\n", "\n", @@ -225,6 +222,16 @@ "echo \"\">> user_nl_cam \n", "```\n", "\n", + "Edit the file ``user_nl_clm` and add the lines:\n", + "```\n", + "use_init_interp = .true. \n", + "```\n", + "Alternatively, you can add the lines using `echo`:\n", + "\n", + "```\n", + "echo \"use_init_interp = .true.\" >> user_nl_clm \n", + "```\n", + "\n", "You build the namelists with the command:\n", "```\n", "./preview_namelists\n", @@ -263,6 +270,11 @@ "``` \n", "./xmlchange STOP_N=5,STOP_OPTION=ndays\n", "```\n", + "**# Copy restart file into the run directory **\n", + "\n", + "```\n", + "cp /glade/campaign/cesm/cesmdata/cseg/inputdata/cesm2_init/b1850_interp/0011-01-01/* $RUNDIR\n", + "```\n", "\n", "**# Build and submit**:\n", "```\n", @@ -270,9 +282,9 @@ "./case.submit\n", "```\n", "\n", - "------------\n", + "___\n", "\n", - "### Verify the Configuration\n", + "### **Verify the Configuration**\n", "\n", "**# Check the Run Type**\n", "```\n", @@ -318,9 +330,9 @@ "\n", "The key difference is the initialization strategy and model start date.\n", "\n", - "------------\n", + "___\n", "\n", - "### Check your solution\n", + "### **Check your solution**\n", "\n", "When the run is completed, look at the history files into the archive directory. \n", " \n", diff --git a/notebooks/challenge/cam/exercise_4.ipynb b/notebooks/challenge/cam/exercise_4.ipynb index ee2a0061..4bc3ff02 100644 --- a/notebooks/challenge/cam/exercise_4.ipynb +++ b/notebooks/challenge/cam/exercise_4.ipynb @@ -320,10 +320,10 @@ "qcmd -- ./case.build\n", "./case.submit\n", "```\n", - "------------\n", + "___\n", "\n", "\n", - "**# Check your solution**\n", + "### **Check your solution**\n", "\n", "When the run is completed, look at the history files into the archive directory. \n", " \n", @@ -339,37 +339,50 @@ "\n", "- The file should contain the instantaneous output in the file ``h1`` for the variables:\n", "```\n", - " float FLNS(time, lat, lon) ;\n", - " FLNS:Sampling_Sequence = \"rad_lwsw\" ;\n", - " FLNS:units = \"W/m2\" ;\n", - " FLNS:long_name = \"Net longwave flux at surface\" ;\n", - " float FLNT(time, lat, lon) ;\n", - " FLNT:Sampling_Sequence = \"rad_lwsw\" ;\n", - " FLNT:units = \"W/m2\" ;\n", - " FLNT:long_name = \"Net longwave flux at top of model\" ;\n", - " float LHFLX(time, lat, lon) ;\n", - " LHFLX:units = \"W/m2\" ;\n", - " LHFLX:long_name = \"Surface latent heat flux\" ;\n", - " float PRECT(time, lat, lon) ;\n", - " PRECT:units = \"m/s\" ;\n", - " PRECT:long_name = \"Total (convective and large-scale) precipitation rate (liq + ice)\" ;\n", - " float PS(time, lat, lon) ;\n", - " PS:units = \"Pa\" ;\n", - " PS:long_name = \"Surface pressure\" ;\n", - " float SHFLX(time, lat, lon) ;\n", - " SHFLX:units = \"W/m2\" ;\n", - " SHFLX:long_name = \"Surface sensible heat flux\" ;\n", - " float T850(time, lat, lon) ;\n", - " T850:units = \"K\" ;\n", - " T850:long_name = \"Temperature at 850 mbar pressure surface\" ;\n", - " float TS(time, lat, lon) ;\n", - " TS:units = \"K\" ;\n", - " TS:long_name = \"Surface temperature (radiative)\" ;\n", - " float U850(time, lat, lon) ;\n", - " U850:units = \"m/s\" ;\n", - " U850:long_name = \"Zonal wind at 850 mbar pressure surface\" ;\n", - "```\n", - "Note that these variables have no ``cell_methods`` attribute becasue the output is instantaneous. \n", + "\tfloat FLNS(time, lat, lon) ;\n", + "\t\tFLNS:Sampling_Sequence = \"rad_lwsw\" ;\n", + "\t\tFLNS:units = \"W/m2\" ;\n", + "\t\tFLNS:long_name = \"Net longwave flux at surface\" ;\n", + "\t\tFLNS:cell_methods = \"time: point\" ;\n", + "\tfloat FLNT(time, lat, lon) ;\n", + "\t\tFLNT:Sampling_Sequence = \"rad_lwsw\" ;\n", + "\t\tFLNT:units = \"W/m2\" ;\n", + "\t\tFLNT:long_name = \"Net longwave flux at top of model\" ;\n", + "\t\tFLNT:cell_methods = \"time: point\" ;\n", + "\tfloat LHFLX(time, lat, lon) ;\n", + "\t\tLHFLX:units = \"W/m2\" ;\n", + "\t\tLHFLX:long_name = \"Surface latent heat flux\" ;\n", + "\t\tLHFLX:cell_methods = \"time: point\" ;\n", + "\tfloat PRECT(time, lat, lon) ;\n", + "\t\tPRECT:units = \"m/s\" ;\n", + "\t\tPRECT:long_name = \"Total (convective and large-scale) precipitation rate (liq + ice)\" ;\n", + "\t\tPRECT:cell_methods = \"time: point\" ;\n", + "\tfloat PS(time, lat, lon) ;\n", + "\t\tPS:units = \"Pa\" ;\n", + "\t\tPS:long_name = \"Surface pressure\" ;\n", + "\t\tPS:cell_methods = \"time: point\" ;\n", + "\tfloat SHFLX(time, lat, lon) ;\n", + "\t\tSHFLX:units = \"W/m2\" ;\n", + "\t\tSHFLX:long_name = \"Surface sensible heat flux\" ;\n", + "\t\tSHFLX:cell_methods = \"time: point\" ;\n", + "\tfloat T850(time, lat, lon) ;\n", + "\t\tT850:units = \"K\" ;\n", + "\t\tT850:long_name = \"Temperature at 850 mbar pressure surface\" ;\n", + "\t\tT850:cell_methods = \"time: point\" ;\n", + "\tfloat TS(time, lat, lon) ;\n", + "\t\tTS:units = \"K\" ;\n", + "\t\tTS:long_name = \"Surface temperature (radiative)\" ;\n", + "\t\tTS:cell_methods = \"time: point\" ;\n", + "\tfloat U850(time, lat, lon) ;\n", + "\t\tU850:units = \"m/s\" ;\n", + "\t\tU850:long_name = \"Zonal wind at 850 mbar pressure surface\" ;\n", + "\t\tU850:cell_methods = \"time: point\" ;\n", + "\tfloat V850(time, lat, lon) ;\n", + "\t\tV850:units = \"m/s\" ;\n", + "\t\tV850:long_name = \"Meridional wind at 850 mbar pressure surface\" ;\n", + "\t\tV850:cell_methods = \"time: point\" ;\n", + "```\n", + "Note that these variables have `cell_methods = \"time: point\" ` attribute because the output is instantaneous. \n", "\n", "\n", "
"