Unidata - To provide the data services, tools, and cyberinfrastructure leadership that advance Earth system science, enhance educational opportunities, and broaden participation. Unidata
         
  advanced  
 

Fortran and Attribute Strings

I've seen traffic on null-termination of strings + Fortran + netCDF, and
have read the section in the manual regarding this issue.  BUT, I thought I
understood this to mean that attribute strings would not be terminated by a
null.  

The files I am reading are written by a python-netCDF processor, and the
strings I get from attributes using the Fortran interface (netCDF version
3.4) are null terminated and the length I get back from nf_inq_attlen
includes the null.  If this is the standard, expected behavior, I can
simply look for and remove null characters any time I read an attribute
string.  I would rather, however, that something a bit lower down in the
library chain deal with this for me.  Am I missing something?

Jim
*-------------------*-------------------------------*
| Jim Secan         | Northwest Research Assoc, Inc |
| (jim@xxxxxxxx)    | 9040 S Rita Road, Suite 2214  |
| (520) 663-3570    | Tucson, Arizona 85747         |
|                   | http://www.nwra.com/          |
*-------------------*-------------------------------*

 
 
  Contact Us     Site Map     Search     Terms and Conditions     Privacy Policy     Participation Policy
 
National Science Foundation (NSF) UCAR Community Programs   Unidata is a member of the UCAR Community Programs, is managed by the University Corporation for Atmospheric Research, and is sponsored by the National Science Foundation.
P.O. Box 3000     Boulder, CO 80307-3000 USA     Tel: 303-497-8643     Fax: 303-497-8690