3 o mrkclm, nrfclm, mapclm, skyclm, mrkstr, idfclm, numdub)
37 INTEGER*4 LEVDBG(8),LUDBUG
38 COMMON /cmdebg/levdbg,ludbug
40 COMMON /gconst/
pi,radeg,
re,rem,
f,
omf2,omegae
151 real*4 gciclm(3,*) , skyclm(10,3,*)
153 INTEGER*4 NUMCLM , NUMSTR , LBLCLM(*), KLMSTR(*)
154 INTEGER*4 MRKCLM(*) , IDFCLM(*) , NRFCLM(*)
155 INTEGER*4 MAPCLM(10,*), MRKSTR(*) , NUMDUB
158 real*8 rangtl , sepang , refang , angdif , toler
159 real*8 e2clma(3), e2clmb(3), e2ref1(3), e2ref2(3)
161 INTEGER*4 ICLMA , ICLMB , IMATCH , IREF1 , IREF2
162 INTEGER*4 IBEST1 , IBEST2 , ISTR , I
163 LOGICAL*4 L_MTCH , L_NOID
165 DATA rmax /999999.0d0/
169 IF (levdbg(7) .NE. 0)
WRITE (ludbug,1000)
174 rangtl = pangtl / radeg
175 DO 110 iclma = 1,numclm
177 IF (mrkclm(iclma) .EQ. 15)
THEN
179 DO 100 istr = 1,numstr
180 IF ((klmstr(istr) .EQ. iclma).AND.
181 1 (mrkstr(istr) .EQ. 17)) mrkstr(istr) = 0
187 DO 500 iclma = 1,(numclm-1)
188 DO 400 iclmb = (iclma+1),numclm
191 IF ((nrfclm(iclma) .GE. 1).AND.(nrfclm(iclmb) .GE. 1))
THEN
196 IF ((idfclm(iclma) .EQ. 0).OR.(idfclm(iclmb) .EQ. 0))
THEN
201 IF (l_mtch .AND. l_noid)
THEN
207 e2clma(1) = dble(gciclm(1,iclma))
208 e2clma(2) = dble(gciclm(2,iclma))
209 e2clma(3) = dble(gciclm(3,iclma))
210 e2clmb(1) = dble(gciclm(1,iclmb))
211 e2clmb(2) = dble(gciclm(2,iclmb))
212 e2clmb(3) = dble(gciclm(3,iclmb))
213 sepang =
dangle(e2clma, e2clmb, toler, angdif)
218 DO 300 iref1 = 1,nrfclm(iclma)
219 DO 200 iref2 = 1,nrfclm(iclmb)
222 e2ref1(1) = dble(skyclm(iref1,1,iclma))
223 e2ref1(2) = dble(skyclm(iref1,2,iclma))
224 e2ref1(3) = dble(skyclm(iref1,3,iclma))
225 e2ref2(1) = dble(skyclm(iref2,1,iclmb))
226 e2ref2(2) = dble(skyclm(iref2,2,iclmb))
227 e2ref2(3) = dble(skyclm(iref2,3,iclmb))
228 refang =
dangle(e2ref1, e2ref2, toler, angdif)
231 angdif = dabs(refang - sepang)
234 IF ((angdif .LE. besta).AND.(angdif .LT. rangtl))
THEN
235 IF (angdif .EQ. besta)
THEN
246 IF (levdbg(7) .GE. 4)
THEN
247 WRITE (ludbug,4000) lblclm(iclma), lblclm(iclmb),
249 WRITE (ludbug,4010) iref1, iref2, mapclm(iref1,iclma),
250 1 mapclm(iref2,iclmb), refang
251 WRITE (ludbug,4020) angdif, besta, imatch
259 IF (imatch .EQ. 0)
THEN
261 IF (idfclm(iclma) .NE. 2) idfclm(iclma) = 0
262 IF (idfclm(iclmb) .NE. 2) idfclm(iclmb) = 0
263 ELSE IF (imatch .GT. 1)
THEN
265 IF (idfclm(iclma) .NE. 2) idfclm(iclma) = 1
266 IF (idfclm(iclmb) .NE. 2) idfclm(iclmb) = 1
278 mapclm(1,iclma) = mapclm(ibest1,iclma)
279 mapclm(1,iclmb) = mapclm(ibest2,iclmb)
282 skyclm(1,1,iclma) = skyclm(ibest1,1,iclma)
283 skyclm(1,2,iclma) = skyclm(ibest1,2,iclma)
284 skyclm(1,3,iclma) = skyclm(ibest1,3,iclma)
285 skyclm(1,1,iclmb) = skyclm(ibest2,1,iclmb)
286 skyclm(1,2,iclmb) = skyclm(ibest2,2,iclmb)
287 skyclm(1,3,iclmb) = skyclm(ibest2,3,iclmb)
294 DO 600 iclma=1,numclm
295 IF ((mrkclm(iclma) .EQ. 0).AND.
296 1 (idfclm(iclma) .EQ. 0)) mrkclm(iclma) = 15
300 DO 700 istr = 1,numstr
301 IF (mrkclm(klmstr(istr)) .EQ. 15) mrkstr(istr) = 17
306 IF (levdbg(7) .GE. 3)
THEN
308 DO 950 iclma=1,numclm
309 WRITE (ludbug,5010) lblclm(iclma),mrkclm(iclma),idfclm(iclma)
310 DO 900 imatch=1,nrfclm(iclma)
311 WRITE (ludbug,5020) imatch, mapclm(imatch,iclma),
312 1 (skyclm(imatch,i,iclma),i=1,3)
318 IF (levdbg(7) .NE. 0)
WRITE (ludbug,2000)
322 1000
FORMAT(
' *** ENTER DOUBLT ***')
323 2000
FORMAT(
' *** EXIT DOUBLT ***')
324 4000
FORMAT(
' INTERMEDIATE DEBUG: '/,
325 1 4x,
'CLUMP PAIR=',i8,2x,i8,
' SEPARATION=',d14.8)
326 4010
FORMAT(4x,
'STAR PAIR =',i8,2x,i8,
' CATALOG INDEX=',i8,2x,i8,
327 1
' SEPARATION=',d14.8)
328 4020
FORMAT(4x,
'ANGDIF=',d14.8,
' BEST YET=',d14.8,
' MATCH #=',i8)
329 5000
FORMAT(
' STAR CLUMP TABLE AFTER DOUBLT ALGORITHM')
330 5010
FORMAT(
' CLUMP=',i6,
' STATUS=',i6,
' IDFLAG=',i6)
331 5020
FORMAT(10x,
'MATCH#',i4,
' CATINDEX=',i8,
' POSITION=',3(f13.6,1x))