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

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

  ViewVC Help
Powered by ViewVC 1.1.22