1 c===========================================================================
3 c This file is part of TISEAN
5 c Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
7 c TISEAN is free software; you can redistribute it and/or modify
8 c it under the terms of the GNU General Public License as published by
9 c the Free Software Foundation; either version 2 of the License, or
10 c (at your option) any later version.
12 c TISEAN is distributed in the hope that it will be useful,
13 c but WITHOUT ANY WARRANTY; without even the implied warranty of
14 c MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 c GNU General Public License for more details.
17 c You should have received a copy of the GNU General Public License
18 c along with TISEAN; if not, write to the Free Software
19 c Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
21 c===========================================================================
23 c Gaussian kernel correlation integral from c2
24 c author T. Schreiber (1998)
25 c===========================================================================
27 dimension e(meps), c(meps), lw(meps)
28 character*72 file, fout, aline
29 double precision g,gd,h,d,f,func,gg,ggd,err,dum1,dum2,a,b,dc,de
34 call whatido("Gaussian kernel correlation sum from c2",iverb)
35 isout=igetout(fout,iverb)
36 if(nstrings().eq.0) call usage()
37 call nthstring(1,file)
38 call infile(file,iunit,iverb)
39 if(isout.eq.1) call addsuff(fout,file,"_g")
40 call outfile(fout,iunit2,iverb)
41 1 read(iunit,'(a)',end=999) aline
42 4 if(aline(1:1).ne."#") goto 1
44 . read(aline(index(aline,"m=")+2:72),'(i20)',err=1) m
46 2 read(iunit,'(a)') aline
47 if(aline(1:72).eq." ") goto 3
49 read(aline,*,err=999,end=999) ee, cc
54 3 write(iunit2,'(4h#m= ,i5)') m
56 call index2sort(me,e,lw)
57 call index2sort(me,c,lw)
63 f=exp((e(k+1)*c(k)-e(k)*c(k+1))/(e(k+1)-e(k)))
64 d=(c(k+1)-c(k))/(e(k+1)-e(k))
69 if(b.ne.a) call dqk15(func,a,b,gg,err,dum1,dum2)
70 if(b.ne.a) call dqk15(funcd,a,b,ggd,err,dum1,dum2)
75 cgauss=g/(h**2)+exp(-exp(2*de)/(2*h**2))
76 cgd=gd/(h**4)+(2+exp(2*de)/h**2)*exp(-exp(2*de)/(2*h**2))
77 10 write(iunit2,*) h, cgauss, -2+cgd/cgauss
84 double precision function func(u)
85 double precision h,d,f,u
88 func=f*exp((2+d)*u-exp(2*u)/(2*h**2))
91 double precision function funcd(u)
92 double precision h,d,f,u
95 funcd=f*exp((4+d)*u-exp(2*u)/(2*h**2))
102 . "[-o outfile -V# -h] file")