/[MITgcm]/MITgcm_contrib/timour_matlab/mscripts/getdonut.m
ViewVC logotype

Contents of /MITgcm_contrib/timour_matlab/mscripts/getdonut.m

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


Revision 1.1 - (show annotations) (download)
Wed Sep 3 21:22:22 2003 UTC (21 years, 10 months ago) by edhill
Branch: MAIN
CVS Tags: HEAD
initial checkin of Timour's MatLAB scripts

1 global Nx Ny Nz
2 global dx dy lat long
3 global dz depth
4 global delt iteration it
5 global descriptor
6 global this_path
7 global g Cp rho_bar alpha
8 global f0 B0 Q0 beta r_heat r_expt H
9 global u v w t
10
11 param_file_name = 'datadonut';
12 feval(param_file_name) ;
13
14 iteration
15
16 it = input(' Please enter iteration : ')
17
18 path = this_path
19 eval(['cd ' path '/it',int2str(it)]);
20 path=pwd
21
22 fprintf(1,' Reading output ... \n') ;
23
24 tfn='theta.sun.b';
25 ufn='u.sun.b';
26 vfn='v.sun.b';
27
28 % T (m/s)
29 t=Readmodel(tfn,[Nx Ny Nz],'float32');
30 t=Extract([3 Nx Ny Nz t(5:4+Nx*Ny*Nz)],[1 Nx 1 Ny 1 Nz]);
31 t=reshape(t,Nx,Ny,Nz);
32
33 % U (m/s)
34 u=Readmodel(ufn,[Nx Ny Nz],'float32');
35 u=Extract([3 Nx Ny Nz u(5:4+Nx*Ny*Nz)],[1 Nx 1 Ny 1 Nz]);
36 u=reshape(u,Nx,Ny,Nz);
37
38 % V (m/s)
39 v=Readmodel(vfn,[Nx Ny Nz],'float32');
40 v=Extract([3 Nx Ny Nz v(5:4+Nx*Ny*Nz)],[1 Nx 1 Ny 1 Nz]);
41 v=reshape(v,Nx,Ny,Nz);
42
43 % W (m/s)
44
45 w=zeros(Nx,Ny,Nz+1);
46
47 for k=Nz:-1:1,
48 w(1:Nx-1,1:Ny-1,k)= w(1:Nx-1,1:Ny-1,k+1)...
49 -u(2:Nx,1:Ny-1,k)*dz(k)/dx +u(1:Nx-1,1:Ny-1,k)*dz(k)/dx ...
50 -v(1:Nx-1,2:Ny,k)*dz(k)/dy +v(1:Nx-1,1:Ny-1,k)*dz(k)/dy ;
51 end
52
53 return

  ViewVC Help
Powered by ViewVC 1.1.22