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

From: Ross Walker <>
Date: Thu, 30 Sep 2010 09:13:40 -0700

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,

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

But it is certainly worthwhile changing any incorrect entries you come
across in the git tree.

Just my 3c.

All the best

|\oss Walker

| Assistant Research Professor |
| San Diego Supercomputer Center |
| Adjunct Assistant Professor |
| Dept. of Chemistry and Biochemistry |
| University of California San Diego |
| NVIDIA Fellow |
| | |
| Tel: +1 858 822 0854 | EMail:- |

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
Received on Thu Sep 30 2010 - 09:30:04 PDT
Custom Search