Re: Support: NetCDF/Perl interface question

NOTE: The decoders mailing list is no longer active. The list archives are made available for historical reasons.

On Mon, 10 Apr 2006, Steve Diggs wrote:

> Dear NetCDF Support Team,
>
> Sorry for the direct email, but I'm getting desperate.  I'm using the
> NetCDF/Perl interface and (in the simplest case) I'm writing out
> temperature data that should be dimensioned:
>
>       temperature(time,pressure,lat,lon)

Steve,

i modified your netcdf_test.pl program so it produces the results that you
wanted and attached it. the problem was that the dimensions were not
set correctly for the temperature variable and the data writing start
and count wasn't correct. the syntax in netcdf-perl can get confusing so
it's easy to have these type of problems.  also attached is another perl
script netcdfperl.example  that deals with char data that may be usefull.
you might want to consider using the netcdf-java package for your
programs because the netcdf-perl package will be sunsetted in the future
because of it's prone to coding errors.

robb...


>
> But I can only figure out how to use NetCDF::varput such that
> 'temperature' in only dependent on 'pressure':
>
>       temperature(pressure)
>
> This, obviously, is not compatible with the CF/COARDS conventions and I
> can't find enough documentation on the NetCDF/Perl interface to do what
> I really *need* to do.  I get a 'Bus Error' each time I try to mess
> with the start and count arrays.  I think that's where I'm not
> understanding what needs to be done.  Do they need to be
> multi-dimensional?  If so, how should they be structured and passed to
> 'varput'?
>
> To make it easier to uderstand where I'm having trouble, I wrote and
> attached a piece of code, that will (under Linux/Unix) produce a sample
> file which does what I >can< do.
>
> If possible, could the person(s) there in the know, make the necessary
> well-documented modifications to this short piece of code, such that
> the output file writes temperature like this:
>
>       temperature(time,pressure,lat,lon)
>
> If you'd  do this, I'll post it to the NetCDF list for other dense
> people like myself to follow.  This must be very trivial for you folks
> (I hope).
>
> Thanks so much,
> -Steve Diggs
> --
> Stephen C. Diggs
> Southwest Fisheries Science Center / FRD
> 8604 La Jolla Shores Drive
> La Jolla, California, USA 92037
> +1.858.546.7083
>

==============================================================================
Robb Kambic                                Unidata Program Center
Software Engineer III                      Univ. Corp for Atmospheric Research
rkambic@xxxxxxxxxxxxxxxx                   WWW: http://www.unidata.ucar.edu/
==============================================================================
  • 2006 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the decoders archives: