1 |
|
|
2 |
kwr=1; |
kwr=1; kprt=0; |
3 |
nx=80; ny=42; nr=3; nt=2; |
nx=80; ny=42; nr=3; nt=1; |
4 |
|
|
5 |
xc=[1:nx]; xc=xc-mean(xc); |
xc=[1:nx]; xc=xc-mean(xc); |
6 |
yc=[1:ny]-.5; |
yc=[1:ny]-.5; |
74 |
%end |
%end |
75 |
%------------------------------------------------------ |
%------------------------------------------------------ |
76 |
|
|
77 |
namf='edge100.bin'; w0=1.; |
namf='ice0_area.bin'; iceC0=1.; |
78 |
var=w0*ones(nx,ny); |
iceConc=iceC0*ones(nx,ny); iceConc(:,1)=0; |
79 |
var(:,2)=0*var(:,end); |
iceConc(:,2)=0.00*iceC0; |
80 |
var(:,3)=0.01*var(:,end-1); |
iceConc(:,3)=0.10*iceC0; |
81 |
var(:,4)=0.1*var(:,end-2); |
iceConc(:,end) =0.00*iceC0; |
82 |
var(:,end)=0*var(:,end); |
iceConc(:,end-1)=0.01*iceC0; |
83 |
var(:,end-1)=0.01*var(:,end-1); |
if kwr > 0, |
|
var(:,end-2)=0.1*var(:,end-2); |
|
|
if kwr >0, |
|
84 |
fprintf('write to file: %s\n',namf); |
fprintf('write to file: %s\n',namf); |
85 |
fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid); |
fid=fopen(namf,'w','b'); fwrite(fid,iceConc,'real*8'); fclose(fid); |
86 |
end |
end |
87 |
|
|
88 |
namf='edge+20.bin'; w0=0.2; |
namf='ice0_heff.bin'; iceH0=0.2; |
89 |
var=w0*ones(nx,ny); |
iceVol=iceConc*iceH0; |
90 |
var(:,2)=0*var(:,end); |
if kwr > 0, |
|
var(:,3)=0.01*var(:,end-1); |
|
|
var(:,4)=0.1*var(:,end-2); |
|
|
var(:,end)=0*var(:,end); |
|
|
var(:,end-1)=0.01*var(:,end-1); |
|
|
var(:,end-2)=0.1*var(:,end-2); |
|
|
if kwr >0, |
|
91 |
fprintf('write to file: %s\n',namf); |
fprintf('write to file: %s\n',namf); |
92 |
fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid); |
fid=fopen(namf,'w','b'); fwrite(fid,iceVol,'real*8'); fclose(fid); |
93 |
end |
end |
94 |
|
|
95 |
%------------------------------------------------------ |
%------------------------------------------------------ |
96 |
|
|
|
|
|
97 |
dsw0=100; |
dsw0=100; |
98 |
namf=['dsw_',int2str(dsw0),'.bin']; |
namf=['dsw_',int2str(dsw0),'.bin']; |
99 |
fld=dsw0*ones(nx,ny,nt); |
fld=dsw0*ones(nx,ny,nt); |
102 |
fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid); |
fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid); |
103 |
end |
end |
104 |
|
|
105 |
dlw0=250; |
dlw0=250; |
106 |
namf=['dlw_',int2str(dlw0),'.bin']; |
namf=['dlw_',int2str(dlw0),'.bin']; |
107 |
fld=dlw0*ones(nx,ny,nt); |
fld=dlw0*ones(nx,ny,nt); |
108 |
if kwr > 0, |
if kwr > 0, |
142 |
%end; |
%end; |
143 |
|
|
144 |
muTf = 5.4e-2; |
muTf = 5.4e-2; |
145 |
tfreeze=-muTf*sCst; |
tfreeze=-muTf*sCst; |
146 |
fprintf('T-freeze = %10.6f\n',tfreeze); |
fprintf('T-freeze = %10.6f\n',tfreeze); |
147 |
to_y=(yc-2)/ny; |
%- parabolic profile in Y, max @ j=4, min @ j=ny, amplitude=1.K |
148 |
|
to_y=(yc-3.5)/(ny-4); |
149 |
to_y=tfreeze+0.5-to_y.*to_y; |
to_y=tfreeze+0.5-to_y.*to_y; |
150 |
|
mnV=min(to_y); MxV=max(to_y); Avr=mean(to_y(2:end)); |
151 |
|
fprintf(' SST* av,mn,Mx: %9.6f , %9.6f , %9.6f , %9.6f\n',Avr,mnV,MxV,MxV-mnV); |
152 |
to=repmat(to_y,[nx 1 nt]); |
to=repmat(to_y,[nx 1 nt]); |
153 |
namf='tocn.bin'; |
namf='tocn.bin'; |
154 |
if kwr > 0, |
if kwr > 0, |
195 |
dewPt=-cvapor_exp./log(dewPt); |
dewPt=-cvapor_exp./log(dewPt); |
196 |
|
|
197 |
figure(2);clf; |
figure(2);clf; |
198 |
subplot(211) |
subplot(311) |
199 |
plot(xc,ta_x-cel2K,'r-'); hold on; |
P(1)=plot(xc,ta_x-cel2K,'r-'); hold on; |
200 |
plot(xc,dewPt-cel2K,'b-'); |
P(2)=plot(xc,dewPt-cel2K,'b-'); |
201 |
plot(xc,tfreeze*ones(nx,1),'k-'); |
P(3)=plot(xc,tfreeze*ones(nx,1),'k-'); |
202 |
hold off; |
set(P,'LineWidth',1); |
203 |
AA=axis; axis([-nx/2 nx/2 AA(3:4)]); |
hold off; AA=axis; |
204 |
|
axis([-nx/2 nx/2 AA(3:4)]); |
205 |
legend('ta','dew'); |
legend('ta','dew'); |
206 |
grid |
grid |
207 |
title(['del-Temp-X= ',int2str(dtx),' ; RH= ',int2str(rh),' ; Air Temp (^oC)']); |
xlabel('X') |
208 |
subplot(212) |
title(['Air Temp (^oC): del-Temp-X = ',int2str(dtx),' , RH= ',int2str(rh)]); |
209 |
plot(yc,to_y,'b-'); hold on; |
subplot(312) |
210 |
plot(yc,tfreeze*ones(ny,1),'k-'); |
P(1)=plot(yc,to_y,'b-'); hold on; |
211 |
hold off; |
P(2)=plot(yc,tfreeze*ones(ny,1),'k-'); |
212 |
AA=axis; axis([0 ny AA(3:4)]); |
set(P,'LineWidth',1); |
213 |
|
hold off; AA=axis; |
214 |
|
L=line([1 1],AA(3:4)); set(L,'LineWidth',2.,'Color',[0 0 0]); |
215 |
|
axis([0 ny AA(3:4)]); |
216 |
grid |
grid |
217 |
|
xlabel('Y') |
218 |
title('Ocean Temp ^oC'); |
title('Ocean Temp ^oC'); |
219 |
|
|
220 |
|
subplot(313) |
221 |
|
var=iceConc(1,:); |
222 |
|
P(1)=semilogy(yc,var,'b-x'); hold on; |
223 |
|
%plot(yc,var,'b-x'); hold on; |
224 |
|
var=iceVol(1,:); |
225 |
|
P(2)=semilogy(yc,var,'r-x'); |
226 |
|
%plot(yc,var,'r-x'); |
227 |
|
set(P,'LineWidth',1); |
228 |
|
hold off; AA=axis; |
229 |
|
L=line([1 1],AA(3:4)); set(L,'LineWidth',2.,'Color',[0 0 0]); |
230 |
|
axis([0 ny [0 2]*iceC0]); |
231 |
|
grid |
232 |
|
xlabel('Y') |
233 |
|
legend('iceC','hEff','Location','South'); |
234 |
|
title('Initial ice in Channel : y-section'); |
235 |
|
%----- |
236 |
|
if kprt == 1, f=2; |
237 |
|
namfig=sprintf('forcing_%2.2i',f); |
238 |
|
fprintf([' print fig= %2i to file: ',namfig,' '],f); |
239 |
|
set(f,'PaperOrientation','portrait') |
240 |
|
%set(f,'PaperPosition',[0.25 1.5 6. 8.]); |
241 |
|
set(f,'PaperPosition',[0.25 1.5 5.25 7.]); |
242 |
|
print(f,'-depsc2',namfig); fprintf('\n'); |
243 |
|
end |
244 |
|
%----- |
245 |
|
|
246 |
|
figure(3);clf; |
247 |
|
subplot(311) |
248 |
|
var=iceConc; ccB=[-1 12]/10; |
249 |
|
imagesc(xc,yc,var'); set(gca,'YDir','normal'); |
250 |
|
caxis(ccB); |
251 |
|
%change_colmap(-1); |
252 |
|
colorbar; |
253 |
|
title('Ice Concentration in Channel'); |
254 |
|
|
255 |
|
subplot(312) |
256 |
|
var=iceVol; ccB=[-1 12]/50; |
257 |
|
imagesc(xc,yc,var'); set(gca,'YDir','normal'); |
258 |
|
caxis(ccB); |
259 |
|
%change_colmap(-1); |
260 |
|
colorbar; |
261 |
|
title('Effective ice thickness in Channel'); |
262 |
|
|
263 |
|
subplot(313) |
264 |
|
var=iceConc(1,:); |
265 |
|
%plot(yc,var,'b-x'); hold on; |
266 |
|
semilogy(yc,var,'b-x'); hold on; |
267 |
|
var=iceVol(1,:); |
268 |
|
%plot(yc,var,'r-x'); hold off; |
269 |
|
semilogy(yc,var,'r-x'); hold on; |
270 |
|
AA=axis; axis([0 ny [0 2]*iceC0]); |
271 |
|
grid |
272 |
|
legend('iceC','hEff','Location','South'); |
273 |
|
title('Initial ice in Channel : y-section'); |
274 |
|
%----- |
275 |
|
|
276 |
|
return |