SUBROUTINE CADJMOD C C Fixes parameters if eccentricity or diameters are negative. C Adjusts the diameters using the diameter in filter 1 and the C diameter ratios given. Fits parabola through colors and diameters. C Needs to be called everytime a model parameter is changed! C Adapted from CADJMOD (J. T. Armstrong) by C. A. Hummel C for the BINAFIT software 2 September 1991 C include 'constnts.inc' include 'data.inc' include 'model.inc' real*8 x1,x2,x3,y1,y2,y3 C C Fix up the diameters for filters IG > 1, C DO IC = 1, NCOMP DO IG = 2, NFILT DIAM(IC,1) = ABS( DIAM(IC,1) ) DRATIO(IC,IG) = ABS( DRATIO(IC,IG) ) DIAM(IC,IG) = DIAM(IC,1) * DRATIO(IC,IG) END DO y1=diam(ic,1) y2=diam(ic,2) y3=diam(ic,3) x1=mfilter(1) x2=mfilter(2) x3=mfilter(3) dcoeff(ic,3)=( (y3-y2)*(x2-x1)-(y2-y1)*(x3-x2) )/ & ( (x3-x2)*(x2-x1)*(x3-x1) ) dcoeff(ic,2)=( (y3-y2)*(x2*x2-x1*x1)-(y2-y1)*(x3*x3-x2*x2) )/ & ( (x3-x2)*(x2-x1)*(x1-x3) ) dcoeff(ic,1)= diam(ic,1)-(dcoeff(ic,3)*x1*x1+dcoeff(ic,2)*x1) END DO C Fit parabola through colors, which is needed in case a data filter C does not correspond to model filter. if(delmag(1,3).ne.10)then delmag(2,3)=delmag(2,2)-delmag(1,3) endif y1=0.D0 y2=delmag(2,2)-delmag(2,1) y3=delmag(2,3)-delmag(2,1) x1=mfilter(1) x2=mfilter(2) x3=mfilter(3) ccoeff(3)=( (y3-y2)*(x2-x1)-(y2-y1)*(x3-x2) )/ & ( (x3-x2)*(x2-x1)*(x3-x1) ) ccoeff(2)=( (y3-y2)*(x2*x2-x1*x1)-(y2-y1)*(x3*x3-x2*x2) )/ & ( (x3-x2)*(x2-x1)*(x1-x3) ) ccoeff(1)= - (ccoeff(3)*x1*x1 + ccoeff(2)*x1) c c Fix T, and omega if e<0 c if(e_true.lt.0.d0)then e_true=-e_true epoch=epoch-period/2.d0 arg_peri=arg_peri+180.d0 if(arg_peri.gt.360)arg_peri=arg_peri-360.d0 endif RETURN END