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