3 i mrkclm, numstr, klmstr,
4 o mrkstr, skyclm, nrfclm, mapclm,
41 INTEGER*4 LEVDBG(8),LUDBUG
42 COMMON /cmdebg/levdbg,ludbug
44 COMMON /gconst/
pi,radeg,
re,rem,
f,
omf2,omegae
150 real*8 tangtl , tminco
152 real*4 gciclm(3,*) , skyclm(10,3,*)
154 INTEGER*4 NUMCLM , LBLCLM(*) , NOBCLM(*)
155 INTEGER*4 MRKCLM(*) , IDFCLM(*) , NUMSTR , KLMSTR(*)
156 INTEGER*4 MRKSTR(*) , NRFCLM(*) , MAPCLM(10,*) , NUMTRP
160 real*8 rangtl , angdif , toler , besta , rmax , coangl
161 real*8 cangab , cangac , cangbc , cangle,
dangle, rminco
162 real*8 rang12 , rang13 , rang23 , rangle
163 real*8 e2clma(3), e2clmb(3), e2clmc(3)
164 real*8 e2ref1(3), e2ref2(3), e2ref3(3)
165 INTEGER*4 ICLMA , ICLMB , ICLMC , IREF1 , IREF2 , IREF3
166 INTEGER*4 IMATCH , IBEST1 , IBEST2 , IBEST3 , ISTR
167 LOGICAL*4 L_GOOD , L_MTCH , L_NOID
169 DATA rmax /999999.0d0/
173 IF (levdbg(7) .NE. 0)
WRITE (ludbug,1000)
174 IF (levdbg(7) .GE. 1)
WRITE (ludbug,3999) tangtl,tminco
180 rangtl = tangtl / radeg
181 rminco = tminco / radeg
182 IF (levdbg(7) .GE. 1)
WRITE (ludbug,3999) rangtl,rminco
183 DO 100 iclma = 1,numclm
188 dowhile(nrfclm(istr).LT.1)
192 DO 700 iclma = istr,(numclm-2)
193 DO 600 iclmb = (iclma+1),(numclm-1)
194 DO 500 iclmc = (iclmb+1),numclm
197 IF ((mrkclm(iclma) .EQ. 0).AND.(mrkclm(iclmb) .EQ. 0).AND.
198 1 (mrkclm(iclmc) .EQ. 0))
THEN
203 IF ((nrfclm(iclma) .GE. 1).AND.(nrfclm(iclmb) .GE. 1).AND.
204 1 (nrfclm(iclmc) .GE. 1))
THEN
209 IF ((idfclm(iclma) .EQ. 0).OR.(idfclm(iclmb) .EQ. 0).OR.
210 1 (idfclm(iclmc) .EQ. 0))
THEN
215 IF (l_good .AND. l_mtch .AND. l_noid)
THEN
216 CALL coline (iclma, iclmb, iclmc, lblclm, gciclm, coangl)
217 IF (coangl .GT. rminco)
THEN
223 e2clma(1) = dble(gciclm(1,iclma))
224 e2clma(2) = dble(gciclm(2,iclma))
225 e2clma(3) = dble(gciclm(3,iclma))
226 e2clmb(1) = dble(gciclm(1,iclmb))
227 e2clmb(2) = dble(gciclm(2,iclmb))
228 e2clmb(3) = dble(gciclm(3,iclmb))
229 e2clmc(1) = dble(gciclm(1,iclmc))
230 e2clmc(2) = dble(gciclm(2,iclmc))
231 e2clmc(3) = dble(gciclm(3,iclmc))
232 cangab =
dangle(e2clma, e2clmb, toler, angdif)
233 cangbc =
dangle(e2clmb, e2clmc, toler, angdif)
234 cangac =
dangle(e2clma, e2clmc, toler, angdif)
235 cangle = cangab + cangbc + cangac
240 DO 400 iref1 = 1,nrfclm(iclma)
241 DO 300 iref2 = 1,nrfclm(iclmb)
242 DO 200 iref3 = 1,nrfclm(iclmc)
246 e2ref1(1) = dble(skyclm(iref1,1,iclma))
247 e2ref1(2) = dble(skyclm(iref1,2,iclma))
248 e2ref1(3) = dble(skyclm(iref1,3,iclma))
249 e2ref2(1) = dble(skyclm(iref2,1,iclmb))
250 e2ref2(2) = dble(skyclm(iref2,2,iclmb))
251 e2ref2(3) = dble(skyclm(iref2,3,iclmb))
252 e2ref3(1) = dble(skyclm(iref3,1,iclmc))
253 e2ref3(2) = dble(skyclm(iref3,2,iclmc))
254 e2ref3(3) = dble(skyclm(iref3,3,iclmc))
255 rang12 =
dangle(e2ref1, e2ref2, toler, angdif)
256 rang13 =
dangle(e2ref1, e2ref3, toler, angdif)
257 rang23 =
dangle(e2ref2, e2ref3, toler, angdif)
258 rangle = rang12 + rang13 + rang23
262 angdif = dabs(cangab - rang12)
263 * + dabs(cangac - rang13)
264 * + dabs(cangbc - rang23)
267 IF ((angdif.LE.besta).AND.(angdif.LT.rangtl))
THEN
268 IF (angdif .EQ. besta)
THEN
280 IF (levdbg(7) .GE. 4)
THEN
281 WRITE (ludbug,4000) lblclm(iclma),
282 1 lblclm(iclmb), lblclm(iclmc), cangle
283 WRITE (ludbug,4010) iref1, iref2, iref3,
284 1 mapclm(iref1,iclma), mapclm(iref2,iclmb),
285 2 mapclm(iref3,iclmc), rangle
286 WRITE (ludbug,4020) angdif, besta, imatch
295 IF (imatch .EQ. 0)
THEN
297 IF (idfclm(iclma) .NE. 2) idfclm(iclma) = 0
298 IF (idfclm(iclmb) .NE. 2) idfclm(iclmb) = 0
299 IF (idfclm(iclmc) .NE. 2) idfclm(iclmc) = 0
300 ELSE IF (imatch .GT. 1)
THEN
302 IF (idfclm(iclma) .NE. 2) idfclm(iclma) = 1
303 IF (idfclm(iclmb) .NE. 2) idfclm(iclmb) = 1
304 IF (idfclm(iclmc) .NE. 2) idfclm(iclmb) = 1
318 mapclm(1,iclma) = mapclm(ibest1,iclma)
319 mapclm(1,iclmb) = mapclm(ibest2,iclmb)
320 mapclm(1,iclmc) = mapclm(ibest3,iclmc)
323 skyclm(1,1,iclma) = skyclm(ibest1,1,iclma)
324 skyclm(1,2,iclma) = skyclm(ibest1,2,iclma)
325 skyclm(1,3,iclma) = skyclm(ibest1,3,iclma)
326 skyclm(1,1,iclmb) = skyclm(ibest2,1,iclmb)
327 skyclm(1,2,iclmb) = skyclm(ibest2,2,iclmb)
328 skyclm(1,3,iclmb) = skyclm(ibest2,3,iclmb)
329 skyclm(1,1,iclmc) = skyclm(ibest3,1,iclmc)
330 skyclm(1,2,iclmc) = skyclm(ibest3,2,iclmc)
331 skyclm(1,3,iclmc) = skyclm(ibest3,3,iclmc)
342 DO 800 iclma=1,numclm
343 IF ((mrkclm(iclma) .EQ. 0).AND.
344 1 (idfclm(iclma) .EQ. 0)) mrkclm(iclma) = 15
348 DO 900 istr = 1,numstr
349 IF (mrkclm(klmstr(istr)) .EQ. 15) mrkstr(istr) = 17
354 IF (levdbg(7) .GE. 3)
THEN
356 DO 950 iclma=1,numclm
357 WRITE (ludbug,5010) lblclm(iclma),mrkclm(iclma),idfclm(iclma)
358 DO 930 imatch=1,nrfclm(iclma)
359 WRITE (ludbug,5020) imatch, mapclm(imatch,iclma),
360 1 (skyclm(imatch,i,iclma),i=1,3)
366 IF (levdbg(7) .NE. 0)
WRITE (ludbug,2000)
370 1000
FORMAT(
' *** ENTER TRIPLT ***')
371 2000
FORMAT(
' *** EXIT TRIPLT ***')
372 3999
FORMAT(
' TRIPLET PARAMETERS: TANGTL=',d12.6,
' TMINCO=',d12.6)
373 4000
FORMAT(
' INTERMEDIATE DEBUG: '/,
374 1 4x,
'CLUMP TRIPLT=',i8,2x,i8,2x,i8,
' SEPARATION=',d12.6)
375 4010
FORMAT(4x,
'STAR TRIPLT =',i8,2x,i8,2x,i8,
' CATALOG #S=',
376 1 i8,2x,i8,2x,i8,
' SEPARATION=',d12.6)
377 4020
FORMAT(4x,
'ANGDIF=',d12.6,
' BEST YET=',d12.6,
' MATCH #=',i8)
378 5000
FORMAT(
' STAR CLUMP TABLE AFTER TRIPLT ALGORITHM')
379 5010
FORMAT(
' CLUMP=',i6,
' STATUS=',i6,
' IDFLAG=',i6)
380 5020
FORMAT(10x,
'MATCH#',i4,
' CATINDEX=',i8,
' POSITION=',3(f13.6,1x))