1 |
nx=1 ; ny=56 ; |
2 |
dx=3 ; dy=3 ; yyM=84 ; |
3 |
yc=-yyM+dy/2:dy:yyM; xc=dx/2:dx:nx*dx; |
4 |
kg=3; |
5 |
|
6 |
%-- Bathy : |
7 |
if kg == 1 |
8 |
|
9 |
hh=ones(nx,ny); |
10 |
hh(:,1)=zeros(nx,1); |
11 |
hh(:,ny)=zeros(nx,1); |
12 |
hh=-6000*hh; |
13 |
|
14 |
imagesc(xc,yc,hh');set(gca,'YDir','normal'); |
15 |
scalHV_colbar([1. 1. 0.5 0.7],1); |
16 |
grid; |
17 |
|
18 |
file_name='topo_sl.bin' ; |
19 |
fid=fopen(file_name,'w','b'); |
20 |
fwrite(fid,hh,'real*8'); fclose(fid); |
21 |
|
22 |
end |
23 |
%--- |
24 |
|
25 |
%-- SST : |
26 |
if kg == 2 |
27 |
|
28 |
yyp=abs(yc/90); |
29 |
phi=yyp.^3.; |
30 |
phi=-9*phi; |
31 |
ts1=exp(phi); ts1=28*ts1 - 1 ; |
32 |
subplot(211); |
33 |
%plot(y2c,sst2zav,'k-',y2c,sst2sym,'b-',yc,ts1,'r-'); |
34 |
plot(yc,ts1,'k-'); |
35 |
AA=axis ; axis([-81 81 AA(3:4)]); |
36 |
grid; |
37 |
|
38 |
ts=zeros(nx,ny); for j=1:ny, ts(:,j)=ts1(j) ; end |
39 |
file_name='sst_sl.bin' ; |
40 |
fid=fopen(file_name,'w','b'); |
41 |
fwrite(fid,ts,'real*8'); fclose(fid); |
42 |
|
43 |
end |
44 |
%--- |
45 |
|
46 |
%-- Tau-X : |
47 |
if kg == 3 |
48 |
|
49 |
%- exponential damping if y > 60 (or y > 55) : |
50 |
yyp=abs(yc/60); |
51 |
yyp=max(yyp,1); |
52 |
yyp=yyp.^5; |
53 |
yye=1-yyp; yye=exp(yye); |
54 |
|
55 |
rad=pi/180.; |
56 |
phi=4.0*rad*yc; |
57 |
tx0=cos(phi); tx0=-.06*tx0 ; |
58 |
phi=7.2*rad*yc; |
59 |
tx1=cos(phi); tx1=.043*tx1 ; |
60 |
tx3=tx0+tx1 ; fc=90; |
61 |
tx3=tx3.*yye; |
62 |
%- tx4 = tx3 but only positive part in high lat. |
63 |
tx4=tx3; |
64 |
nn=min( find(yc >= -60) ) ; tx4(1:nn)=max(tx4(1:nn),0) ; |
65 |
nn=max( find(yc <= 60) ) ; tx4(nn:ny)=max(tx4(nn:ny),0) ; |
66 |
subplot(212); |
67 |
plot(y2c,tx2zav,'k-',y2c,tx2sym,'b-',yc,tx4,'g-',yc,tx3,'r-'); |
68 |
%plot(yc,tx3,'k-',yc,tx4,'r-'); |
69 |
AA=axis ; axis([-81 81 AA(3:4)]); |
70 |
grid; |
71 |
|
72 |
tx=zeros(nx,ny); for j=1:ny, tx(:,j)=tx3(j) ; end |
73 |
file_name='taux_sl.bin' ; |
74 |
%tx=zeros(nx,ny); for j=1:ny, tx(:,j)=tx4(j) ; end |
75 |
%file_name='taux2sl.bin' ; |
76 |
fid=fopen(file_name,'w','b'); |
77 |
fwrite(fid,tx,'real*8'); fclose(fid); |
78 |
|
79 |
end |
80 |
%--- |