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

[netCDF #AYT-822283]: Question about nc_get_vara_double



Markus,

From the ncdump output, the declaration of TMP

  double TMP(time, lat, lon) ;

means time is the most slowly varying dimension, and lon is the most
quickly varying dimension.  So I'm not sure what you mean by:

> ... I really belive
> this depends on the time dimention; as you said, it vary faster, while I need
> it vary slower (after lat-lon).

The loop I recommended

> for(i=0; i<12; i++)
>      for(j=0; j<190; j++)
>        for (k=0; k<190; k++)
>           tempx[i*NLAT*NLON+k*NLON+j] = temperature[i*NLAT*NLON+j*NLON+k];

assumed you wanted a transposed temperature grid, but since you say
the grid should not be transposed and should have longitude varying
fastest with latitude varying next fastest, the above code won't
work.

If you don't need to transpose the temperature array, you also
shouldn't need to copy it to another array in memory, it already has
elements in the right order (the same order as the grid array).  So I
would think you could just plot the values in the tempoerature array
directly.

--Russ

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



Ticket Details
===================
Ticket ID: AYT-822283
Department: Support netCDF
Priority: Normal
Status: Closed