2: mid-Holocene case#
The Holocene Epoch started ~11,700 before present (11.7 ka BP) and is the current geological epoch.
The term Anthropocene is used by many scientists to describe the current period, characterized by profound and lasting human influences on Earth’s geological formations and ecosystems. However, the Anthropocene has not yet been officially formalized as a distinct epoch by the International Commission on Stratigraphy.
The Holocene is an interglacial period, marked by receding ice sheets and rising greenhouse gases that were accompanied by changes in the Earth’s orbit around the Sun.
Today, we will use CESM to investigate influence of mid-Holocene orbital forcing on the atmosphere.
Create, configure, build and run a atmosphere-land coupled mid-Holocene (~6 ka BP) case called f.e30.FLT1850.ne16_mg17.midHolocene.001 following CESM naming conventions.
Run for 1 month.
Click here for hints
What is the compset for atmosphere-land coupled mid-Holocene run?
Use
F1850C_LTsoand modify preindustrial orbital configuration (no mid-Holocene compset available)
What is the resolution for B1850?
Use resolution
ne16pg3_ne16pg3_mg17for fast throughput
What was the orbital configuration 6 ka BP?
According to Table 1 of Otto-Bliesner et al., (2017), Eccentricity = 0.018682, Obliquity (degrees) = 24.105, Perihelion = 0.87 (for simplicity, we don’t consider the other forcings here, i.e., CO2)
How to modify orbital configuration in CESM world?
Edit
user_nl_cplorb_mode = 'fixed_parameters'orb_eccen = 0.018682orb_obliq = 24.105orb_mvelp = 0.87
Click here for the solution
# Set environment variables
Set environment variables with the commands:
For tcsh users
set CASENAME=f.e30.FLT1850.ne16_mg17.midHolocene.001
set CASEDIR=/glade/u/home/$USER/cases/$CASENAME
set RUNDIR=/glade/derecho/scratch/$USER/$CASENAME/run
set COMPSET=F1850C_LTso
set RESOLUTION=ne16pg3_ne16pg3_mg17
set PROJECT=UESM0016
For bash users
export CASENAME=f.e30.FLT1850.ne16_mg17.midHolocene.001
export CASEDIR=/glade/u/home/$USER/cases/$CASENAME
export RUNDIR=/glade/derecho/scratch/$USER/$CASENAME/run
export COMPSET=F1850C_LTso
export RESOLUTION=ne16pg3_ne16pg3_mg17
export PROJECT=UESM0016
Make sure you have $PROJECT set to the project number given for this tutorial.
# Make a case directory
If needed create a directory cases into your home directory:
mkdir /glade/u/home/$USER/cases/
# Create a new case
Create a new case with the command create_newcase:
cd /glade/u/home/$USER/code/my_cesm_code/cime/scripts/
./create_newcase --case $CASEDIR --res $RESOLUTION --compset $COMPSET --project $PROJECT --run-unsupported
# Set the job queue and project to charge
If needed, change job queue.
For instance, to run in the queue tutorial.
cd $CASEDIR
./xmlchange JOB_QUEUE=tutorial,PROJECT=$PROJECT --force
setenv PBS_ACCOUNT $PROJECT
This step can be redone at anytime in the process.
# Setup
Invoke case.setup with the command:
cd $CASEDIR
./case.setup
You build the namelists with the command:
./preview_namelists
This step is optional as the script preview_namelists is automatically called by case.build and case.submit. But it is nice to check that your changes made their way into:
$CASEDIR/CaseDocs/atm_in
# Set run length
./xmlchange STOP_N=1,STOP_OPTION=nmonths
# Add the following to user_nl_cpl
orb_mode = 'fixed_parameters'
orb_eccen = 0.018682
orb_obliq = 24.105
orb_mvelp = 0.87
# Build and submit
qcmd -- ./case.build
./case.submit
# Validate your simulation setup
(1) If you want to check the log file, atm.log.xxx, in the Run Directory (when model is still running) or in your Storage Directory (when the simulation and archiving have finished).
Note: The less command in Linux is a terminal pager program used to view (but not change) the contents of a text file one screen at a time. It is particularly useful for large files, as it does not need to read the entire file before starting, hence it loads large files faster than editors like vi or emacs.
To skip to the bottom of the file, press <shift> + g
To stop viewing the contents of the file with less, press q.
less /glade/derecho/scratch/$USER/$CASENAME/run/atm.log.*
less /glade/derecho/scratch/$USER/archive/$CASENAME/logs/atm.log.*.gz
Alternatively, use the real-time monitoring mode with less that you can activate with the +F (forward) option. Now, new lines will be continuously displayed as they are added to the file during the run.
To exit forward mode and revert to the standard interactive mode of less, press <ctrl> + C.
less +F /glade/derecho/scratch/$USER/$CASENAME/run/atm.log.*
(2) Type /orb_params to search, you should see the following
((atm_comp_nuopc):(InitializeRealize)) :CAM atm model initialization
(shr_orb_params) Use input orbital parameters:
(shr_orb_params) ------ Computed Orbital Parameters ------
(shr_orb_params) Eccentricity = 1.868200E-02
(shr_orb_params) Obliquity (deg) = 2.410500E+01
(shr_orb_params) Obliquity (rad) = 4.207116E-01
(shr_orb_params) Long of perh(deg) = 8.700000E-01
(shr_orb_params) Long of perh(rad) = 3.156777E+00
(shr_orb_params) Long at v.e.(rad) = -5.753730E-04
# Check your solution
When the run is completed, look at the history files into the archive directory.
(1) Check that your archive directory on derecho (The path will be different on other machines):
cd /glade/derecho/scratch/$USER/archive/$CASENAME/atm/hist
ls
As your run is one-month and an F-case, there should be 1 monthly file for the atmosphere (h0a) and land (h0) components only.
To save time, we only produced 1 month (January) of preindustrial and mid-Holocene output. However, one year of monthly files for each simulation is needed to complete the rest of this exercise.
One year of each simulation has been run for you and placed in the following directory. Please create a new directory for this exercise in your work space and copy the files into it.
mkdir /glade/work/$USER/tutorial_paleo_runs
cd /glade/work/$USER/tutorial_paleo_runs
cp /glade/work/macarew/cesm_tutorial_paleo/runs/* .
There are two ways of defining months or seasons:
(1) a “fixed-length” method in which months are defined by a fixed number of days (e.g., January in CESM history files is the first 31 days of a 365-day year)
(2) a “fixed-angular” method in which months are defined by a fixed number of degrees of the Earth’s orbit (e.g., January is 31.0 days × (360° / 365-day year = 30.6° of orbit))
Due to changes in Earth’s orbital eccentricity and precession, the portion of Earth’s orbit covered by each fixed-length month varies over time. According to Kepler’s second law (1609), Earth moves faster along its elliptical orbit near perihelion and more slowly near aphelion. Because the calendar days of perihelion and aphelion shift over time, the number of days it takes Earth to traverse a fixed orbital arc (e.g., 30.6°) also changes. This leads to misalignment between fixed-length months relative to solstices/equinoxes when comparing simulations with different orbital configurations. The impact of this misalignment is known as the paleo calendar effect.
In this exercise, the issue is that CESM history output defines months using the fixed-length method. When comparing simulations of the mid-Holocene with the preindustrial control, a given month (e.g., January) corresponds to different positions in Earth’s orbit. Thus, apparent climate differences reflect both:
changes in insolation from orbital forcing (paleoclimate forcing), and
mismatches in calendar definition (paleo calendar effect)
Note: If you have daily-average output from CESM, the calendar effect must still be considered when summarizing those data by months. In this case, you would average daily data using the appropriate (paleo) month starting and ending days, thereby explicitly incorporating the changing month lengths.
Fortunately, post-processing tools exist to adjust monthly CESM output and account for the paleo calendar effect. Your tasks are:
Convert monthly surface temperature and solar insolation fields from the mid-Holocene CAM history files to a calendar-adjusted monthly format by aggregating pseudo-daily data on fixed-angular calendar appropriate for 6 ka.
Use NCO and Ncview to compare and visualize differences between the mid-Holocene and preindustrial simulations after calendar adjustment.
Click here for hints
What tools exist to adjust the calendar of monthly average CESM history files?
One convenient Fortran-based tool for calendar-adjustment of climate model output is the PaleoCalAdjust tool from Bartlein & Shafer et al. (2019).
The key program
cal_adjustcan provide the paleo calendar-effect adjustment for CESM output.Here is a path to a cal_adjust makefile that is locally configured for Derecho:
/glade/work/macarew/cesm_tutorial_paleo/makefile
Note: PaleoCalAdjust is designed to work with netCDF files that conform to CMIP/PMIP-like data structures. So, some reformatting of the raw CESM monthly-average history files (i.e., netCDF containing all variables within one month of output on an unstructured grid) is necessary to be compatible with cal_adjust. These reformatting steps include converting monthly-average history files into timeseries, remapping the data onto a regular rectilinear grid, removing the global history attribute from the netCDF metadata, and adding missing value information. Luckily, all can be done from the command line with neat netCDF Operators (NCO)!
How do I convert monthly-average history files into timeseries format?
To convert all variables in monthly-average CESM history files to timeseries format, the CESM_postprocessing tool is recommended. However, in this exercise we only need to convert 12 months of
TSandSOLINinto timeseries files, so NCO is suitable.
How do I remap timeseries on an unstructured grid to a regular rectilinear grid?
There are many different ways to regrid unstructured data. One popular method is to generate a mapping file using the ESMF_RegridWeightGen tool. This tool requires files that describe the source and destination grids, which are available on NCAR Glade at
/glade/p/cesmdata/cseg/inputdata/share/scripgrids/
How do I format the information file needed to run the cal_adjust program?
The information file is a CSV file that you will create with details about the location of input/output files, variables of interest, output frequency and length of simulation, calendar type used in CESM, paleo time period of interest, and the mean-preserving interpolation method used to convert monthly average values into a daily time step.
An example information file is available here in PaleoCalAdjust:
PaleoCalAdjust/data/info_files/cal_adj_info_test01.csv
Click here for the solution
# Download PaleoCalAdjust Github repository to your work directory
cd /glade/work/$USER
git clone https://github.com/pjbartlein/PaleoCalAdjust.git PaleoCalAdjust
# Make a directory for tutorial files in PaleoCalAdjust
mkdir /glade/work/$USER/PaleoCalAdjust/tutorial
# Set case name variables
Set case name variables with the commands:
For tcsh users
set CASENAME_MH=f.e30.FLT1850.ne16_mg17.midHolocene.001
set CASENAME_PI=f.e30.FLT1850.ne16_mg17.piControl.001
For bash users
export CASENAME_MH=f.e30.FLT1850.ne16_mg17.midHolocene.001
export CASENAME_PI=f.e30.FLT1850.ne16_mg17.piControl.001
# Use NCO to convert CAM history files into TS and SOLIN timeseries files
cd /glade/work/$USER/tutorial_paleo_runs
module load nco
ncrcat -v TS $CASENAME_MH.cam.h0a.*.nc $CASENAME_MH.cam.h0a.TS.0001.nc
ncrcat -v SOLIN $CASENAME_MH.cam.h0a.*.nc $CASENAME_MH.cam.h0a.SOLIN.0001.nc
Let’s also do this for the preindustrial control so that output files are in the same format:
ncrcat -v TS $CASENAME_PI.cam.h0a.*.nc $CASENAME_PI.cam.h0a.TS.0001.nc
ncrcat -v SOLIN $CASENAME_PI.cam.h0a.*.nc $CASENAME_PI.cam.h0a.SOLIN.0001.nc
# Use NCO to remap CAM timeseries files from the unstructured ne16pg3 to regular 2x2° grid
First, you need a mapping file and for simplicity one has been created for you. Please copy this file into a new directory called remapped.
mkdir /glade/work/$USER/tutorial_paleo_runs/remapped
cd /glade/work/$USER/tutorial_paleo_runs/remapped
cp /glade/work/macarew/cesm_tutorial_paleo/map_ne16pg3_TO_2x2d_bilin.260625.nc .
Note: You can see some details on the tools used to make this file by using ncdump map_ne16pg3_TO_2x2d_bilin.260625.nc | less. While we use bilinear interpolation for both TS and SOLIN in this exercise, conservative interpolation methods are recommended for flux quantities to conserve the area-weighted integral values from the native grid.
Now you can remap the timeseries using NCO. While we do not need to calendar-adjust the preindustrial run, we will also remap it to compare the simulations later on a common grid.
ncremap -m map_ne16pg3_TO_2x2d_bilin.260625.nc /glade/work/$USER/tutorial_paleo_runs/$CASENAME_MH.cam.h0a.SOLIN.0001.nc $CASENAME_MH.001.cam.h0a.SOLIN.0001.remap2x2d.nc
ncremap -m map_ne16pg3_TO_2x2d_bilin.260625.nc /glade/work/$USER/tutorial_paleo_runs/$CASENAME_MH.cam.h0a.SOLIN.0001.nc $CASENAME_MH.001.cam.h0a.SOLIN.0001.remap2x2d.nc
ncremap -m map_ne16pg3_TO_2x2d_bilin.260625.nc /glade/work/$USER/tutorial_paleo_runs/$CASENAME_PI.cam.h0a.SOLIN.0001.nc $CASENAME_PI.001.cam.h0a.SOLIN.0001.remap2x2d.nc
ncremap -m map_ne16pg3_TO_2x2d_bilin.260625.nc /glade/work/$USER/tutorial_paleo_runs/$CASENAME_PI.cam.h0a.SOLIN.0001.nc $CASENAME_PI.001.cam.h0a.SOLIN.0001.remap2x2d.nc
# Now let’s move into PalCalAdjust tutorial directory and compile executable
cd /glade/work/$USER/PaleoCalAdjust/tutorial
cp /glade/work/macarew/cesm_tutorial_paleo/makefile .
make
# Adjust 2x2° CESM timeseries for mid-Holocene into PMIP/CMIP-like format for cal_adjust
ncatted -h \
-a history,global,d,, \
-a _FillValue,SOLIN,o,f,1.0e+20 \
-a missing_value,SOLIN,o,f,1.0e+20 \
$CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d.nc \
$CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d.format.nc
ncatted -h \
-a history,global,d,, \
$CASENAME_MH.cam.h0a.TS.0001.remap2x2d.nc \
$CASENAME_MH.cam.h0a.TS.0001.remap2x2d.format.nc
# Copy and modify CSV information file with correct formatting for mid-Holocene simulation
cp ../data/info_files/cal_adj_info_test01.csv cal_adj_info.csv
This is what your final CSV file should look like: /glade/work/macarew/cesm_tutorial_paleo/cal_adj_info.csv
# Run executable to calendar adjust monthly CAM output
./cal_adjust cal_adj_info.csv
The calendar-adjusted files should be in your current directory!
Click here to visualize results
# Use Ncview to visualize solar insolation and temperature
Earth’s orbital configuration and the paleo calendar effect will influence monthly-average incoming solar insolation.
Take a look at the SOLIN and TS CAM variables for each month in the pre-industrial and calendar-adjusted mid-Holocene output.
module load ncview
ncview $CASENAME_PI.cam.h0a.SOLIN.0001.remap2x2d.nc &
ncview $CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d_cal_adj.nc &
ncview $CASENAME_PI.cam.h0a.TS.0001.remap2x2d.nc &
ncview $CASENAME_MH.cam.h0a.TS.0001.remap2x2d_cal_adj.nc &
Adding the & symbol allows you to open two Ncview windows and compare the files side by side.
Using the right arrow button in the Ncview windows, you can toggle between all months of the pre-industrial and mid-Holocene SOLIN values.
Now, let’s take a look at the differences between the pre-industrial and mid-Holocene cases more clearly using NCO. The first comparison is the difference in SOLIN and TS induced by correcting for the paleo calendar effect.
ncdiff $CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d_cal_adj.nc $CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d.nc MH_adj-orig_SOLIN.nc
ncdiff $CASENAME_MH.001.cam.h0a.TS.0001.remap2x2d_cal_adj.nc $CASENAME_MH.cam.h0a.TS.0001.remap2x2d.nc MH_adj-orig_TS.nc
ncview MH_adj-orig_SOLIN.nc &
ncview MH_adj-orig_TS.nc &
# Questions for reflection:
Where are the largest differences in solar insolation?
Do the regional differences in solar insolation due to the paleo calendar effect translate to similar changes in surface temperature? Why or why not?
Now that we have a better understanding of the influence of the paleo calendar effect and have adjusted for it, let’s take a look at the impact of orbital variations on insolation between the preindustrial and mid-Holocene.
ncdiff $CASENAME_MH.cam.h0a.SOLIN.0001.remap2x2d_cal_adj.nc $CASENAME_PI.cam.h0a.SOLIN.0001.remap2x2d.nc MH-PI_SOLIN.nc
ncdiff $CASENAME_MH.cam.h0a.TS.0001.remap2x2d_cal_adj.nc $CASENAME_PI.cam.h0a.TS.0001.remap2x2d.nc MH-PI_TS.nc
ncview MH-PI_SOLIN.nc &
ncview MH-PI_TS.nc &
# Questions for reflection:
Which orbital parameters are different at the middle Holocene (6 ka BP)?
How does the orbital parameter impact the top-of-atmosphere shortwave radiation (solar insolation) during summertime in the Northern Hemisphere?
Do the results look correct? You can compare your results with Figure 3b of Otto-Bliesner et al., (2017)
What other aspects of climate are different between the mid-Holocene and pre-industrial runs?