-
Notifications
You must be signed in to change notification settings - Fork 16
/
Copy pathRandom Path Pick
36 lines (36 loc) · 1.1 KB
/
Random Path Pick
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
dimension xlat(20),xlon(20),id(20),ip(5)
r = 6378
call random_seed
call random_number(r1)
call random_number(r2)
ib = floor(60*r2)
do i = 1,60
read(21,*)i1,i2,i3,i4,i5
if (i.eq.ib) then
write(*,*)ib,i1,i2,i3,i4,i5
write(*,*)
ip(1) =i1
ip(2) =i2
ip(3) =i3
ip(4) =i4
ip(5) =i5
end if
end do
do i = 1,5
read(1,*)ix,x1,x2
id(i) = ix
xlat(i) = x1/57.1
xlon(i) = x2/57.1
end do
do i = 1,4
dlat = xlat(ip(i)) - xlat(ip(i+1))
dlon = xlon(ip(i)) - xlon(ip(I+1))
a=(sin(dlat/2))**2+cos(xlat(ip(i)))*cos(xlat(ip(i+1)))*(sin(dlon/2))**2
b = sqrt(a)
c = 2 * asin(b)
d= r*c
d0 = d+d0
write(*,*)ip(i),ip(i+1), d,d0
end do
stop
end