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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[netCDF #OLW-364027]: [netcdfgroup] nf90_put_var treatment of scalar strings



Brian,

Attached is a small test program that I think demonstrates the bug
you have described.  When I run it linked against the current f90
library, I get:

  $ ./bug
 
   *** Testing netCDF text I/O with fill mode from Fortran 90.
   "abc   "
   "abc^@^@^@"
  STOP: 7

where I have substituted the two characters "^@" for a null byte that
actually gets printed.  Note that this is with nofill mode, so on my
platform it's padding with nulls anyway, although I expected garbage
padding instead from your description.

When I try the fixes you suggested to the nf90_put_var_text() function in
netcdf_text_variables.f90, running the code attached code for demonstrating
the bug, things seem to work OK:

  $ ./bug
 
   *** Testing netCDF text I/O with fill mode from Fortran 90.
   *** SUCCESS!

So I think this fixes the bug.  I'll check in the change and the fix will
be in the next release, as well as the current snapshot release.  I'll 
also put a note about the two-line patch in our "Known problems" web page,
in case anyone wants to just fix this problem before the next release ...

--Russ



Russ Rew                                         UCAR Unidata Program
russ@xxxxxxxxxxxxxxxx                     http://www.unidata.ucar.edu



Ticket Details
===================
Ticket ID: OLW-364027
Department: Support netCDF
Priority: Normal
Status: Closed

Attachment: bug.f90
Description: Binary data


 
 
  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