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

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

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

revision 1.1 by jmc, Thu Apr 20 23:25:06 2006 UTC revision 1.2 by jmc, Wed Apr 23 23:23:31 2008 UTC
# Line 1  Line 1 
1  % This is a matlab script that generates the input data  % This is a matlab script that generates the input data
2    
3  % Dimensions of grid  % Dimensions of grid
4  nx=64;  nx=100;
5  ny=64;  ny=100;
6  nz=20;  nz=50;
7  % Nominal depth of model (meters)  % Nominal depth of model (meters)
8  H=1000;  H=1000;
9  % Size of domain  % Size of domain
10  Lx=3.2e3;  Lx=2.0e3;
11  % Scale of disk (m)  % Radius of cooling disk (m)
12  L=10e3;  Rc=600.;
13  % Horizontal resolution (m)  % Horizontal resolution (m)
14  dx=Lx/nx;  dx=Lx/nx;
15  % Rotation  % Rotation
16  f=1e-4;  f=1.e-4;
17  % Stratification  % Stratification
18  N=0. * f*L/H;  N=0.0*(f*Rc/H);
19  % Flux  % surface temperature
20  Qo=800;  Ts=20.;
21    % Flux : Cooling disk & noise added to cooling
22    Qo=800; Q1=10;
23    
24  % Gravity  % Gravity
25  g=9.81;  g=10.;
26  % E.O.S.  % E.O.S.
27  alpha=2.e-4;  alpha=2.e-4;
28    
# Line 33  x=(1:nx)*dx;x=x-mean(x); Line 35  x=(1:nx)*dx;x=x-mean(x);
35  y=(1:ny)*dx;y=y-mean(y);  y=(1:ny)*dx;y=y-mean(y);
36  z=-dz/2:-dz:-H;  z=-dz/2:-dz:-H;
37    
 [Y,X]=meshgrid(y,x);  
   
38  % Temperature profile  % Temperature profile
39  [sprintf('Tref =') sprintf(' %8.6g,',Tz*z-mean(Tz*z))]  Tref=Ts+Tz*z-mean(Tz*z);
40    [sprintf('Tref =') sprintf(' %8.6g,',Tref)]
41    
42  % Surface heat flux  % Surface heat flux : refine the grid (by 3 x 3) to assign mean heat flux
43  Q=Qo*(0.5+rand([nx,ny]));  Q=Qo+Q1*(0.5+rand([nx,ny]));
44  r=sqrt(X.^2+Y.^2);  Qc=zeros(nx,ny);
45  Q( find(r>L) )=0;  xc=x'*ones(1,ny); yc=ones(nx,1)*y;
46  fid=fopen('Qsurface','w','b'); fwrite(fid,Q,'real*8'); fclose(fid);  for j=-1:1, for i=-1:1,
47     xs=xc+dx*i/3 ; ys=yc+dx*j/3; r2=xs.*xs+ys.*ys;
48     qs=Q/9; qs( find(r2 > Rc*Rc) )=0.;
49     Qc=Qc+qs;
50    end ; end
51    fid=fopen('Qnet.bin','w','b'); fwrite(fid,Qc,'real*8'); fclose(fid);
52    
53    var=2*pi*[0:1000]/1000; xl=Rc*cos(var); yl=Rc*sin(var);
54    figure(1);clf;
55    var=Qc; var(find(var==0))=NaN;
56    imagesc(xc,yc,var'); set(gca,'YDir','normal');
57    caxis([-15 820]);
58    %change_colmap(-1);
59    colorbar
60    grid;
61    hold on
62    L=line(xl,yl);
63    set(L,'color',[0 0 0]);
64    hold off ;

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

  ViewVC Help
Powered by ViewVC 1.1.22