PnetCDF Fortran Binding Issues
William Gropp
gropp at mcs.anl.gov
Wed Aug 6 12:31:56 CDT 2003
At 01:21 PM 8/4/2003 -0500, Jianwei Li wrote:
>Bill,
>
>I took a look at the original netCDF library User Guide and the src code,
>The index in C interface is 0-based and that in Fortran is 1-based.
>
>There is functions converting FORTRAN co-ordinates into C co-ordinates.
>
> for (i = 0; i < ndims; ++i)
> ccoords[i] = fcoords[ndims - 1 - i] - 1;
>
>The dimension-ID vector, count, stride are also converted in such a way.
>So, now I'm sure the original netCDF requires that Fortran users define
>their array variables in a reverse dimension order than if C code is used.
>In users' view, if we talk about most/least significant dimension instead
>of the numerical order, Fortran interface and C interface look common.
>Within the Fortran binding, however, it reverses all dimension-related
>index vectors before calling the C functions, and it also converts between
>0-based and 1-based indices.
>That way, the data buffer of the array variables don't need to be
>transposed in the Fortran binding implementation.
>
>So, I think, all we need to do in the Fortran binding is to implement the
>same index vector convertion for those involved functions --- convert
>from F to C for input index vectors, and from C to F for output ones.
>
>I can list those function and their victim arguments, if that helps.
That would be a big help. This might also change the size_t handling.
Bill
More information about the parallel-netcdf
mailing list