Re: [netcdfgroup] The netCDF format flavor generated by ncgen

  • To: Gabriel Mateescu <gabriel@xxxxxxxxxx>
  • Subject: Re: [netcdfgroup] The netCDF format flavor generated by ncgen
  • From: Ed Hartnett <ed@xxxxxxxxxxxxxxxx>
  • Date: Tue, 22 Dec 2009 06:12:52 -0700
Gabriel Mateescu <gabriel@xxxxxxxxxx> writes:

> Hi,
>
> Many thanks to Russ and David Pierce for the tips.
>
> With ncgen I generated a netcdf-4 classic and
> a netcdf-4 file by using the command line options
> -k "netCDF-4 classic model" and -k "netCDF-4",
> respectively.
>
> The nc files generated this way have the expected format:
>
>    $ ncdump -k sample4.nc
>    netCDF-4
>
>    $ ncdump -k sample4-classic.nc
>    netCDF-4 classic model
>
> and differ in length by 13 bytes:
>
>      $ ls -l sample4*nc
>     -rw-r--r-- 1 gabriel users 15695 Dec 21 17:29 sample4-classic.nc
>     -rw-r--r-- 1 gabriel users 15708 Dec 21 16:44 sample4.nc
>
> which is exactly the length of the string "classic model".  So I
> checked if the difference in the files comes only from meta-data
>
>    $ od -c sample4.nc | more                       
>    0000000 211   H   D   F  \r  \n 032  \n 002  \b  \b  \0  
> \0  \0  \0  \0
>    0000020  \0  \0  \0  \0 377 377 377 377 377 377 377 377   \   = 
>  \0  \0
>    0000040  \0  \0  \0  \0   0  \0  \0  \0  \0  \0  \0  \0 332 
> 323   H   *
>    ...
>
>    $ od -c sample4-classic.nc | more                    
>                  
>    0000000 211   H   D   F  \r  \n 032  \n 002  \b  \b  \0  
> \0  \0  \0  \0
>    0000020  \0  \0  \0  \0 377 377 377 377 377 377 377 377   O   = 
>  \0  \0
>    0000040  \0  \0  \0  \0   0  \0  \0  \0  \0  \0  \0  \0   
> I 263   j   }
>    ...
>
> The dump seems to indicate that the data in netCDF-4 is
> different from that in neCDF-4 classic, even though I have
> not used any "new" API features (these files are obtained from
> a cdl file with ncgen). Or am I interpreting incorrectly the output
> from "od" ?
>
> Thank you.
> Gabriel
>

The only difference between netCDF-4 classic model and netCDF-4 is the
extra attribute, marking it as classic model.

The data should be the same.

Use ncdump to check it.

Thanks,

Ed
-- 
Ed Hartnett  -- ed@xxxxxxxxxxxxxxxx
  • 2009 messages navigation, sorted by:
    1. Thread
    2. Subject
    3. Author
    4. Date
    5. ↑ Table Of Contents
  • Search the netcdfgroup archives: