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

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

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


Revision 1.1 - (show annotations) (download)
Tue Nov 27 15:16:34 2001 UTC (22 years, 5 months ago) by adcroft
Branch: MAIN
CVS Tags: checkpoint46b_post, checkpoint57t_post, checkpoint48f_post, checkpoint46k_post, checkpoint51k_post, checkpoint53f_post, checkpoint47j_post, checkpoint54a_pre, checkpoint55c_post, checkpoint53b_pre, checkpoint48d_pre, checkpoint51l_post, checkpoint51j_post, branch-exfmods-tag, checkpoint47e_post, checkpoint57m_post, checkpoint44h_pre, checkpoint47i_post, checkpoint52l_pre, checkpoint48i_post, checkpoint52e_pre, checkpoint57v_post, checkpoint57g_pre, checkpoint52j_post, checkpoint47f_post, checkpoint48d_post, checkpoint51o_pre, checkpoint57f_post, checkpoint46j_post, checkpoint47c_post, checkpoint50e_post, checkpoint52e_post, checkpoint50c_post, checkpoint57s_post, checkpoint51n_pre, checkpoint47d_post, checkpoint44e_post, checkpoint57j_post, checkpoint58b_post, checkpoint44f_pre, checkpoint47a_post, checkpoint46c_post, checkpoint57b_post, checkpoint46f_post, checkpoint46l_pre, checkpoint53c_post, checkpoint53d_post, checkpoint57f_pre, checkpoint46a_post, checkpoint48a_post, checkpoint55d_pre, checkpoint46n_post, checkpoint51f_pre, checkpoint46d_pre, checkpoint57g_post, checkpoint48e_post, checkpoint46e_post, checkpoint57a_post, checkpoint48h_post, checkpoint55j_post, checkpoint56b_post, checkpoint50c_pre, release1-branch_tutorials, checkpoint57h_pre, checkpoint57y_post, checkpoint44g_post, branchpoint-genmake2, checkpoint46h_pre, checkpoint44h_post, checkpoint46l_post, chkpt44c_post, checkpoint57x_post, checkpoint52j_pre, checkpoint54a_post, checkpoint46e_pre, checkpoint43a-release1mods, branch-netcdf, checkpoint50d_pre, checkpoint55h_post, checkpoint45d_post, checkpoint51r_post, checkpoint52b_pre, checkpoint52n_post, checkpoint54b_post, checkpoint46j_pre, checkpoint45b_post, checkpoint46b_pre, checkpoint51i_post, checkpoint57e_post, checkpoint54d_post, checkpoint47h_post, checkpoint48c_post, chkpt44a_pre, release1-branch-end, checkpoint56c_post, checkpoint54e_post, release1_final_v1, checkpoint55b_post, checkpoint51e_post, checkpoint51b_post, checkpoint46, checkpoint57h_post, checkpoint51l_pre, checkpoint52m_post, checkpoint51c_post, checkpoint57y_pre, checkpoint55, checkpoint53a_post, checkpoint55a_post, checkpoint57c_pre, checkpoint44, checkpoint45, checkpoint48, checkpoint49, checkpoint44f_post, checkpoint47b_post, checkpoint53b_post, checkpoint57o_post, checkpoint55g_post, checkpoint57r_post, checkpoint51o_post, checkpoint48g_post, checkpoint57k_post, checkpoint57d_post, checkpoint44b_post, checkpoint55f_post, checkpoint57i_post, checkpoint51q_post, checkpoint52l_post, checkpoint52k_post, chkpt44d_post, checkpoint58, checkpoint57a_pre, checkpoint54, checkpoint57, checkpoint56, checkpoint51, checkpoint50, checkpoint53, checkpoint52, checkpoint50d_post, checkpoint52d_post, checkpoint46m_post, checkpoint46g_pre, checkpoint51b_pre, checkpoint52a_post, checkpoint57h_done, checkpoint47g_post, checkpoint52b_post, checkpoint53g_post, chkpt44a_post, checkpoint52f_post, checkpoint44b_pre, checkpoint52c_post, checkpoint58d_post, checkpoint57w_post, checkpoint57p_post, checkpint57u_post, checkpoint51h_pre, checkpoint58a_post, checkpoint46a_pre, checkpoint50g_post, checkpoint45c_post, checkpoint57q_post, checkpoint44e_pre, checkpoint51g_post, ecco_c52_e35, chkpt44c_pre, checkpoint57z_post, checkpoint54f_post, checkpoint51f_post, checkpoint46d_post, checkpoint48b_post, checkpoint50b_post, eckpoint57e_pre, checkpoint46g_post, checkpoint58c_post, checkpoint45a_post, checkpoint57c_post, checkpoint50f_post, checkpoint50a_post, checkpoint46c_pre, checkpoint50f_pre, checkpoint52a_pre, checkpoint47d_pre, checkpoint51d_post, checkpoint48c_pre, release1-branch_branchpoint, checkpoint46i_post, checkpoint51m_post, checkpoint51t_post, checkpoint53d_pre, checkpoint47, checkpoint55e_post, checkpoint54c_post, checkpoint50h_post, checkpoint52i_post, checkpoint51a_post, checkpoint46h_post, checkpoint50e_pre, checkpoint50i_post, checkpoint51p_post, checkpoint51n_post, checkpoint55i_post, checkpoint51i_pre, checkpoint57l_post, checkpoint52i_pre, checkpoint51u_post, checkpoint52h_pre, checkpoint52f_pre, checkpoint50b_pre, checkpoint56a_post, checkpoint51s_post, checkpoint55d_post
Branch point for: netcdf-sm0, branch-genmake2, branch-nonh, tg2-branch, release1_final, checkpoint51n_branch, release1-branch, release1, branch-exfmods-curt
New expt: gravity plume on slope (as used by slegg@whoi.edu)

