[MITgcm-support] rdmds.m: how to read a given field in a multi-field file?

Alastair McKinstry alastair.mckinstry at nuigalway.ie
Sun Mar 13 16:37:06 EDT 2011


On 2011-03-13 19:31, Klymak Jody wrote:
>
> On 2011-03-13, at 3:55 AM, Alastair McKinstry wrote:
>> I can do:
>>
>>     octave:2> [AA,ITER,MM] = rdmds('surfDiag',NaN);
>>     Reading 7 time levels: 20 40 60 80 100 120 140
>>     octave:3> MM
>>     MM =  nDims = [ 2 ]; dimList = [ 192 32 ]; dataprec = [ 'float64'
>>     ]; nrecords = [ 3 ]; timeStepNumber = [ 20 40 60 80 100 120 140
>>     ]; timeInterval = [ 0.000000000000E+00 1.200000000000E+04 ;
>>     1.200000000000E+04 2.400000000000E+04 ; 2.400000000000E+04
>>     3.600000000000E+04 ; 3.600000000000E+04 4.800000000000E+04 ;
>>     4.800000000000E+04 6.000000000000E+04 ; 6.000000000000E+04
>>     7.200000000000E+04 ; 7.200000000000E+04 8.400000000000E+04 ];
>>     nFlds = [ 3 ]; fldList = { 'ETAN    ' 'ETANSQ  ' 'DETADT2 ' };
>>
>> but
>>
>>     octave:4> size(AA)
>>     ans =
>>
>>        192    32     3     7
>>
>
>
> Looks like
> EtaNsq = squeeze(AA(:,:,2,i));
>
> will give you what you want, assuming octave has "squeeze".
>
> Cheers,  Jody
>
I think I gave a bad example, as the above has both 3 records and 3 fields.
A better example is:

octave:1> [AA,ITER,MM]=rdmds('pickup.ckptA');
octave:2> MM
MM =  nDims = [ 2 ]; dimList = [ 192 32 ]; dataprec = [ 'float64' ]; 
nrecords = [ 43 ]; timeStepNumber = [ 144 ]; timeInterval = [ 
8.640000000000E+04 ]; nFlds = [ 11 ]; fldList = { 'Uvel    ' 'Vvel    ' 
'Theta   ' 'Salt    ' 'GuNm1   ' 'GvNm1   ' 'GtNm1   ' 'GsNm1   ' 
'EtaN    ' 'dEtaHdt ' 'EtaH    ' };
octave:3> ITER
ITER = -1
octave:4> size(AA)
ans =

    192    32    43


This has 43 records but 11 fields. I think the squeeze example above 
works to pick out the records, but not the fields.

> -- 
>> Alastair McKinstry,<alastair.mckinstry at nuigalway.ie>
>> Centre for Astronomy, National University of Ireland,Galway
>> _______________________________________________
>> MITgcm-support mailing list
>> MITgcm-support at mitgcm.org <mailto:MITgcm-support at mitgcm.org>
>> http://mitgcm.org/mailman/listinfo/mitgcm-support
>
>
> _______________________________________________
> MITgcm-support mailing list
> MITgcm-support at mitgcm.org
> http://mitgcm.org/mailman/listinfo/mitgcm-support

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mitgcm.org/pipermail/mitgcm-support/attachments/20110313/8b6b1c03/attachment.htm>


More information about the MITgcm-support mailing list