[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
20020628: netCDF 3.5.2-beta Fortran 90 bug
- Subject: 20020628: netCDF 3.5.2-beta Fortran 90 bug
- Date: Fri, 28 Jun 2002 12:33:01 -0600
Matthias,
> to: address@hidden.
> From: LANGER 2494 <address@hidden>
> Organization: ?
> Subject: bug in the function "nf90_Inquire_Variable":
> Keywords: 200206280820.g5S8Kou23535 netCDF Fortran 90
The above message contained the following:
> The array assignment:
> > if(present(dimids)) dimids(:numDimensions) = dimensionIDs
> will produce an error, because the shape of dimensionIDs is nf90_max_var_dims,
> but dimids could have a size < nf90_max_var_dims. I think a more secure
> assignment should check the bounds of the arrays, like:
> > if(present(dimids)) then
> > if ( size(dimids) >= numDimensions ) then
> > dimids(:numDimensions) = dimensionIDs(:numDimensions)
> > else
> > *** exit with an error code
> > endif
> > endif
> --------
> Matthias Langer/Vienna-Austria/28jun2002
> .
This bug was reported earlier. The relevant line had been changed to
if(present(dimids)) dimids(:numDimensions) = dimensionIDs(:numDimensions)
I like your additional check on the size of the user's vector, however.
So we'll also include that in the next release.
Thanks for sending this in.
Regards,
Steve Emmerson <http://www.unidata.ucar.edu>