DO WHILE LOOP in source.f

From: ±ΟΤΆ½ά <biyuanjie_at_tsinghua.org.cn>
Date: Fri, 12 Jul 2013 17:08:46 +0800 (CST)

Dear Fluka users,

I use a do while loop in source.f like this,

       R=140.0
       H=100.0
       DO WHILE ( (2.0*G1-1.0)**2+(2.0*G2-1.0)**2 .GT. 1.0)
       G1=FLRNDM(XDUMMY)
       G2=FLRNDM(XDUMMY)
       END DO

       XBEAM=R*(2.0*G1-1.0)
       YBEAM=R*(2.0*G2-1.0)
       ZBEAM=H*(2.0*FLRNDM(XDUMMY)-1.0)

but for every particle, it gives the same value for G1 and G2,
what is the problem?

Many thanks
Yuanjie
Received on Mon Jul 15 2013 - 10:55:55 CEST

This archive was generated by hypermail 2.3.0 : Mon Jul 15 2013 - 10:55:59 CEST