Back to home page

MITgcm

 
 

    


Warning, /verification/matrix_example/input/from_31x31_to_32x32.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit fb7b6e1c on 2011-08-25 22:36:38 UTC
fb7b6e1c49 Jean*0001 
                0002 %- To allow to split the domain in several tiles, change the domain size
                0003 %  from 31x31 to 32x32 by adding 1 row (on Southern side) + 1 column (on
                0004 %  Western side) of land points.
                0005 
                0006 %- read old input files (31x31) and write new ones:
                0007 nx1=31; ny1=31;
                0008 nx2=1+nx1;
                0009 ny2=1+ny1;
                0010 prec='real*4';
                0011 
                0012 fnam1='topog.box';
                0013 fnam2='topo_box.bin';
                0014 fprintf('converting %s to %s ...',fnam1,fnam2)
                0015 vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
                0016 vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
                0017 fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
                0018 fprintf(' done\n');
                0019 %figure(1);clf; imagesc(vv2');set(gca,'YDir','normal');colorbar
                0020 
                0021 fnam1='windx.cos_y';
                0022 fnam2='taux_cosY.bin';
                0023 fprintf('converting %s to %s ...',fnam1,fnam2)
                0024 vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
                0025 vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
                0026 fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
                0027 fprintf(' done\n');
                0028 
                0029 fnam1='trinit1';
                0030 fnam2='tr1_ini.bin';
                0031 fprintf('converting %s to %s ...',fnam1,fnam2)
                0032 vv1=rdda(fnam1,[nx1 ny1],1,prec,'b');
                0033 vv2=zeros(nx2,ny2); vv2(2:nx2,2:ny2)=vv1;
                0034 fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
                0035 fprintf(' done\n');
                0036 
                0037 prec='real*8';
                0038 fnam1='pickup'; it=200000;
                0039 fnam2='pickup.32x32.data';
                0040 fprintf('converting %s to %s ...',fnam1,fnam2)
                0041 vv1=rdmds(fnam1,it); n3d=size(vv1,3);
                0042 vv2=zeros(nx2,ny2,n3d); vv2(2:nx2,2:ny2,:)=vv1;
                0043 fid=fopen(fnam2,'w','b'); fwrite(fid,vv2,prec); fclose(fid);
                0044 fprintf(' done\n');
                0045