Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
Sorry for causing all this noise on the Internet !! Found the answer to this stupid question myself ! netCDF only supports characters. Thus it should be like this, and it is rather s urprising that ncdump produces strings for some files. In IDL the solution is to read the attribute into a the variable and then do a s tring on it. Like this : res=ncdf_attinq(fid, var_id, "title") title=string(xx_tmp) Perhaps it answers the question for somebody else !! Best regards POLCHER Jan wrote: > I have a small problem when writing STRINGs to netCDF files. This is > espacially problematic for attributes. > > When I do the following : > > title="Sea Surface" > ncdf_attput, cr_id, var_id, 'title', title, /char > > I get a strange result in the file. ON a ncdump I get the following > output : > > toto:title = 'S', 'e', 'a', ' ', 'S', 'u', 'r', 'f', 'a', 'c', 'e' > > A similar problem exists when I read an attribute from an existing > netCDF file. The IDL variable contains the ASCII numbers for the single > characters. > > To me it looks as if strings are not supported by the IDL implementation > of netCDF. Perhaps there is a not documented /string keyword ??? -- Jan Polcher TEL: -33-1-44322243 Laboratoire de Mï¿½tï¿½orologie Dynamique du CNRS FAX: -33-1-43368392 ï¿½cole Normale Supï¿½rieure 24, rue Lhomond polcher@lmd.ens.fr 75231 PARIS cedex 05, FRANCE http://www.lmd.ens.fr/~polcher/
POLCHER Jan wrote: > > Sorry for causing all this noise on the Internet !! > > Found the answer to this stupid question myself ! > > netCDF only supports characters. Thus it should be like this, and it is > rather s Or is that "only supports numerals"? > -- > Jan Polcher TEL: > -33-1-44322243 > Laboratoire de Mï¿½tï¿½orologie Dynamique du CNRS FAX: > -33-1-43368392 > ï¿½cole Normale Supï¿½rieure > 24, rue Lhomond > polcher@lmd.ens.fr > 75231 PARIS cedex 05, FRANCE > http://www.lmd.ens.fr/~polcher/ -- Andrew F. Loughe afl@cdc.noaa.gov University of Colorado, CIRES http://cdc.noaa.gov/~afl Campus Box 449 phn:(303)492-0707 fax:(303)497-7013 Boulder, CO 80309-0449 "He who laughs last thinks slowest!"