| 31 |
integer npoints !fit number of points |
integer npoints !fit number of points |
| 32 |
real dep(npoints),indep(npoints) !dependent and independent variables |
real dep(npoints),indep(npoints) !dependent and independent variables |
| 33 |
|
|
| 34 |
real angle(npoints) !angle between the tangent line in the input points and |
c real angle(npoints) !angle between the tangent line in the input points and |
| 35 |
|
c ! the independent variable axis |
| 36 |
|
c real residual(npoints) !residuals |
| 37 |
|
c real chi !sum of squared residuals |
| 38 |
|
c real xc,zc,radius !circle parameters |
| 39 |
|
double precision angle(npoints) !angle between the tangent line in the input points and |
| 40 |
! the independent variable axis |
! the independent variable axis |
| 41 |
|
double precision residual(npoints) !residuals EM GCC4.7 |
| 42 |
real residual(npoints) !residuals |
double precision chi !sum of squared residuals EM GCC4.7 |
| 43 |
real chi !sum of squared residuals |
double precision xc,zc,radius !circle parameters EM GCC4.7 |
|
real xc,zc,radius !circle parameters |
|
| 44 |
|
|
| 45 |
integer eflag !error flag =1 if the procedure fails |
integer eflag !error flag =1 if the procedure fails |
| 46 |
|
|
| 55 |
integer ifail !=-1 if singular matrix error, =0 if not singular |
integer ifail !=-1 if singular matrix error, =0 if not singular |
| 56 |
integer jfail !=0 if determinant can be evaluated, =-1 if determinat is probably too small, =+1 if too large |
integer jfail !=0 if determinant can be evaluated, =-1 if determinat is probably too small, =+1 if too large |
| 57 |
|
|
| 58 |
parameter (big=1.e4) !just a number greater than C(npoints,3) |
integer ibig ! EM GCC4.7 |
| 59 |
double precision xxc(big),zzc(big),rrr(big) !centres and radii to be averaged |
c parameter (ibig=1.e4) !just a number greater than C(npoints,3) |
| 60 |
|
parameter (ibig=10000) !just a number greater than C(npoints,3) EM GCC 4.7 |
| 61 |
|
double precision xxc(ibig),zzc(ibig),rrr(ibig) !centres and radii to be averaged |
| 62 |
|
|
| 63 |
double precision tmp1,tmp2,tmp(npoints) !temp variables |
double precision tmp1,tmp2,tmp(npoints) !temp variables |
| 64 |
|
|
| 180 |
call DFACT(3,d,3,ir,ifail,detd,jfail) |
call DFACT(3,d,3,ir,ifail,detd,jfail) |
| 181 |
if(ifail.eq.-1) then |
if(ifail.eq.-1) then |
| 182 |
if(DEBUG)then |
if(DEBUG)then |
| 183 |
print*,'tricircle: ERROR: singular matrix D:' |
print*,'tricircle: ERROR: singular matrix D:' |
| 184 |
do i=1,3 |
do i=1,3 |
| 185 |
print*,(d(i,j),j=1,3) |
print*,(d(i,j),j=1,3) |
| 186 |
enddo |
enddo |
| 187 |
endif |
endif |
| 188 |
eflag=1 |
eflag=1 |
| 189 |
endif |
endif |
| 190 |
if(jfail.eq.-1) then |
if(jfail.eq.-1) then |
| 191 |
if(DEBUG)then |
if(DEBUG)then |
| 192 |
print* |
print* |
| 193 |
$ ,'tricircle: ERROR: matrix D: determinant too small?' |
$ ,'tricircle: ERROR: matrix D: determinant too small?' |
| 194 |
do i=1,3 |
do i=1,3 |
| 195 |
print*,(d(i,j),j=1,3) |
print*,(d(i,j),j=1,3) |
| 196 |
enddo |
enddo |
| 197 |
endif |
endif |
| 198 |
eflag=1 |
eflag=1 |
| 199 |
elseif(jfail.eq.1) then |
elseif(jfail.eq.1) then |
| 218 |
enddo |
enddo |
| 219 |
endif |
endif |
| 220 |
eflag=1 |
eflag=1 |
| 221 |
endif |
endif |
| 222 |
if(jfail.eq.-1) then |
if(jfail.eq.-1) then |
| 223 |
if(DEBUG)then |
if(DEBUG)then |
| 224 |
print* |
print* |