Mac binaries
[jabaws.git] / website / archive / binaries / mac / src / disembl / Tisean_3.0.1 / source_f / compare.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   compare.f
23 c   compare two data sets
24 c   author T. Schreiber
25 c===========================================================================
26
27       parameter(nx=1000000,mx=2)
28       character*72 file
29       dimension x(nx,mx), icol(mx)
30       data iverb/1/
31
32       call whatido("compare time series in RMS sense",iverb)
33       nmaxx=ican("l",nx)
34       nexcl=ican("x",0)
35       call columns(mc,mx,icol)
36       mcmax=mx
37       if(nstrings().ne.1) call usage()
38       call nthstring(1,file)
39
40       nmax=nmaxx
41       call xreadfile(nmax,mcmax,nx,x,nexcl,icol,file,iverb)
42       if(file.eq."-") file="stdin"
43
44       call rms(nmax,x(1,1),sc1,sd1)
45       call rms(nmax,x(1,2),sc2,sd2)
46       do 10 n=1,nmax
47  10      x(n,1)=x(n,2)-x(n,1)
48       call rms(nmax,x(1,1),scd,sdd)
49
50       write(istderr(),*)
51       write(istderr(),*) "col ", icol(1), ": Mean ", sc1, 
52      .   ", standard deviation ", sd1
53       write(istderr(),*) "col ", icol(2), ": Mean ", sc2, 
54      .   ", standard deviation ", sd2
55       write(istderr(),*)
56       write(istderr(),*) "mean difference              ", scd 
57       write(istderr(),*)  
58      .   "root mean squared difference ", sqrt(sdd**2+scd**2) 
59       write(istderr(),*) "standard deviation           ", sdd
60       end
61
62       subroutine usage()
63 c usage message
64
65       call whatineed(
66      .   "[-l# -x# -c#[,#] -V# -h] file")
67       call popt("l","number of values to be read (all)")
68       call popt("x","number of values to be skipped (0)")
69       call popt("c","columns to be read (1,2)")
70       call pall()
71       stop
72       end