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.9 |
[budgMo,budgMi]=calc_budget_mass(kBudget); |
106 |
gforget |
1.7 |
|
107 |
gforget |
1.9 |
contOCN=budgMo.contOCN; |
108 |
|
|
hdivOCN=budgMo.hdivOCN; |
109 |
|
|
zdivOCN=budgMo.zdivOCN; |
110 |
|
|
contICE=budgMi.contICE; |
111 |
|
|
hdivICE=budgMi.hdivICE; |
112 |
|
|
zdivICE=budgMi.zdivICE; |
113 |
gforget |
1.1 |
contTOT=contOCN+contICE; |
114 |
gforget |
1.7 |
hdivTOT=hdivOCN+hdivICE; |
115 |
gforget |
1.1 |
zdivTOT=zdivOCN+zdivICE; |
116 |
gforget |
1.7 |
|
117 |
gforget |
1.1 |
%bottom pressure for comparison: |
118 |
|
|
bp=myparms.rhoconst/9.81*PHIBOT; |
119 |
|
|
|
120 |
|
|
%compute global integrals: |
121 |
|
|
%------------------------- |
122 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
123 |
|
|
glo_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
124 |
|
|
glo_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
125 |
|
|
glo_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
126 |
|
|
glo_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
127 |
gforget |
1.3 |
|
128 |
|
|
if sum([90 1170]~=mygrid.ioSize)==0; |
129 |
gforget |
1.1 |
%compute gsboxern hemisphere integrals: |
130 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
131 |
gforget |
1.1 |
gsbox_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
132 |
|
|
gsbox_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
133 |
|
|
gsbox_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
134 |
|
|
gsbox_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
135 |
|
|
|
136 |
|
|
%and arcticern hemisphere integrals: |
137 |
|
|
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
138 |
|
|
arctic_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
139 |
|
|
arctic_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
140 |
|
|
arctic_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
141 |
|
|
arctic_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC); |
142 |
gforget |
1.3 |
end; |
143 |
gforget |
1.1 |
|
144 |
|
|
%=======HEAT======= |
145 |
|
|
|
146 |
gforget |
1.9 |
[budgHo,budgHi]=calc_budget_heat(kBudget); |
147 |
gforget |
1.7 |
|
148 |
gforget |
1.9 |
contOCN=budgHo.contOCN; |
149 |
|
|
hdivOCN=budgHo.hdivOCN; |
150 |
|
|
zdivOCN=budgHo.zdivOCN; |
151 |
|
|
contICE=budgHi.contICE; |
152 |
|
|
hdivICE=budgHi.hdivICE; |
153 |
|
|
zdivICE=budgHi.zdivICE; |
154 |
gforget |
1.1 |
contTOT=contOCN+contICE; |
155 |
gforget |
1.7 |
hdivTOT=hdivOCN+hdivICE; |
156 |
gforget |
1.1 |
zdivTOT=zdivOCN+zdivICE; |
157 |
gforget |
1.7 |
|
158 |
gforget |
1.1 |
%compute global integrals: |
159 |
|
|
%------------------------- |
160 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
161 |
|
|
glo_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
162 |
|
|
glo_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
163 |
|
|
glo_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
164 |
|
|
|
165 |
gforget |
1.3 |
if sum([90 1170]~=mygrid.ioSize)==0; |
166 |
gforget |
1.1 |
%compute gsboxern hemisphere integrals: |
167 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
168 |
gforget |
1.1 |
gsbox_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
169 |
|
|
gsbox_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
170 |
|
|
gsbox_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
171 |
|
|
|
172 |
|
|
%and arcticern hemisphere integrals: |
173 |
|
|
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
174 |
|
|
arctic_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
175 |
|
|
arctic_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
176 |
|
|
arctic_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
177 |
gforget |
1.3 |
end; |
178 |
gforget |
1.1 |
|
179 |
|
|
%=======SALT======= |
180 |
|
|
|
181 |
gforget |
1.9 |
[budgSo,budgSi]=calc_budget_salt(kBudget); |
182 |
gforget |
1.7 |
|
183 |
gforget |
1.9 |
contOCN=budgSo.contOCN; |
184 |
|
|
hdivOCN=budgSo.hdivOCN; |
185 |
|
|
zdivOCN=budgSo.zdivOCN; |
186 |
|
|
contICE=budgSi.contICE; |
187 |
|
|
hdivICE=budgSi.hdivICE; |
188 |
|
|
zdivICE=budgSi.zdivICE; |
189 |
|
|
contTOT=contOCN+contICE; |
190 |
|
|
hdivTOT=hdivOCN+hdivICE; |
191 |
|
|
zdivTOT=zdivOCN+zdivICE; |
192 |
gforget |
1.1 |
contTOT=contOCN+contICE; |
193 |
gforget |
1.7 |
hdivTOT=hdivOCN+hdivICE; |
194 |
gforget |
1.1 |
zdivTOT=zdivOCN+zdivICE; |
195 |
|
|
|
196 |
|
|
%compute global integrals: |
197 |
|
|
%------------------------- |
198 |
|
|
msk=mygrid.mskC(:,:,kBudget); |
199 |
|
|
glo_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
200 |
|
|
glo_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
201 |
|
|
glo_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
202 |
gforget |
1.3 |
|
203 |
|
|
if sum([90 1170]~=mygrid.ioSize)==0; |
204 |
gforget |
1.1 |
%compute gsboxern hemisphere integrals: |
205 |
gforget |
1.5 |
msk=mygrid.mskC(:,:,kBudget).*v4_basin('atl').*(mygrid.YC>=26&mygrid.YC<=45); |
206 |
gforget |
1.1 |
gsbox_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
207 |
|
|
gsbox_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
208 |
|
|
gsbox_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
209 |
|
|
|
210 |
|
|
%and arcticern hemisphere integrals: |
211 |
|
|
msk=mygrid.mskC(:,:,kBudget).*v4_basin('arct'); |
212 |
|
|
arctic_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk); |
213 |
|
|
arctic_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk); |
214 |
|
|
arctic_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk); |
215 |
gforget |
1.3 |
end; |
216 |
gforget |
1.1 |
|
217 |
|
|
%===================== COMPUTATIONAL SEQUENCE ENDS =========================% |
218 |
|
|
%===================== PLOTTING SEQUENCE BEGINS =========================% |
219 |
|
|
|
220 |
gforget |
1.3 |
elseif userStep==-1&multiBasins==1;%plotting |
221 |
gforget |
1.1 |
|
222 |
|
|
if isempty(setDiagsParams); |
223 |
|
|
choicePlot={'all'}; |
224 |
|
|
elseif isnumeric(setDiagsParams{1})&length(setDiagsParams)==1; |
225 |
|
|
choicePlot={'all'}; |
226 |
|
|
elseif isnumeric(setDiagsParams{1}); |
227 |
|
|
choicePlot={setDiagsParams{2:end}}; |
228 |
|
|
else; |
229 |
|
|
choicePlot=setDiagsParams; |
230 |
|
|
end; |
231 |
|
|
|
232 |
|
|
tt=[1:length(alldiag.listTimes)]; |
233 |
|
|
TT=alldiag.listTimes(tt); |
234 |
|
|
nt=length(TT); |
235 |
|
|
|
236 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass'))); |
237 |
|
|
|
238 |
|
|
%1.1) ocean+seaice mass budgets |
239 |
|
|
%------------------------------ |
240 |
|
|
figureL; |
241 |
|
|
%global volume budget: |
242 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_tot,'kg/m2','Global Mean Mass (incl. ice)'); |
243 |
|
|
%add bp: |
244 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
245 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
246 |
|
|
%gsboxern hemisphere budget: |
247 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_tot,'kg/m2','Gulf Stream Box Mass (incl. ice)'); |
248 |
gforget |
1.1 |
%add bp: |
249 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
250 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
251 |
|
|
%arcticern hemisphere budget: |
252 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_tot,'kg/m2','Arctic Mass (incl. ice)'); |
253 |
gforget |
1.1 |
%add bp: |
254 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
255 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
256 |
|
|
%add to tex file |
257 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
258 |
|
|
myCaption={myCaption{:},'mass budget (ocean+ice) in kg/m2.'}; |
259 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
260 |
|
|
|
261 |
|
|
%1.2) ice mass budgets |
262 |
|
|
%--------------------- |
263 |
|
|
figureL; |
264 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ice,'kg/m2','Global Mean Mass (only ice)'); |
265 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
266 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
267 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_ice,'kg/m2','Gulf Stream Box Mass (only ice)'); |
268 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
269 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
270 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_ice,'kg/m2','Arctic Mass (only ice)'); |
271 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
272 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
273 |
|
|
%add to tex file |
274 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
275 |
|
|
myCaption={myCaption{:},'mass budget (ice only) in kg/m2.'}; |
276 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
277 |
|
|
|
278 |
|
|
end; |
279 |
|
|
|
280 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass'))); |
281 |
|
|
|
282 |
|
|
%1.3) ocean mass budgets |
283 |
|
|
%----------------------- |
284 |
|
|
figureL; |
285 |
|
|
%global volume budget: |
286 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ocn,'kg/m2','Global Mean Mass (only ocean)'); |
287 |
|
|
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp); |
288 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
289 |
gforget |
1.3 |
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_vol_ocn,'kg/m2','Gulf Stream Box Mass (only ocean)'); |
290 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.gsbox_bp); |
291 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
292 |
gforget |
1.3 |
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_vol_ocn,'kg/m2','Arctic Mass (only ocean)'); |
293 |
gforget |
1.1 |
dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.arctic_bp); |
294 |
|
|
plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal'); |
295 |
|
|
%add to tex file |
296 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
297 |
|
|
myCaption={myCaption{:},'mass budget (ocean only) in kg/m2.'}; |
298 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
299 |
|
|
|
300 |
|
|
end; |
301 |
|
|
|
302 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat'))); |
303 |
|
|
|
304 |
|
|
%2.1) ocean+seaice heat budgets |
305 |
|
|
%------------------------------ |
306 |
|
|
figureL; |
307 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_tot,'J/m2','Global Mean Ocean Heat (incl. ice)'); |
308 |
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)'); |
309 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_tot,'J/m2','Arctic Ocean Heat (incl. ice)'); |
310 |
gforget |
1.1 |
%add to tex file |
311 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
312 |
|
|
myCaption={myCaption{:},'heat budget (ocean+ice) in J/m2.'}; |
313 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
314 |
|
|
|
315 |
|
|
%2.2) ice heat budgets |
316 |
|
|
%--------------------- |
317 |
|
|
figureL; |
318 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ice,'J/m2','Global Mean Ocean Heat (only ice)'); |
319 |
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)'); |
320 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_ice,'J/m2','Arctic Ocean Heat (only ice)'); |
321 |
gforget |
1.1 |
%add to tex file |
322 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
323 |
|
|
myCaption={myCaption{:},'heat budget (ice only) in J/m2.'}; |
324 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
325 |
|
|
|
326 |
|
|
end; |
327 |
|
|
|
328 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat'))); |
329 |
|
|
|
330 |
|
|
%2.3) ocean heat budgets |
331 |
|
|
%----------------------- |
332 |
|
|
figureL; |
333 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ocn,'J/m2','Global Mean Ocean Heat (only ocean)'); |
334 |
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)'); |
335 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_heat_ocn,'J/m2','Arctic Ocean Heat (only ocean)'); |
336 |
gforget |
1.1 |
%add to tex file |
337 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
338 |
|
|
myCaption={myCaption{:},'heat budget (ocean only) in J/m2.'}; |
339 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
340 |
|
|
|
341 |
|
|
end; |
342 |
|
|
|
343 |
|
|
if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt'))); |
344 |
|
|
|
345 |
|
|
%3.1) ocean+seaice salt budgets |
346 |
|
|
%------------------------------ |
347 |
|
|
figureL; |
348 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_tot,'g/m2','Global Mean Ocean Salt (incl. ice)'); |
349 |
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)'); |
350 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_tot,'g/m2','Arctic Ocean Salt (incl. ice)'); |
351 |
gforget |
1.1 |
%add to tex file |
352 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
353 |
|
|
myCaption={myCaption{:},'salt budget (ocean+ice) in g/m2.'}; |
354 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
355 |
|
|
|
356 |
|
|
%2.2) ice salt budgets |
357 |
|
|
%--------------------- |
358 |
|
|
figureL; |
359 |
|
|
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ice,'g/m2','Global Mean Ocean Salt (only ice)'); |
360 |
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)'); |
361 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_ice,'g/m2','Arctic Ocean Salt (only ice)'); |
362 |
gforget |
1.1 |
%add to tex file |
363 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
364 |
|
|
myCaption={myCaption{:},'salt budget (ice only) in g/m2.'}; |
365 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
366 |
|
|
|
367 |
|
|
end; |
368 |
|
|
|
369 |
|
|
|
370 |
|
|
if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt'))); |
371 |
|
|
|
372 |
|
|
%3.3) ocean salt budgets |
373 |
|
|
%----------------------- |
374 |
|
|
figureL; |
375 |
gforget |
1.4 |
subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ocn,'g/m2','Global Mean Ocean Salt (only ocean)'); |
376 |
|
|
subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.gsbox_salt_ocn,'g/m2','Gulf Stream Box Ocean Salt (only ocean)'); |
377 |
|
|
subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.arctic_salt_ocn,'g/m2','Arctic Ocean Salt (only ocean)'); |
378 |
gforget |
1.1 |
%add to tex file |
379 |
|
|
myCaption={myYmeanTxt,' global (upper) gsbox (mid) and arctic (lower), '}; |
380 |
|
|
myCaption={myCaption{:},'salt budget (ocean only) in g/m2.'}; |
381 |
|
|
if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end; |
382 |
|
|
|
383 |
|
|
end; |
384 |
|
|
|
385 |
|
|
end; |