/[MITgcm]/MITgcm/utils/matlab/readmat.m
ViewVC logotype

Contents of /MITgcm/utils/matlab/readmat.m

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


Revision 1.1.2.1 - (show annotations) (download)
Thu May 1 00:01:16 2003 UTC (21 years ago) by dimitri
Branch: release1
CVS Tags: release1_p16, release1_p17, release1_p14, release1_p15
Branch point for: release1_50yr
Changes since 1.1: +36 -0 lines
release1_p14
o Added interpolation routine pkg/exf/new_interp.F for on-the-fly
  interpolation.  Enable with USE_EXF_INTERPOLATION and specify
  input grids in data.exf
o Added direct pressure solver pkg/solver.
  See pkg/solver/README.directSolver for instructions.

1 % read solver matrix
2 %--------------------
3 % input : snx,sny,npx,npy
4 % output : as2d, aw2d, cent
5 % files : aw2d*, as2d*, cent* in MITGCMUV mdsio format
6
7 nx=npx*snx;
8 ny=npy*sny;
9
10 aw2d=zeros(nx,ny);
11 as2d=zeros(nx,ny);
12 cent=zeros(nx,ny);
13 for i = 1:npx,
14 ii=(i-1)*snx;
15 xc1=ii+1:ii+snx;
16
17 for j = 1:npy,
18 jj=(j-1)*sny;
19 yc1=jj+1:jj+sny;
20
21 fname = sprintf('aw2d.%03i.%03i.data', i, j );
22 fid=fopen(fname,'r');
23 aw2d(xc1,yc1) = fread( fid, [snx,sny], 'float32' );
24 fclose(fid);
25
26 fname = sprintf('as2d.%03i.%03i.data', i, j );
27 fid=fopen(fname,'r');
28 as2d(xc1,yc1) = fread( fid, [snx,sny], 'float32' );
29 fclose(fid);
30
31 fname = sprintf('cent.%03i.%03i.data', i, j );
32 fid=fopen(fname,'r');
33 cent(xc1,yc1) = fread( fid, [snx,sny], 'float64' );
34 fclose(fid);
35 end
36 end

  ViewVC Help
Powered by ViewVC 1.1.22