Back to home page

MITgcm

 
 

    


Warning, /verification/adjustment.cs-32x32x1/input/gendata.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit add29e06 on 2018-01-31 20:35:05 UTC
dd7ff44a46 Jean*0001 % This is a matlab script that generates the input data
                0002 
                0003 nx=32; ny=nx; nf=6;
                0004 kwr=1;
                0005 
                0006 %- flat bottom bathy with rectangular island on face 2
                0007 dp=ones(nx,nf,ny);
                0008 Htot=1366;
                0009 dp=-Htot*dp;
                0010 
                0011 fc=2;
                0012 i1=1; i2=nx; j1=ny/4 ; j2=1+3*ny/4;
                0013 dp(:,fc,j1:j2)=0;
                0014 dp(nx,1,j1:j2)=0;
                0015 dp(j1:j2,4,1)=0;
                0016 
                0017 if kwr > 0,
                0018  fid=fopen('bathy_f2.bin','w','b');
                0019  fwrite(fid,dp,'real*8');
                0020  fclose(fid);
                0021 end
                0022 
                0023 %----------
                0024 
                0025 h=zeros(nx,nf,ny);
                0026 
                0027 x=0.25*((0.5:nx)/nx-0.5);
                0028 [X,Y]=ndgrid(x,x);
                0029 R=sqrt(X.^2+Y.^2);
                0030 
                0031 
                0032 tileno=1;
aea29c8517 Alis*0033 
                0034 o=1;
                0035 i=round(nx*1/2);
                0036 j=round(ny*1/2);
                0037 h(i:i+o,tileno,j:j+o)=1;
                0038 
dd7ff44a46 Jean*0039 h(:,1,:)=0.5+0.5*cos(   pi*min(R,0*R+0.04)/0.04 );
                0040 
                0041 %- 10 m max SSH anomaly:
                0042 h=h*10;
                0043 
                0044 if kwr > 0,
                0045  fid=fopen('ssh_eq.bin','w','b');
                0046  fwrite(fid,h,'real*8');
                0047  fclose(fid);
                0048 end
                0049 
                0050 return
                0051 %----------
                0052 % plot to check : ----------
                0053 rDir='/home/jmc/grid_cs32/';
                0054 G=load_grid(rDir,10);
                0055 nc=G.dims(2); %nr=G.dims(3); nPxy=G.dims(1)*G.dims(2); nPp2=nPxy+2;
                0056 ccB=[0 0]; shift=-1; cbV=0; AxBx=[-180 180 -90 90]; kEnv=0;
                0057 
                0058 figure(1);clf;
                0059 var=reshape(dp,[nx*nf ny]);
                0060 grph_CS(var,G.xC,G.yC,G.xG,G.yG,ccB(1),ccB(2),shift,cbV,AxBx,kEnv);
                0061 
                0062 figure(2);clf;
                0063 var=reshape(h,[nx*nf ny]);
                0064 grph_CS(var,G.xC,G.yC,G.xG,G.yG,ccB(1),ccB(2),shift,cbV,AxBx,kEnv);
                0065 
                0066 %----------