nfmpi_put_var_char expected behavior?

Wei-keng Liao wkliao at ece.northwestern.edu
Wed Aug 1 20:58:17 CDT 2012


Hi, Jim

NetCDF's default for fill mode is NC_FILL and the default fill value for char type
is NC_FILL_CHAR == (char)0. See netCDF user guide below.
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.html#nc_005fset_005ffill
http://www.unidata.ucar.edu/software/netcdf/docs/netcdf-c.html#Fill-Values

In PnetCDF, only NC_NOFILL is implemented. So, for those spaces that were not
written by the application, their contents are undefined.


Wei-keng

On Aug 1, 2012, at 11:27 AM, Jim Edwards wrote:

> If I declare a character string variable with a length x and then write a string of length y<x using nfmpi_put_var_char 
> what is the expected behavior?     I think that what I am getting is incorrect (a bunch of garbage in the string from y:x )
> 
> So for example I want to write string './none/foo.009.nc' into a variable of length 80.    In the file I am getting:
> 
> './none/foo.009.nc 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0'
> 
> 
> I think that this is a bug.   
> 
> 
> This is happening with the latest pnetcdf svn trunk code on jaguarpf compiled using:
> 
> Currently Loaded Modulefiles:
>   1) modules/3.2.6.6                      10) xpmem/0.1-2.0400.31280.3.1.gem       19) DefApps
>   2) xtpe-network-gemini                  11) xe-sysroot/4.0.46                    20) altd/1.0
>   3) pgi/12.5.0                           12) xt-asyncpe/5.11                      21) subversion/1.6.17
>   4) xt-libsci/11.1.00                    13) atp/1.4.1                            22) szip/2.1
>   5) udreg/2.3.2-1.0400.5038.0.0.gem      14) PrgEnv-pgi/4.0.46                    23) hdf5/1.8.7
>   6) ugni/2.3-1.0400.4374.4.88.gem        15) xt-mpich2/5.5.0                      24) netcdf/4.1.3
>   7) pmi/3.0.0-1.0000.8661.28.2807.gem    16) xtpe-interlagos                      25) esmf/5.2.0rp1
>   8) dmapp/3.2.1-1.0400.4782.3.1.gem      17) eswrap/1.0.9
>   9) gni-headers/2.1-1.0400.4351.3.1.gem  18) lustredu/1.0
> 
> -- 
> Jim Edwards
> 
> CESM Software Engineering Group
> National Center for Atmospheric Research
> Boulder, CO 
> 303-497-1842
> 



More information about the parallel-netcdf mailing list