[問題] 跑迴圈
PARAMETER (RC=3.0D-4, RN=2.0D-4)
N=0 ! Shower counter.
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C ------------------------ Shower simulation starts here.
C
101 CONTINUE
N=N+1.0D0
C
C ********** Set the initial state of the primary particle.
C
KPAR=KPARP
RY=RC*RAND(1.0D0)**(1.0/3.0)
IF(RY.LT.2.0D-4) GO TO 101
PTHETA=ACOS(2*RAND(1.0D0)-1)
PPHI=2*PI*RAND(1.0D0)
X=RY*SIN(PTHETA)*COS(PPHI)
Y=RY*SIN(PTHETA)*SIN(PPHI)
Z=RY*COS(PTHETA)
請問我現在假設有一個球的模型,而每一個亂數得到的座標會是空間上的一點
我現在是想點數均勻分布在大球跟小球之間
所以我假設IF(RY.LT.2.0D-4) GO TO 101,若是RY小於小球的半徑就重新跑
但是有個問題是跑完了就會由下一個接下去
例如
1符合但2不符合就從3開始
但是2就沒辦法記錄到就變成只有兩個結果,
有辦法解決這個問題嗎
謝謝大家
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.114.106.110
→
12/15 16:32, , 1F
12/15 16:32, 1F
→
12/15 16:37, , 2F
12/15 16:37, 2F
→
12/15 16:39, , 3F
12/15 16:39, 3F
推
12/15 16:52, , 4F
12/15 16:52, 4F
→
12/15 16:55, , 5F
12/15 16:55, 5F
→
12/15 16:56, , 6F
12/15 16:56, 6F
→
12/15 17:01, , 7F
12/15 17:01, 7F
→
12/15 17:04, , 8F
12/15 17:04, 8F
→
12/15 17:05, , 9F
12/15 17:05, 9F
推
12/15 17:12, , 10F
12/15 17:12, 10F
→
12/15 17:12, , 11F
12/15 17:12, 11F
→
12/15 17:14, , 12F
12/15 17:14, 12F
→
12/15 17:14, , 13F
12/15 17:14, 13F
推
12/15 17:15, , 14F
12/15 17:15, 14F
推
12/15 17:20, , 15F
12/15 17:20, 15F
→
12/15 17:20, , 16F
12/15 17:20, 16F
推
12/15 18:31, , 17F
12/15 18:31, 17F
→
12/15 18:32, , 18F
12/15 18:32, 18F
→
12/15 18:33, , 19F
12/15 18:33, 19F
→
12/15 18:38, , 20F
12/15 18:38, 20F
→
12/15 18:39, , 21F
12/15 18:39, 21F
→
12/15 23:24, , 22F
12/15 23:24, 22F
→
12/15 23:25, , 23F
12/15 23:25, 23F
→
12/15 23:28, , 24F
12/15 23:28, 24F
→
12/16 15:31, , 25F
12/16 15:31, 25F
→
12/16 15:32, , 26F
12/16 15:32, 26F
→
12/16 15:33, , 27F
12/16 15:33, 27F
推
12/16 15:37, , 28F
12/16 15:37, 28F
→
12/16 15:49, , 29F
12/16 15:49, 29F
推
12/16 16:20, , 30F
12/16 16:20, 30F
→
12/16 16:21, , 31F
12/16 16:21, 31F
→
12/16 16:22, , 32F
12/16 16:22, 32F
→
12/16 16:23, , 33F
12/16 16:23, 33F
→
12/16 16:24, , 34F
12/16 16:24, 34F
→
12/18 12:57, , 35F
12/18 12:57, 35F
→
12/18 13:06, , 36F
12/18 13:06, 36F
推
12/18 18:51, , 37F
12/18 18:51, 37F
→
12/18 23:18, , 38F
12/18 23:18, 38F
推
12/18 23:19, , 39F
12/18 23:19, 39F
→
12/18 23:19, , 40F
12/18 23:19, 40F
推
12/19 13:23, , 41F
12/19 13:23, 41F
Fortran 近期熱門文章
PTT數位生活區 即時熱門文章