1 % This is a matlab script that generates the input data
2 % variable x resolution
3
4 prec='real*8';
5 ieee='b';
6
7 % Dimensions of grid
8 %nx=80;
9 nx=320;
10 ny=1;
11 nz=60;
12 % Nominal depth of model (meters)
13 H=200.0;
14 % Size of domain
15 Lx=6.40e3;
16
17 % Horizontal resolution (m)
18 %Variable resolution
19 res1=2*Lx/(3*nx);
20 L1=Lx/2;
21 L2=Lx - L1;
22 n2=nx - (L1/res1);
23 res2=L2/n2;
24 A=res2 - res1;
25 iswitch1=L1/res1;
26 width=40;
27 dx=zeros(nx,1);
28 for i=1:nx
29 dx(i) = res1 + 0.5*A*( tanh( (i-iswitch1)/width) + 1);
30 %dx(i) = Lx/nx;
31 end
32
33 dy = Lx/nx
34
35 % Flux
36 Qo=200;
37
38 % Stratification
39 gravity=9.81;
40 talpha=2.0e-4;
41 N2=0.0;
42 Tz=N2/(gravity*talpha);
43
44 dz=H/nz;
45 sprintf('delZ = %d * %7.6g,',nz,dz)
46
47 x=zeros(nx,1);
48 x(1) = dx(1);
49 for i=2:nx
50 x(i)=x(i-1) + dx(i);
51 end
52 z=-dz/2:-dz:-H;
53
54 %Tanh function for cooling
55 xswitch = 2.50e3 + Lx/2.0;
56 qwidth = 0.1e3;
57 Q=0.0*rand([nx,ny]);
58 for i=1:nx
59 Q(i,:) = Q(i,:) + Qo*0.5*(tanh((Lx-x(i)-xswitch)/qwidth) + 1);
60 %Q(i,:) = Q(i,:) + Qo*0.5*(tanh((x(i)-xswitch)/qwidth) + 1);
61 end
62 fid=fopen('Qnet.forcing','w',ieee); fwrite(fid,Q,prec); fclose(fid);
63
64 % Temperature profile
65 Tref=Tz*z-mean(Tz*z);
66 [sprintf('Tref =') sprintf(' %8.6g,',Tref)]
67 %t = 0.25*rand([nx,ny,nz]);
68 t=0.01*rand([nx,ny,nz]);
69 for k=1:nz
70 t(:,:,k) = t(:,:,k) + Tref(k);
71 end
72 fid=fopen('T.init','w',ieee); fwrite(fid,t,prec); fclose(fid);
73
74 % Sloping channel
75 % tanh function for slope
76 slope=0.15
77 offset=1.5e3 + Lx/2.0;
78 dmax=-40.0;
79 h1=dmax;
80 h2=-H;
81 hdiff=(h1-h2);
82 xwidth=hdiff/(2.0*slope);
83 d=0.0*rand([nx,ny]);
84 for i=1:nx
85 for j=1:ny
86 %d(i,j) = hdiff/2*( exp((x(i)-offset)/xwidth) - exp(-(x(i)-offset)/xwidth))/ ( exp((x(i)-offset)/xwidth) + exp(-(x(i)-offset)/xwidth)) + hdiff/2 -H;
87 d(i,j) = hdiff/2*(tanh((Lx-x(i)-offset)/xwidth) + 1) - H;
88 end
89 end
90 d(1,:)=0.0;
91 fid=fopen('topog.slope','w',ieee); fwrite(fid,d,prec); fclose(fid);
92 plot(x,d(:,1))
93 fid=fopen('dx.bin','w',ieee); fwrite(fid,dx,prec); fclose(fid);
94

  ViewVC Help
Powered by ViewVC 1.1.22