/[MITgcm]/MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_set_D.m
ViewVC logotype

Contents of /MITgcm_contrib/gael/matlab_class/gcmfaces_diags/diags_set_D.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph


Revision 1.24 - (show annotations) (download)
Fri Feb 12 22:26:04 2016 UTC (9 years, 5 months ago) by gforget
Branch: MAIN
CVS Tags: checkpoint65x, checkpoint65v, checkpoint65w, checkpoint65u, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, HEAD
Changes since 1.23: +1 -2 lines
- diags_inifin_D.m: treat 3D case; add test3d switch to function input list.
- diags_pre_process.m: only test for nctiles or nctiles_climatology rather than for nctiles*
- diags_set_D.m: get tend from burg.fluxes; pass test3d to diags_inifin_D.m.

1
2 %select kBudget:
3 if ~isempty(setDiagsParams);
4 kBudget=setDiagsParams{1};
5 else;
6 kBudget=1;
7 end;
8
9 doMoreBudgetOutput=0;
10 %doMoreBudgetOutput=1;
11
12 %override default file name:
13 %---------------------------
14 tmp1=setDiags;
15 if kBudget>1;
16 tmp1=sprintf('D%02i',kBudget);
17 end;
18 fileMat=['diags_set_' tmp1];
19
20 if userStep==1;%diags to be computed
21 listDiags=['glo_vol_ocn glo_vol_tot glo_vol_ice glo_bp'];
22 listDiags=[listDiags ' north_vol_ocn north_vol_tot north_vol_ice north_bp'];
23 listDiags=[listDiags ' south_vol_ocn south_vol_tot south_vol_ice south_bp'];
24 listDiags=[listDiags ' glo_heat_ocn glo_heat_tot glo_heat_ice'];
25 listDiags=[listDiags ' north_heat_ocn north_heat_tot north_heat_ice'];
26 listDiags=[listDiags ' south_heat_ocn south_heat_tot south_heat_ice'];
27 listDiags=[listDiags ' glo_salt_ocn glo_salt_tot glo_salt_ice'];
28 listDiags=[listDiags ' north_salt_ocn north_salt_tot north_salt_ice'];
29 listDiags=[listDiags ' south_salt_ocn south_salt_tot south_salt_ice'];
30
31 elseif userStep==2;%input files and variables
32 dirSnap=fullfile(dirModel,'diags',filesep,'BUDG',filesep);
33 if ~isdir(dirSnap); dirSnap=fullfile(dirModel,'diags',filesep); end;
34 tmp1=fullfile(dirSnap,'budg2d_snap_set2*meta');
35 test3d=isempty(dir(tmp1));
36 %
37 listFlds={ 'ETAN','SIheff','SIhsnow','THETA ','SALT ','PHIBOT','geothFlux'};
38 listFlds={listFlds{:},'SIatmFW ','oceFWflx','SItflux','TFLUX','SFLUX','oceSPflx','SRELAX'};
39 listFlds={listFlds{:},'oceQnet ','SIatmQnt','SIaaflux','SIsnPrcp','SIacSubl'};
40 listFlds={listFlds{:},'TRELAX','WTHMASS','WSLTMASS','oceSflux','oceQsw','oceSPtnd'};
41 if kBudget>1|test3d;
42 listFlds={listFlds{:},'ADVr_TH','DFrE_TH','DFrI_TH','ADVr_SLT','DFrE_SLT','DFrI_SLT','WVELMASS'};
43 end;
44 listFlds={listFlds{:},'SDIAG1','SDIAG2','SDIAG3'};
45 listFlds={listFlds{:},'UVELMASS','VVELMASS','AB_gT','AB_gS'};
46 listFlds={listFlds{:},'ADVx_TH ','ADVy_TH ','DFxE_TH ','DFyE_TH '};
47 listFlds={listFlds{:},'ADVx_SLT','ADVy_SLT','DFxE_SLT','DFyE_SLT'};
48 listFlds={listFlds{:},'ADVxHEFF','ADVyHEFF','DFxEHEFF','DFyEHEFF'};
49 listFlds={listFlds{:},'ADVxSNOW','ADVySNOW','DFxESNOW','DFyESNOW'};
50 listFldsNames=deblank(listFlds);
51 %
52 listFiles={'rate_budg2d_snap_set1','budg2d_hflux_set1','budg2d_zflux_set1','budg2d_zflux_set2'};
53 if test3d;
54 listFiles={listFiles{:},'rate_budg3d_snap_set1','budg3d_hflux_set1','budg3d_zflux_set1'};
55 elseif kBudget==1;
56 listFiles={listFiles{:},'rate_budg2d_snap_set2','budg2d_hflux_set2','geothermalFlux'};
57 else;
58 tmp1=sprintf('rate_budg2d_snap_set3_%02i',kBudget);
59 tmp2=sprintf('budg2d_zflux_set3_%02i',kBudget);
60 tmp3=sprintf('budg2d_hflux_set3_%02i',kBudget);
61 tmp4=sprintf('geothermalFlux_%02i',kBudget);
62 listFiles={listFiles{:},tmp1,tmp2,tmp3,tmp4};
63 end;
64 listSubdirs={[dirMat 'BUDG/' ],[dirMat '../BUDG/' ],dirSnap};
65
66 elseif userStep==3;%computational part;
67
68 %preliminary tests
69 test1=isempty(dir([dirModel 'diags/BUDG/budg2d_snap_set1*']));
70 test2=isempty(dir([dirMat 'BUDG/rate_budg2d_snap_set1*']))&...
71 isempty(dir([dirMat '../BUDG/rate_budg2d_snap_set1*']));
72 if (strcmp(setDiags,'D')&test1&test2);
73 fprintf('\n abort : global and regional budgets, due to missing \n');
74 fprintf(['\n ' dirModel 'diags/BUDG/budg2d_snap_set1* \n']);
75 return;
76 end;
77
78 if (strcmp(setDiags,'D')&test2);
79 fprintf('\n abort : global and regional budgets, due to missing \n');
80 fprintf(['\n ' dirModel 'diags/BUDG/rate_budg2d_snap_set1* \n']);
81 return;
82 end;
83
84 %override default file name:
85 %---------------------------
86 tmp1=setDiags;
87 if kBudget>1;
88 tmp1=sprintf('D%02i',kBudget);
89 end;
90 fileMat=['diags_set_' tmp1 '_' num2str(tt) '.mat'];
91
92 %fill in optional fields:
93 %------------------------
94 if isempty(who('TRELAX')); TRELAX=0; end;
95 if isempty(who('SRELAX')); SRELAX=0; end;
96 if isempty(who('AB_gT')); AB_gT=0; end;
97 if isempty(who('AB_gS')); AB_gS=0; end;
98 if isempty(who('oceSPtnd')); oceSPtnd=0; end;
99 if isempty(who('oceSPflx')); oceSPflx=0; end;
100 if isempty(who('PHIBOT')); PHIBOT=0; end;
101 if isempty(who('geothFlux')); geothFlux=0; end;
102
103 %aliases from development phase (applies to 2012 core runs)
104 %---------------------------------------------------------
105 if ~isempty(who('SDIAG1')); SRELAX=SDIAG1; end;
106 if ~isempty(who('SDIAG2')); SIatmFW=SDIAG2; end;
107 if ~isempty(who('SDIAG3')); SItflux=SDIAG3; end;
108
109 %=======indexing and sign convention======
110
111 %- MITgcm: fluxes are >0 downward, k=1 start at free surface
112 %- here, similarly: >0 downward, k=1 free surface k=2 sea floor
113 if ~test3d;
114 budgO.specs.top='free surface';
115 if kBudget>1; budgO.specs.top=['interface no. ' num2str(kBudget)]; end;
116 budgO.specs.bottom='sea floor';
117 else;
118 budgO.specs.top='interface k';
119 budgO.specs.bottom='interface k+1';
120 end;
121 budgI.specs.top='ocn-ice to atm interface';
122 budgI.specs.bottom='free surface';
123
124 %here we output tendencies and fluxes in kg/s
125 budgMo=budgO; budgMi=budgI;
126 budgMo.specs.units='kg/s';%ocean only
127 budgMi.specs.units='kg/s';%ice only
128 %here we output tendencies and fluxes in Watts
129 budgHo=budgO; budgHi=budgI;
130 budgHo.specs.units='W';%ocean only
131 budgHi.specs.units='W';%ice only
132 %here we output tendencies and fluxes in g/s
133 budgSo=budgO; budgSi=budgI;
134 budgSo.specs.units='g/s';%ocean only
135 budgSi.specs.units='g/s';%ice only
136
137 %=======MASS=========
138
139 [budgMo,budgMi,budgMoi]=calc_budget_mass(kBudget);
140
141 %bottom pressure for comparison:
142 bp=myparms.rhoconst/9.81*PHIBOT;
143
144 %compute global integrals:
145 %-------------------------
146 msk=mygrid.mskC(:,:,kBudget);
147 tmp1=calc_mskmean_T(budgMoi,msk,'extensive');
148 glo_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
149 tmp1=calc_mskmean_T(budgMo,msk,'extensive');
150 glo_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
151 tmp1=calc_mskmean_T(budgMi,msk,'extensive');
152 glo_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
153
154 glo_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
155
156 %compute northern hemisphere integrals:
157 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
158 tmp1=calc_mskmean_T(budgMoi,msk,'extensive');
159 north_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
160 tmp1=calc_mskmean_T(budgMo,msk,'extensive');
161 north_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
162 tmp1=calc_mskmean_T(budgMi,msk,'extensive');
163 north_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
164
165 north_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
166
167 %and southern hemisphere integrals:
168 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
169 tmp1=calc_mskmean_T(budgMoi,msk,'extensive');
170 south_vol_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
171 tmp1=calc_mskmean_T(budgMo,msk,'extensive');
172 south_vol_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
173 tmp1=calc_mskmean_T(budgMi,msk,'extensive');
174 south_vol_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
175
176 south_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
177
178 %=======HEAT=======
179
180 [budgHo,budgHi,budgHoi]=calc_budget_heat(kBudget);
181
182 %compute global integrals:
183 %-------------------------
184 msk=mygrid.mskC(:,:,kBudget);
185 tmp1=calc_mskmean_T(budgHoi,msk,'extensive');
186 glo_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
187 tmp1=calc_mskmean_T(budgHo,msk,'extensive');
188 glo_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
189 tmp1=calc_mskmean_T(budgHi,msk,'extensive');
190 glo_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
191
192 %compute northern hemisphere integrals:
193 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
194 tmp1=calc_mskmean_T(budgHoi,msk,'extensive');
195 north_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
196 tmp1=calc_mskmean_T(budgHo,msk,'extensive');
197 north_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
198 tmp1=calc_mskmean_T(budgHi,msk,'extensive');
199 north_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
200
201 %and southern hemisphere integrals:
202 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
203 tmp1=calc_mskmean_T(budgHoi,msk,'extensive');
204 south_heat_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
205 tmp1=calc_mskmean_T(budgHo,msk,'extensive');
206 south_heat_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
207 tmp1=calc_mskmean_T(budgHi,msk,'extensive');
208 south_heat_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
209
210 %=======SALT=======
211
212 [budgSo,budgSi,budgSoi]=calc_budget_salt(kBudget);
213
214 %compute global integrals:
215 %-------------------------
216 msk=mygrid.mskC(:,:,kBudget);
217 tmp1=calc_mskmean_T(budgSoi,msk,'extensive');
218 glo_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
219 tmp1=calc_mskmean_T(budgSo,msk,'extensive');
220 glo_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
221 tmp1=calc_mskmean_T(budgSi,msk,'extensive');
222 glo_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
223
224 %compute northern hemisphere integrals:
225 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
226 tmp1=calc_mskmean_T(budgSoi,msk,'extensive');
227 north_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
228 tmp1=calc_mskmean_T(budgSo,msk,'extensive');
229 north_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
230 tmp1=calc_mskmean_T(budgSi,msk,'extensive');
231 north_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
232
233 %and southern hemisphere integrals:
234 msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
235 tmp1=calc_mskmean_T(budgSoi,msk,'extensive');
236 south_salt_tot=[tmp1.tend;tmp1.hconv;tmp1.zconv];
237 tmp1=calc_mskmean_T(budgSo,msk,'extensive');
238 south_salt_ocn=[tmp1.tend;tmp1.hconv;tmp1.zconv];
239 tmp1=calc_mskmean_T(budgSi,msk,'extensive');
240 south_salt_ice=[tmp1.tend;tmp1.hconv;tmp1.zconv];
241
242 if doMoreBudgetOutput;
243 %initial and final state:
244 if ii==1; diags_inifin_D(kBudget,test3d,dirSnap,dirMat); end;
245 %list of budgets to output
246 listbudg={'budgMo','budgHo','budgSo'};
247 if kBudget==1; listbudg={listbudg{:},'budgMi','budgHi','budgSi'}; end;
248 %the actual output
249 for iibudg=1:length(listbudg);
250 %set directory name
251 dirbudg=dirMat;
252 if ~isempty(strfind(dirMat,['diags_set_' setDiags '/']))
253 dirbudg=fullfile(dirMat,'..',filesep);
254 end;
255 sufbudg='';
256 if kBudget>1; sufbudg=num2str(kBudget); end;
257 dirbudg=fullfile(dirbudg,['diags_set_' listbudg{iibudg} sufbudg],filesep);
258 %
259 if ~isdir(dirbudg); mkdir(dirbudg); end;
260 %set file name
261 filebudg=[listbudg{iibudg} '_' num2str(tt) '.mat'];
262 %output to file
263 eval(['tmpbudg=' listbudg{iibudg} '.fluxes;']);
264 listterms=fieldnames(tmpbudg);
265 for iiterm=1:length(listterms);
266 tmp1=getfield(tmpbudg,listterms{iiterm});
267 tmp1=convert2gcmfaces(tmp1);
268 %tmp2=prod(size(tmp1));
269 fid=fopen([dirbudg listterms{iiterm} '.bin'],'a+','b');
270 %status=fseek(fid,(tt-1)*recl2D,'bof');
271 fwrite(fid,tmp1,'float64');
272 fclose(fid);
273 end;
274 end;
275 end;
276
277 %===================== COMPUTATIONAL SEQUENCE ENDS =========================%
278 %===================== PLOTTING SEQUENCE BEGINS =========================%
279
280 elseif userStep==-1;%plotting
281
282 if isempty(setDiagsParams);
283 choicePlot={'all'};
284 elseif isnumeric(setDiagsParams{1})&length(setDiagsParams)==1;
285 choicePlot={'all'};
286 elseif isnumeric(setDiagsParams{1});
287 choicePlot={setDiagsParams{2:end}};
288 else;
289 choicePlot=setDiagsParams;
290 end;
291
292 tt=[1:length(alldiag.listTimes)];
293 TT=alldiag.listTimes(tt);
294 nt=length(TT);
295
296 if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
297
298 %1.1) ocean+seaice mass budgets
299 %------------------------------
300 figureL;
301 %global volume budget:
302 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_tot,'kg/m^2','Global Mean Mass (incl. ice)');
303 %add bp:
304 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
305 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
306 %northern hemisphere budget:
307 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_tot,'kg/m^2','Northern Mean Mass (incl. ice)');
308 %add bp:
309 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
310 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
311 %southern hemisphere budget:
312 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_tot,'kg/m^2','Southern Mean Mass (incl. ice)');
313 %add bp:
314 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
315 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
316 %add to tex file
317 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
318 myCaption={myCaption{:},'mass budget (ocean+ice) in kg/m$^2$.'};
319 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
320
321 %1.2) ice mass budgets
322 %---------------------
323 figureL;
324 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ice,'kg/m^2','Global Mean Mass (only ice)');
325 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
326 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
327 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ice,'kg/m^2','Northern Mean Mass (only ice)');
328 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
329 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
330 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ice,'kg/m^2','Southern Mean Mass (only ice)');
331 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
332 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
333 %add to tex file
334 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
335 myCaption={myCaption{:},'mass budget (ice only) in kg/m$^2$.'};
336 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
337
338 end;
339
340 if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
341
342 %1.3) ocean mass budgets
343 %-----------------------
344 figureL;
345 %global volume budget:
346 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ocn,'kg/m^2','Global Mean Mass (only ocean)');
347 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
348 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
349 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ocn,'kg/m^2','Northern Mean Mass (only ocean)');
350 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
351 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
352 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ocn,'kg/m^2','Southern Mean Mass (only ocean)');
353 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
354 plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
355 %add to tex file
356 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
357 myCaption={myCaption{:},'mass budget (ocean only) in kg/m$^2$.'};
358 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
359
360 end;
361
362 if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
363
364 %2.1) ocean+seaice heat budgets
365 %------------------------------
366 figureL;
367 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_tot,'J/m^2','Global Mean Ocean Heat (incl. ice)');
368 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_tot,'J/m^2','Northern Mean Ocean Heat (incl. ice)');
369 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_tot,'J/m^2','Southern Mean Ocean Heat (incl. ice)');
370 %add to tex file
371 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
372 myCaption={myCaption{:},'heat budget (ocean+ice) in J/m$^2$.'};
373 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
374
375 %2.2) ice heat budgets
376 %---------------------
377 figureL;
378 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ice,'J/m^2','Global Mean Ocean Heat (only ice)');
379 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ice,'J/m^2','Northern Mean Ocean Heat (only ice)');
380 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ice,'J/m^2','Southern Mean Ocean Heat (only ice)');
381 %add to tex file
382 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
383 myCaption={myCaption{:},'heat budget (ice only) in J/m$^2$.'};
384 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
385
386 end;
387
388 if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
389
390 %2.3) ocean heat budgets
391 %-----------------------
392 figureL;
393 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ocn,'J/m^2','Global Mean Ocean Heat (only ocean)');
394 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ocn,'J/m^2','Northern Mean Ocean Heat (only ocean)');
395 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ocn,'J/m^2','Southern Mean Ocean Heat (only ocean)');
396 %add to tex file
397 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
398 myCaption={myCaption{:},'heat budget (ocean only) in J/m$^2$.'};
399 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
400
401 end;
402
403 if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
404
405 %3.1) ocean+seaice salt budgets
406 %------------------------------
407 figureL;
408 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_tot,'g/m^2','Global Mean Ocean Salt (incl. ice)');
409 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_tot,'g/m^2','Northern Mean Ocean Salt (incl. ice)');
410 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_tot,'g/m^2','Southern Mean Ocean Salt (incl. ice)');
411 %add to tex file
412 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
413 myCaption={myCaption{:},'salt budget (ocean+ice) in g/m$^2$.'};
414 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
415
416 %2.2) ice salt budgets
417 %---------------------
418 figureL;
419 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ice,'g/m^2','Global Mean Ocean Salt (only ice)');
420 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ice,'g/m^2','Northern Mean Ocean Salt (only ice)');
421 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ice,'g/m^2','Southern Mean Ocean Salt (only ice)');
422 %add to tex file
423 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
424 myCaption={myCaption{:},'salt budget (ice only) in g/m$^2$.'};
425 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
426
427 end;
428
429
430 if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
431
432 %3.3) ocean salt budgets
433 %-----------------------
434 figureL;
435 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ocn,'g/m^2','Global Mean Ocean Salt (only ocean)');
436 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ocn,'g/m^2','Northern Mean Ocean Salt (only ocean)');
437 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ocn,'g/m^2','Southern Mean Ocean Salt (only ocean)');
438 %add to tex file
439 myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
440 myCaption={myCaption{:},'salt budget (ocean only) in g/m$^2$.'};
441 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
442
443 end;
444
445 end;

  ViewVC Help
Powered by ViewVC 1.1.22