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

Contents of /MITgcm/utils/matlab/store.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: +48 -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 % invert S matrix and write it in MITGCMUV mdsio format
2 %------------------------------------------------------
3 % input : sumij,npx,npy,ninterf
4 % output : files
5
6 % MITGCMUV has a funny distribution for 2x2=4 processors it is:
7 %
8 % 1 3
9 % 0 2
10 %
11 % Thus, we have to permute the npx and npy dimension
12 % write negative because we have used (-A) internally
13
14 %old ok
15 %sumij = full(sumij);
16 %sumij = -permute(reshape(inv(sumij),ninterf,npx,npy,ninterf,npx,npy),[1,3,2,4,5,6]);
17
18 sumij = full(sumij\eye(size(sumij)));
19 sumij = -permute(reshape(sumij,ninterf,npx,npy,ninterf,npx,npy),[1,3,2,4,5,6]);
20
21 ndims = 1;
22 dimList = [32768, 1,16384];
23 format = 'float64';
24 sformat = '''float64''';
25 nrecords = 1;
26 timeStepNumber = 0;
27
28 for i = 1:npx,
29 for j = 1:npy,
30 fname = sprintf('ss_matrix.%03i.%03i.data', i, j );
31 fid = fopen(fname,'w');
32 fwrite( fid, sumij(:,:,:,:,i,j), format );
33 fclose(fid);
34 fname = sprintf('ss_matrix.%03i.%03i.meta', i, j );
35 fid = fopen(fname,'w');
36 fprintf(fid, ' nDims = [ %3i ];\n', ndims);
37 fprintf(fid, ' dimList = [\n');
38 fprintf(fid, ' dimList = [\n');
39 fprintf(fid, ' ');
40 fprintf(fid, '%5i,', dimList);
41 fprintf(fid, '\n ]\n');
42 fprintf(fid, 'format = [ %s ];\n', sformat);
43 fprintf(fid, ' nrecords = [ %5i ];\n', nrecords);
44 fprintf(fid, ' timeStepNumber = [ %8i ];\n', timeStepNumber);
45 fclose(fid);
46 end
47 end
48 %clear sumij;

  ViewVC Help
Powered by ViewVC 1.1.22