[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 20041115:cleanup for netcdf 3.6.0 beta 6



Arnaud,

> Another thing I noticed is that in the fortran 90 APIs, the argument
> "values" of nf90_get_var is intent(out). It does not seem right as
> "intent(out)" invalidates the content of the variable at the beginning
> of the function call.  I think it should be "intent(inout)" at least
> in the case of a call to nf_get_vars/nf_get_varm, For instance, in one
> of my code, I call repeatedly nf_get_varm with the same array to load
> only a few elements at a time in their expected position. I relie on
> the fact that the content of the array is not invalidated
> (e.g. intent(inout)).
> 
> Having said that, I suppose it is now a feature of the f90
> bindings. Too bad that the intent(inout) behaviour of nf_get_varm is
> lost in nf90_get_var but one can always pass a discontinuous section
> to get the job done. However, it makes the arguments "stride" and
> "map" pretty useless in practice.
> 
> Only the code generated from nveaget.m4 is affected. I think the rest
> would stay more or less identical if intent(out) was changed to
> intent(inout).

You make a fairly convincing argument for changing the declaration of
the values arguments in nf_get_vars/nf_get_varm from intent(out) to
intent(inout).  From my limited knowledge of Fortran 90, I think we
could do this without causing problems for existing users, but I'm not
confident about that.  I'm CC:ing Robert Pincus, the original author
of the f90 interface, in case he has any comments on your suggestion.

What would be very useful for proposed changes like this would be a
better set of tests for the Fortran 90 interface.  We've never
developed such tests.  Do you have anything that would test the
implementation of a larger subset of the Fortran 90 interfaces than
our current example program?

--Russ

_____________________________________________________________________

Russ Rew                                         UCAR Unidata Program
address@hidden          http://www.unidata.ucar.edu/staff/russ