Re: filevarattdef - IO/API

From: Dennis Shea <shea_at_nyahnyahspammersnyahnyah>
Date: Thu, 15 Nov 2007 17:44:41 -0700

Sorry, there is not enough information.

Are you writing character variables to the netCDF file?

Just FYI

ncl 1> s = "test"
ncl 2> c = stringtochar(s)
ncl 3> print(c)

Variable: c
Type: character
Total Size: 5 bytes
             5 values
Number of Dimensions: 1
Dimensions and sizes: [5]
Coordinates:
(0) t
(1) e
(2) s
(3) t
(4) 0x00 ; NCL adds the NULL to char variables

ncl 4> nc = dimsizes( c )
ncl 5> cNew = c(0:nc-2)
ncl 6> print(cNew)

Variable: cNew
Type: character
Total Size: 4 bytes
             4 values
Number of Dimensions: 1
Dimensions and sizes: [4]
Coordinates:
(0) t
(1) e
(2) s
(3) t

Neil Davis wrote:
> I am using NCL to manipulate some files which I then want to write out
> in the IO/API netCDF format. This format has strict rules about the
> size of the attributes associated with netCDF variables. When I try to
> use the filevarattdef command to copy the files over there is an extra
> "NULL" character which gets included on the file variable's attribute
> even if I first trim it from the NCL variable's attribute. Is there a
> way which I can write a file variable's attribute that will not include
> this "NULL" character, as currently I have to trim one of the characters
> from the attribute to allow space for the "NULL"
>
> Thanks,
> Neil Davis
> _______________________________________________
> ncl-talk mailing list
> ncl-talk_at_ucar.edu
> http://mailman.ucar.edu/mailman/listinfo/ncl-talk

_______________________________________________
ncl-talk mailing list
ncl-talk_at_ucar.edu
http://mailman.ucar.edu/mailman/listinfo/ncl-talk
Received on Thu Nov 15 2007 - 17:44:41 MST

This archive was generated by hypermail 2.2.0 : Sun Nov 25 2007 - 07:21:25 MST