[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[netCDF #TVR-349102]: netcdf - nf90_get_var
- Subject: [netCDF #TVR-349102]: netcdf - nf90_get_var
- Date: Fri, 16 Jun 2006 13:13:19 -0600
Tim,
> Hi Steve,
>
> Ed gave me your adress because I have got problems with hte ma -
> function of netCDF - etter: I do not understand the entries of the map
> vectro by MORE than two and three dimensions.
>
> I have to create a program for a grid environment and so I do not know,
> which order the dimensions will be of the file to process. So I have to
> create a general read - routine for all nc-Files.
>
> The data will have 4 dimensions: lon, lat, lev, time
> After interpreting the header of the file I have the size (n) and
> order(id) of all dimensions:
> lon%id, lon%n
> lat%id, lat%n
> lev%id, lev%n
> time%id, time%n
>
> or in general:
>
> dim(i)%id, dim(i)%n with i=1 to 4
>
>
> To get an idea of the usage I will give you some examples:
>
> If I understand it correctly, the entries of the count vector will
> always be the size of the dimension in the order of the file. The start
> and the stride vector will be set to const=1 -> at first I want to read
> all data.
>
>
> examlple 1:
> =========================
>
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(nlon,nlat,nlev,ntime)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/nlon, nlat, nlev, ntime /)
> ->map=(/ 1, nlon, nlon*nlat, nlon*nlat*nlev /) ????
That is correct. map(i) is the distance between adjacent in-memory locations
for the i-th dimension of the on-disk dataset.
> and now some "permutations" of the order of the dimensions in the dataset:
>
>
> example 2:
> =========================
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(nlat,nlon,nlev,ntime)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/nlat,nlon,nlev,ntime/)
> -> map=(/nlat,1, nlat*nlon, nlat*nlon*nlev/) ??????
I'm surprised that you permuted the on-disk dataset dimensions because their
sequence is usually fixed by agreement between data providers and consumers.
I assume, therefore, that the on-disk dataset dimensions are fixed and
that what you really want is the following:
example 2:
=========================
program: rh(nlat,nlon,nlev,ntime)
dataset: rh(nlon,nlat,nlev,ntime)
-> start=(/1,1,1,1/)
-> stride=(/1,1,1,1/)
-> count=(/nlon,nlat,nlev,ntime/)
-> map=(/nlat,1, nlat*nlon, nlat*nlon*nlev/)
> example 3:
> =========================
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(nlat,nlev,nlon,ntime)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/nlat,nlev,nlon,ntime/)
> -> map=(/ /) ??????
Again, you probably mean
example 3:
=========================
program: rh(nlat,nlev,nlon,ntime)
dataset: rh(nlon,nlat,nlev,ntime)
-> start=(/1,1,1,1/)
-> stride=(/1,1,1,1/)
-> count=(/nlat,nlat,nlev,ntime/)
-> map=(/nlat*nlev,1,nlat,nlat*nlev*nlon/)
> example 4:
> =========================
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(ntime,nlat,nlev,nlon)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/ntime,nlat,nlev,nlon/)
> -> map=(//) ??????
Similarly
example 4:
=========================
program: rh(ntime,nlat,nlev,nlon)
dataset: rh(nlon,nlat,nlev,ntime)
-> start=(/1,1,1,1/)
-> stride=(/1,1,1,1/)
-> count=(/nlon,nlat,nlev,ntime/)
-> map=(/ntime*nlat*nlev,ntime,ntime*nlat,1/)
> example 5:
> =========================
> I want to read all data to timestep itime:
Sorry, but I don't know what you mean by the above given that the
following has "ntime" in the "count" vector. If you only want one
time, then the count vector should have had 1 in the time dimension.
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(nlon,nlat,nlev,ntime)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/nlon,nlat,nlev,ntime/)
> -> map=(//) ??????
If you only want one time, then the above should be
program: rh(nlon,nlat,nlev,ntime)
dataset: rh(nlon,nlat,nlev,ntime)
-> start=(/1,1,1,1/)
-> stride=(/1,1,1,1/)
-> count=(/nlon,nlat,nlev,1/)
-> map=(/1,nlon,nlon*nlat,nlon*nlat*nlev/)
> example 6:
> =========================
> I want to read all data to timestep itime:
> program: rh(nlon,nlat,nlev,ntime)
> dataset: rh(nlev,nlat,nlon,ntime)
> -> start=(/1,1,1,1/)
> -> stride=(/1,1,1,1/)
> -> count=(/nlev,nlat,nlon,ntime/)
> -> map=(//) ??????
Assuming, again, that you only want one time and that the dataset
dimensions are fixed, then the above should be
example 6:
=========================
I want to read all data to timestep itime:
program: rh(nlon,nlat,nlev,ntime)
dataset: rh(nlev,nlat,nlon,ntime)
-> start=(/1,1,1,1/)
-> stride=(/1,1,1,1/)
-> count=(/nlev,nlat,nlon,ntime/)
-> map=(/nlon*nlat,nlon,1,nlon*nlat*nlev/)
>
>
> Thanks for your help and greetings from Cologne,
> Tim
>
>
> --
>
> Dipl. Met. Tim Bruecher address@hidden
> Institute of Geophysics and Meteorology Tel.: +49/(0)221/470 - 3689
> University of Cologne Fax: +49/(0)221/470 - 5161
> 50923 Cologne
> Germany http://www.meteo.uni-koeln.de/meteo.php?show=De_In_Pr_256_0
Regards,
Steve Emmerson
Ticket Details
===================
Ticket ID: TVR-349102
Department: Support netCDF
Priority: Critical
Status: Closed