diff options
author | eschnett <> | 2001-03-19 20:33:00 +0000 |
---|---|---|
committer | eschnett <> | 2001-03-19 20:33:00 +0000 |
commit | 8e78b91193c9f592a8a59724028d83522ea42368 (patch) | |
tree | 9ea23dbd7e03fddd552cb92088510ec2c4c0924b /CarpetExtra/IDHydroToy | |
parent | fc0e7af205874d55377d18ffdb68555df2843d32 (diff) |
Added files I forgot.
darcs-hash:20010319203346-f6438-2f8aea72388a14a8569ecd8922366e89ef0759ba.gz
Diffstat (limited to 'CarpetExtra/IDHydroToy')
-rw-r--r-- | CarpetExtra/IDHydroToy/src/erf.f | 13 | ||||
-rw-r--r-- | CarpetExtra/IDHydroToy/src/gammln.f | 22 | ||||
-rw-r--r-- | CarpetExtra/IDHydroToy/src/gammp.f | 16 | ||||
-rw-r--r-- | CarpetExtra/IDHydroToy/src/gcf.f | 30 | ||||
-rw-r--r-- | CarpetExtra/IDHydroToy/src/gser.f | 28 |
5 files changed, 109 insertions, 0 deletions
diff --git a/CarpetExtra/IDHydroToy/src/erf.f b/CarpetExtra/IDHydroToy/src/erf.f new file mode 100644 index 000000000..30bc84520 --- /dev/null +++ b/CarpetExtra/IDHydroToy/src/erf.f @@ -0,0 +1,13 @@ + FUNCTION erf(x) + implicit none + REAL*8 erf,x +CU USES gammp + REAL*8 gammp + if(x.lt.0)then + erf=-gammp(.5d0,x**2) + else + erf=gammp(.5d0,x**2) + endif + return + END +C (C) Copr. 1986-92 Numerical Recipes Software t4. diff --git a/CarpetExtra/IDHydroToy/src/gammln.f b/CarpetExtra/IDHydroToy/src/gammln.f new file mode 100644 index 000000000..b99fb6aa2 --- /dev/null +++ b/CarpetExtra/IDHydroToy/src/gammln.f @@ -0,0 +1,22 @@ + FUNCTION gammln(xx) + implicit none + REAL*8 gammln,xx + INTEGER j + DOUBLE PRECISION ser,stp,tmp,x,y,cof(6) + SAVE cof,stp + DATA cof,stp/76.18009172947146d0,-86.50532032941677d0, + *24.01409824083091d0,-1.231739572450155d0,.1208650973866179d-2, + *-.5395239384953d-5,2.5066282746310005d0/ + x=xx + y=x + tmp=x+5.5d0 + tmp=(x+0.5d0)*log(tmp)-tmp + ser=1.000000000190015d0 + do 11 j=1,6 + y=y+1.d0 + ser=ser+cof(j)/y +11 continue + gammln=tmp+log(stp*ser/x) + return + END +C (C) Copr. 1986-92 Numerical Recipes Software t4. diff --git a/CarpetExtra/IDHydroToy/src/gammp.f b/CarpetExtra/IDHydroToy/src/gammp.f new file mode 100644 index 000000000..99a938857 --- /dev/null +++ b/CarpetExtra/IDHydroToy/src/gammp.f @@ -0,0 +1,16 @@ + FUNCTION gammp(a,x) + implicit none + REAL*8 a,gammp,x +CU USES gcf,gser + REAL*8 gammcf,gamser,gln + if(x.lt.0.or.a.le.0)pause 'bad arguments in gammp' + if(x.lt.a+1)then + call gser(gamser,a,x,gln) + gammp=gamser + else + call gcf(gammcf,a,x,gln) + gammp=1-gammcf + endif + return + END +C (C) Copr. 1986-92 Numerical Recipes Software t4. diff --git a/CarpetExtra/IDHydroToy/src/gcf.f b/CarpetExtra/IDHydroToy/src/gcf.f new file mode 100644 index 000000000..09fd58aa0 --- /dev/null +++ b/CarpetExtra/IDHydroToy/src/gcf.f @@ -0,0 +1,30 @@ + SUBROUTINE gcf(gammcf,a,x,gln) + implicit none + INTEGER ITMAX + REAL*8 a,gammcf,gln,x,EPS,FPMIN + PARAMETER (ITMAX=100,EPS=3.d-7,FPMIN=1.d-30) +CU USES gammln + INTEGER i + REAL*8 an,b,c,d,del,h,gammln + gln=gammln(a) + b=x+1-a + c=1/FPMIN + d=1/b + h=d + do 11 i=1,ITMAX + an=-i*(i-a) + b=b+2 + d=an*d+b + if(abs(d).lt.FPMIN)d=FPMIN + c=b+an/c + if(abs(c).lt.FPMIN)c=FPMIN + d=1/d + del=d*c + h=h*del + if(abs(del-1).lt.EPS)goto 1 +11 continue + pause 'a too large, ITMAX too small in gcf' +1 gammcf=exp(-x+a*log(x)-gln)*h + return + END +C (C) Copr. 1986-92 Numerical Recipes Software t4. diff --git a/CarpetExtra/IDHydroToy/src/gser.f b/CarpetExtra/IDHydroToy/src/gser.f new file mode 100644 index 000000000..fad2be01f --- /dev/null +++ b/CarpetExtra/IDHydroToy/src/gser.f @@ -0,0 +1,28 @@ + SUBROUTINE gser(gamser,a,x,gln) + implicit none + INTEGER ITMAX + REAL*8 a,gamser,gln,x,EPS + PARAMETER (ITMAX=100,EPS=3.d-7) +CU USES gammln + INTEGER n + REAL*8 ap,del,sum,gammln + gln=gammln(a) + if(x.le.0)then + if(x.lt.0)pause 'x < 0 in gser' + gamser=0 + return + endif + ap=a + sum=1/a + del=sum + do 11 n=1,ITMAX + ap=ap+1 + del=del*x/ap + sum=sum+del + if(abs(del).lt.abs(sum)*EPS)goto 1 +11 continue + pause 'a too large, ITMAX too small in gser' +1 gamser=sum*exp(-x+a*log(x)-gln) + return + END +C (C) Copr. 1986-92 Numerical Recipes Software t4. |