-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathmain.m
177 lines (102 loc) · 4.78 KB
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
% --------------------------------------------------------------------
% main script to postprocess and visualise CESM output: CTL and IRR
% --------------------------------------------------------------------
tic
% clean up
clc;
clear;
close all;
% flags
flags.eval = 0; % 0: do not evaluate model
% 1: evaluate model
flags.stat = 1; % 0: do not compute statistical significance of change
% 1: compute statistical significance of change
flags.STCD = 0; % 0: do not decompose the Surface Temperature change
% 1: decompose the Surface Temperature change
flags.perc = 0; % 0: do not compute percentile changes
% 1: compute percentile changes
flags.local = 0; % 0: do not compute local effect
% 1: compute local effect
flags.offli = 0; % 0: do not process offline simulations
% 1: process offline simulations
flags.valp = 0; % 0: do not compute values used in the paper
% 1: compute values used in the paper
flags.plot = 1; % 0: do not plot
% 1: plot
% --------------------------------------------------------------------
% initialisation
% --------------------------------------------------------------------
% declare globals
global island %#ok<NUSED>
% add matlab scripts directory to path
addpath(genpath('C:\Users\u0079068\Documents\Research\matlab_scripts'));
% add directory containing nc files to path
addpath(genpath('C:\Users\u0079068\Documents\Research\CESM_present\ncfiles'));
% initialise model parameters
nens = 5; % number of ensemble members
% initialise time parameters - CESM
time_begin = [1981, 1, 1, 0,0,0];
time_end = [2010,12,31,23,0,0];
years = (time_begin(1):time_end(1))';
nyears = length(years);
% initialise physical constants
[Lvap, rhow, a_earth] = mf_inicon('Lvap', 'rhow', 'a_earth');
% initialise srex variable/unit/region names - TSA
srex_vars = {'QIRRIG' , 'TSA' , 'Qle' , 'FSH' , 'FSA' , 'FIRA' , 'PRECT' , 'QRUNOFF' }; % srex variables considered in this study ...
srex_ylabels = {'Q_i_r_r' , 'T_2_m', 'LHF' , 'SHF' , 'SW_n_e_t', 'LW_n_e_t', 'Precipitation', 'Q_R_U_N_O_F_F' }; % ... their y-axis label,
srex_units = {'mm d^-^1', 'K' , 'W m^-^1', 'W m^-^1', 'W m^-^1' , 'W m^-^1' , 'mm d^-^1' , 'mm d^-^1' }; % ... their units,
srex_block = {'lnd' , 'lnd' , 'lnd' , 'lnd' , 'lnd' , 'lnd' , 'atm' , 'lnd' }; % ... and whether it's a land or atmospheric variable
srex_reg = {'WNA', 'CNA', 'MED', 'WAS', 'SAS', 'SEA', 'EAS'}; % srex regions considered in this study
% initialise observational product names
prod_names = {'Qirr census', 'LHF LandFlux', 'LHF GLEAM', 'SWnet SRB', 'LWnet SRB', 'T2m CRU', ' Precipitation CRU', ' Precipitation GPCP', 'TXx GHCNDEX', 'TXx HadEx2', 'TNn GHCNDEX', 'TNn HadEx2'};
% --------------------------------------------------------------------
% load data
% --------------------------------------------------------------------
ms_load
% --------------------------------------------------------------------
% manipulations: general
% --------------------------------------------------------------------
ms_manip
% --------------------------------------------------------------------
% Model evaluation
% --------------------------------------------------------------------
if flags.eval == 1
ms_evaluation;
end
% --------------------------------------------------------------------
% Statistical significance
% --------------------------------------------------------------------
if flags.stat == 1
ms_statsign;
end
% --------------------------------------------------------------------
% Surface Energy Balance decomposition
% --------------------------------------------------------------------
if flags.STCD == 1
ms_STCdecomp
end
% --------------------------------------------------------------------
% Percentile change
% --------------------------------------------------------------------
if flags.perc == 1
ms_perc
end
% --------------------------------------------------------------------
% local effects
% --------------------------------------------------------------------
if flags.local == 1
ms_local
end
% --------------------------------------------------------------------
% get values used in the paper
% --------------------------------------------------------------------
if flags.valp == 1
ms_valp
end
% --------------------------------------------------------------------
% visualise output
% --------------------------------------------------------------------
if flags.plot == 1
ms_plotscript
end
toc