Warning, /verification/ideal_2D_oce/input/gendata.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 11bb4bac on 2003-01-17 14:17:58 UTC
11bb4bac97 Jean*0001 nx=1 ; ny=56 ;
0002 dx=3 ; dy=3 ; yyM=84 ;
0003 yc=-yyM+dy/2:dy:yyM; xc=dx/2:dx:nx*dx;
0004 kg=3;
0005
0006 %-- Bathy :
0007 if kg == 1
0008
0009 hh=ones(nx,ny);
0010 hh(:,1)=zeros(nx,1);
0011 hh(:,ny)=zeros(nx,1);
0012 hh=-6000*hh;
0013
0014 imagesc(xc,yc,hh');set(gca,'YDir','normal');
0015 scalHV_colbar([1. 1. 0.5 0.7],1);
0016 grid;
0017
0018 file_name='topo_sl.bin' ;
0019 fid=fopen(file_name,'w','b');
0020 fwrite(fid,hh,'real*8'); fclose(fid);
0021
0022 end
0023 %---
0024
0025 %-- SST :
0026 if kg == 2
0027
0028 yyp=abs(yc/90);
0029 phi=yyp.^3.;
0030 phi=-9*phi;
0031 ts1=exp(phi); ts1=28*ts1 - 1 ;
0032 subplot(211);
0033 %plot(y2c,sst2zav,'k-',y2c,sst2sym,'b-',yc,ts1,'r-');
0034 plot(yc,ts1,'k-');
0035 AA=axis ; axis([-81 81 AA(3:4)]);
0036 grid;
0037
0038 ts=zeros(nx,ny); for j=1:ny, ts(:,j)=ts1(j) ; end
0039 file_name='sst_sl.bin' ;
0040 fid=fopen(file_name,'w','b');
0041 fwrite(fid,ts,'real*8'); fclose(fid);
0042
0043 end
0044 %---
0045
0046 %-- Tau-X :
0047 if kg == 3
0048
0049 %- exponential damping if y > 60 (or y > 55) :
0050 yyp=abs(yc/60);
0051 yyp=max(yyp,1);
0052 yyp=yyp.^5;
0053 yye=1-yyp; yye=exp(yye);
0054
0055 rad=pi/180.;
0056 phi=4.0*rad*yc;
0057 tx0=cos(phi); tx0=-.06*tx0 ;
0058 phi=7.2*rad*yc;
0059 tx1=cos(phi); tx1=.043*tx1 ;
0060 tx3=tx0+tx1 ; fc=90;
0061 tx3=tx3.*yye;
0062 %- tx4 = tx3 but only positive part in high lat.
0063 tx4=tx3;
0064 nn=min( find(yc >= -60) ) ; tx4(1:nn)=max(tx4(1:nn),0) ;
0065 nn=max( find(yc <= 60) ) ; tx4(nn:ny)=max(tx4(nn:ny),0) ;
0066 subplot(212);
0067 plot(y2c,tx2zav,'k-',y2c,tx2sym,'b-',yc,tx4,'g-',yc,tx3,'r-');
0068 %plot(yc,tx3,'k-',yc,tx4,'r-');
0069 AA=axis ; axis([-81 81 AA(3:4)]);
0070 grid;
0071
0072 tx=zeros(nx,ny); for j=1:ny, tx(:,j)=tx3(j) ; end
0073 file_name='taux_sl.bin' ;
0074 %tx=zeros(nx,ny); for j=1:ny, tx(:,j)=tx4(j) ; end
0075 %file_name='taux2sl.bin' ;
0076 fid=fopen(file_name,'w','b');
0077 fwrite(fid,tx,'real*8'); fclose(fid);
0078
0079 end
0080 %---