/[MITgcm]/MITgcm/verification/front_relax/input/gendata.m
ViewVC logotype

Diff of /MITgcm/verification/front_relax/input/gendata.m

Parent Directory Parent Directory | Revision Log Revision Log | View Revision Graph Revision Graph | View Patch Patch

revision 1.1 by adcroft, Mon Apr 10 14:38:01 2000 UTC revision 1.3 by jmc, Thu Jun 21 01:07:17 2007 UTC
# Line 20  fid=fopen('topog.bin','w',ieee); fwrite( Line 20  fid=fopen('topog.bin','w',ieee); fwrite(
20  Lx=dx*nx;  Lx=dx*nx;
21  Ly=dy*(ny-1);  % Solid wall in North  Ly=dy*(ny-1);  % Solid wall in North
22    
23    % Variable resolution
24    y=(1:ny)/(ny-0)-0.5;
25    dy=1-0.3*exp( -(5*y).^2 );
26    %dy=ones(1,ny);              % Constant resolution
27    dy=dy/sum(dy(1:ny-1))*Ly;
28    fid=fopen('dy.bin','w',ieee); fwrite(fid,dy,prec); fclose(fid);
29    
30  % Coordinates  % Coordinates
31  xc=((1:nx)-0.5)*dx;  xc=((1:nx)-0.5)*dx;
32  yc=((1:ny)-0.5)*dy-Ly/2;  yf=-Ly/2+[0 cumsum(dy)];
33    yc=(yf(1:end-1)+yf(2:end))/2;
34  zf=[0 -cumsum(dz)];  zf=[0 -cumsum(dz)];
35  zc=(zf(1:end-1)+zf(2:end))/2;  zc=(zf(1:end-1)+zf(2:end))/2;
36  [X,Y]=ndgrid(xc,yc);  [X,Y]=ndgrid(xc,yc);
# Line 44  for k=1:nz, Line 52  for k=1:nz,
52               *exp(-(3*zc(k)/Ho)^2);               *exp(-(3*zc(k)/Ho)^2);
53  end  end
54  T(:,end,:)=0;  T(:,end,:)=0;
55  fid=fopen('theta.bin','w',ieee); fwrite(fid,T,prec); fclose(fid);  %- add 10 more levels:
56    t25=zeros(nx,ny,nz+10); t25(:,:,[1:nz]=T;
57    fid=fopen('theta.bin','w',ieee); fwrite(fid,t25,prec); fclose(fid);
58    
59  % Salt (passive tracer)  % Salt (passive tracer)
60  for k=1:nz,  for k=1:nz,
# Line 54  for k=1:nz, Line 64  for k=1:nz,
64   S(:,:,k)=exp(-(2*Y/Ly).^2);           % Exponential with y   S(:,:,k)=exp(-(2*Y/Ly).^2);           % Exponential with y
65  end  end
66  S(:,end,:)=0;  S(:,end,:)=0;
67  fid=fopen('salt.bin','w',ieee); fwrite(fid,S,prec); fclose(fid);  %- add 10 more levels:
68    s25=zeros(nx,ny,nz+10); s25(:,:,[1:nz]=S;
69    fid=fopen('salt.bin','w',ieee); fwrite(fid,s25,prec); fclose(fid);

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.3

  ViewVC Help
Powered by ViewVC 1.1.22