[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Read some elements of an array with NetCDF



Stéphane,

In rereading my reply to your question, I think I misunderstood what
you asked.  Now I can see you were using

>       status = NF_GET_VAR_DOUBLE(IdFichier,4,Val) 

to read the whole array, but

>       status = NF_GET_VARM_DOUBLE(IdFichier,4,start,count,stride,imap,Val)

to read a few elements of the array.  I was confused, because it's
also possible to use NF_GET_VARM_DOUBLE() to read all the elements of
an array also.

using the VARM function will still be more efficient than using the
VAR function if the array is large enough and you only want a few
values, but the VARM function will still have to read through much of
the array, because it's just implemented by loops that read single
values of the array, each of which will either read a disk block or a
cached value.  The VARM function doesn't use any efficiencies that
will improve over what you do do yourself with reading single values.

--Russ


_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden                     http://www.unidata.ucar.edu