Guest User

Untitled

a guest
Apr 23rd, 2018
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. character*17 name1, name2, name3, name4, name5, name6
  2. integer i,j,x
  3. real a,b,c,d,e,f,g,h,k,l,m,n,o,p,q,r,s,t,u,v,w,y,z
  4. real aa,ba,ca,da,ea,fa,ga,ha,ia,ja,ka,la,ma
  5. pi=acos(-1.0)
  6. open(unit=1, file="pointingsTable2")
  7. open(unit=20, file="testedpointings.dat")
  8. open(unit=30, file="commonSources.dat")
  9. open(unit=50, file="transientSources.dat")
  10. open(unit=60, file="allSources.dat")
  11. DO i=1,10
  12.     read(1,*,end=10) name1  !pointing1
  13.     write(20,*) name1
  14.     open(unit=2, file=name1)
  15.     DO ii=1,1000
  16.         read(2,*,end=20) a,name2,b,c,d,e,f,g,h,k,l !details of source1
  17.         m=(b*15)+(c/4)+(d/240)  !RA of source1
  18.         n=e-(f/60)-(g/3600) !declination of source1
  19.         open(unit=3, file="pointingsTable3")
  20.         DO j=1,1000
  21.             read(3,*,end=30) name3,o,p,q,r,s,t !details of pointing2
  22.             u=(o*15)+(p/4)  !RA of pointing2
  23.             v=r-(s/60)-(t/3600) !declination of pointing2
  24.             w=sqrt(((m-u)**2)+((n-v)**2))   !distance between pointing2 and source1
  25.             IF ( ( w .le. 2.25 ) .and. ( name1 .ne. name3 ) ) then
  26.                 write(60,*) name2   !all sources
  27.                 x=1
  28.                 open(unit=4, file=name3)
  29.                 DO jj=1,1000
  30.                     read(4,*,end=40) aa,name4,ba,ca,da,ea,fa,ga,ha,ia,ja    !details of source2 in pointing2
  31.                     ka=(ba*15)+(ca/4)+(da/240)  !RA of source2 in pointing2
  32.                     la=ea-(fa/60.0)-(ga/3600)   !declination of source2 in pointing2
  33.                     ma=sqrt(((ka-m)**2)+((la-n)**2))    !distance between source1 and source2
  34.                     IF (ma.lt.(5.0/3600)) then
  35.                         write(30,*) name1,name2,name3,name4
  36.                         x=0
  37.                     ENDIF
  38.                 ENDDO
  39.                 40 continue
  40.                 IF (x.eq.1) write(50,*) name1,a,name2,b,c,d,e,f,g,h,k,l !transient sources
  41.                 close(4)
  42.             ENDIF
  43.         ENDDO
  44.         30 continue
  45.         close(3)       
  46.     ENDDO
  47.     20 continue
  48.     close(2)
  49. ENDDO  
  50. 10 continue
  51. close(1)
  52. close(30)
  53. close(40)
  54. close(50)
  55. close(60)
  56. close(70)
  57. close(80)
  58. close(90)
  59. close(100)
  60. close(110)
  61. close(120)
  62. STOP
  63. END
Add Comment
Please, Sign In to add comment