[MITgcm-support] Matlab for post-processing!

Van Thinh Nguyen vtnguyen at moisie2.math.uwaterloo.ca
Thu Sep 13 20:49:07 EDT 2007


Hi Dimitris,

I already knew how come the error, because my output data is not in 
single, so when I used 'real*8', I got the correct slice what I want.

Thannks a lot!

Vth

---------------------------------------------------

On Thu, 13 Sep 2007, Dimitris Menemenlis wrote:

> 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
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support
>



More information about the MITgcm-support mailing list