[ncl-talk] write out in HDF5 format by NCL
Yi-Chih Huang
dscpln at gmail.com
Sat Aug 12 03:10:54 MDT 2017
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)
..............
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20170812/36506e0a/attachment.html
More information about the ncl-talk
mailing list