Great Deal! Get Instant $10 FREE in Account on First Order + 10% Cashback on Every Order Order Now

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...

1 answer below »
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.
Answered Same Day Nov 13, 2021

Solution

Kshitij answered on Nov 17 2021
144 Votes
Climate/Climate.doc
1Analyze precipitation changes simulated by global climate models over the period 2006-2100.
Global annual mean precipitation time series for 2006-2100
1
multimodel mean precipitation change between 2006-2025 and 2081-2100
2
create NewCDF File ans save as multimodel.nc
3
Analyze precipitation changes simulated by global climate models over the period 2006-2100.
% clear screen
clc
clear all
close all
warning off
% delete model for inte
upption
delete Multimodel.nc
Global annual mean precipitation time series for 2006-2100
% load the model
list = dir('*.cdf');
% ploting all the model
figure;
set(gcf,'WindowState','maximized')
for q =1:numel(list)
Modellat = ncread(list(q).name,'lat'); % latitude
Modellon = ncread(list(q).name,'lon'); % longtitude
Modelpr = ncread(list(q).name,'pr'); % precipitation
ModelT = ncread(list(q).name,'T'); % time in months
% finding global annual mean
year=1;
for i=1:12:numel(ModelT)
pr_global(year) = mean(mean(mean(Modelpr(:,:,i:i+11))))*86400;
year=year+1;
end
% store the model data to get multimodel mean
store_pr_global(q,:)=imresize(pr_global,[1 95]);
T = 2006:2005+(numel(ModelT)/12);
% give legends to all plot
Legd = erase(list(q).name,'.cdf');
% plot data
plot(T,pr_global,'DisplayName',Legd)
xlabel('Years')
ylabel('Precipitation mm/day')
title('Global Annual Mean Precipitation')
legend show
legend location northwest
hold on
% clear data to avoid interferences
clear Modellat Modellon Modelpr ModelT pr_global T yea
end
% plot the multimodel mean
plot(2006:2100,mean(store_pr_global),'Displayname','MultiModel')
hold off
multimodel mean precipitation change between 2006-2025 and 2081-2100
for w=1:numel(list)
Modellat = ncread(list(q).name,'lat'); % latitude
Modellon = ncread(list(q).name,'lon'); % longtitude
Modelpr = ncread(list(q).name,'pr'); % precipitation
ModelT = ncread(list(q).name,'T'); % time in months
% time average precipitation in the latter period minus time average
% precipitation in the former period
Modelpr = mean(Modelpr(:,:,1:228),3)-mean(Modelpr(:,:,900:length(Modelpr)),3);
% Regrid all the model to the common grid
multimodel(:,:,w)=imresize(Modelpr,[180,360]);
end
% Plot the geographic data
figure;
set(gcf,'WindowState','maximized')
mean_multimodel = mean(multimodel,3);
La=-90:1:90;
Lo=0:1:360;
imagesc(Lo,La,mean_multimodel')
xticks(0:30:360)
yticks(-90:30:90)
grid on
ox on
xlabel('longitude')
ylabel('latitude')
title('Multimodel mean precipitation change between 2006-2025 and 2081-2100 (mm/day)')
colo
ar('southoutside')
create NewCDF File ans save as...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here