[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
address@hidden                     http://www.unidata.ucar.edu



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

Attachment: bug.f90
Description: Binary data