0% found this document useful (0 votes)
60 views10 pages

Climate Model Simulation Exercises

Uploaded by

张宇
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views10 pages

Climate Model Simulation Exercises

Uploaded by

张宇
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Overview

Control

Run a control case: CAM6, data ocean, climatological forcings from around year 2000. Run for 5 days
only, with 3-hourly instantaneous output of a few fields so we can see what is changing

Exercises

Then choose one or more exercises to try:


• 1a. Use historical SSTs/forcings instead of fixed (compset change)
• 1b Try running starting 1850 with spun-up pre-industrial model (compset change)
• 2a. Increase orographic height over the western US (dataset change)
• 2b. Modify sea surface temperature in the tropics (dataset change)
• 3. Increase the triggering threshold for deep convection over land (code change--simple)
• 4. Add a (fake) physics parameterization (code change--advanced)

Compare your test exercise to your control

Solutions to the exercices

My own recommendation:
DON’T LOOK AT THE SOLUTIONS DURING THE LAB !!!
Exercise 0: Control

Run a control case: CAM6, data ocean, climatological forcings from around year 2000. Run for 5 days
only, with 3-hourly instantaneous output of a few fields so we can see what is changing

Solution to exercise 0

# set variables
set CASENAME = f2000
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = F2000climo
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported –project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "">> user_nl_cam

# compile
qcmd -A UESM0011 -- ./case.build

# submit job
./case.submit
Exercise 1a

Create, configure, build and run a case called fhist with the compset FHIST at the resolution
f09_f09_mg17 using the same history file output as in the control.

• How can you check that there is a difference between the set up of this and your control?
• How can you check that it is running the way you intended: using ssts & ghg forcings from
time-varying, historical files?
• What year is the model running?

Solution to exercise 1a

# set variables
set CASENAME = fhist
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = FHIST
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported –project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "">> user_nl_cam

# compile
qcmd -A UESM0011 -- ./case.build

# submit job
./case.submit
Exercise 1b

Create, configure, build and run a case called fhist with the compset FHIST at the resolution
f09_f09_mg17 using the same history file output as in the control. Start model in 1850.

• How can you check that there is a difference between the set up of this and your control?
• How can you check that it is running the way you intended: using ssts & ghg forcings from
time-varying, historical files?
• What year is the model running?

Solution to exercise 1a

# set variables
set CASENAME = fhist.1850
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = FHIST
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported –project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "">> user_nl_cam

# change starting date and ref case


./xmlchange RUN_STARTDATE=1850-01-01
./xmlchange RUN_REFCASE=b.e21.B1850.f19_g17.CMIP6-piControl-2deg.001
./xmlchange RUN_REFDATE=0321-01-01

# compile
qcmd -A UESM0011 -- ./case.build

# submit job
./case.submit
Exercise 2a

Create a case similar to control case but change input boundary datasets by increasing surface
geopotential height by 50% in the western USA

Solution to exercise 2a

# set variables
set CASENAME = f2000.oro
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = F2000climo
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported –project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# modify orography
cp \
/glade/p/cesmdata/cseg/inputdata/atm/cam/topo/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_
ZR_GRNL_031819.nc .

ncap2 -O -s 'lat2d[lat,lon]=lat ; lon2d[lat,lon]=lon' \


-s 'omask=(lat2d >= 30. && lat2d <= 50.) && (lon2d >= 235. && lon2d <= 260.)' \
-s 'PHIS=(PHIS*(1.+omask*0.5))' \
fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_031819.nc \
fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_031819.orox50.nc

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "bnd_topo =
'$CASEDIR/fv_1.9x2.5_nc3000_Nsw084_Nrs016_Co120_Fi001_ZR_GRNL_031819.orox50.nc' " >>
user_nl_cam
echo "">> user_nl_cam

# compile
qcmd -A UESM0011 -- ./case.build
# submit job
./case.submit
Exercise 2b

Create a case similar to control case but change input boundary datasets by increasing surface
geopotential height by 50% in the western USA

Solution to exercise 2a

# set variables
set CASENAME = f2000.sst
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = F2000climo
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported –project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# modify sst file


cp /glade/p/cesmdata/cseg/inputdata/atm/cam/sst/sst_HadOIBl_bc_1.9x2.5_2000climo_c180511.nc .

ncap2 -O -s 'lat2d[lat,lon]=lat ; lon2d[lat,lon]=lon' \


-s 'omask=(lat2d >= -10. && lat2d <= 10.) && (lon2d >= 180. && lon2d <= 240.)'\
-s 'SST_cpl=(SST_cpl+omask*2.)' \
sst_HadOIBl_bc_1.9x2.5_2000climo_c180511.nc \
sst_HadOIBl_bc_1.9x2.5_2000climo_c180511.nc.warmtcp.nc

./xmlchange \
SSTICE_DATA_FILENAME="$CASEDIR/sst_HadOIBl_bc_1.9x2.5_2000climo_c180511.nc.warmtcp.nc"

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "">> user_nl_cam

# compile
qcmd -A UESM0011 -- ./case.build
# submit job
./case.submit
Exercise 3

Create a case similar to control case. Add code change to examine the mean effects of delaying the
initiation of convection by increasing the minimum required convective available potential energy
(CAPE) to initiate convection over land;

Solution to exercise 3

# set variables
set CASENAME = f2000.cape
set CASEDIR = /glade/u/home/$USER/cases/$CASENAME
set RUNDIR = /glade/scratch/$USER/$CASENAME/run
set COMPSET = F2000climo
set RESOLUTION = f19_f19_mg17

# create new case


cd /glade/p/cesm/tutorial/cesm2.1_tutorial2022/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --run-unsupported --project
UESM0011

# setup
cd $CASEDIR
./xmlchange JOB_QUEUE=regular,PROJECT=UESM0011 # if needed after 5pm
./case.setup
./preview_namelists

# user_nl_cam
echo "NHTFRQ(2) = -3">> user_nl_cam
echo "MFILT(2) = 240">> user_nl_cam
echo "FINCL2 = 'TS:I','PS:I', 'U850:I','T850:I','PRECT:I','LHFLX:I','SHFLX:I','FLNT:I','FLNS:I'">> user_nl_cam
echo "">> user_nl_cam

# modify code: copy and modify zm_conv.F90


cp /glade/p/cesm/tutorial/cesm2.1_tutorial2022/components/cam/src/physics/cam/zm_conv.F90 \
SourceMods/src.cam

# Edit SourceMods/src.cam/zm_conv.F90 to include your mods


# Change the following section of code in sub-routine zm_convr
if (cape(i) > capelmt) then
lengath = lengath + 1
ideep(lengath) = i
end if
To
if (landfrac(i) > 0.5_r8) then
capelmt_mask = 10._r8*capelmt
else
capelmt_mask = capelmt
end if
if (cape(i) > capelmt_mask) then
lengath = lengath + 1
ideep(lengath) = i
end if
write(iulog,*) 'HELLO WORLD'

Near the top of subroutine zm_convr, right after:


real(r8) pblt(pcols)
Add real(r8) :: capelmt_mask

# compile
qcmd -A UESM0011 -- ./case.build

# submit job
./case.submit

Exercise 4

Add a fake parameterization. Please follow guidance from the slides.

You might also like