CESM2 Quickstart

Download CESM

Take the Blue Waters as an example:

#module unload cmake
module load bwpy/0.3.2 Subversion
export PERL5LIB=/usr/lib/perl5/vendor_perl/5.10.0/x86_64-linux-thread-multi:$PERL5LIB
export PATH=~/bin:$PATH

git clone -b release-cesm2.1.1 https://github.com/ESCOMP/cesm.git
cd cesm
./manage_externals/checkout_externals

Set up a CESM case

The following steps are based on Cheyenne:

# create a new case

# Cheyenne
cd ~/cesm/cime/scripts
#cd /glade/p/cesm/tutorial/cesm2.1.1_tutorial/cime/scripts
#./create_newcase --case ~/cases/FHIST_09 --compset FHIST --res f09_f09_mg17 --project UIUC0021

# Blue Waters
cd ~/cesm/cime/scripts
./create_newcase --case ~/cases/FHIST_09 --compset FHIST --res f09_f09_mg17 --project basl --input-dir /scratch/sciteam/zheng1/cesm_data

# setup case
cd ~/cases/FHIST_09
./case.setup

# customize history output
vi user_nl_cam
# in the user_nl_cam, add the lines 
# assume "h1" file with instantaneous value every 3 hour
nhtfrq=0,-3
# assume "h1" files with 8 timesteps each
mfilt=1,8
fincl2='T:I','RELHUM:I','SZA:I','SOAG_SRF:I','DMS_SRF:I','H2SO4_SRF:I','O3:I','H2O2_SRF:I','SO2_SRF:I','bc_a1_SRF:I','bc_a4_SRF:I','dst_a1_SRF:I','dst_a2_SRF:I','dst_a3_SRF:I','ncl_a1_SRF:I','ncl_a2_SRF:I','ncl_a3_SRF:I','pom_a1_SRF:I','pom_a4_SRF:I','so4_a1_SRF:I','so4_a2_SRF:I','so4_a3_SRF:I','soa_a1_SRF:I','soa_a2_SRF:I'

# change run lenth (assume one-month)
./xmlchange RUN_STARTDATE=2011-01-01
./xmlchange STOP_N=1,STOP_OPTION=nmonths
# set up project (if haven't done) and job_queue
./xmlchange PROJECT=UIUC0021
./xmlchange --subgroup case.run JOB_QUEUE=regular
./xmlchange --subgroup case.st_archive JOB_QUEUE=regular
# set up wallclock time
./xmlchange --subgroup case.run JOB_WALLCLOCK_TIME=12:00:00
./xmlchange --subgroup case.st_archive JOB_WALLCLOCK_TIME=06:00:00
# use "./xmlquery" if necessary
# ./xmlquery -p QUEUE

Build/Submit a CESM case

# build the case (if a Cheyenne user)
qcmd -A UIUC0021 -q regular -- ./case.build
# build the case (if a Blue Waters user)
./case.build

# submit the case
./case.submit

Check the results

# if a Cheyenne user
#cd /glade/scratch/$user/archive/FHIST_09/atm/hist

# if a Blue Waters user
cd ~/scratch

(Optional)

Option 1: Use the following script

#!/bin/csh -f

### set env variables
setenv CASENAME FHIST_09
setenv CASEDIR  /u/sciteam/zheng1/cases/FHIST_09
setenv CESMROOT /u/sciteam/zheng1/cesm

# create new case
$CESMROOT/cime/scripts/create_newcase --case $CASEDIR --compset FHIST --res f09_f09_mg17 --project basl --input-dir /scratch/sciteam/zheng1/cesm_data

# set up case
cd $CASEDIR
./case.setup

# add to user_nl_cam:
cat > user_nl_cam <<EOF
! Users should add all user specific namelist changes below in the form of
! namelist_var = new_namelist_value
! assume "h1" file with instantaneous value every 3 hour
nhtfrq=0,-3
! assume "h1" files with 8 timesteps each
mfilt=1,8
fincl2='T:I','RELHUM:I','SZA:I','SOAG_SRF:I','DMS_SRF:I','H2SO4_SRF:I','O3:I','H2O2_SRF:I','SO2_SRF:I','bc_a1_SRF:I','bc_a4_SRF:I','dst_a1_SRF:I','dst_a2_SRF:I','dst_a3_SRF:I','ncl_a1_SRF:I','ncl_a2_SRF:I','ncl_a3_SRF:I','pom_a1_SRF:I','pom_a4_SRF:I','so4_a1_SRF:I','so4_a2_SRF:I','so4_a3_SRF:I','soa_a1_SRF:I','soa_a2_SRF:I'
EOF

# change run lenth and time
./xmlchange STOP_N=1,STOP_OPTION=nmonths
./xmlchange RESUBMIT=24
./xmlchange RUN_STARTDATE=2011-01-01

# build the case
./case.build

# submit the case
./case.submit

Option 2: Use the command and script provided by Blue Waters staff

Command:

# 1. Clone 
git clone -b release-cesm2.1.0 https://github.com/ESCOMP/cesm.git cesm2_1_0
# 2. Configure
cd cesm2_1_0
module load bwpy/0.3.2 Subversion
./manage_externals/checkout_externals
# 3. Create and build a case
module load bwpy/0.3.2
export CESMDATAROOT=/scratch/sciteam/$USER/cesm_data

Script:

#!/bin/csh -f

### set env variables
setenv CASENAME my_case
setenv CESMROOT /u/sciteam/$USER/cesm2_1_0
setenv PSN baga

$CESMROOT/cime/scripts/create_newcase --case $CASENAME --res f19_g16_rx1 --compset A --project $PSN
cd $CASENAME

### modify case parameters
./xmlchange -file env_run.xml -id RUN_STARTDATE -val '1979-01-01'
./xmlchange -file env_run.xml -id STOP_OPTION -val 'ndays'
./xmlchange -file env_run.xml -id REST_N -val '5'
./xmlchange -file env_run.xml -id RESUBMIT -val '0'

# change run type to startup
./xmlchange -file env_run.xml -id RUN_TYPE -val 'startup'

# change the input directory
./xmlchange -file env_run.xml -id DIN_LOC_ROOT -val '/scratch/sciteam/$USER/cesm_data'

### set up the case
./case.setup

### build the case
./case.build

### submit the case for running on the system
./case.submit

Reference

[1] CESM Tutorial 2019

[2] CESM release download

[3] Bluw Waters: CESM

[1] CESM Quickstart Guide

[2] CESM compset

[3] CESM grid resolution

[4] CESM namelist

[5] CESM CAM History Field

[6] CAM User's Guide (Atmospheric configurations)

results matching ""

    No results matching ""