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

Re: NetCDF library problems (fwd)



One other thing, what really confused me is that the following worked ok:

NetCDF::varget( $ncid, $depth_id, \( 0 ), \( 30 ), \@data ) ;

and this did not:

NetCDF::varget
( $ncid, $current_u_id, \( $i, 0, 0, 0 ), \( 1, 30, 1, 1 ), \@data ) ;

but this worked ok:

NetCDF::varget
( $ncid, $current_u_id, [ $i, 0, 0, 0 ], [ 1, 30, 1, 1 ], \@data ) ;

the inconsistency caused problems.

robb...

===============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
address@hidden             WWW: http://www.unidata.ucar.edu/
===============================================================================

---------- Forwarded message ----------
Date: Wed, 30 Jun 2004 18:05:22 -0400
From: Jason Thaxter <address@hidden>
To: Robb Kambic <address@hidden>
Subject: Re: NetCDF library problems

One quick question, as I'm wrapping up...

There are two ways I can see to get the values for a variable: one is via
recget, which is mostly what I use.

Another one is via varget. It *looks* as if I should be able to get the whole
(possibly 2-dimensional) array with varget.  And for variables that are
dimensions, I can. e.g., in the attached file, I can get the contents of lat,
lon, depth, and time. But at the first real "data" variable, current_u, I get:

ncvarget: ncid 3; varid 4: Index exceeds dimension bound

I'm not giving a dimension bound; if I were, I'd expect this function to be
called ncdimget... Am I missing something? Since the script I'm writing apes
the output of ncdump, I thought I might get somewhere by going through the
ncdump code, but in fact it calls some function vardata, which appears to step
through the binary chunks of data on its own, as opposed to using an interface
into the library such as varget.

Obviously there's something fundamental about NetCDF that I'm not getting
here, but the nice thing about intefaces is that you usually don't have to
understand the whole thing. Time to dive in, I guess.

Anyway, if you consider this a blind alley, I can show that via
NetCDF::recget, I can extract our data, but the variable made of bytes arrays
comes back with zilch. I can just strip my little demo down to that example
and send it on...

Thanks,
Jason

-- 
----------------------------------------------
Jason Thaxter
GoMOOS, P.O. Box 4919, Portland, ME 04112-4919
Office Location: 1 Canal Plaza, 7th Floor
Office: 207.773.0423
Fax:    207.773.8672
Email:  address@hidden
------------www.gomoos.org--------------------