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

Annotation of /MITgcm/verification/exp4/input/gendata.m

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


Revision 1.4 - (hide annotations) (download)
Tue Oct 11 13:00:56 2005 UTC (18 years, 7 months ago) by mlosch
Branch: MAIN
CVS Tags: checkpoint58b_post, checkpoint57y_post, checkpoint59, checkpoint58, checkpoint58f_post, checkpoint58d_post, checkpoint58a_post, checkpoint57z_post, checkpoint58y_post, checkpoint58t_post, checkpoint58m_post, checkpoint57v_post, checkpoint60, checkpoint61, checkpoint58w_post, checkpoint57y_pre, checkpoint58o_post, checkpoint58p_post, checkpoint58q_post, checkpoint58e_post, checkpoint58r_post, checkpoint58n_post, checkpoint59q, checkpoint59p, checkpoint59r, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint58k_post, checkpoint58v_post, checkpoint58l_post, checkpoint61f, checkpoint58g_post, checkpoint58x_post, checkpoint61n, checkpoint58h_post, checkpoint58j_post, checkpoint61q, checkpoint57w_post, checkpoint61e, checkpoint58i_post, checkpoint57x_post, checkpoint58c_post, checkpoint58u_post, checkpoint58s_post, checkpoint61g, checkpoint61d, checkpoint61b, checkpoint61c, checkpoint61a, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p
Changes since 1.3: +26 -9 lines
o modify exp4, so that it now tests not only open boundary conditions
  in general but also:
  - reading open boundaries with the useOBCSprescribe option, (without
    exf-package)
  - open boundary support for passive tracers

o remove unnecessary files

o updated output.txt will follow. This current one is still the same,
  which is OK for everything but salinity and ptracers (not included)

1 adcroft 1.1 % This is a matlab script that generates the input data
2    
3     % Dimensions of grid
4     nx=80;
5     ny=42;
6     nz=8;
7     % Nominal depth of model (meters)
8     H=4500;
9     % Scale of bump (m)
10     L=25e3;
11     % Height of bump (m)
12     dh=0.90*H;
13     % Horizontal resolution (m)
14     dx=5e3;
15     % Rotation
16     f=1e-4;
17     % Stratification
18     N=1.5 * f*L/H;
19    
20     % Gravity
21     g=9.81;
22     % E.O.S.
23     alpha=2.e-4;
24    
25     Tz=N^2/(g*alpha)
26    
27     dz=H/nz;
28     sprintf('delZ = %d * %7.6g,',nz,dz)
29    
30     x=(1:nx)*dx;x=x-mean(x);
31     y=(1:ny)*dx;y=y-mean(y);
32     z=-dz/2:-dz:-H;
33    
34     [Y,X]=meshgrid(y,x);
35    
36     % Temperature profile
37     [sprintf('Tref =') sprintf(' %8.6g,',Tz*z-mean(Tz*z))]
38    
39 adcroft 1.3 ieee='b';
40     accuracy='real*8';
41    
42 adcroft 1.1 % Gaussian bump
43     h=-H+dh*exp( -(X.^2+Y.^2)/(2*(L^2)) );
44 adcroft 1.3 fid=fopen('topog.bump','w',ieee); fwrite(fid,h,accuracy); fclose(fid);
45 adcroft 1.1
46 mlosch 1.4 % $$$ % Side walls + bump
47     % $$$ h(:,1)=0;
48     % $$$ h(:,ny)=0;
49     % $$$ fid=fopen('topog.bumpchannel','w',ieee); fwrite(fid,h,accuracy); fclose(fid);
50 adcroft 1.1
51 mlosch 1.4 % $$$ % Simple channel
52     % $$$ h(:,1)=0;
53     % $$$ h(:,2:ny-1)=-H;
54     % $$$ h(:,ny)=0;
55     % $$$ fid=fopen('topog.channel','w',ieee); fwrite(fid,h,accuracy); fclose(fid);
56    
57     % initial fields for salinity
58     si = 35;
59     fid=fopen('S.init','w',ieee); fwrite(fid,si*ones(nx,ny,nz),accuracy); fclose(fid);
60    
61     % open boundary conditions;
62     u0 = .25;
63     s0 = si+1;
64    
65     % create two time slabs for testing
66     uMerid = cat(3,u0*ones(nx,nz),zeros(nx,nz));
67     uZonal = cat(3,u0*ones(ny,nz),zeros(ny,nz));
68     sZonal = cat(3,s0*ones(ny,nz),s0*ones(ny,nz));
69    
70     fid=fopen('OBmeridU.bin','w',ieee); fwrite(fid,uMerid,accuracy); fclose(fid);
71     fid=fopen('OBzonalU.bin','w',ieee); fwrite(fid,uZonal,accuracy); fclose(fid);
72     fid=fopen('OBzonalS.bin','w',ieee); fwrite(fid,sZonal,accuracy); fclose(fid);

  ViewVC Help
Powered by ViewVC 1.1.22