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