1 |
gforget |
1.8 |
|
2 |
gforget |
1.1 |
%select kBudget: |
3 |
|
|
if ~isempty(setDiagsParams); |
4 |
|
|
kBudget=setDiagsParams{1}; |
5 |
|
|
else; |
6 |
|
|
kBudget=1; |
7 |
|
|
end; |
8 |
|
|
|
9 |
|
|
%override default file name: |
10 |
|
|
%--------------------------- |
11 |
|
|
tmp1=setDiags; |
12 |
|
|
if kBudget>1; |
13 |
|
|
tmp1=sprintf('F%02i',kBudget); |
14 |
|
|
end; |
15 |
|
|
fileMat=['diags_set_' tmp1]; |
16 |
|
|
|
17 |
|
|
if userStep==1;%diags to be computed |
18 |
|
|
listDiags=['glo_vol_ocn glo_vol_tot glo_vol_ice glo_bp']; |
19 |
gforget |
1.3 |
listDiags=[listDiags ' glo_heat_ocn glo_heat_tot glo_heat_ice']; |
20 |
|
|
listDiags=[listDiags ' glo_salt_ocn glo_salt_tot glo_salt_ice']; |
21 |
|
|
if sum([90 1170]~=mygrid.ioSize)==0; |
22 |
gforget |
1.1 |
listDiags=[listDiags ' gsbox_vol_ocn gsbox_vol_tot gsbox_vol_ice gsbox_bp']; |
23 |
|
|
listDiags=[listDiags ' arctic_vol_ocn arctic_vol_tot arctic_vol_ice arctic_bp']; |
24 |
|
|
listDiags=[listDiags ' gsbox_heat_ocn gsbox_heat_tot gsbox_heat_ice']; |
25 |
|
|
listDiags=[listDiags ' arctic_heat_ocn arctic_heat_tot arctic_heat_ice']; |
26 |
|
|
listDiags=[listDiags ' gsbox_salt_ocn gsbox_salt_tot gsbox_salt_ice']; |
27 |
|
|
listDiags=[listDiags ' arctic_salt_ocn arctic_salt_tot arctic_salt_ice']; |
28 |
gforget |
1.3 |
end; |
29 |
gforget |
1.1 |
|
30 |
|
|
elseif userStep==2;%input files and variables |
31 |
gforget |
1.7 |
listFlds={ 'ETAN','SIheff','SIhsnow','THETA ','SALT ','PHIBOT','geothFlux'}; |
32 |
gforget |
1.1 |
listFlds={listFlds{:},'SIatmFW ','oceFWflx','SItflux','TFLUX','SFLUX','oceSPflx','SRELAX'}; |
33 |
|
|
listFlds={listFlds{:},'oceQnet ','SIatmQnt','SIaaflux','SIsnPrcp','SIacSubl'}; |
34 |
|
|
listFlds={listFlds{:},'TRELAX','WTHMASS','WSLTMASS','oceSflux','oceQsw','oceSPtnd'}; |
35 |
|
|
if kBudget>1; |
36 |
|
|
listFlds={listFlds{:},'ADVr_TH','DFrE_TH','DFrI_TH','ADVr_SLT','DFrE_SLT','DFrI_SLT','WVELMASS'}; |
37 |
|
|
end; |
38 |
|
|
listFlds={listFlds{:},'SDIAG1','SDIAG2','SDIAG3'}; |
39 |
|
|
listFlds={listFlds{:},'UVELMASS','VVELMASS','AB_gT','AB_gS'}; |
40 |
|
|
listFlds={listFlds{:},'ADVx_TH ','ADVy_TH ','DFxE_TH ','DFyE_TH '}; |
41 |
|
|
listFlds={listFlds{:},'ADVx_SLT','ADVy_SLT','DFxE_SLT','DFyE_SLT'}; |
42 |
|
|
listFlds={listFlds{:},'ADVxHEFF','ADVyHEFF','DFxEHEFF','DFyEHEFF'}; |
43 |
|
|
listFlds={listFlds{:},'ADVxSNOW','ADVySNOW','DFxESNOW','DFyESNOW'}; |
44 |
|
|
listFldsNames=deblank(listFlds); |
45 |
|
|
% |
46 |
|
|
listFiles={'rate_budg2d_snap_set1','budg2d_hflux_set1','budg2d_zflux_set1','budg2d_zflux_set2'}; |
47 |
|
|
if kBudget==1; |
48 |
gforget |
1.8 |
listFiles={listFiles{:},'rate_budg2d_snap_set2','budg2d_hflux_set2','geothermalFlux'}; |
49 |
gforget |
1.1 |
else; |
50 |
|
|
tmp1=sprintf('rate_budg2d_snap_set3_%02i',kBudget); |
51 |
|
|
tmp2=sprintf('budg2d_zflux_set3_%02i',kBudget); |
52 |
|
|
tmp3=sprintf('budg2d_hflux_set3_%02i',kBudget); |
53 |
gforget |
1.7 |
tmp4=sprintf('geothermalFlux_%02i',kBudget); |
54 |
|
|
listFiles={listFiles{:},tmp1,tmp2,tmp3,tmp4}; |
55 |
gforget |
1.1 |
end; |
56 |
gforget |
1.6 |
listSubdirs={[dirMat 'BUDG/' ],[dirMat '../BUDG/' ],[dirModel 'diags/BUDG/'],[dirModel 'diags/']}; |
57 |
gforget |
1.1 |
|
58 |
|
|
elseif userStep==3;%computational part; |
59 |
|
|
|
60 |
|
|
%preliminary tests |
61 |
|
|
test1=isempty(dir([dirModel 'diags/BUDG/budg2d_snap_set1*'])); |
62 |
|
|
test2=isempty(dir([dirMat 'BUDG/rate_budg2d_snap_set1*']))&... |
63 |
|
|
isempty(dir([dirMat '../BUDG/rate_budg2d_snap_set1*'])); |
64 |
|
|
|
65 |
|
|
if (strcmp(setDiags,'F')&test1&test2); |
66 |
|
|
fprintf('\n abort : global and regional budgets, due to missing \n'); |
67 |
|
|
fprintf(['\n ' dirModel 'diags/BUDG/budg2d_snap_set1* \n']); |
68 |
|
|
return; |
69 |
|
|
end; |
70 |
|
|
|
71 |
|
|
if (strcmp(setDiags,'F')&test2); |
72 |
|
|
fprintf('\n abort : global and regional budgets, due to missing \n'); |
73 |
|
|
fprintf(['\n ' dirModel 'diags/BUDG/rate_budg2d_snap_set1* \n']); |
74 |
|
|
return; |
75 |
|
|
end; |
76 |
|
|
|
77 |
|
|
%override default file name: |
78 |
|
|
%--------------------------- |
79 |
|
|
tmp1=setDiags; |
80 |
|
|
if kBudget>1; |
81 |
|
|
tmp1=sprintf('F%02i',kBudget); |
82 |
|
|
end; |
83 |
|
|
fileMat=['diags_set_' tmp1 '_' num2str(tt) '.mat']; |
84 |
|
|
|
85 |
|
|
%fill in optional fields: |
86 |
|
|
%------------------------ |
87 |
|
|
if isempty(who('TRELAX')); TRELAX=0*mygrid.XC; end; |
88 |
|
|
if isempty(who('SRELAX')); SRELAX=0*mygrid.XC; end; |
89 |
|
|
if isempty(who('AB_gT')); AB_gT=0*mygrid.XC; end; |
90 |
|
|
if isempty(who('AB_gS')); AB_gS=0*mygrid.XC; end; |
91 |
|
|
if isempty(who('oceSPtnd')); oceSPtnd=0*mygrid.XC; end; |
92 |
|
|
if isempty(who('oceSPflx')); oceSPflx=0*mygrid.XC; end; |
93 |
|
|
if isempty(who('PHIBOT')); PHIBOT=0*mygrid.XC; end; |
94 |
gforget |
1.7 |
if isempty(who('geothFlux')); geothFlux=0; end; |
95 |
gforget |
1.1 |
|
96 |
|
|
%aliases from development phase (applies to 2012 core runs) |
97 |
|
|
%--------------------------------------------------------- |
98 |
|
|
if ~isempty(who('SDIAG1')); SRELAX=SDIAG1; end; |
99 |
|
|
if ~isempty(who('SDIAG2')); SIatmFW=SDIAG2; end; |
100 |
|
|
if ~isempty(who('SDIAG3')); SItflux=SDIAG3; end; |
101 |
|
|
|
102 |
|
|
|
103 |
|
|
%=======MASS========= |
104 |
|
|
|
105 |
gforget |
1.10 |
[budgMo,budgMi,budgMoi]=calc_budget_mass(kBudget); |
106 |
gforget |
1.7 |
|
107 |
gforget |
1.1 |
%bottom pressure for comparison: |
108 |
|
|
bp=myparms.rhoconst/9.81*PHIBOT; |
109 |
|
|
|
110 |
|
|
%compute global integrals: |
111 |
|
|
%------------------------- |
112 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
113 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMoi,msk,'extensive'); |
114 |
gforget |
1.12 |
glo_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
115 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMo,msk,'extensive'); |
116 |
gforget |
1.12 |
glo_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
117 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMi,msk,'extensive'); |
118 |
gforget |
1.12 |
glo_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
119 |
gforget |
1.1 |
glo_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
120 |
gforget |
1.3 |
|
121 |
|
|
if sum([90 1170]~=mygrid.ioSize)==0; |
122 |
gforget |
1.11 |
%compute gsbox integrals: |
123 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
124 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMoi,msk,'extensive'); |
125 |
gforget |
1.12 |
gsbox_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
126 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMo,msk,'extensive'); |
127 |
gforget |
1.12 |
gsbox_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
128 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMi,msk,'extensive'); |
129 |
gforget |
1.12 |
gsbox_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
130 |
gforget |
1.1 |
gsbox_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
131 |
|
|
|
132 |
gforget |
1.11 |
%and arctic integrals: |
133 |
gforget |
1.1 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
134 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMoi,msk,'extensive'); |
135 |
gforget |
1.12 |
arctic_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
136 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMo,msk,'extensive'); |
137 |
gforget |
1.12 |
arctic_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
138 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgMi,msk,'extensive'); |
139 |
gforget |
1.12 |
arctic_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
140 |
gforget |
1.1 |
arctic_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
141 |
gforget |
1.3 |
end; |
142 |
gforget |
1.11 |
|
143 |
gforget |
1.1 |
%=======HEAT======= |
144 |
|
|
|
145 |
gforget |
1.10 |
[budgHo,budgHi,budgHoi]=calc_budget_heat(kBudget); |
146 |
gforget |
1.7 |
|
147 |
gforget |
1.1 |
%compute global integrals: |
148 |
|
|
%------------------------- |
149 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
150 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHoi,msk,'extensive'); |
151 |
gforget |
1.12 |
glo_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
152 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHo,msk,'extensive'); |
153 |
gforget |
1.12 |
glo_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
154 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHi,msk,'extensive'); |
155 |
gforget |
1.12 |
glo_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
156 |
gforget |
1.1 |
|
157 |
gforget |
1.3 |
if sum([90 1170]~=mygrid.ioSize)==0; |
158 |
gforget |
1.11 |
%compute gsbox integrals: |
159 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
160 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHoi,msk,'extensive'); |
161 |
gforget |
1.12 |
gsbox_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
162 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHo,msk,'extensive'); |
163 |
gforget |
1.12 |
gsbox_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
164 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHi,msk,'extensive'); |
165 |
gforget |
1.12 |
gsbox_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
166 |
gforget |
1.1 |
|
167 |
gforget |
1.11 |
%and arctic integrals: |
168 |
gforget |
1.1 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
169 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHoi,msk,'extensive'); |
170 |
gforget |
1.12 |
arctic_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
171 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHo,msk,'extensive'); |
172 |
gforget |
1.12 |
arctic_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
173 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgHi,msk,'extensive'); |
174 |
gforget |
1.12 |
arctic_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
175 |
gforget |
1.3 |
end; |
176 |
gforget |
1.11 |
|
177 |
gforget |
1.1 |
%=======SALT======= |
178 |
|
|
|
179 |
gforget |
1.10 |
[budgSo,budgSi,budgSoi]=calc_budget_salt(kBudget); |
180 |
gforget |
1.7 |
|
181 |
gforget |
1.1 |
%compute global integrals: |
182 |
|
|
%------------------------- |
183 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
184 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSoi,msk,'extensive'); |
185 |
gforget |
1.12 |
glo_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
186 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSo,msk,'extensive'); |
187 |
gforget |
1.12 |
glo_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
188 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSi,msk,'extensive'); |
189 |
gforget |
1.12 |
glo_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
190 |
gforget |
1.3 |
|
191 |
|
|
if sum([90 1170]~=mygrid.ioSize)==0; |
192 |
gforget |
1.11 |
%compute gsbox integrals: |
193 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
194 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSoi,msk,'extensive'); |
195 |
gforget |
1.12 |
gsbox_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
196 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSo,msk,'extensive'); |
197 |
gforget |
1.12 |
gsbox_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
198 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSi,msk,'extensive'); |
199 |
gforget |
1.12 |
gsbox_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
200 |
gforget |
1.1 |
|
201 |
gforget |
1.11 |
%and arctic integrals: |
202 |
gforget |
1.1 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
203 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSoi,msk,'extensive'); |
204 |
gforget |
1.12 |
arctic_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
205 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSo,msk,'extensive'); |
206 |
gforget |
1.12 |
arctic_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
207 |
gforget |
1.11 |
tmp1=calc_mskmean_T(budgSi,msk,'extensive'); |
208 |
gforget |
1.12 |
arctic_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv]; |
209 |
gforget |
1.3 |
end; |
210 |
gforget |
1.1 |
|
211 |
|
|
%===================== COMPUTATIONAL SEQUENCE ENDS =========================% |
212 |
|
|
%===================== PLOTTING SEQUENCE BEGINS =========================% |
213 |
|
|
|
214 |
gforget |
1.3 |
elseif userStep==-1&multiBasins==1;%plotting |
215 |
gforget |
1.1 |
|
216 |
|
|
if isempty(setDiagsParams); |
217 |
|
|
choicePlot={'all'}; |
218 |
|
|
elseif isnumeric(setDiagsParams{1})&length(setDiagsParams)==1; |
219 |
|
|
choicePlot={'all'}; |
220 |
|
|
elseif isnumeric(setDiagsParams{1}); |
221 |
|
|
choicePlot={setDiagsParams{2:end}}; |
222 |
|
|
else; |
223 |
|
|
choicePlot=setDiagsParams; |
224 |
|
|
end; |
225 |
|
|
|
226 |
|
|
tt=[1:length(alldiag.listTimes)]; |
227 |
|
|
TT=alldiag.listTimes(tt); |
228 |
|
|
nt=length(TT); |
229 |
|
|
|
230 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass'))); |
231 |
|
|
|
232 |
|
|
%1.1) ocean+seaice mass budgets |
233 |
|
|
%------------------------------ |
234 |
|
|
figureL; |
235 |
|
|
%global volume budget: |
236 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_tot,'kg/m2','Global Mean Mass (incl. ice)'); |
237 |
|
|
%add bp: |
238 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
239 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
240 |
|
|
%gsboxern hemisphere budget: |
241 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_tot,'kg/m2','Gulf Stream Box Mass (incl. ice)'); |
242 |
gforget |
1.1 |
%add bp: |
243 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
244 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
245 |
|
|
%arcticern hemisphere budget: |
246 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_tot,'kg/m2','Arctic Mass (incl. ice)'); |
247 |
gforget |
1.1 |
%add bp: |
248 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
249 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
250 |
|
|
%add to tex file |
251 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
252 |
|
|
myCaption={myCaption{:},'mass budget (ocean+ice) in kg/m2.'}; |
253 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
254 |
|
|
|
255 |
|
|
%1.2) ice mass budgets |
256 |
|
|
%--------------------- |
257 |
|
|
figureL; |
258 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ice,'kg/m2','Global Mean Mass (only ice)'); |
259 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
260 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
261 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_ice,'kg/m2','Gulf Stream Box Mass (only ice)'); |
262 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
263 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
264 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_ice,'kg/m2','Arctic Mass (only ice)'); |
265 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
266 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
267 |
|
|
%add to tex file |
268 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
269 |
|
|
myCaption={myCaption{:},'mass budget (ice only) in kg/m2.'}; |
270 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
271 |
|
|
|
272 |
|
|
end; |
273 |
|
|
|
274 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass'))); |
275 |
|
|
|
276 |
|
|
%1.3) ocean mass budgets |
277 |
|
|
%----------------------- |
278 |
|
|
figureL; |
279 |
|
|
%global volume budget: |
280 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ocn,'kg/m2','Global Mean Mass (only ocean)'); |
281 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
282 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
283 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_ocn,'kg/m2','Gulf Stream Box Mass (only ocean)'); |
284 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
285 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
286 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_ocn,'kg/m2','Arctic Mass (only ocean)'); |
287 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
288 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
289 |
|
|
%add to tex file |
290 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
291 |
|
|
myCaption={myCaption{:},'mass budget (ocean only) in kg/m2.'}; |
292 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
293 |
|
|
|
294 |
|
|
end; |
295 |
|
|
|
296 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat'))); |
297 |
|
|
|
298 |
|
|
%2.1) ocean+seaice heat budgets |
299 |
|
|
%------------------------------ |
300 |
|
|
figureL; |
301 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_tot,'J/m2','Global Mean Ocean Heat (incl. ice)'); |
302 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_heat_tot,'J/m2','Gulf Stream Box Ocean Heat (incl. ice)'); |
303 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_tot,'J/m2','Arctic Ocean Heat (incl. ice)'); |
304 |
gforget |
1.1 |
%add to tex file |
305 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
306 |
|
|
myCaption={myCaption{:},'heat budget (ocean+ice) in J/m2.'}; |
307 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
308 |
|
|
|
309 |
|
|
%2.2) ice heat budgets |
310 |
|
|
%--------------------- |
311 |
|
|
figureL; |
312 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ice,'J/m2','Global Mean Ocean Heat (only ice)'); |
313 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_heat_ice,'J/m2','Gulf Stream Box Ocean Heat (only ice)'); |
314 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_ice,'J/m2','Arctic Ocean Heat (only ice)'); |
315 |
gforget |
1.1 |
%add to tex file |
316 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
317 |
|
|
myCaption={myCaption{:},'heat budget (ice only) in J/m2.'}; |
318 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
319 |
|
|
|
320 |
|
|
end; |
321 |
|
|
|
322 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat'))); |
323 |
|
|
|
324 |
|
|
%2.3) ocean heat budgets |
325 |
|
|
%----------------------- |
326 |
|
|
figureL; |
327 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ocn,'J/m2','Global Mean Ocean Heat (only ocean)'); |
328 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_heat_ocn,'J/m2','Gulf Stream Box Ocean Heat (only ocean)'); |
329 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_ocn,'J/m2','Arctic Ocean Heat (only ocean)'); |
330 |
gforget |
1.1 |
%add to tex file |
331 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
332 |
|
|
myCaption={myCaption{:},'heat budget (ocean only) in J/m2.'}; |
333 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
334 |
|
|
|
335 |
|
|
end; |
336 |
|
|
|
337 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt'))); |
338 |
|
|
|
339 |
|
|
%3.1) ocean+seaice salt budgets |
340 |
|
|
%------------------------------ |
341 |
|
|
figureL; |
342 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_tot,'g/m2','Global Mean Ocean Salt (incl. ice)'); |
343 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_salt_tot,'g/m2','Gulf Stream Box Ocean Salt (incl. ice)'); |
344 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_tot,'g/m2','Arctic Ocean Salt (incl. ice)'); |
345 |
gforget |
1.1 |
%add to tex file |
346 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
347 |
|
|
myCaption={myCaption{:},'salt budget (ocean+ice) in g/m2.'}; |
348 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
349 |
|
|
|
350 |
|
|
%2.2) ice salt budgets |
351 |
|
|
%--------------------- |
352 |
|
|
figureL; |
353 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ice,'g/m2','Global Mean Ocean Salt (only ice)'); |
354 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_salt_ice,'g/m2','Gulf Stream Box Ocean Salt (only ice)'); |
355 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_ice,'g/m2','Arctic Ocean Salt (only ice)'); |
356 |
gforget |
1.1 |
%add to tex file |
357 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
358 |
|
|
myCaption={myCaption{:},'salt budget (ice only) in g/m2.'}; |
359 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
360 |
|
|
|
361 |
|
|
end; |
362 |
|
|
|
363 |
|
|
|
364 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt'))); |
365 |
|
|
|
366 |
|
|
%3.3) ocean salt budgets |
367 |
|
|
%----------------------- |
368 |
|
|
figureL; |
369 |
gforget |
1.4 |
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ocn,'g/m2','Global Mean Ocean Salt (only ocean)'); |
370 |
|
|
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_salt_ocn,'g/m2','Gulf Stream Box Ocean Salt (only ocean)'); |
371 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_ocn,'g/m2','Arctic Ocean Salt (only ocean)'); |
372 |
gforget |
1.1 |
%add to tex file |
373 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
374 |
|
|
myCaption={myCaption{:},'salt budget (ocean only) in g/m2.'}; |
375 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
376 |
|
|
|
377 |
|
|
end; |
378 |
|
|
|
379 |
|
|
end; |