[ncl-talk] write out in HDF5 format by NCL

David Brown dbrown at ucar.edu
Tue Aug 15 13:09:34 MDT 2017


Hi Yi-Chih,

I tried running the script you pointed to using NCL 6.4.0 and there
were no errors. I am not sure what you mean
by "commented the three lines below". Which lines specifically are you
referring to? Also which version of NCL are you running?
 -dave


On Sat, Aug 12, 2017 at 3:10 AM, Yi-Chih Huang <dscpln at gmail.com> wrote:
> Hello,
>
>     I am trying to write out one variable in HDF5 format in an NCL script
> following the commands on the web page
> https://www.ncl.ucar.edu/Applications/hdf5.shtml.  Because the output data
> are calculated in the NCL script, I commented the three lines below.
> However, I got the error message "NclFileAddGrp: Old File Structure DO NOT
> Support Group." as follows.  Could anyone indicate how to fix this error?
>
>     Thanks much,
>
>                    Yi-Chih
>
>
> fatal:["FileSupport.c":1638]:_NclFileAddGrp: Old File Structure DO NOT
> Support Group.
> ^Mfatal:["FileSupport.c":1638]:_NclFileAddGrp: Old File Structure DO NOT
> Support Group.
> ^Mfatal:["FileSupport.c":1638]:_NclFileAddGrp: Old File Structure DO NOT
> Support Group.
> ^Mfatal:["Execute.c":8128]:Execute: Error occurred at or near line 340 in
> file q_ln-ln_pre_q01.ncl
>
> ##########################################
> ; fn = "/Users/huangwei/myncl/nc4_work/wrtgroup/nc4uvt.nc"
>
> ; fi = addfile(fn, "r")
>
> ;  fAtt at source_file   = fn
>
> ##########################################     as on the web page
> https://www.ncl.ucar.edu/Applications/hdf5.shtml
>
> 	Write HDF5 file with group:
>
>  setfileoption("nc", "FileStructure", "Advanced")
>
>  fn = "/Users/huangwei/myncl/nc4_work/wrtgroup/nc4uvt.nc"
>
>  fi = addfile(fn, "r")
>
> ;printVarSummary(fi)
> ;print(fi)
>
>  time = fi->time
>  lev = fi->lev
>  lat = fi->lat
>  lon = fi->lon
>
>  t = fi->T
>  u = fi->U
>  v = fi->V
>
> ;printVarSummary(t)
> ;printVarSummary(u)
> ;printVarSummary(v)
>
> ;print("t(0,0,0,0) = " + t(0,0,0,0))
> ;print("u(0,1,1,1) = " + u(0,1,1,1))
> ;print("v(0,2,2,2) = " + v(0,2,2,2))
>
> ;print("t&lat(0) = " + t&lat(0))
> ;print("t at units = " + t at units)
> ;print("u at units = " + u at units)
> ;print("v at units = " + v at units)
>
> ;u1 = fi->U(::2)
> ;v1 = fi->V(3:121:3)
>
>  ntim  = dimsizes(time)	; get dimension sizes
>  nlev  = dimsizes(lev)
>  nlat  = dimsizes(lat)
>  nlon  = dimsizes(lon)
>
> ;------------------------------------------------------------
>  setfileoption("h5", "FileStructure", "Advanced")
>
>  fon = "ncl_wrt_uvt.h5"
>  system("/bin/rm -f " + fon) ; remove if exists
>  fo = addfile(fon, "c")
>
> ;===================================================================
> ; explicitly declare file definition mode. Improve efficiency.
> ;===================================================================
> ;setfileoption(fo,"CompressionLevel", 6)
> ;setfileoption(fo,"CacheSize", 3200000)
> ;setfileoption(fo,"CacheNelems", 1027)
> ;setfileoption(fo,"CachePreemption", 0.25)
>
> ..............
>
>
> _______________________________________________
> ncl-talk mailing list
> ncl-talk at ucar.edu
> List instructions, subscriber options, unsubscribe:
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk
>


More information about the ncl-talk mailing list