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

Yi-Chih Huang dscpln at gmail.com
Tue Aug 15 17:32:02 MDT 2017


David,

     I am working on Version 6.1.2.  I created one variable to output in my
NCL script instead of the fn file.  Thus, I commented all the fn and fi
below for consistency.  I got the error message "NclFileAddGrp: Old File
Structure DO NOT Support Group" over and over again and wonder how to fix
this error?

    Thanks,

                    Yi-Chih

; fn = "/Users/huangwei/myncl/nc4_work/wrtgroup/nc4uvt.nc"

; fi = addfile(fn, "r")

;  fAtt at source_file   = fn

; time = fi->time
; lev = fi->lev
; lat = fi->lat
; lon = fi->lon

; t = fi->T
; u = fi->U
; v = fi->V


On Wed, Aug 16, 2017 at 3:09 AM, David Brown <dbrown at ucar.edu> wrote:

> 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
> >
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170816/d95310f5/attachment.html 


More information about the ncl-talk mailing list