I think it is your compiler here that is busted and not the expression.
The expression in question is:
do while ( ie <= iend .and. groupbuffer(ie:ie) /= ' ' )
ie = ie + 1
end do
Which consists of two relational operators and a logical operator. The do
while expression must evaluate to true for the loop to iterate hence the
value of ie cannot be updated until both relational expressions involving ie
have been evaluated as true.
The Fortran standard asserts that arithmetic operators have a higher
priority than any relational operators which have a higher priority than any
logical operators. Thus the following three statements are logically
equivalent:
(((x+3)<=y) .AND. (y<=z))
((x+3<=y) .AND. (y<=z))
(x+3<=y .AND. y<=z)
I refer you to Ellis, Philips, Lahey, "Fortran 90 Programming",
Addison-Wesley, 1994, Chapter 5.
Hence your compiler is not implementing the Fortran standard correctly.
Hence this is most likely a compiler bug. This is strange since I have not
seen this problem before in any mainstream compiler. What compiler and
version are you using?
/\
\/
|\oss Walker
| HPC Consultant and Staff Scientist |
| 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.
> -----Original Message-----
> From: owner-amber.scripps.edu
> [mailto:owner-amber.scripps.edu] On Behalf Of Peljidiyn Genden
> Sent: Saturday, April 14, 2007 00:43
> To: amber.scripps.edu
> Subject: AMBER: mdfil.f
>
> Jagshemash! [sacred Mongolian word meaning "Hello
> everybody, nice to meet you again!"]
>
> it is well known here in Mongolia that FORTRAN is a
> unique language
> in many ways; in particular, FORTRAN (unlike any other
> language in
> the visible part of our Universe) does not evaluate
> boolean
> expressions is some definite order; therefore there
> are (at least)
> 2 (more) errors in mdfil.f submodule of SANDER module
> of AMBER; see below
>
> --- src/sander/mdfil.f
> +++ src/sander/mdfil.f
> .. -299,8 +299,9 .. integer function iargc_wrap()
> else
> is = istart
> ie = istart
> - do while ( ie <= iend .and. &
> - groupbuffer(ie:ie) /= ' ' )
> + do while ( ie <= iend)
> + if (groupbuffer(ie:ie) == ' ' ) &
> + exit
> ie = ie + 1
> end do
> ia = ia + 1
> .. -349,8 +350,9 .. subroutine getarg_wrap(iarg, arg)
>
> is = istart
> ie = istart
> - do while ( ie <= iend .and. &
> - groupbuffer(ie:ie) /= ' ' )
> + do while ( ie <= iend )
> + if (groupbuffer(ie:ie) == ' ') &
> + exit
> ie = ie + 1
> end do
> ia = ia + 1
>
> Excuse me please for the so brief message - I have to
> run - Mongolian
> born Kazaki superstar Korki Buchek sings today in the
> Mongolian
> national academie theater of opera and ballet
> (Ulaanbaatar, Mongol Uls).
>
> Yours,
> Peljidiyn Genden
>
>
> sef w==.$.# =.$3 23 .#$.= 234.# ++ 234 24
> --))(()((-==wqer
>
> Peljidiyn Genden, Ph. D., MD, FD, and OP
> Ministry Of FORTRAN Affairs
> Ulaanbaatar, Mongol Uls
>
> [phone/fax are prohibited in our department to
> prevent
> us from spreading the insanity over the wires]
>
> 966 0wr wer er == ___ 34 r5234 === 2345 2=--- 234
> ---=====
>
>
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam protection around
> http://mail.yahoo.com
>
> --------------------------------------------------------------
> ---------
> The AMBER Mail Reflector
> To post, send mail to amber.scripps.edu
> To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
>
-----------------------------------------------------------------------
The AMBER Mail Reflector
To post, send mail to amber.scripps.edu
To unsubscribe, send "unsubscribe amber" to majordomo.scripps.edu
Received on Wed Apr 18 2007 - 06:07:18 PDT