Warning, /verification/global_ocean.cs32x15/input/rdwr_grid.m is written in an unsupported language. File is not indexed.
view on githubraw file Latest commit 2b076403 on 2005-07-15 16:33:41 UTC
2b07640372 Jean*0001
0002 nc=32; ncp=nc+1;
0003
0004 outpName='grid_cs32';
0005 inpName='tile.mitgrid';
0006
0007 %- load angle Cos & Sin:
0008 angFil=['proj_cs',int2str(nc),'_2uEvN.bin'];
0009 anCs=rdda(angFil,[nc 6 nc],1,'real*8','b');
0010 anSn=rdda(angFil,[nc 6 nc],2,'real*8','b');
0011 anCs=permute(anCs,[1 3 2]);
0012 anSn=permute(anSn,[1 3 2]);
0013
0014 for n=1:6,
0015 %-- read :
0016 namF=sprintf([inpName(1:4),'%3.3i',inpName(5:end)],n);
0017 fid=fopen(namF,'r','b');
0018 var=fread(fid,'real*8');
0019 fclose(fid);
0020 s=size(var,1);
0021 fprintf(['read: ',namF,' : size: %i (%ix%ix%i)\n'],s,ncp,ncp,s/ncp/ncp);
0022 k=s/ncp/ncp;
0023 var=reshape(var,[ncp ncp k]);
0024 %-- Add angle:
0025 vv2=zeros(ncp,ncp,k+2); vv2(:,:,[1:k])=var;
0026 vv2([1:nc],[1:nc],k+1)=anCs(:,:,n);
0027 vv2([1:nc],[1:nc],k+2)=anSn(:,:,n);
0028 %-- write:
0029 namW=sprintf([outpName,'.face%3.3i.bin'],n);
0030 fid=fopen(namW,'w','b');
0031 fwrite(fid,vv2,'real*8');
0032 fclose(fid);
0033 fprintf([' write to file: ',namW,' %i 2D.var(%ix%i)\n'],k+2,ncp,ncp);
0034 end
0035
0036