Re: [AMBER-Developers] misused intent(out)

From: Jason Swails <jason.swails.gmail.com>
Date: Thu, 30 Sep 2010 12:18:39 -0400

This was what I figured -- especially since the major compilers we support
give the same results whether it's out or inout. I just figured I'd poll
the more experienced rather than rely on just my own assumptions. It is
still formally improper Fortran90, though, right?

Thanks!
Jason

On Thu, Sep 30, 2010 at 12:13 PM, Ross Walker <ross.rosswalker.co.uk> wrote:

> Hi Jason,
>
> > Well intent(out) is applied to an array in which only a chunk of the
> array
> > is initialized (the charges of a single residue, or 2, are changed in the
> > global charge array). According to the Fortran standard, I think the
> rest
> > of the array is technically undefined. So it would be legitimate
> compiler
> > behavior to trash the remaining array values. If I'm mistaken here,
> please
>
> You would think this but I have never come across a compiler that actually
> seems to make optimization decisions based on the use of an intent
> statement. As far as I can tell the most they are used for is at compile
> time to issue a warning if an array with intent(out) is not actually
> written
> to in a routine. I am pretty sure you could change every single variable in
> AMBER to just be intent(out) regardless of its actual use, ignore the
> warnings and everything would run fine regardless of which compiler you
> use.
>
> This may of course change in the future so we can't rely on it but I'm not
> sure it is critical as a bugfix. I am certain there is more than just the
> one example of misuse of intent in the code anyway so probably the one bug
> fix won't solve the issue if compiler behavior does actually end up
> changing.
>
> But it is certainly worthwhile changing any incorrect entries you come
> across in the git tree.
>
> Just my 3c.
>
> All the best
> Ross
>
> /\
> \/
> |\oss Walker
>
> ---------------------------------------------------------
> | Assistant Research Professor |
> | San Diego Supercomputer Center |
> | Adjunct Assistant Professor |
> | Dept. of Chemistry and Biochemistry |
> | University of California San Diego |
> | NVIDIA Fellow |
> | http://www.rosswalker.co.uk | http://www.wmd-lab.org/ |
> | Tel: +1 858 822 0854 | EMail:- ross.rosswalker.co.uk |
> ---------------------------------------------------------
>
> Note: Electronic Mail is not secure, has no guarantee of delivery, may not
> be read every day, and should not be used for urgent or sensitive issues.
>
>
>
>
> _______________________________________________
> AMBER-Developers mailing list
> AMBER-Developers.ambermd.org
> http://lists.ambermd.org/mailman/listinfo/amber-developers
>



-- 
Jason M. Swails
Quantum Theory Project,
University of Florida
Ph.D. Graduate Student
352-392-4032
_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Thu Sep 30 2010 - 09:30:08 PDT
Custom Search