NOTICE: This version of the NSF Unidata web site (archive.unidata.ucar.edu) is no longer being updated.
Current content can be found at unidata.ucar.edu.

To learn about what's going on, see About the Archive Site.

Re: [netcdfgroup] NetCDF: Start+count exceeds dimension bound

Thanks a lot to everyone gives help. After reversing dimensions' order, the
error gone. I use fortran API, so 'start' is begin with 1, not like C from
0.

brick

On Tue, Nov 23, 2010 at 6:30 AM, Ted Mansell <Ted.Mansell@xxxxxxxx> wrote:

> The output from ncdump has the dimensions in "C" order, so in fortran you
> need to reverse the order:
>
> ALLOCATE(Reflectivity(nGate,nAzimuth)
>
> CALL nc_check ( nf90_get_var(ncid, 5, Reflectivity, start = (/ 1, 1 /),
> count = (/ nGate, nAzimuth /)) )
>
> Hope that helps.
>
> -- Ted
>
>
> On Nov 23, 2010, at 12:33 AM, brick wrote:
>
> > Hi
> >
> > When I read a nc file, there's an error: NetCDF: Start+count exceeds
> dimension bound.
> >
> > The data file is looked like:
> >
> > dimensions:
> >       Azimuth = 46 ;
> >       Gate = 1800 ;
> > variables:
> >       float Azimuth(Azimuth) ;
> >               Azimuth:Units = "Degrees" ;
> >       float BeamWidth(Azimuth) ;
> >               BeamWidth:Units = "Degrees" ;
> >       float GateWidth(Azimuth) ;
> >               GateWidth:Units = "Meters" ;
> >       float NyquistVelocity(Azimuth) ;
> >               NyquistVelocity:Units = "MetersPerSecond" ;
> >       float Reflectivity(Azimuth, Gate) ;
> >               Reflectivity:Units = "dBZ" ;
> >               Reflectivity:NumValidRuns = 25622 ;
> >
> > // global attributes:
> > ..............................
> >
> > The first four variables, dimensions and all attributes were read
> correctly. Only when read the fifth variable, Reflectivity(Azimuth, Gate),
>  the error occurred. At beginning, the code was wrote like:
> >
> > REAL   , ALLOCATABLE :: Reflectivity(:, :)
> > ALLOCATE(Reflectivity(nAzimuth, nGate), STAT = AlState)
> > CALL nc_check ( nf90_get_var(ncid, 5, Reflectivity) )
> >
> > nAzimuth, nGate are the dimensions read from data file. And then, it was
> modified as:
> >
> > CALL nc_check ( nf90_get_var(ncid, 5, Reflectivity, start = (/ 1, 1 /),
> count = (/ nAzimuth, nGate /)) )
> >
> > both of them don't work. Thanks.
> >
> > brick
> > _______________________________________________
> > netcdfgroup mailing list
> > netcdfgroup@xxxxxxxxxxxxxxxx
> > For list information or to unsubscribe,  visit:
> http://www.unidata.ucar.edu/mailing_lists/
>
>
  • 2010 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: