Fortran attribute functions

Wei-keng Liao wkliao at ece.northwestern.edu
Fri Jun 15 16:00:41 CDT 2007


All pnetcdf attribute functions have an argument LEN indicating the number 
of elements in argument array VALS. In netcdf, the data type of LEN is 
integer, but in the pnetcdf implementation, it is MPI_Offset type. Since 
attribute data tends to be small, there is no need to use MPI_Offset.

Using MPI_Offset introduces datatype overflow in Fortran. For example, if 
I used a constant number in LEN. It will be first type-converted to 4-byte 
integer by Fortran compiler, and then type-converted to MPI_Offset at run 
time. I tested it on a Cray XT3 and get an error of this kind.

I suggest to replace LEN's datatype to integer for all attribute 
functions, both in C and Fortran.

Wei-keng




More information about the parallel-netcdf mailing list