Coding_Application_1
Coding Application #1
Computer Analysis of Global Climate Model Output, XXXXXXXXXX
Overview
Global climate change due to anthropogenic emissions of greenhouse gases has many different
facets. Among the most important of these is changes in precipitation, which may impact
freshwater availability, the occu
ence of hydrological extremes such as floods and droughts, and
ocean salinity and circulation. In this problem, you will write computer code in Matlab to
analyze precipitation changes simulated by global climate models over the period XXXXXXXXXX.
Climate Model Output
We will be working with monthly, gridded climate model output (simulated precipitation) from
the following 20 global climate models that were included in the fifth Coupled Model
Intercomparison Project (CMIP5): ACCESS1-0, BNU-ESM, CanESM2, CCSM4, CESM1-
CAM5, CMCC-CESM, CNRM-CM5, CSIRO-Mk3-6-0, EC-EARTH, FGOALS-g2, FIO-ESM,
GFDL-CM3, GISS-E2-R, HadGEM2-AO, inmcm4, IPSL-CM5A-LR, MIROC5, MPI-ESM-LR,
MRI-CGCM3 and NorESM1-M. The output from each model has been archived in NetCDF
format, and can be accessed by Matlab by specifying the appropriate OPeNDAP URL. For
example, for the first model (ACCESS1-0), the OPeNDAP URL is:
http:
strega.ldeo.columbia.edu:81/CMIP5/.monthly/.byScenario/.rcp85/.atmos/.mon/.p
.ACCES
S1-0/.r1i1p1/.p
dods. The URLs for the remaining models are identical except for the model
name.
Code assignment
Write a Matlab program to:
1. Calculate and plot the global annual mean precipitation time series for XXXXXXXXXXfor
each of the 20 models and for the multimodel mean. All time series should be included
on the same plot. Use different line colors/styles to distinguish between models, and
include a legend. The precipitation should be plotted in units of mm/day.
2. Calculate and plot a geographic map of the multimodel mean precipitation change
etween XXXXXXXXXXand XXXXXXXXXXi.e., time average precipitation in the latter period
minus time average precipitation in the former period). The map should include a
colo
ar. The precipitation change should be plotted in units of mm/day.
3. On the same geographic map created in Step 2, find a way to show the locations (i.e., grid
points) where at least 90% of the individual models agree on the sign of the precipitation
change.
4. Create a new NetCDF file and write to this file the necessary data to reproduce your plot
from Steps 2-3. These data include the grid information (i.e., latitudes and longitudes),
the multimodel mean precipitation change (Step 2), and the measure of model agreement
(Step 3). The latter could be represented as a matrix of zeros and ones, for example.
Your new NetCDF file should include appropriate variable attributes (e.g., description
and units).
Pointers
1. The model output you’ll be reading in is monthly precipitation as a function of latitude
and longitude. The output for all models begins in January 2006, but the end of the time
series can be different for different models. This should be accounted for in your Matlab
code so that you are only reading in the output for the period XXXXXXXXXXinclusive). The
simulated precipitation is provided in units of kg m-2 s-1. You can multiply this by 86,400
(number of seconds per day) to convert to units of mm/day.
2. To complete Step 1, you’ll need to spatially and temporally average the model output in
order to go from gridded (i.e., function of latitude and longitude) monthly data to global
annual means. The spatial averaging should be done using area weighting. A simple and
standard way to do this is to weight by the cosine of latitude. Using this approach in
Matlab, the global annual mean precipitation in a given year would be: pr_global =
sum(pr.*cosd(lats))/sum(cosd(lats)), where pr is the average precipitation at each latitude
(or zonal-mean precipitation), and lats are the latitudes in degrees. (Note that pr and lats
must have the same dimensions.)
3. Model output is provided on different grids (i.e., at different latitudes and longitudes) for
different models. To complete Steps 2-4, the output from each individual model needs to
e regridded to a common grid. You can do this using the function regrid_cmip5.m,
which can be downloaded from Courseworks.
4. Groups of 2–3 are allowed to work together, but every student must hand in the complete
assignment.
Grading
You should turn in (1) a time series plot of the global annual mean precipitation for XXXXXXXXXX
(Step 1), (2) a geographic plot of the multimodel mean precipitation change overlaid with the
measure of model agreement (Steps 2-3), (3) your new NetCDF file (Step 4), and (4) all Matlab
outines.
The assignment will be graded as follows:
• 20%: Time series plot of global annual mean precipitation
• 20%: Geographic map of precipitation change
• 20%: New NetCDF file
• 20%: Matlab code works with only minor adjustments
• 10%: Well-structured code (e.g., appropriate use of functions)
• 10%: Good commenting and documentation practices
If students work together on the assignment, the code must include comments at the top that
describe the group and the contributions of each member.