Re: [AMBER-Developers] Amber coding standards

From: case <case.biomaps.rutgers.edu>
Date: Mon, 30 Mar 2009 18:16:56 +0100

On Mon, Mar 30, 2009, Joe Krahn wrote:

>
> D) Convert them to allocatables, but don't use all allocation subroutine:
>
> < call allint(nphih_new,iph2,jph2,kph2,lph2,icph2)
>
> > allocate(iph2(nphih_new),jph2(nphih_new),kph2(nphih_new), &
> > lph2(nphih_new),icph2(nphih_new),stat=statall)
> > if ( statall /= 0 ) call allocate_error( &
> > "iph2,jph2,kph2,lph2,icph2","get_bonded_params",nphih_new)
>
> This avoids possible pointer aliasing slow-downs or leaks due to
> reallocation without deallocation, and does not require TR-15581.

I agree with this: the "Amber rule" should be that allocatable arrays are
allocated in the same routine that they are originally declared in, not in
some subroutine. (If I have this right....)

...dac


_______________________________________________
AMBER-Developers mailing list
AMBER-Developers.ambermd.org
http://lists.ambermd.org/mailman/listinfo/amber-developers
Received on Wed Apr 01 2009 - 01:09:20 PDT
Custom Search