[ncl-talk] write ubyte data to NetCDF file

Tang, Qi tang30 at llnl.gov
Thu Sep 22 18:05:22 MDT 2016


Hello,

I need to write some data of ubyte type (unsigned 1 bit integer) to a NetCDF file.

But I got an error saying the ubyte type is not supported by the NetCDF format. I checked and found both NCL and NetCDF support ubyte. I am using v6.1.2.

Does anyone know a solution? The small example below shows the error:
ncl 0> f=addfile("tst.nc","c")
ncl 1> a=23B
ncl 2> f->a=a
fatal:["NclFile.c":474]:FileAddVar: an error occurred while adding a variable to a file, check to make sure data type is supported by the output format
fatal:["Execute.c":8126]:Execute: Error occurred at or near line 2

ncl 3> print(a)


Variable: a
Type: ubyte
Total Size: 1 bytes
            1 values
Number of Dimensions: 1
Dimensions and sizes:   [1]
Coordinates:
(0)     23

Thanks,
--
Qi Tang
Research Scientist
Atmospheric, Earth and Energy Division
Lawrence Livermore National Laboratory
7000 East Ave L-103, Livermore, CA 94550
+1 (925) 423-3514
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mailman.ucar.edu/pipermail/ncl-talk/attachments/20160923/569d7e9a/attachment.html 


More information about the ncl-talk mailing list