Fortran intent bug and API documentation errors
Wei-keng Liao
wkliao at eecs.northwestern.edu
Tue Mar 14 18:05:47 CDT 2017
Hi, Brian
In the 1.5.0 release, a configure option "--disable-in-place-swap" was added
to avoid the compile error you are encountering. That option may impact the
I/O performance. Please see the release note for more information and let me
know if you have further questions.
As for the F90 API document, thanks for pointing out the mistakes. I will
fix that soon.
Wei-keng
On Mar 14, 2017, at 2:18 PM, Brian Taylor wrote:
> Hello,
>
> The following code does not compile with parallel-netcdf 1.8.1:
>
> $cat bug.f90
> subroutine sub(iarg)
> use pnetcdf
> implicit none
>
> integer, intent(in ) :: iarg
>
> integer :: ncid, varid, ierr
>
> ierr = nf90mpi_put_var(ncid, varid, iarg)
>
> end subroutine
> $mpif90 -c bug.f90
> bug.f90:9:9:
>
> ierr = nf90mpi_put_var(ncid, varid, iarg)
> 1
>
> Error: There is no specific function for the generic 'nf90mpi_put_var' at (1)
>
> If the fifth line is changed to "integer, intent(inout) :: iarg", the code compiles successfully. I assume this is a bug with the declared intent of the "values" argument to nf90mpi_put_var in the pnetcdf module, which is documented to be intent(in) according to <http://cucis.ece.northwestern.edu/projects/PnetCDF/doc/pnetcdf-c/Summary-of-Fortran-90-Interface.html#Summary-of-Fortran-90-Interface> but in the current parallel-netcdf library it appears to be intent(inout). If "values" is actually supposed to be intent(inout), then the API documentation should be updated to reflect this.
>
> By the way, the API documentation referenced above has several other errors. Most notably, several of the arguments are documented to be default integers, but in current code they are actually integer(kind=mpi_offset_kind). For example, the "start" and "count" arguments to nf90mpi_put_var have this problem. It would be nice if the documentation could be fixed.
>
> Thanks,
> Brian
>
More information about the parallel-netcdf
mailing list