Exercises

Exercises#

Exercise: Initializing a simulation from a previous one

Create a case b1850_hybrid using the B1850-tutorial compset at f19_g17 resolution. Set the run as an hybrid run from the run: b1850_initial for 1st Jan for year 2.

The initial run is in: /scratch/data/b1850_initial/

Here you’ll make use of restart files from a previously run simulation, to initialize your simulation using a hybrid initialization. A 1 year simulation, called b1850_initial, which uses the B1850-tutorial compset at f19_g17 resolution as already been performed and the archive directory is IN:

/scratch/data/b1850_initial/

Here you’ll find all the restart files for 1st Jan for year 2 of this run

/scratch/data/b1850_initial/rest/0002-01-01-00000
Click here for hints

Create a new case, using the B1850-tutorial compset at f19_g17 resolution. Call it b1850_hybrid and put it in ∼/cases. Set up the case.

The following changes to xml parameters in env run.xml need to be performed to run the hybrid initialization.

#change to a hybrid initialization
./xmlchange RUN_TYPE=hybrid 

# set the name of the run from which you are initializing
./xmlchange RUN_REFCASE=b1850_initial 

# set the path to the initialization files that you want to use
./xmlchange RUN_REFDIR=/scratch/data/b1850_initial/rest/0002-01-01-00000 

# sets the date of initialization - corresponds to the date of the initialization files being used
./xmlchange RUN_REFDATE=0002-01-01 

# ensures it automatically obtains the restarts and initial conditions from RUN_REFDIR specified below
./xmlchange GET_REFCASE=TRUE

Lets also output some high frequency fields so we can see the history fields in a short 5 day run. Add the following to user nl cam to output daily precipitation

fincl2='PRECT'
nhtfrq=0,-24
mfilt=1,1

Build the case. Submit it.

Is it running? Are the history files being created?

Note that the default is RUN_STARTDATE=0001-01-01. This means that even though you have initialized from January 1st year 2, the dates of your run will start from January 1st year 1. In a hybrid run, you can change RUN_STARTDATE to any date you like

Click here for the solution

create a new case

go into scripts directory into the CESM code and run the create_newcase command

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

case setup

go in case directory and run case_setup

cd ~/cases/b1850_hybrid
./case.setup

Set a hybrid run and point to the reference case

./xmlchange RUN_TYPE=hybrid
./xmlchange RUN_REFCASE=b1850_initial
./xmlchange RUN_REFDATE=0002-01-01
./xmlchange RUN_STARTDATE=0001-01-01
./xmlchange RUN_REFDIR=/scratch/data/b1850_initial/rest/0002-01-01-00000/
./xmlchange GET_REFCASE=TRUE

namelist modifications

Add to user_nl_cam

fincl2='PRECT'
nhtfrq=0,-24
mfilt=1,1

Build and submit

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