| 1 |
jmc |
1.1 |
|
| 2 |
|
|
kwr=0; |
| 3 |
|
|
%kwr=-1; |
| 4 |
|
|
nx=80; ny=42; nr=3; nt=1; |
| 5 |
|
|
|
| 6 |
|
|
xc=[1:nx]; xc=xc-mean(xc); |
| 7 |
|
|
yc=[1:ny]-.5; |
| 8 |
|
|
|
| 9 |
|
|
%------------------------------------------------------ |
| 10 |
|
|
|
| 11 |
|
|
windx=10.; |
| 12 |
|
|
H0=-100.; |
| 13 |
|
|
|
| 14 |
|
|
namf='channel.bin'; |
| 15 |
|
|
depth=H0*ones(nx,ny); depth(:,1)=0.; depth(:,ny)=0.; |
| 16 |
|
|
if kwr > 0, |
| 17 |
|
|
fprintf('write to file: %s\n',namf); |
| 18 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,depth,'real*8'); fclose(fid); |
| 19 |
|
|
end |
| 20 |
|
|
|
| 21 |
|
|
namf='windx.bin'; |
| 22 |
|
|
wnd=windx*ones(nx,ny,nt); |
| 23 |
|
|
if kwr > 0, |
| 24 |
|
|
fprintf('write to file: %s\n',namf); |
| 25 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,wnd,'real*8'); fclose(fid); |
| 26 |
|
|
end |
| 27 |
|
|
|
| 28 |
|
|
%- file name convention: "const_{xx}.bin" <-> uniform value = xx (in percent) |
| 29 |
|
|
namf='const_00.bin'; |
| 30 |
|
|
fld=0*ones(nx,ny,nt); |
| 31 |
|
|
if kwr > 0, |
| 32 |
|
|
fprintf('write to file: %s\n',namf); |
| 33 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid); |
| 34 |
|
|
end |
| 35 |
|
|
|
| 36 |
|
|
namf='const100.bin'; w0=1.; |
| 37 |
|
|
%var=w0*ones(nx,ny); |
| 38 |
|
|
%if kwr > 0, |
| 39 |
|
|
% fprintf('write to file: %s\n',namf); |
| 40 |
|
|
% fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid); |
| 41 |
|
|
%end |
| 42 |
|
|
|
| 43 |
|
|
namf='const+20.bin'; w0=0.2; |
| 44 |
|
|
var=w0*ones(nx,ny); |
| 45 |
|
|
if kwr > 0, |
| 46 |
|
|
fprintf('write to file: %s\n',namf); |
| 47 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,var,'real*8'); fclose(fid); |
| 48 |
|
|
end |
| 49 |
|
|
|
| 50 |
|
|
namf='ice0_area.bin'; iceC0=1.; |
| 51 |
|
|
iceConc=zeros(nx,ny); |
| 52 |
|
|
iceConc(21:60,:)=iceC0; |
| 53 |
|
|
iceConc(:,1)=0; iceConc(:,ny)=0; |
| 54 |
|
|
if kwr > 0, |
| 55 |
|
|
fprintf('write to file: %s\n',namf); |
| 56 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,iceConc,'real*8'); fclose(fid); |
| 57 |
|
|
end |
| 58 |
|
|
|
| 59 |
|
|
namf='ice0_heff.bin'; iceH0=0.2; |
| 60 |
|
|
%iceVol=iceConc*iceH0; |
| 61 |
|
|
%if kwr > 0, |
| 62 |
|
|
% fprintf('write to file: %s\n',namf); |
| 63 |
|
|
% fid=fopen(namf,'w','b'); fwrite(fid,iceVol,'real*8'); fclose(fid); |
| 64 |
|
|
%end |
| 65 |
|
|
|
| 66 |
|
|
%------------------------------------------------------ |
| 67 |
|
|
|
| 68 |
|
|
dsw0=70; dswA=30; |
| 69 |
|
|
ymid=(yc(2)+yc(ny))/2; |
| 70 |
|
|
ysn=yc-ymid ; ysn=ysn/(yc(ny)-yc(2)); ysn=sin(pi*ysn); |
| 71 |
|
|
|
| 72 |
|
|
namf=['dsw_',int2str(dsw0),'y.bin']; |
| 73 |
|
|
dsw_y=dsw0+dswA*ysn; |
| 74 |
|
|
fld=ones(nx,1)*dsw_y; |
| 75 |
|
|
if kwr > 0, |
| 76 |
|
|
fprintf('write to file: %s\n',namf); |
| 77 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid); |
| 78 |
|
|
end |
| 79 |
|
|
|
| 80 |
|
|
dlw0=270; dlwA=-20; |
| 81 |
|
|
namf=['dlw_',int2str(dlw0),'y.bin']; |
| 82 |
|
|
dlw_y=dlw0+dlwA*ysn; |
| 83 |
|
|
fld=ones(nx,1)*dlw_y; |
| 84 |
|
|
if kwr > 0, |
| 85 |
|
|
fprintf('write to file: %s\n',namf); |
| 86 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,fld,'real*8'); fclose(fid); |
| 87 |
|
|
end |
| 88 |
|
|
|
| 89 |
|
|
cel2K=273.15; taC=-10; |
| 90 |
|
|
%ta0=cel2K+taC; |
| 91 |
|
|
%- cheapAML works in deg.C |
| 92 |
|
|
ta0=taC; |
| 93 |
|
|
ta=ta0*ones(nx,ny); |
| 94 |
|
|
namf=['tair_',int2str(taC),'.bin']; |
| 95 |
|
|
if kwr > 0, |
| 96 |
|
|
fprintf('write to file: %s\n',namf); |
| 97 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,ta,'real*8'); fclose(fid); |
| 98 |
|
|
end; |
| 99 |
|
|
|
| 100 |
|
|
cvapor_fac = 640380.000 ; |
| 101 |
|
|
cvapor_exp = 5107.400 ; |
| 102 |
|
|
atmrho = 1.200 ; |
| 103 |
|
|
rh=70; %- specific humid <--> 70.% relative humid |
| 104 |
|
|
taK=cel2K+taC; |
| 105 |
|
|
tmpbulk = cvapor_fac*exp(-cvapor_exp./taK); |
| 106 |
|
|
qa0= (rh/100.)*tmpbulk/atmrho ; |
| 107 |
|
|
qa=qa0*ones(nx,ny); |
| 108 |
|
|
namf=['qa',int2str(rh),'_',int2str(taC),'.bin']; |
| 109 |
|
|
if kwr > 0, |
| 110 |
|
|
fprintf('write to file: %s\n',namf); |
| 111 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,qa,'real*8'); fclose(fid); |
| 112 |
|
|
end; |
| 113 |
|
|
|
| 114 |
|
|
%- salinity |
| 115 |
|
|
sCst=30; |
| 116 |
|
|
so=sCst*ones(nx,ny,nt); |
| 117 |
|
|
namf='socn.bin'; |
| 118 |
|
|
%if kwr > 0, |
| 119 |
|
|
% fprintf('write to file: %s\n',namf); |
| 120 |
|
|
% fid=fopen(namf,'w','b'); fwrite(fid,so,'real*8'); fclose(fid); |
| 121 |
|
|
%end; |
| 122 |
|
|
|
| 123 |
|
|
muTf = 5.4e-2; |
| 124 |
|
|
tfreeze=-muTf*sCst; |
| 125 |
|
|
fprintf('T-freeze = %10.6f\n',tfreeze); |
| 126 |
|
|
dtx=1; %- dtx = amplitude of relaxing ocean temp variations in X-dir |
| 127 |
|
|
%to_x=tfreeze + dtx*sin(pi*(1+2*xc'/nx)) + dtx; |
| 128 |
|
|
to_x=tfreeze + dtx*sin(pi*(2*xc'/nx)) + dtx; |
| 129 |
|
|
mnV=min(to_x); MxV=max(to_x); Avr=mean(to_x); |
| 130 |
|
|
fprintf(' SST* av,mn,Mx: %9.6f , %9.6f , %9.6f , %9.6f\n',Avr,mnV,MxV,MxV-mnV); |
| 131 |
|
|
to=repmat(to_x,[1 ny nt]); |
| 132 |
|
|
namf=['tocn_',int2str(dtx),'x.bin']; |
| 133 |
|
|
if kwr > 0, |
| 134 |
|
|
fprintf('write to file: %s\n',namf); |
| 135 |
|
|
fid=fopen(namf,'w','b'); fwrite(fid,to,'real*8'); fclose(fid); |
| 136 |
|
|
end; |
| 137 |
|
|
|
| 138 |
|
|
%-- make some plots to check: ---------------- |
| 139 |
|
|
|
| 140 |
|
|
hScal=[-1.1 0.1]*abs(H0); |
| 141 |
|
|
figure(1); clf; |
| 142 |
|
|
subplot(211); |
| 143 |
|
|
var=depth; |
| 144 |
|
|
imagesc(xc,yc,var'); set(gca,'YDir','normal'); |
| 145 |
|
|
%caxis(hScal); |
| 146 |
|
|
%change_colmap(-1); |
| 147 |
|
|
colorbar; |
| 148 |
|
|
title('Depth [m]'); |
| 149 |
|
|
|
| 150 |
|
|
subplot(413); |
| 151 |
|
|
var=depth; |
| 152 |
|
|
j1=2; |
| 153 |
|
|
j2=ny/2; |
| 154 |
|
|
j3=j2+1; |
| 155 |
|
|
plot(xc,var(:,j1),'k-') |
| 156 |
|
|
hold on; j=j+1; |
| 157 |
|
|
plot(xc,var(:,j2),'ro-') |
| 158 |
|
|
plot(xc,var(:,j3),'b-') |
| 159 |
|
|
hold off; |
| 160 |
|
|
axis([-nx/2 nx/2 hScal]); |
| 161 |
|
|
grid |
| 162 |
|
|
legend(int2str(j1),int2str(j2),int2str(j3)); |
| 163 |
|
|
title('Depth @ j= cst'); |
| 164 |
|
|
|
| 165 |
|
|
subplot(414); |
| 166 |
|
|
i=nx/2; |
| 167 |
|
|
plot(yc,var(i,:),'k-') |
| 168 |
|
|
axis([0 ny H0*1.1 -H0*.1]); |
| 169 |
|
|
grid |
| 170 |
|
|
title(['Depth @ i=',int2str(i)]); |
| 171 |
|
|
|
| 172 |
|
|
%-- |
| 173 |
|
|
|
| 174 |
|
|
figure(2);clf; |
| 175 |
|
|
subplot(211) |
| 176 |
|
|
plot(xc,to_x,'r-'); hold on; |
| 177 |
|
|
%plot(xc,dewPt-cel2K,'b-'); |
| 178 |
|
|
plot(xc,tfreeze*ones(nx,1),'k-'); |
| 179 |
|
|
hold off; |
| 180 |
|
|
AA=axis; axis([-nx/2 nx/2 AA(3:4)]); |
| 181 |
|
|
legend('To','Tfrz'); |
| 182 |
|
|
grid |
| 183 |
|
|
title('Ocean Temp ^oC'); |
| 184 |
|
|
%title(['del-Temp-X= ',int2str(dtx),' ; RH= ',int2str(rh),' ; Air Temp (^oC)']); |
| 185 |
|
|
subplot(212) |
| 186 |
|
|
plot(yc,dsw_y,'r-'); hold on; |
| 187 |
|
|
plot(yc,dlw_y-200,'b-'); |
| 188 |
|
|
hold off; |
| 189 |
|
|
%AA=axis; axis([0 ny AA(3:4)]); |
| 190 |
|
|
axis([0 ny 30 110]); |
| 191 |
|
|
grid |
| 192 |
|
|
legend('sw','lw','Location','South'); |
| 193 |
|
|
title('Downward SW and LW (-200) [W/m^2]'); |
| 194 |
|
|
|
| 195 |
|
|
%-- |
| 196 |
|
|
|
| 197 |
|
|
figure(3);clf; |
| 198 |
|
|
subplot(311) |
| 199 |
|
|
var=iceConc; ccB=[-1 12]/10; |
| 200 |
|
|
imagesc(xc,yc,var'); set(gca,'YDir','normal'); |
| 201 |
|
|
caxis(ccB); |
| 202 |
|
|
%change_colmap(-1); |
| 203 |
|
|
colorbar; |
| 204 |
|
|
title('Ice Concentration in Channel'); |
| 205 |
|
|
|
| 206 |
|
|
iceVol=iceH0*iceConc; |
| 207 |
|
|
subplot(312) |
| 208 |
|
|
var=iceVol; ccB=[-1 12]/50; |
| 209 |
|
|
imagesc(xc,yc,var'); set(gca,'YDir','normal'); |
| 210 |
|
|
caxis(ccB); |
| 211 |
|
|
%change_colmap(-1); |
| 212 |
|
|
colorbar; |
| 213 |
|
|
title('Effective ice thickness in Channel'); |
| 214 |
|
|
|
| 215 |
|
|
subplot(313) |
| 216 |
|
|
var=iceConc(1,:); |
| 217 |
|
|
%plot(yc,var,'b-x'); hold on; |
| 218 |
|
|
semilogy(yc,var,'b-x'); hold on; |
| 219 |
|
|
var=iceVol(1,:); |
| 220 |
|
|
%plot(yc,var,'r-x'); hold off; |
| 221 |
|
|
semilogy(yc,var,'r-x'); hold on; |
| 222 |
|
|
AA=axis; axis([0 ny [0 2]*iceC0]); |
| 223 |
|
|
grid |
| 224 |
|
|
legend('iceC','hEff','Location','South'); |
| 225 |
|
|
title('Initial ice in Channel : y-section'); |
| 226 |
|
|
%-- |