summaryrefslogtreecommitdiff
path: root/lib/fchisq0.f90
diff options
context:
space:
mode:
authorhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
committerhibby <d@vehibberd.com>2018-02-16 15:17:14 +0000
commit37f727ac0746fd85504aa46c1f023c09b3eff33a (patch)
treec8a7ce04545040a8f161ba279528730bd9a3e6ab /lib/fchisq0.f90
parentd63dd8d081a6fcd0715cd13f26df59fb831769d2 (diff)
New upstream version 1.8.0+repackupstream/1.8.0+repack
Diffstat (limited to 'lib/fchisq0.f90')
-rw-r--r--lib/fchisq0.f9023
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/fchisq0.f90 b/lib/fchisq0.f90
new file mode 100644
index 00000000..2c62f275
--- /dev/null
+++ b/lib/fchisq0.f90
@@ -0,0 +1,23 @@
+real function fchisq0(y,npts,a)
+
+ real y(npts),a(4)
+
+! rewind 51
+ chisq = 0.
+ do i=1,npts
+ x=i
+ z=(x-a(3))/(0.5*a(4))
+ yfit=a(1)
+ if(abs(z).lt.3.0) then
+ d=1.0 + z*z
+ yfit=a(1) + a(2) * (1.0/d - 0.1)
+ endif
+ chisq=chisq + (y(i) - yfit)**2
+! write(51,3001) i,y(i),yfit,y(i)-yfit
+!3001 format(i5,3f10.4)
+ enddo
+ fchisq0=chisq
+
+ return
+end function fchisq0
+