/[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.3 - (hide annotations) (download)
Sun Dec 30 14:45:17 2012 UTC (12 years, 6 months ago) by gforget
Branch: MAIN
Changes since 1.2: +4 -0 lines
- diags_set_D.m : specific time axis for budget, also in display.
- diags_driver.m : removed dirModel parameter to insitu_diags.
- diags_driver_tex.m : removed dirModel parameter to insitu_diags.
- diags_driver_tex.m : added nameTex parameter in insitu_diags and cost*.

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.2 %override default file name:
10     %---------------------------
11     tmp1=setDiags;
12     if kBudget>1;
13     tmp1=sprintf('D%02i',kBudget);
14 gforget 1.1 end;
15 gforget 1.2 fileMat=['diags_set_' tmp1];
16 gforget 1.1
17     if userStep==1;%diags to be computed
18     listDiags=['glo_vol_ocn glo_vol_tot glo_vol_ice glo_bp'];
19     listDiags=[listDiags ' north_vol_ocn north_vol_tot north_vol_ice north_bp'];
20     listDiags=[listDiags ' south_vol_ocn south_vol_tot south_vol_ice south_bp'];
21     listDiags=[listDiags ' glo_heat_ocn glo_heat_tot glo_heat_ice'];
22     listDiags=[listDiags ' north_heat_ocn north_heat_tot north_heat_ice'];
23     listDiags=[listDiags ' south_heat_ocn south_heat_tot south_heat_ice'];
24     listDiags=[listDiags ' glo_salt_ocn glo_salt_tot glo_salt_ice'];
25     listDiags=[listDiags ' north_salt_ocn north_salt_tot north_salt_ice'];
26     listDiags=[listDiags ' south_salt_ocn south_salt_tot south_salt_ice'];
27 gforget 1.2
28 gforget 1.1 elseif userStep==2;%input files and variables
29     listFlds={ 'ETAN','SIheff','SIhsnow','THETA ','SALT ','PHIBOT'};
30     listFlds={listFlds{:},'SIatmFW ','oceFWflx','SItflux','TFLUX','SFLUX','oceSPflx','SRELAX'};
31     listFlds={listFlds{:},'oceQnet ','SIatmQnt','SIaaflux','SIsnPrcp','SIacSubl'};
32     listFlds={listFlds{:},'TRELAX','WTHMASS','WSLTMASS','oceSflux','oceQsw','oceSPtnd'};
33     if kBudget>1;
34     listFlds={listFlds{:},'ADVr_TH','DFrE_TH','DFrI_TH','ADVr_SLT','DFrE_SLT','DFrI_SLT','WVELMASS'};
35     end;
36     listFlds={listFlds{:},'UVELMASS','VVELMASS','AB_gT','AB_gS'};
37     listFlds={listFlds{:},'ADVx_TH ','ADVy_TH ','DFxE_TH ','DFyE_TH '};
38     listFlds={listFlds{:},'ADVx_SLT','ADVy_SLT','DFxE_SLT','DFyE_SLT'};
39     listFlds={listFlds{:},'ADVxHEFF','ADVyHEFF','DFxEHEFF','DFyEHEFF'};
40     listFlds={listFlds{:},'ADVxSNOW','ADVySNOW','DFxESNOW','DFyESNOW'};
41     listFldsNames=deblank(listFlds);
42     %
43     listFiles={'rate_budg2d_snap_set1','budg2d_hflux_set1','budg2d_zflux_set1','budg2d_zflux_set2'};
44     if kBudget==1;
45     listFiles={listFiles{:},'rate_budg2d_snap_set2','budg2d_hflux_set2'};
46     else;
47     tmp1=sprintf('rate_budg2d_snap_set3_%02i',kBudget);
48     tmp2=sprintf('budg2d_zflux_set3_%02i',kBudget);
49     tmp3=sprintf('budg2d_hflux_set3_%02i',kBudget);
50     listFiles={listFiles{:},tmp1,tmp2,tmp3};
51     end;
52     listSubdirs={[dirMat 'BUDG/' ],[dirModel 'diags/BUDG/']};
53 gforget 1.2
54 gforget 1.1 elseif userStep==3;%computational part;
55 gforget 1.2
56     %preliminary tests
57     test1=isempty(dir([dirModel 'diags/BUDG/budg2d_snap_set1*']));
58     test2=isempty(dir([dirMat 'BUDG/rate_budg2d_snap_set1*']));
59    
60     if (strcmp(setDiags,'D')&test1&test2);
61     fprintf('\n abort : global and regional budgets, due to missing \n');
62     fprintf(['\n ' dirModel 'diags/BUDG/budg2d_snap_set1* \n']);
63     return;
64     end;
65    
66     if (strcmp(setDiags,'D')&test2);
67     fprintf('\n abort : global and regional budgets, due to missing \n');
68     fprintf(['\n ' dirModel 'diags/BUDG/rate_budg2d_snap_set1* \n']);
69     return;
70     end;
71 gforget 1.1
72     %override default file name:
73     %---------------------------
74     tmp1=setDiags;
75     if kBudget>1;
76     tmp1=sprintf('D%02i',kBudget);
77     end;
78     fileMat=['diags_set_' tmp1 '_' num2str(tt) '.mat'];
79    
80     %fill in optional fields:
81     %------------------------
82     if isempty(who('TRELAX')); TRELAX=0*mygrid.XC; end;
83     if isempty(who('SRELAX')); SRELAX=0*mygrid.XC; end;
84     if isempty(who('AB_gT')); AB_gT=0*mygrid.XC; end;
85     if isempty(who('AB_gS')); AB_gS=0*mygrid.XC; end;
86     if isempty(who('oceSPtnd')); oceSPtnd=0*mygrid.XC; end;
87     if isempty(who('oceSPflx')); oceSPflx=0*mygrid.XC; end;
88     if isempty(who('PHIBOT')); PHIBOT=0*mygrid.XC; end;
89    
90     %=======MASS=========
91    
92     %compute mapped budget:
93     %----------------------
94    
95     %mass = myparms.rhoconst * sea level
96     contOCN=ETAN*myparms.rhoconst;
97     contICE=(SIheff*myparms.rhoi+SIhsnow*myparms.rhosn);
98     %for deep ocean layer :
99     if kBudget>1&myparms.useNLFS<2;
100     contOCN=0;
101     elseif kBudget>1;%rstar case
102     tmp1=mk3D(mygrid.DRF,mygrid.hFacC).*mygrid.hFacC;
103     tmp2=sum(tmp1(:,:,kBudget:length(mygrid.RC)),3)./mygrid.Depth;
104     contOCN=tmp2.*ETAN*myparms.rhoconst;
105     end;
106     %
107     contTOT=contOCN+contICE;
108     %vertical divergence (air-sea fluxes or vertical advection)
109     zdivOCN=oceFWflx;
110     zdivICE=SIatmFW-oceFWflx;
111     %in virtual salt flux we omit :
112     if ~myparms.useRFWF; zdivOCN=0*zdivOCN; end;
113     %for deep ocean layer :
114     if kBudget>1; zdivOCN=-WVELMASS*myparms.rhoconst; end;
115     %
116     zdivTOT=zdivOCN+zdivICE;
117     %horizontal divergence (advection and ice diffusion)
118     hdivOCN=myparms.rhoconst*calc_UV_div(UVELMASS,VVELMASS,{'dh'}); %for 2D, already vertically integrated, fields
119     tmpU=(myparms.rhoi*DFxEHEFF+myparms.rhosn*DFxESNOW+myparms.rhoi*ADVxHEFF+myparms.rhosn*ADVxSNOW);
120     tmpV=(myparms.rhoi*DFyEHEFF+myparms.rhosn*DFyESNOW+myparms.rhoi*ADVyHEFF+myparms.rhosn*ADVySNOW);
121     hdivICE=calc_UV_div(tmpU,tmpV); %no dh needed here
122     hdivTOT=hdivOCN+hdivICE;
123    
124     %bottom pressure for comparison:
125     bp=myparms.rhoconst/9.81*PHIBOT;
126    
127     %compute global integrals:
128     %-------------------------
129     msk=mygrid.mskC(:,:,kBudget);
130     glo_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
131     glo_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
132     glo_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
133     glo_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
134    
135     %compute northern hemisphere integrals:
136     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
137     north_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
138     north_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
139     north_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
140     north_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
141    
142     %and southern hemisphere integrals:
143     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
144     south_vol_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
145     south_vol_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
146     south_vol_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
147     south_bp=nansum(bp.*msk.*mygrid.RAC)/nansum(msk.*mygrid.RAC);
148    
149     %=======HEAT=======
150    
151     contOCN=myparms.rcp*THETA-myparms.rcp*AB_gT;
152     contICE=-myparms.flami*(SIheff*myparms.rhoi+SIhsnow*myparms.rhosn);
153     contTOT=contOCN+contICE;
154     %vertical divergence (air-sea fluxes or vertical adv/dif)
155     zdivOCN=TFLUX;
156     zdivICE=-(SItflux+TFLUX-TRELAX);
157     %in linear surface we omit :
158     if ~myparms.useNLFS; zdivOCN=zdivOCN-myparms.rcp*WTHMASS; end;
159     %in virtual salt flux we omit :
160     if ~myparms.useRFWF|~myparms.useNLFS; zdivICE=zdivICE+SIaaflux; end;
161     %working approach for real fresh water (?) and virtual salt flux
162     if 0; zdivICE=-oceQnet-SIatmQnt-myparms.flami*(SIsnPrcp-SIacSubl); end;
163     %for deep ocean layer :
164     if kBudget>1;
165     zdivOCN=-(ADVr_TH+DFrE_TH+DFrI_TH)./mygrid.RAC*myparms.rcp;
166     dd=mygrid.RF(kBudget); msk=mygrid.mskC(:,:,kBudget);
167     swfrac=0.62*exp(dd/0.6)+(1-0.62)*exp(dd/20);
168     if dd<-200; swfrac=0; end;
169     zdivOCN=zdivOCN+swfrac*oceQsw;%.*msk;
170     end;
171     %
172     zdivTOT=zdivOCN+zdivICE;
173     %horizontal divergence (advection and diffusion)
174     tmpU=myparms.rcp*(ADVx_TH+DFxE_TH); tmpV=myparms.rcp*(ADVy_TH+DFyE_TH);
175     hdivOCN=calc_UV_div(tmpU,tmpV);
176     tmpU=-myparms.flami*(myparms.rhoi*DFxEHEFF+myparms.rhosn*DFxESNOW+myparms.rhoi*ADVxHEFF+myparms.rhosn*ADVxSNOW);
177     tmpV=-myparms.flami*(myparms.rhoi*DFyEHEFF+myparms.rhosn*DFyESNOW+myparms.rhoi*ADVyHEFF+myparms.rhosn*ADVySNOW);
178     hdivICE=calc_UV_div(tmpU,tmpV); %no dh needed here
179     hdivTOT=hdivOCN+hdivICE;
180    
181     %compute global integrals:
182     %-------------------------
183     msk=mygrid.mskC(:,:,kBudget);
184     glo_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
185     glo_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
186     glo_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
187    
188     %compute northern hemisphere integrals:
189     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
190     north_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
191     north_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
192     north_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
193    
194     %and southern hemisphere integrals:
195     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
196     south_heat_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
197     south_heat_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
198     south_heat_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
199    
200     %=======SALT=======
201    
202     contOCN=myparms.rhoconst*SALT-myparms.rhoconst*AB_gS;
203     contICE=myparms.SIsal0*myparms.rhoi*SIheff;
204     contTOT=contOCN+contICE;
205     %vertical divergence (air-sea fluxes or vertical adv/dif)
206     zdivOCN=SFLUX+oceSPflx;
207     zdivICE=-zdivOCN+SRELAX;
208     %in linear surface we omit :
209     if ~myparms.useNLFS; zdivOCN=zdivOCN-myparms.rhoconst*WSLTMASS; end;
210     %working approach for real fresh water (?) and virtual salt flux
211     if ~myparms.useRFWF|~myparms.useNLFS; zdivICE=-oceSflux; end;
212     %for deep ocean layer :
213     if kBudget>1;
214     zdivOCN=-(ADVr_SLT+DFrE_SLT+DFrI_SLT)./mygrid.RAC*myparms.rhoconst;
215     zdivOCN=zdivOCN+oceSPtnd;%.*msk;
216     end;
217     zdivTOT=zdivOCN+zdivICE;
218     %horizontal divergence (advection and diffusion)
219     tmpU=myparms.rhoconst*(ADVx_SLT+DFxE_SLT); tmpV=myparms.rhoconst*(ADVy_SLT+DFyE_SLT);
220     hdivOCN=calc_UV_div(tmpU,tmpV);
221     tmpU=myparms.SIsal0*(myparms.rhoi*DFxEHEFF+myparms.rhoi*ADVxHEFF);
222     tmpV=myparms.SIsal0*(myparms.rhoi*DFyEHEFF+myparms.rhoi*ADVyHEFF);
223     hdivICE=calc_UV_div(tmpU,tmpV); %no dh needed here
224     hdivTOT=hdivOCN+hdivICE;
225    
226     %compute global integrals:
227     %-------------------------
228     msk=mygrid.mskC(:,:,kBudget);
229     glo_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
230     glo_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
231     glo_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
232    
233     %compute northern hemisphere integrals:
234     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC>0);
235     north_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
236     north_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
237     north_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
238    
239     %and southern hemisphere integrals:
240     msk=mygrid.mskC(:,:,kBudget).*(mygrid.YC<=0);
241     south_salt_tot=calc_budget_mean_mask(contTOT,zdivTOT,hdivTOT,msk);
242     south_salt_ocn=calc_budget_mean_mask(contOCN,zdivOCN,hdivOCN,msk);
243     south_salt_ice=calc_budget_mean_mask(contICE,zdivICE,hdivICE,msk);
244 gforget 1.2
245     %===================== COMPUTATIONAL SEQUENCE ENDS =========================%
246     %===================== PLOTTING SEQUENCE BEGINS =========================%
247    
248     elseif userStep==-1;%plotting
249    
250     if isempty(setDiagsParams);
251     choicePlot={'all'};
252     elseif isnumeric(setDiagsParams{1})&length(setDiagsParams)==1;
253     choicePlot={'all'};
254     elseif isnumeric(setDiagsParams{1});
255     choicePlot={setDiagsParams{2:end}};
256     else;
257     choicePlot=setDiagsParams;
258     end;
259    
260 gforget 1.3 tt=[1:length(alldiag.listTimes)];
261     TT=alldiag.listTimes(tt);
262     nt=length(TT);
263    
264 gforget 1.2 if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
265    
266     %1.1) ocean+seaice mass budgets
267     %------------------------------
268     figureL;
269     %global volume budget:
270     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_tot,'kg/m2','Global Mean Mass (incl. ice)');
271     %add bp:
272     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
273     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
274     %northern hemisphere budget:
275     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_tot,'kg/m2','Northern Mean Mass (incl. ice)');
276     %add bp:
277     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
278     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
279     %southern hemisphere budget:
280     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_tot,'kg/m2','Southern Mean Mass (incl. ice)');
281     %add bp:
282     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
283     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
284     %add to tex file
285     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
286     myCaption={myCaption{:},'mass budget (ocean+ice) in kg/m2.'};
287     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
288    
289     %1.2) ice mass budgets
290     %---------------------
291     figureL;
292     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ice,'kg/m2','Global Mean Mass (only ice)');
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     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ice,'kg/m2','Northern Mean Mass (only ice)');
296     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
297     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
298     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ice,'kg/m2','Southern Mean Mass (only ice)');
299     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
300     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
301     %add to tex file
302     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
303     myCaption={myCaption{:},'mass budget (ice only) in kg/m2.'};
304     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
305    
306     end;
307    
308     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'mass')));
309    
310     %1.3) ocean mass budgets
311     %-----------------------
312     figureL;
313     %global volume budget:
314     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_vol_ocn,'kg/m2','Global Mean Mass (only ocean)');
315     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.glo_bp);
316     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
317     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_vol_ocn,'kg/m2','Northern Mean Mass (only ocean)');
318     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.north_bp);
319     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
320     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_vol_ocn,'kg/m2','Southern Mean Mass (only ocean)');
321     dt=median(diff(TT))*86400; bp=dt*cumsum(alldiag.south_bp);
322     plot(TT,bp,'k'); aa=legend; bb=get(aa,'String'); bb={bb{:},'bp'}; legend(bb,'Orientation','horizontal');
323     %add to tex file
324     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
325     myCaption={myCaption{:},'mass budget (ocean only) in kg/m2.'};
326     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
327    
328     end;
329    
330     if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
331    
332     %2.1) ocean+seaice heat budgets
333     %------------------------------
334     figureL;
335     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_tot,'J/m2','Global Mean Ocean Heat (incl. ice)');
336     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_tot,'J/m2','Northern Mean Ocean Heat (incl. ice)');
337     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_tot,'J/m2','Southern Mean Ocean Heat (incl. ice)');
338     %add to tex file
339     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
340     myCaption={myCaption{:},'heat budget (ocean+ice) in J/m2.'};
341     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
342    
343     %2.2) ice heat budgets
344     %---------------------
345     figureL;
346     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ice,'J/m2','Global Mean Ocean Heat (only ice)');
347     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ice,'J/m2','Northern Mean Ocean Heat (only ice)');
348     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ice,'J/m2','Southern Mean Ocean Heat (only ice)');
349     %add to tex file
350     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
351     myCaption={myCaption{:},'heat budget (ice only) in J/m2.'};
352     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
353    
354     end;
355    
356     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'heat')));
357    
358     %2.3) ocean heat budgets
359     %-----------------------
360     figureL;
361     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_heat_ocn,'J/m2','Global Mean Ocean Heat (only ocean)');
362     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_heat_ocn,'J/m2','Northern Mean Ocean Heat (only ocean)');
363     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_heat_ocn,'J/m2','Southern Mean Ocean Heat (only ocean)');
364     %add to tex file
365     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
366     myCaption={myCaption{:},'heat budget (ocean only) in J/m2.'};
367     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
368    
369     end;
370    
371     if (kBudget==1)&(sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
372    
373     %3.1) ocean+seaice salt budgets
374     %------------------------------
375     figureL;
376     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_tot,'g/m2','Global Mean Ocean Salt (incl. ice)');
377     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_tot,'g/m2','Northern Mean Ocean Salt (incl. ice)');
378     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_tot,'g/m2','Southern Mean Ocean Salt (incl. ice)');
379     %add to tex file
380     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
381     myCaption={myCaption{:},'salt budget (ocean+ice) in g/m2.'};
382     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
383    
384     %2.2) ice salt budgets
385     %---------------------
386     figureL;
387     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ice,'g/m2','Global Mean Ocean Salt (only ice)');
388     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ice,'g/m2','Northern Mean Ocean Salt (only ice)');
389     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ice,'g/m2','Southern Mean Ocean Salt (only ice)');
390     %add to tex file
391     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
392     myCaption={myCaption{:},'salt budget (ice only) in g/m2.'};
393     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
394    
395     end;
396    
397    
398     if (sum(strcmp(choicePlot,'all'))|sum(strcmp(choicePlot,'salt')));
399    
400     %3.3) ocean salt budgets
401     %-----------------------
402     figureL;
403     subplot(3,1,1); disp_budget_mean_mask(TT,alldiag.glo_salt_ocn,'g/m2','Global Mean Ocean Salt (incl. ice)');
404     subplot(3,1,2); disp_budget_mean_mask(TT,alldiag.north_salt_ocn,'g/m2','Northern Mean Ocean Salt (incl. ice)');
405     subplot(3,1,3); disp_budget_mean_mask(TT,alldiag.south_salt_ocn,'g/m2','Southern Mean Ocean Salt (incl. ice)');
406     %add to tex file
407     myCaption={myYmeanTxt,' global (upper) north (mid) and south (lower), '};
408     myCaption={myCaption{:},'salt budget (ocean only) in g/m2.'};
409     if addToTex&multiTimes; write2tex(fileTex,2,myCaption,gcf); elseif ~multiTimes; close; end;
410    
411     end;
412    
413 gforget 1.1 end;

  ViewVC Help
Powered by ViewVC 1.1.22