Adding DisEMBL dependency Tisean executable
[jabaws.git] / binaries / src / disembl / Tisean_3.0.1 / source_f / events.f
1 c===========================================================================
2 c
3 c   This file is part of TISEAN
4
5 c   Copyright (c) 1998-2007 Rainer Hegger, Holger Kantz, Thomas Schreiber
6
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.
11 c
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.
16 c
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
20 c
21 c===========================================================================
22 c   events.f
23 c   convert inter-event intervals to event times
24 c   author T. Schreiber (1999)
25 c===========================================================================
26       parameter(nx=1000000)
27       dimension x(nx)
28       character*72 file, fout
29       data iverb/1/
30
31       call whatido("interval to event time conversion",iverb)
32       nmaxx=ican("l",nx)
33       nexcl=ican("x",0)
34       jcol=ican("c",0)
35       isout=igetout(fout,iverb)
36
37       do 10 ifi=1,nstrings()
38          call nthstring(ifi,file)
39          nmax=nmaxx
40          call readfile(nmax,x,nexcl,jcol,file,iverb)
41          nmax=nmax+1
42          do 20 n=nmax,2,-1
43  20         x(n)=x(n-1)
44          x(1)=0
45          do 30 n=2,nmax
46  30         x(n)=x(n)+x(n-1)
47          if(file.eq."-") file="stdin"
48          if(isout.eq.1) call addsuff(fout,file,"_st")
49  10      call writefile(nmax,x,fout,iverb)
50       end
51
52       subroutine usage()
53 c usage message
54
55       call whatineed(
56      .   "[-o outfile -l# -x# -c# -V# -h] file(s)")
57       call popt("l","number of values to be read (all)")
58       call popt("x","number of values to be skipped (0)")
59       call popt("c","column to be read (1 or file,#)")
60       call pout("file_st")
61       call pall()
62       stop
63       end
64
65