/[MITgcm]/MITgcm/verification/matrix_example/input/from_31x31_to_32x32.m
ViewVC logotype

Annotation of /MITgcm/verification/matrix_example/input/from_31x31_to_32x32.m

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


Revision 1.1 - (hide annotations) (download)
Thu Aug 25 22:36:38 2011 UTC (12 years, 8 months ago) by jmc
Branch: MAIN
CVS Tags: checkpoint64y, checkpoint64x, checkpoint64z, checkpoint64q, checkpoint64p, checkpoint64s, checkpoint64r, checkpoint64u, checkpoint64t, checkpoint64w, checkpoint64v, checkpoint64i, checkpoint64h, checkpoint64k, checkpoint64j, checkpoint64m, checkpoint64l, checkpoint64o, checkpoint64n, checkpoint64a, checkpoint64c, checkpoint64b, checkpoint64e, checkpoint64d, checkpoint64g, checkpoint64f, checkpoint63p, checkpoint63q, checkpoint63r, checkpoint63s, checkpoint63l, checkpoint63m, checkpoint63n, checkpoint63o, checkpoint63h, checkpoint63i, checkpoint63j, checkpoint63k, checkpoint63d, checkpoint63e, checkpoint63f, checkpoint63g, checkpoint63b, checkpoint63c, checkpoint64, checkpoint65, checkpoint66g, checkpoint66f, checkpoint66e, checkpoint66d, checkpoint66c, checkpoint66b, checkpoint66a, checkpoint66o, checkpoint66n, checkpoint66m, checkpoint66l, checkpoint66k, checkpoint66j, checkpoint66i, checkpoint66h, checkpoint65z, checkpoint65x, checkpoint65y, checkpoint65r, checkpoint65s, checkpoint65p, checkpoint65q, checkpoint65v, checkpoint65w, checkpoint65t, checkpoint65u, checkpoint65j, checkpoint65k, checkpoint65h, checkpoint65i, checkpoint65n, checkpoint65o, checkpoint65l, checkpoint65m, checkpoint65b, checkpoint65c, checkpoint65a, checkpoint65f, checkpoint65g, checkpoint65d, checkpoint65e, HEAD
add a matlab script to do the conversion 31x31 --> 32x32
(adding 1 row (on Southern side) + 1 column (on Western side) of land points)

1 jmc 1.1
2     %- To allow to split the domain in several tiles, change the domain size
3     % from 31x31 to 32x32 by adding 1 row (on Southern side) + 1 column (on
4     % Western side) of land points.
5    
6     %- read old input files (31x31) and write new ones:
7     nx1=31; ny1=31;
8     nx2=1+nx1;
9     ny2=1+ny1;
10     prec='real*4';
11    
12     fnam1='topog.box';
13     fnam2='topo_box.bin';
14     fprintf('converting %s to %s ...',fnam1,fnam2)
15     vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
16     vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
17     fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
18     fprintf(' done\n');
19     %figure(1);clf; imagesc(vv2');set(gca,'YDir','normal');colorbar
20    
21     fnam1='windx.cos_y';
22     fnam2='taux_cosY.bin';
23     fprintf('converting %s to %s ...',fnam1,fnam2)
24     vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
25     vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
26     fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
27     fprintf(' done\n');
28    
29     fnam1='trinit1';
30     fnam2='tr1_ini.bin';
31     fprintf('converting %s to %s ...',fnam1,fnam2)
32     vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
33     vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
34     fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
35     fprintf(' done\n');
36    
37     prec='real*8';
38     fnam1='pickup'; it=200000;
39     fnam2='pickup.32x32.data';
40     fprintf('converting %s to %s ...',fnam1,fnam2)
41     vv1=rdmds(fnam1,it); n3d=size(vv1,3);
42     vv2=zeros(nx2,ny2,n3d); vv2(2:nx2,2:ny2,:)=vv1;
43     fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
44     fprintf(' done\n');
45    

  ViewVC Help
Powered by ViewVC 1.1.22