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===========================================================================
22 c multivariate i/o utilities for TISEAN f-sources
23 c author T. Schreiber (1999)
24 c===========================================================================
25 subroutine xreadfile(nmax,mmax,nx,x,nexcl,icol,file,iverb)
26 c read columns as seperate time series
28 dimension x(nx,mmax), icol(mmax), dum(mline)
32 if(iv.ne.0) write(istderr(),*)
33 . 'reading from columns', (icol(i),i=1,mmax)
34 call infile(file,iunit,iverb)
37 10 mlast=max(mlast,icol(i))
38 if(mlast.gt.mline) stop "xreadfile: make mline larger."
42 20 read(iunit,*,end=999)
45 read(iunit,*,err=2,end=999) (dum(i),i=1,mlast)
47 40 x(n,i)=dum(icol(i))
49 2 if(iv.ne.0) write(istderr(),*) "data in line ", lc, " ignored"
52 if(iv.ne.0) write(istderr(),*) '*** readfile: warning:'//
53 . ' maybe not the whole file has been used'
55 if(iunit.ne.istdin()) close(iunit)
56 if(iv.ne.0) call readreport(nmax,file)
59 subroutine xwritecfile(nmax,mmax,nx,x,file,iverb,comm)
60 c write comment and nmax points
62 character*(*) file,comm
65 write(istderr(),*) "xwritecfile: "//
66 . "cannot write more than 1000 columns"
69 call outfile(file,iunit,iverb)
70 if(comm.ne." ") write(iunit,'(a)') comm
72 10 write(iunit,'(1000g16.7)') (x(n,i),i=1,mmax)
73 if(iunit.eq.istdout()) then
79 if(iv_io(iverb).eq.1) call writereport(nmax,file)
82 subroutine xwritefile(nmax,mmax,nx,x,file,iverb)
87 call xwritecfile(nmax,mmax,nx,x,file,iverb," ")
90 subroutine columns(mc,mmax,icol)
93 call imcan("c",mmax,mc,icol)
96 10 icmax=max(icmax,icol(m))