Exercise 1

Exercise 1#

We’ll start with a simple example: doubling the CO2 concentration

Exercise: Doubling the CO2 concentration

Make a new case using the B1850-tutorial compset and f19_g17 resolution. Put it in ~/cases and call it b1850_2x.

Set up the case and preview the namelists. You can preview the namelists that the case is using with the following command in your case directory

./preview_namelists

Check that the value of co2vmr in CaseDocs/atm_in and in the run directory.

Double the CO2 concentration and preview the namelists again. Check that the value of co2vmr changed in CaseDocs/atm_in and in the run directory.

Note: You don’t need to build (qcmd -- ./case.build) and submit (./case.submit). We are just looking at namelists without running the case.

Click here for hints

How to preview namelists

You can preview the namelists that the case is using with the following command in your case directory

./preview_namelists

This will generate files with names XXX_in where XXX corresponds to the model component e.g., atm_in for the atmosphere component. These files are generated both in the CaseDocs sub- directory of your case directory and the run directory. Take a look at ./CaseDocs/atm_in.

How to double the CO2 concentration

Now for the B1850-tutorial compset, CO2 concentrations are controlled by the namelist parameter co2vmr i.e., CO2 volume mixing ratio. You should see in the atm_in file that it is currently set to

co2vmr=284.7e-6

To double the CO2 concentration we need to modify co2vmr by setting it to the value we want in the user_nl_cam file. DO NOT change it in the atm_in file. That will not affect the simulation. The atm_in file is generated simply for reference when the case is built or submitted. So place the following entry in user_nl_cam

co2vmr=569.4e-6

Has your change been propagated to the atm in file after running preview_namelists?

How to edit the user_nl_cam

Use a text editor as explained in the nano editor section.

Click here for the solution

To create a new case using the B1850-tutorial compset with f19_g17 resolution you can do the following

cd $CESMROOT/cime/scripts
./create_newcase --case ~/cases/b1850_2x --compset B1850-tutorial --res f19_g17

Now, go to the case directory and set up your case

cd ~/cases/b1850_2x
./case.setup

You can check the default value of co2vmr by previewing the namelists

./preview_namelists

and searching for the variable co2vmr in ./CaseDocs/atm_in within your case directory

grep 'co2vmr' ./CaseDocs/atm_in

Now add the following line to user_nl_cam

co2vmr=569.4e-6

Now run

./preview_namelists

and check your changes have propagates to the namelist i.e., examine the files

~/cases/b1850_2x/CaseDocs/atm_in

and

~/scratch/b1850_2x/run/atm_in

We’re not doing this here, but if you wanted to actually submit the run, you’d do

qcmd -- ./case.build
./case.submit