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

Re: 20050817: Question about 'ncvgt'

This archive contains answers to questions sent to Unidata support through mid-2025. Note that the archive is no longer being updated. We provide the archive for reference; many of the answers presented here remain technically correct, even if somewhat outdated. For the most up-to-date information on the use of NSF Unidata software and data services, please consult the Software Documentation first.


  • Subject: Re: 20050817: Question about 'ncvgt'
  • Date: Sun, 21 Aug 2005 08:13:53 -0600

Unidata Support <address@hidden> writes:

> ------- Forwarded Message
>
>>To: address@hidden
>>From: Hui Du <address@hidden>
>>Subject: Question about 'ncvgt'
>>Organization: UC Davis
>>Keywords: 200508172351.j7HNpTjo016472 netCDF Fortran
>
> Dear Sir/Mam:
>   I am using netcdf in fortran to read some data out from the netcdf 
> file.  In my netcdf file, my data type is short.  So in my fortran 
> program, I set the 'integer' type and use the function 'ncvgt' to read 
> the data I want.
>   I do  not know why the output is much much biger than the real values. 
> In other words, I can not output the correct data.
> Can you give me some hint?
>   Thanks a lot
>

What makes you think the program is not working?

You can read short data (2-byte) as integer data (4-byte), and you
will double the size of your data, but that's OK. Is this what you are
seeing?

If you do an ncdump on the file, do you see the data you expect?

Have you used ncgen to create a fortran program to read this file? Try
that, and compare it to your program.

If none of this helps, you need to send some more information.

Good luck!

Ed
-- 
Ed Hartnett  -- address@hidden