Re: can NCL read a HDF5 file

From: Dave Allured <dave.allured_at_nyahnyahspammersnyahnyah>
Date: Mon Feb 14 2011 - 21:52:40 MST

Mi,

I think you need to update your NCL version. I had no problem
reading this file with NCL version 5.2.1. See below.

--Dave

mac56:~/temp/hdf 26> ls -l *.nc
-rw-r--r-- 1 dallured rain 985683429 Jan 31 02:07 KK10_2k_1850_30m.nc
mac56:~/temp/hdf 27> ncdump -k KK10_2k_1850_30m.nc
netCDF-4
mac56:~/temp/hdf 28> ncl
  Copyright (C) 1995-2010 - All Rights Reserved
  University Corporation for Atmospheric Research
  NCAR Command Language Version 5.2.1
  The use of this software is governed by a License Agreement.
  See http://www.ncl.ucar.edu/ for more details.
ncl 0> f = addfile ("KK10_2k_1850_30m.nc","r")
ncl 1> printVarSummary(f)

Variable: f
(0)
filename: KK10_2k_1850_30m
path: KK10_2k_1850_30m.nc
    file global attributes:
       Conventions : COARDS, CF-1.0
       title : Crop suitability and land clearance models
       node_offset : 1
       history : Mon Jan 31 09:34:31 2011: ncks -d time,6000,7900 -v
land_use KK10_30m_8k.nc test.nc
       NCO : 20110131
    dimensions:
       time = 1901 // unlimited
       lat = 360
       lon = 720
    variables:
       short land_use ( time, lat, lon )
          long_name : Fraction of grid cell under human land use
          units : fraction
          note : values in 0.01% steps
          scale_factor : 0.0001
          add_offset : 0
          _FillValue : -32768
          missing_value : -32768
          valid_range : ( 0, 10000 )

       float lat ( lat )
          long_name : latitude
          units : degrees_north
          actual_range : ( -90, 90 )

       float lon ( lon )
          long_name : longitude
          units : degrees_east
          actual_range : ( -180, 180 )

       integer time ( time )
          long_name : time
          units : years before 1950
          calendar : standard

ncl 2> grid1 = f->land_use(0,:,:)
ncl 3> printVarSummary(grid1)

Variable: grid1
Type: short
Total Size: 518400 bytes
             259200 values
Number of Dimensions: 2
Dimensions and sizes: [lat | 360] x [lon | 720]
Coordinates:
             lat: [-89.75..89.75]
             lon: [-179.75..179.75]
Number Of Attributes: 9
   time : 2000
   long_name : Fraction of grid cell under human land use
   units : fraction
   note : values in 0.01% steps
   scale_factor : 0.0001
   add_offset : 0
   _FillValue : -32768
   missing_value : -32768
   valid_range : ( 0, 10000 )

ncl 4> print ("Min = " + min(grid1))
(0) Min = 0

ncl 5> print ("Max = " + max(grid1))
(0) Max = 9808

ncl 6> exit

On 2/14/2011 8:36 PM, 铚滀弗 wrote:
> Hi,
> I downloaded an 'nc' file from
> 'http://ecospriv4.epfl.ch/pub/KK10_2k_1850_30m.nc.gz'.
> I tried NCL "addfile", it happened to me the error like
>
> ncl 2> load "$NCARG_ROOT/lib/ncarg/nclscripts/csm/contributed.ncl"
> ncl 3> a=addfile("KK10_2k_1850_30m.nc","r")
> fatal:Can't open HDF5 attribute
> fatal:Could not open (KK10_2k_1850_30m.nc)
>
> I noticed from 'reading supported formats' that NCL can read HDF
> files, so if I missed some statements or something?
> My NCL version is 5.1.1.
> And I also tried ndump, it only worked after I added hdf5 utilities.
> Thank you!
> Best regards,
> Mi

_______________________________________________
ncl-talk mailing list
List instructions, subscriber options, unsubscribe:
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Mon Feb 14 21:52:52 2011

This archive was generated by hypermail 2.1.8 : Tue Feb 15 2011 - 09:43:19 MST