Back to home page

MITgcm

 
 

    


Warning, /verification/solid-body.cs-32x32x1/input/rdwr_grid.m is written in an unsupported language. File is not indexed.

view on githubraw file Latest commit e41e5db8 on 2005-08-31 21:47:20 UTC
e41e5db850 Jean*0001 
                0002 nc=32; ncp=nc+1;
                0003 
                0004 inpName='tile.mitgrid';
                0005 rDir='./';
                0006 vvg=zeros(ncp,ncp,16);
                0007 
                0008 for n=1:6,
                0009 %-- read :
                0010 %- XC YC DXF DYF RA XG YG DXV DYU RAZ DXC DYC RAW RAS DXG DYG:
                0011  namV=sprintf('LONC.%3.3i.bin',n);
                0012  var=rdda(namV,[nc nc],1,'real*8','b'); vvg(1:nc,1:nc,1)=var;
                0013  namV=sprintf('LATC.%3.3i.bin',n);
                0014  var=rdda(namV,[nc nc],1,'real*8','b'); vvg(1:nc,1:nc,2)=var;
                0015  namV='DXF.bin'; 
                0016  var=rdda(namV,[nc nc],1,'real*8','b'); vvg(1:nc,1:nc,3)=var;
                0017  namV='DYF.bin';
                0018  var=rdda(namV,[nc nc],1,'real*8','b'); vvg(1:nc,1:nc,4)=var;
                0019  namV='RA.bin';
                0020  var=rdda(namV,[nc nc],1,'real*8','b'); vvg(1:nc,1:nc,5)=var;
                0021 %--
                0022  namV=sprintf('LONG.%3.3i.bin',n);
                0023  var=rdda(namV,[ncp ncp],1,'real*8','b'); vvg(:,:,6)=var;
                0024  namV=sprintf('LATG.%3.3i.bin',n);
                0025  var=rdda(namV,[ncp ncp],1,'real*8','b'); vvg(:,:,7)=var;
                0026  namV='DXV.bin';
                0027  var=rdda(namV,[ncp ncp],1,'real*8','b'); vvg(:,:,8)=var;
                0028  namV='DYU.bin';
                0029  var=rdda(namV,[ncp ncp],1,'real*8','b'); vvg(:,:,9)=var;
                0030  namV='RAZ.bin';
                0031  var=rdda(namV,[ncp ncp],1,'real*8','b'); vvg(:,:,10)=var;
                0032 %--
                0033  namV='DXC.bin';
                0034  var=rdda(namV,[ncp nc],1,'real*8','b'); vvg(:,1:nc,11)=var;
                0035  namV='DYC.bin';
                0036  var=rdda(namV,[nc ncp],1,'real*8','b'); vvg(1:nc,:,12)=var;
                0037  namV='RAW.bin';
                0038  var=rdda(namV,[ncp nc],1,'real*8','b'); vvg(:,1:nc,13)=var;
                0039  namV='RAS.bin';
                0040  var=rdda(namV,[nc ncp],1,'real*8','b'); vvg(1:nc,:,14)=var;
                0041  namV='DXG.bin';
                0042  var=rdda(namV,[nc ncp],1,'real*8','b'); vvg(1:nc,:,15)=var;
                0043  namV='DYG.bin';
                0044  var=rdda(namV,[ncp nc],1,'real*8','b'); vvg(:,1:nc,16)=var;
                0045 %- XC YC DXF DYF RA XG YG DXV DYU RAZ DXC DYC RAW RAS DXG DYG:
                0046  namF=sprintf([rDir,inpName(1:4),'%3.3i',inpName(5:end)],n);
                0047  fid=fopen(namF,'w','b');
                0048  fwrite(fid,vvg,'real*8');
                0049  fclose(fid); 
                0050  s=prod(size(vvg));
                0051  fprintf(['write: ',namF,' : size: %i (%ix%ix%i)\n'],s,ncp,ncp,s/ncp/ncp);
                0052 end