Re: [AMBER-Developers] Scalar vs. array mix-up in QMGB

From: Ben Roberts <roberts.qtp.ufl.edu>
Date: Thu, 11 Feb 2010 16:47:32 -0500

Hi Ross,

Ross Walker wrote:
> Hi Ben,
>
> Looking at the code this all looks perfectly legal to me. I think it is just
> the Gfortran compiler being overzealous when you have warn all turned on.

I'm using the Intel compiler (at least this time), but other than that,
I've been told that you're probably right.

> This should be perfectly legal and I am certain similar constructs are used
> elsewhere in sander. This code looks perfectly legal to me but perhaps one
> should check the standard to be sure. And see if there is a more 'correct'
> way of accomplishing what is done here. Essentially providing an alias to
> the middle of a large array as another array inside a subroutine.

Apparently it does violate the standard. For example, see here:

http://software.intel.com/en-us/blogs/2009/03/31/doctor-fortran-in-ive-come-here-for-an-argument/

However, since the errors don't appear without "warn all", I think it's
safe to say that there's some less rigorous level of warnings that would
disable it.

On the other hand, I (perhaps naively) wonder whether it would be useful
to try something like the following:

call subroutine qmgb_calc_mm_pot ( ...
qmmm_scratch%qm_real_scratch(1,natom),
qmmm_scratch%qm_real_scratch(natom+1,2*natom) ... )

I'll give this a go in my sandbox, unless there's a reason I shouldn't,
and see what I find.

Cheers,
Ben

_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Thu Feb 11 2010 - 14:00:02 PST
Custom Search