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

Annotation 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.18 - (hide annotations) (download)
Sat Feb 6 18:12:32 2016 UTC (9 years, 5 months ago) by gforget
Branch: MAIN
Changes since 1.17: +21 -6 lines
- revise handling of outputs in calc_budget_heat.m,
  calc_budget_mass.m, and calc_budget_salt.m

1 gforget 1.1
2     %select kBudget:
3     if ~isempty(setDiagsParams);
4     kBudget=setDiagsParams{1};
5     else;
6     kBudget=1;
7     end;
8    
9 gforget 1.9 doMoreBudgetOutput=0;
10 gforget 1.16 %doMoreBudgetOutput=1;
11 gforget 1.9
12 gforget 1.2 %override default file name:
13     %---------------------------
14     tmp1=setDiags;
15     if kBudget>1;
16     tmp1=sprintf('D%02i',kBudget);
17 gforget 1.1 end;
18 gforget 1.2 fileMat=['diags_set_' tmp1];
19 gforget 1.1
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 gforget 1.2
31 gforget 1.1 elseif userStep==2;%input files and variables
32 gforget 1.15 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 gforget 1.11 test3d=isempty(dir(tmp1));
36     %
37 gforget 1.16 listFlds={ 'ETAN','SIheff','SIhsnow','THETA ','SALT ','PHIBOT','geothFlux'};
38 gforget 1.1 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 gforget 1.11 if kBudget>1|test3d;
42 gforget 1.1 listFlds={listFlds{:},'ADVr_TH','DFrE_TH','DFrI_TH','ADVr_SLT','DFrE_SLT','DFrI_SLT','WVELMASS'};
43     end;
44 gforget 1.4 listFlds={listFlds{:},'SDIAG1','SDIAG2','SDIAG3'};
45 gforget 1.1 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 gforget 1.11 if test3d;
54     listFiles={listFiles{:},'rate_budg3d_snap_set1','budg3d_hflux_set1','budg3d_zflux_set1'};
55     elseif kBudget==1;
56 gforget 1.16 listFiles={listFiles{:},'rate_budg2d_snap_set2','budg2d_hflux_set2','geothermalFlux'};
57 gforget 1.1 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 gforget 1.16 tmp4=sprintf('geothermalFlux_%02i',kBudget);
62     listFiles={listFiles{:},tmp1,tmp2,tmp3,tmp4};
63 gforget 1.1 end;
64 gforget 1.15 listSubdirs={[dirMat 'BUDG/' ],[dirMat '../BUDG/' ],dirSnap};
65 gforget 1.2
66 gforget 1.1 elseif userStep==3;%computational part;
67 gforget 1.2
68     %preliminary tests
69     test1=isempty(dir([dirModel 'diags/BUDG/budg2d_snap_set1*']));
70 gforget 1.5 test2=isempty(dir([dirMat 'BUDG/rate_budg2d_snap_set1*']))&...
71     isempty(dir([dirMat '../BUDG/rate_budg2d_snap_set1*']));
72 gforget 1.2 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 gforget 1.1
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 gforget 1.11 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 gforget 1.16 if isempty(who('geothFlux')); geothFlux=0; end;
102 gforget 1.4
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 gforget 1.17 %=======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 gforget 1.1
124 gforget 1.17 %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 gforget 1.1 %=======MASS=========
138    
139 gforget 1.18 [budgMo,budgMi]=calc_budget_mass(kBudget);
140 gforget 1.17
141 gforget 1.18 contOCN=budgMo.contOCN;
142     hdivOCN=budgMo.hdivOCN;
143     zdivOCN=budgMo.zdivOCN;
144     contICE=budgMi.contICE;
145     hdivICE=budgMi.hdivICE;
146     zdivICE=budgMi.zdivICE;
147 gforget 1.1 contTOT=contOCN+contICE;
148 gforget 1.17 hdivTOT=hdivOCN+hdivICE;
149 gforget 1.1 zdivTOT=zdivOCN+zdivICE;
150    
151     %bottom pressure for comparison:
152     bp=myparms.rhoconst/9.81*PHIBOT;
153    
154     %compute global integrals:
155     %-------------------------
156     msk=mygrid.mskC(:,:,kBudget);
157     glo_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
158     glo_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
159     glo_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
160     glo_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
161    
162     %compute northern hemisphere integrals:
163     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
164     north_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
165     north_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
166     north_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
167     north_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
168    
169     %and southern hemisphere integrals:
170     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
171     south_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
172     south_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
173     south_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
174     south_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
175    
176     %=======HEAT=======
177 gforget 1.11
178 gforget 1.18 [budgHo,budgHi]=calc_budget_heat(kBudget);
179 gforget 1.17
180 gforget 1.18 contOCN=budgHo.contOCN;
181     hdivOCN=budgHo.hdivOCN;
182     zdivOCN=budgHo.zdivOCN;
183     contICE=budgHi.contICE;
184     hdivICE=budgHi.hdivICE;
185     zdivICE=budgHi.zdivICE;
186 gforget 1.11 contTOT=contOCN+contICE;
187 gforget 1.17 hdivTOT=hdivOCN+hdivICE;
188 gforget 1.1 zdivTOT=zdivOCN+zdivICE;
189    
190     %compute global integrals:
191     %-------------------------
192     msk=mygrid.mskC(:,:,kBudget);
193     glo_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
194     glo_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
195     glo_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
196    
197     %compute northern hemisphere integrals:
198     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
199     north_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
200     north_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
201     north_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
202    
203     %and southern hemisphere integrals:
204     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
205     south_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
206     south_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
207     south_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
208 gforget 1.11
209 gforget 1.1 %=======SALT=======
210 gforget 1.17
211 gforget 1.18 [budgSo,budgSi]=calc_budget_salt(kBudget);
212 gforget 1.17
213 gforget 1.18 contOCN=budgSo.contOCN;
214     hdivOCN=budgSo.hdivOCN;
215     zdivOCN=budgSo.zdivOCN;
216     contICE=budgSi.contICE;
217     hdivICE=budgSi.hdivICE;
218     zdivICE=budgSi.zdivICE;
219 gforget 1.11 contTOT=contOCN+contICE;
220 gforget 1.17 hdivTOT=hdivOCN+hdivICE;
221 gforget 1.1 zdivTOT=zdivOCN+zdivICE;
222 gforget 1.17
223 gforget 1.1 %compute global integrals:
224     %-------------------------
225     msk=mygrid.mskC(:,:,kBudget);
226     glo_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
227     glo_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
228     glo_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
229    
230     %compute northern hemisphere integrals:
231     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
232     north_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
233     north_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
234     north_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
235    
236     %and southern hemisphere integrals:
237     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
238     south_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
239     south_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
240     south_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
241 gforget 1.2
242 gforget 1.9 if doMoreBudgetOutput;
243     %list of budgets to output
244     listbudg={'budgMo','budgHo','budgSo'};
245     if kBudget==1; listbudg={listbudg{:},'budgMi','budgHi','budgSi'}; end;
246     %the actual output
247     for iibudg=1:length(listbudg);
248     %set directory name
249     dirbudg=dirMat;
250     if ~isempty(strfind(dirMat,['diags_set_' setDiags '/']))
251     dirbudg=fullfile(dirMat,'..',filesep);
252     end;
253     sufbudg='';
254     if kBudget>1; sufbudg=num2str(kBudget); end;
255     dirbudg=fullfile(dirbudg,['diags_set_' listbudg{iibudg} sufbudg],filesep);
256     %
257     if ~isdir(dirbudg); mkdir(dirbudg); end;
258     %set file name
259     filebudg=[listbudg{iibudg} '_' num2str(tt) '.mat'];
260     %output to file
261     eval(['tmpbudg=' listbudg{iibudg} ';']);
262     save([dirbudg filebudg],'-struct','tmpbudg');
263     end;
264     end;
265 gforget 1.13
266 gforget 1.2 %===================== COMPUTATIONAL SEQUENCE ENDS =========================%
267     %===================== PLOTTING SEQUENCE BEGINS =========================%
268    
269     elseif userStep==-1;%plotting
270    
271     if isempty(setDiagsParams);
272     choicePlot={'all'};
273     elseif isnumeric(setDiagsParams{1})&length(setDiagsParams)==1;
274     choicePlot={'all'};
275     elseif isnumeric(setDiagsParams{1});
276     choicePlot={setDiagsParams{2:end}};
277     else;
278     choicePlot=setDiagsParams;
279     end;
280    
281 gforget 1.3 tt=[1:length(alldiag.listTimes)];
282     TT=alldiag.listTimes(tt);
283     nt=length(TT);
284    
285 gforget 1.2 if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
286    
287     %1.1) ocean+seaice mass budgets
288     %------------------------------
289     figureL;
290     %global volume budget:
291 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_tot,'kg/m^2','Global Mean Mass (incl. ice)');
292 gforget 1.2 %add bp:
293     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
294     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
295     %northern hemisphere budget:
296 heimbach 1.6 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_tot,'kg/m^2','Northern Mean Mass (incl. ice)');
297 gforget 1.2 %add bp:
298     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
299     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
300     %southern hemisphere budget:
301 heimbach 1.6 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_tot,'kg/m^2','Southern Mean Mass (incl. ice)');
302 gforget 1.2 %add bp:
303     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
304     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
305     %add to tex file
306     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
307 heimbach 1.6 myCaption={myCaption{:},'mass budget (ocean+ice) in kg/m$^2$.'};
308 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
309    
310     %1.2) ice mass budgets
311     %---------------------
312     figureL;
313 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ice,'kg/m^2','Global Mean Mass (only ice)');
314 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
315     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
316 heimbach 1.6 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ice,'kg/m^2','Northern Mean Mass (only ice)');
317 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
318     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
319 heimbach 1.6 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ice,'kg/m^2','Southern Mean Mass (only ice)');
320 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
321     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
322     %add to tex file
323     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
324 heimbach 1.6 myCaption={myCaption{:},'mass budget (ice only) in kg/m$^2$.'};
325 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
326    
327     end;
328    
329     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
330    
331     %1.3) ocean mass budgets
332     %-----------------------
333     figureL;
334     %global volume budget:
335 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ocn,'kg/m^2','Global Mean Mass (only ocean)');
336 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
337     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
338 heimbach 1.6 subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ocn,'kg/m^2','Northern Mean Mass (only ocean)');
339 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
340     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
341 heimbach 1.6 subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ocn,'kg/m^2','Southern Mean Mass (only ocean)');
342 gforget 1.2 dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
343     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
344     %add to tex file
345     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
346 heimbach 1.6 myCaption={myCaption{:},'mass budget (ocean only) in kg/m$^2$.'};
347 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
348    
349     end;
350    
351     if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
352    
353     %2.1) ocean+seaice heat budgets
354     %------------------------------
355     figureL;
356 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_tot,'J/m^2','Global Mean Ocean Heat (incl. ice)');
357     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_tot,'J/m^2','Northern Mean Ocean Heat (incl. ice)');
358     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_tot,'J/m^2','Southern Mean Ocean Heat (incl. ice)');
359 gforget 1.2 %add to tex file
360     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
361 heimbach 1.6 myCaption={myCaption{:},'heat budget (ocean+ice) in J/m$^2$.'};
362 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
363    
364     %2.2) ice heat budgets
365     %---------------------
366     figureL;
367 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ice,'J/m^2','Global Mean Ocean Heat (only ice)');
368     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ice,'J/m^2','Northern Mean Ocean Heat (only ice)');
369     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ice,'J/m^2','Southern Mean Ocean Heat (only ice)');
370 gforget 1.2 %add to tex file
371     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
372 heimbach 1.6 myCaption={myCaption{:},'heat budget (ice only) in J/m$^2$.'};
373 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
374    
375     end;
376    
377     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
378    
379     %2.3) ocean heat budgets
380     %-----------------------
381     figureL;
382 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ocn,'J/m^2','Global Mean Ocean Heat (only ocean)');
383     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ocn,'J/m^2','Northern Mean Ocean Heat (only ocean)');
384     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ocn,'J/m^2','Southern Mean Ocean Heat (only ocean)');
385 gforget 1.2 %add to tex file
386     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
387 heimbach 1.6 myCaption={myCaption{:},'heat budget (ocean only) in J/m$^2$.'};
388 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
389    
390     end;
391    
392     if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
393    
394     %3.1) ocean+seaice salt budgets
395     %------------------------------
396     figureL;
397 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_tot,'g/m^2','Global Mean Ocean Salt (incl. ice)');
398     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_tot,'g/m^2','Northern Mean Ocean Salt (incl. ice)');
399     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_tot,'g/m^2','Southern Mean Ocean Salt (incl. ice)');
400 gforget 1.2 %add to tex file
401     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
402 heimbach 1.6 myCaption={myCaption{:},'salt budget (ocean+ice) in g/m$^2$.'};
403 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
404    
405     %2.2) ice salt budgets
406     %---------------------
407     figureL;
408 heimbach 1.6 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ice,'g/m^2','Global Mean Ocean Salt (only ice)');
409     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ice,'g/m^2','Northern Mean Ocean Salt (only ice)');
410     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ice,'g/m^2','Southern Mean Ocean Salt (only ice)');
411 gforget 1.2 %add to tex file
412     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
413 heimbach 1.6 myCaption={myCaption{:},'salt budget (ice only) in g/m$^2$.'};
414 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
415    
416     end;
417    
418    
419     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
420    
421     %3.3) ocean salt budgets
422     %-----------------------
423     figureL;
424 gforget 1.8 subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ocn,'g/m^2','Global Mean Ocean Salt (only ocean)');
425     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ocn,'g/m^2','Northern Mean Ocean Salt (only ocean)');
426     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ocn,'g/m^2','Southern Mean Ocean Salt (only ocean)');
427 gforget 1.2 %add to tex file
428     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
429 heimbach 1.6 myCaption={myCaption{:},'salt budget (ocean only) in g/m$^2$.'};
430 gforget 1.2 if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
431    
432     end;
433    
434 gforget 1.1 end;

  ViewVC Help
Powered by ViewVC 1.1.22