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

Contents of /MITgcm/verification/dome/input/gendata.m

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


Revision 1.1 - (show annotations) (download)
Tue Jul 6 18:40:32 2004 UTC (17 years ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint58l_post, checkpoint64z, checkpoint57t_post, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint57o_post, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint58e_post, checkpoint57v_post, checkpoint58u_post, checkpoint58w_post, checkpoint57m_post, checkpoint55c_post, checkpoint54e_post, checkpoint57s_post, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63a, checkpoint63b, checkpoint63c, checkpoint57k_post, checkpoint55d_pre, checkpoint57d_post, checkpoint57g_post, checkpoint64, checkpoint65, checkpoint60, checkpoint61, checkpoint62, checkpoint63, checkpoint57b_post, checkpoint57c_pre, checkpoint58r_post, checkpoint55j_post, checkpoint56b_post, checkpoint57i_post, checkpoint57y_post, checkpoint57e_post, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint55h_post, checkpoint58n_post, checkpoint58x_post, checkpoint57g_pre, checkpoint54b_post, checkpoint55b_post, checkpoint58t_post, checkpoint58h_post, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint54d_post, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, checkpoint56c_post, checkpoint57y_pre, checkpoint55, checkpoint57f_pre, checkpoint57a_post, checkpoint58q_post, checkpoint54f_post, checkpoint59q, checkpoint59p, checkpoint55g_post, checkpoint59r, checkpoint58j_post, checkpoint59e, checkpoint59d, checkpoint59g, checkpoint59f, checkpoint59a, checkpoint55f_post, checkpoint59c, checkpoint59b, checkpoint59m, checkpoint59l, checkpoint59o, checkpoint59n, checkpoint59i, checkpoint59h, checkpoint59k, checkpoint59j, checkpoint57r_post, checkpoint59, checkpoint58, checkpoint57a_pre, checkpoint55i_post, checkpoint57, checkpoint56, eckpoint57e_pre, checkpoint57h_done, checkpoint58f_post, checkpoint57x_post, checkpoint58d_post, checkpoint58c_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint57f_post, checkpoint58a_post, checkpoint58i_post, checkpoint57q_post, checkpoint58g_post, checkpoint58o_post, checkpoint57z_post, checkpoint62c, checkpoint62b, checkpoint62a, checkpoint62g, checkpoint62f, checkpoint62e, checkpoint62d, checkpoint62k, checkpoint62j, checkpoint62i, checkpoint62h, checkpoint62o, checkpoint62n, checkpoint62m, checkpoint62l, checkpoint62s, checkpoint62r, checkpoint62q, checkpoint62p, checkpoint62w, checkpoint62v, checkpoint62u, checkpoint62t, checkpoint57c_post, checkpoint62z, checkpoint62y, checkpoint62x, checkpoint58y_post, checkpoint55e_post, checkpoint58k_post, checkpoint58v_post, checkpoint55a_post, checkpoint54c_post, checkpoint58s_post, checkpoint61f, checkpoint61g, checkpoint61d, checkpoint61e, checkpoint61b, checkpoint61c, checkpoint58p_post, checkpoint61a, checkpoint61n, checkpoint61o, checkpoint61l, checkpoint61m, checkpoint61j, checkpoint61k, checkpoint61h, checkpoint61i, checkpoint61v, checkpoint61w, checkpoint61t, checkpoint61u, checkpoint61r, checkpoint61s, checkpoint61p, checkpoint61q, checkpoint57j_post, checkpoint61z, checkpoint61x, checkpoint61y, checkpoint58b_post, checkpoint57h_pre, checkpoint58m_post, checkpoint57l_post, checkpoint57h_post, checkpoint56a_post, checkpoint55d_post, HEAD
New experiment based on the DOME calculations by Legg and Hallberg.
 o uses modified obcs_calc.F as well as most recent Salt OBCs

1 % This is a matlab script that generates the input data
2 % variable x resolution
3 prec='real*8';
4 ieee='b';
5
6 % Dimensions of grid
7 %nx=50;
8 nx=200;
9 ny=45;
10 nz=25;
11 % Nominal depth of model (meters)
12 H=3600.0;
13 % Size of domain
14 Ly=600.0e3;
15 %Lx=500.0e3;
16 Lx=2000.0e3;
17
18 % Horizontal resolution (m)
19
20 dx=zeros(nx,1);
21 for i=1:nx
22 dx(i) = Lx/(nx);
23 end
24
25 dy=zeros(ny,1);
26 %for i=1:ny
27 %dy(i) = Ly/(ny);
28 %end
29
30 % y-resolution ramps from 10km to 40km in southern basin:
31 y = [0:600];
32 y0 = 420; yw = 40; r1 = 10; r2 = 40;
33 dy = (r1+r2)/2 - (r1-r2)/2*tanh((y-y0)/yw);
34
35 yg = 0; ii = 1; dely = dy(1);
36 while yg(ii)<=max(y)-dely,
37 dely = interp1(y,dy,yg(ii));
38 yg(ii+1) = yg(ii) + dely;
39 ii = ii+1;
40 end
41 yg(ii) = max(y);
42
43 %plot(yg,mean(dy),'b+'); hold on;
44 %plot(0.5*(yg(1:end-1)+yg(2:end)),diff(yg),'rx-');
45 %plot(y,dy,'c.-'); grid on
46 %pause
47 dy = fliplr(diff(yg)*1e3);
48
49 dz=zeros(nz,1);
50 for i=1:nz
51 dz(i)=H/nz;
52 end
53 %sprintf('delZ = %d * %7.6g,',nz,dz)
54
55 z=zeros(nz,1);
56 z(1) = -dz(1)/2.0;
57 for i=2:nz
58 z(i)=z(i-1) - dz(i);
59 end
60
61 % Stratification
62 gravity=9.81;
63 talpha=2.0e-4;
64 rho0=1030.0;
65 rhotop=1030.0;
66 %rhobot=1030.0;
67 rhobot=1032.0;
68
69 %gravity=10;
70 %talpha=1.0e-4;
71 %rho0=1000.0;
72 %rhotop=1000.0;
73 %rhobot=1000.0;
74 N2=((rhobot-rhotop)/H)/rho0*gravity
75 Tz=N2/(gravity*talpha) ;
76
77 % Temperature profile. tRef is a single reference temperature, Tbg is
78 % a background profile, t is a three-dimensional initial stratification.
79 tRef = 0;
80 %Tref=Tz*(z+H) + (rhobot-rho0)/(rho0*talpha) + 1.0;
81 %Tref=Tz*(z+H) + (rhobot-rho0)/(rho0*talpha)
82 Tbg =Tz*(z+H) - (rhobot-rho0)/(rho0*talpha) + tRef;
83 [sprintf('Tref =') sprintf(' %8.6g,',Tbg)]
84 %t=0.00001*rand([nx,ny,nz]);
85 t=0*rand([nx,ny,nz]);
86 for k=1:nz
87 t(:,:,k) = t(:,:,k) + Tbg(k);
88 end
89 fid=fopen('T.init','w',ieee); fwrite(fid,t,prec); fclose(fid);
90
91 % this could be done more elegantly...
92 x=zeros(nx,1);
93 x(1) = 0.5*dx(1); % center of grid cell
94 for i=2:nx
95 x(i)=x(i-1) + 0.5*dx(i-1) + 0.5*dx(i);
96 end
97
98 y=zeros(ny,1);
99 y(1) = dy(1); % north edge of grid cell
100 for i=2:ny
101 y(i) = y(i-1) + dy(i);
102 end
103
104 % Linear slope and embayment
105 slope = 0.01;
106 %slope = 0.005;
107 lembay=50.0e3; % length of embayment
108 eastwall = 1; % make a wall on the eastern boundary
109 westwall = 0; % make a wall on the western boundary
110
111 % These three parameters should match with Width, Dmax and Xcenter
112 % (respectively) in data.obcs or else funny stuff will happen...
113 wembay=100.0e3; % width of embayment
114 dembay=600.0; % depth of embayment
115 embay_ctr=1700.0e3; % x-coordinate of embayment center
116
117 %xembay=Lx-150.0e3-wembay; %x location of start of embayment
118 xembay=embay_ctr-wembay/2;
119 d=0.0*rand([nx,ny]);
120 for i=1:nx
121 d(:,1) = 0.0;
122 for j=2:ny
123 yneg=Ly-y(j);
124 if yneg < lembay
125 if x(i) > xembay
126 if x(i) < xembay+wembay
127 d(i,j) = -dembay;
128 else
129 d(i,j) = 0.0;
130 end
131 else
132 d(i,j) = 0.0;
133 end
134 else
135 d(i,j) = -slope*(yneg - lembay) - dembay;
136 end
137 if d(i,j) < -H
138 d(i,j) = -H;
139 end
140 end
141 end
142 if eastwall
143 d(nx,:) = 0.0; % east wall
144 end
145 if westwall
146 d(1,:) = 0.0; % west wall
147 end
148 fid=fopen('topog.slope','w',ieee); fwrite(fid,d,prec); fclose(fid);
149 hold off;
150 plot(x,d(:,2),'.-'); grid on
151 %plot(y,d(2,:),'.-'); grid on
152
153 %fid=fopen('delXvar','w',ieee); fwrite(fid,dx,prec); fclose(fid);
154 fid=fopen('delYvar','w',ieee); fwrite(fid,dy,prec); fclose(fid);

  ViewVC Help
Powered by ViewVC 1.1.22