RE: amber-developers: Testing Parallel

From: Ross Walker <ross.rosswalker.co.uk>
Date: Tue, 15 Apr 2008 12:29:30 -0700

Hi Dave,

> > possible FAILURE: check out.0.dif
> > /scratch2/sysadmin_test/amber10/test/softcore/complex
> > 77c77
> > < Total charge of 0.1305 removed
> > ---
> > > Total charge of ************ removed
> > ---------------------------------------

In mdread.f:

-------------------------
subroutine remove_charges(crggp,natom,charge)
  use constants, only: INV_AMBER_ELECTROSTATIC
  implicit none
  integer natom, crggp(*),i
  _REAL_ charge(*), charge_removed
  
  do i=1,natom
     if (crggp(i)==1) then
        charge_removed = charge_removed + charge(i) *
INV_AMBER_ELECTROSTATIC
        write (6,'(a,f12.4,a,i5)') 'Removing charge of ', charge(i) *
INV_AMBER_ELECTROSTATIC,' from atom ',i
        charge(i)=0
     end if
  end do
  write(6, '(a,f12.4,a)') 'Total charge of ',charge_removed,' removed'
  RETURN
-------------------------

Try adding

charge_removed = 0.0d0 before the do loop.

I suspect most other compilers zero new variables by default. I know ifort
does and it can be dangerous at times.

All the best
Ross

/\
\/
|\oss Walker

| Assistant Research Professor |
| San Diego Supercomputer Center |
| Tel: +1 858 822 0854 | EMail:- ross.rosswalker.co.uk |
| http://www.rosswalker.co.uk | PGP Key available on request |

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.
Received on Fri Apr 18 2008 - 21:19:37 PDT
Custom Search