Review
Overview
Teaching: min
Exercises: minQuestions
What have we learned so far?
Where are we going?
Objectives
Midway through the semester is a good time to pause and review what we have learned so far and what we have left.
What have we learned so far?
- Some Unix commands
- How to use JupyterLab
- Reading and plotting Climate Model Output
- An overview of Atmospheric Models
- How to run CESM in fully coupled mode (B compset)
- How to modify the CESM to change how long to run, what to output and how often
- How to understand and postprocess CESM output
- How to run diagnostics packages for CESM
- Some advanced Python functions – groupby
- How to setup and run the Atmosphere and Land components of CESM with DOCN (F Compset)
- How to troubleshoot our model runs
Where are we going?
- Overview of Ocean and Ice Modeling
- How to run the Ocean and and Ice components of CESM with DATM
- How to change model code
- How to perform Intervention or Idealized experiments
- Reduced complexity models, why use them? how to run them?
- How to run an Initialized Prediction Experiment (Forecast)
- Regional Modeling
- Land and Land Ice
- Your projects!
Atmospheric Modeling
-
Dynamics (Equations of motion) Assumptions: hydrostatic Linearize, discretize, solve numerically Predict: thickness(w),u,v,q,T
- Physics (Sub grid-scale Parameterized)
- Clouds
- Radiation
- Convection
- Microphysics
- Boundary layer
- Fluxes
- Gravity waves
- Boundary Forcing Information exchnaged with or prescried by other components of the climate system (e.g. soil moisture, sea surface temperature)
CESM Quickstart
A review of our CESM quickstart procedure
Create a newcase (this script is located in CIMEROOT/scripts)
./create_newcase --case CASEROOT --res RESOLUTION --compset COMPSET --project UGMU0032
Setup the case (run from your case directory)
./case.setup
Make your changes to the namelists, .xml files, and/or source codes
- Use
xmlchange
for.xml
files - Use
user_nl_xxx
for namelist changes - Use
SourceMods/src.xxx
for code changes (we will talk about this today)
Build the case
qcmd -- ./case.build
Submit the run
./case.submit
CESM Compsets we have used so far
B
all components are active (fully coupled)F
atmosphere and land are active; ocean and ice are inactive (data)
Today we will work with
G
ocean and ice are active; atmosphere and land are inactive (data)
Key Points
Ocean and Sea Ice Modeling
Overview
Teaching: min
Exercises: minQuestions
How to Ocean and Ice Models work?
Objectives
Just like the atmosphere and land models are typically run together, the ocean and sea ice models are also typically run together. We will learn about what ocean and sea ice models predict, what they explicitly resolve, what they paramaterize, and some of the challenges of ocean and sea ice modeling.
Ocean Models
The CESM2 ocean component is called POP (Parallel Ocean Program). The next version of CESM (CESM3) will use a different ocean model called MOM (Modular Ocean Model). Regardless of the exact model used, the fundamentals of ocean modeling are similar and consist of dynamics and physics. They may also consist of biological and chemical processes as well, but we will not discuss this part.
Dynamics
- Seven Equations and 7 unknowns: U,V,W,T,S,rho,P
- Plus equations for tracers (chemical, biological, isotopes indicated age of water masses)
- Approximations: Hydrostatic, Boussinesq
- Linearize, discretize, solve numerically
Parameterized Physics
-
Vertical mixing: surface boundary layer, interior
-
Lateral mixing: mesoscale eddies Such as the Kuroshio, Gulf Stream, Aghulas, Brazil, etc. This is weather in the ocean. Unlike in the atmosphere, current climate resolution ocean models do not resolve ocean weather.
-
Horizontal viscosity
-
Overflows (Deep channel and Continental shelves) Parameterizes the acceleration of dense water down the slope of bottom topography in deep channels (Denmark Strait, Faroe Bank Channel) and continental shelves (Ross and Weddell Seas). This acceleration of dense water causes vigorious mixing and entrainment that is smaller than the resolution of ocn models.
-
Submesoscale eddies
-
Estuary box model parmeterization (Rivers)
-
Solar absorption: how is radiation absorbed at different depths?
Some Challenges in Ocean Modeling
- Irregular Domain, including narrow straights and channels
- Spatial vs. Temporal Scales: cannot represent eddies (“ocean weather”) in climate resoultion ocean models; Rossby radius of deformation is 10s-100s km vs. 1000 km in Atm.
- Equilibrium timescale: small amount of mixing across density surfaces means that the ocean takes a long time to come into equilibrium; have to accept that the deep ocean is not in equilibrium in many simulations
- Bottom topography: discretization creates step functions
- Large heat capacity
Key Points
Sea Ice Modeling
Overview
Teaching: min
Exercises: minQuestions
How Does Sea Ice Modeling work?
Objectives
Why is it important to model sea ice?
- Arctic sea ice extent is known to be decreasing due to Arctic Amplification, the effect that the poles are warming faster than the rest of the globe.
- Sea ice feedsback to other components of the climate system
- It has high albedo which has an impact on the Earth’s radiation budget
- It insulates the ocean from the atmosphere which impacts the exhanges of heat and moisture
- Can modify ocena circulation: Ice formation leads to salt flux to ocean; ice melt freshens the oceans
Sea Ice Models
The CESM2 sea ice component is called CICE. Sea ice models have two primary components, some models have a 3rd component:
Dynamics
Force balance to determine the motion of the sea ice Wind stress, water stress, internal ice stress, Coriolis, and stress associated with sea surface slope Resistant to converence and shear
Thermodynamics and Radiative Properties
- Solves the vertical ice temperature profile: 8 sea ice thickness categories; 3 snow layers
- Determines the Vertical/lateral melt and growth rates
- Albedo
- Radiation
- Aerosol Depositing and cycling
Ice Thickness Distribution
Sub-gridscale parameterization to represent the spatial hterogeneity in ice
- Five ice categories
- PDF of the ice thickness evolution is solved
- Convergence, ice growth
Key Points
CESM G compset
Overview
Teaching: min
Exercises: minQuestions
How to run Ocean and Ice models?
Objectives
We will setup and run 4 ocean/sea-ice experiments to learn how to work with these components.
Ocean/ice active compsets start with G
.
Just like the F
compsets needed SST data as the boundary forcing, G
compsets require boundary forcing from the atmosphere. The standard atmospheric forcing provided to a G
compset is called CORE (Coordinated Ocean-ice Reference Experiments), version 2, atmopsheric datasets (Large and Yeager 2009)
G
: this is a standard ocean/ice with data atmosphere/land compset in which the boundary forcing is callednormal year forcing (NYF)
, meaning 12 months of CORE forcing data that repeats (think like a climatology).GIAF
: this is ocean/ice activate with data atmosphere/land in which teh boundary forcing is interannually varying from CORE forcing data.
Our Experiments
Control Case: default settings, 1 year__
Setup, build, and run a control case for 1 year. Use the following:
compset
=G
resolution
=T62_g37
Overflow Parameterization Case
Create a case exactly the same as the control case, but with the overflow parameterization turned off.
This means we will not attempt to parameterize the mixing associated with dense water sinking in the Denmark Strait, Faroe Bank Channel, and Weddell and Ross Seas.
Modifying parameterizations is done in the namelists.
After we build the model or run ./preview_namelists
, the namelists that the model uses are located in:
/glade/scratch/USERNAME/CASENAME/run/xxx_in
Remember, when we want to make a change to a namelists, we use user_nl_xxx
to override the default behavior.
We can always run ./preview_namelists
to check our namelists get resolved properly.
To create an exact replica of another case, you can use create_clone
rather than create_newcase
, as follows, replacing NEWCASE
and OLDCASE
with the correct case names:
./create_clone --case ~/cases/NEWCASE --clone ~/cases/OLDCASE
Setup and build the case.
Modify the user_nl_pop
namelist as follows:
overflows_on = .false.
overflows_interactive = .false.
Run the case for 1 year.
Where do you expect the overflow parameterization to matter?
What variables would you look at in your output?
Change the snow albedo on sea ice case
Create a clone of your control simulation.
Modify user_nl_cice
as follows:
r_snw = 2.00
This is a tuning parameter that specifies the number of standard deviations away from the base optical properties in the shortwave
radiative transfer code. The default value is -2.00. It is used in the equation: rsnw_nonmelt = 500 - r_snw * 250
(in microns).
Higher values of r_snw -> lower rsnw_nonmelt -> higher albedo.
Run the model for 1-year.
What do you think will happen by increasing the albedo of the ice?
How can you check?
Some variables to look at:
albedo to convince yourself this worked as expected
ice fraction to see how changing albedo impacted the ice
Increase the zonal wind stress in the ocean case
Create a clone of your control simulation
Run case.setup
This exercise demonstrates how to change the source code (i.e. Fortran) of the model. The original source code resides in:
/glade/work/USERNAME/cesm2.1.1/
Similar to namelists, we don’t change the original, we make changes in an alternate location, then modify it to override the default. Changes to source code go in SourceMods/src.xxx
Also, source code changes must be included in the build, so we make the changes before building the model.
Copy the file /glade/work/USERNAME/cesm2.1.1/components/pop/source/forcing_coupled.F90
to CASEDIR/SourceMods/src.pop/
cp /glade/work/USERNAME/cesm2.1.1/components/pop/source/forcing_coupled.F90 ~/cases/gwindstress/SourceModes/src.pop/
Now let’s look at the code.
Find the subroutine rotate_wind_stress
This code rotates the wind stress vector to map it onto the correct location in the model local grid coordinates. We can think of the first component (array index 1) as the zonal direction (on the model grid) and the second component (array index 2) as the meridional component on the model local grid coordinates.
Add a line of code to increase the first component by 25%.
Build and run the model for 1-year.
Be sure to check that the model built successfully before you run it. If you had a typo, you will likely get a build error and your model will not run because it did not build.
Where do you think there will be the biggest impacts of increased zonal wind stress?
How can you check the impact?
What variables would you look at?
Looking at our output
Once you have submitted your model runs, they will run relatively quickly if the queue is not too busy. In the meantime, you can look at the output of my model runs to explore the results of these experiments.
Experiment 1 (control): /glade/scratch/kpegion/archive/gcontrol/ocn/hist/
Experiment 2 (overflow): /glade/scratch/kpegion/archive/goverflow/ocn/hist/
Experiment 3 (snow albedo): /glade/scratch/kpegion/archive/gsnowalb/ice/hist
Experiment 4 (wind stress): /glade/scratch/kpegion/archive/gwindstress/ocn/hist
How would we read this data?
Login to casper and launch Jupyter
module load python/3.6.8
ncar_pylib
start-jupyter
follow the screen for the rest of the steps.
import xarray as xr
path='/glade/scratch/kpegion/archive/gcontrol/ocn/hist/'
files='gcontrol.pop.h.0001-*.nc'
ds=xr.open_mfdataset(path+files,combine='nested',
concat_dim='time')
ds
We can look at annual mean values by taking the mean in time.
ds_amean=ds.mean(dim='time')
Key Points