[MITgcm-support] Matlab for post-processing!

Dimitris Menemenlis menemenlis at sbcglobal.net
Thu Sep 13 20:03:18 EDT 2007


Van Thinh, the following:

k=15;
tmp=readbin(filename,[Nx Ny],1,'real*4',k-1);

will suffice, assuming the output is in a single, real*4, Nx * Ny * Nz, real*4, 
ieee-be, direct-access binary file.  No need for the "for" loop if you only want 
to read one slice.

What are you trying to read?

D.

-- 
Dimitris Menemenlis <menemenlis at sbcglobal.net>
5056 Oakwood Ave, La Canada, CA 91011-2450
tel/fax: 818-790-6735;   cell: 818-625-6498


> Hi Dimitris,
> 
> I did use the readbin.m script to read my results (from MITgcm's run) as your advice below. However, when I did following test, it showed the result is quite differrent in comparison with the result I got from using rdmds.m script.
> 
> When I would like to have a 2D slice [Nx Ny], for example, at level k=15, I save the data at this level, as follows:
> 
>  for k=1:Nz (or can use for k=14:15)
>    tmp=readbin(filename,[Nx Ny],1,'real*4',k-1);
>    tmp=single(tmp);
>    if k==15
>      save tmp
>    else
>      clear tmp;
>    end;
>  end;
> 
> Could you please check if I might have any mistake on doing it?
> 
> Thanks
> 
> Vth



More information about the MITgcm-support mailing list