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 get command line arguments
24 c author T. Schreiber (1998)
25 c===========================================================================
29 dimension largs(margs)
30 common /args/ nargs, largs
33 nargs=min(margs,iargc())
37 if(i.gt.iargc()) return
38 if(largs(i).eq.0) return
46 dimension largs(margs)
47 common /args/ nargs, largs
52 subroutine nthstring(n,string)
54 dimension largs(margs)
55 common /args/ nargs, largs
60 if(largs(i).eq.1) iv=iv+1
64 1 call getarg(i,string)
68 c get mandatory integer argument, call usage statement if missing
72 if(ierr.ne.0) call usage()
76 c get mandatory real argument, call usage statement if missing
80 if(ierr.ne.0) call usage()
83 subroutine smust(c,string)
84 c get mandatory string argument, call usage statement if missing
88 call sopt(c,1,string,ierr)
89 if(ierr.ne.0) call usage()
93 c get optional integer argument, provide default if missing
97 if(ierr.ne.0) ican=idef
100 function fcan(c,fdef)
101 c get optional real argument, provide default if missing
105 if(ierr.ne.0) fcan=fdef
108 subroutine stcan(c,string,dstring)
109 c get optional string argument, provide default if missing
111 character*(*) string, dstring
113 call sopt(c,1,string,ierr)
114 if(ierr.ne.0) string=dstring
117 function igetout(fout,iverb)
118 c gets alternate output file name, default " "
119 c return 1 if fout must be determined from input file name
123 call stcan("o",fout," ")
124 if(fout.ne." ".and.nstrings().gt.1.and.iv_io(iverb).ne.0)
125 . write(istderr(),*) '*** single output file for multiple'//
126 . ' input files - results may be overwritten'
127 if(fout.ne." ") return
131 subroutine imcan(c,mmax,mc,ilist)
132 c get optional integer argument with multiple comma separated values
137 call stcan(c,string," ")
138 string(index(string," "):index(string," "))=","
140 if(index(string,",").le.1) goto 1
141 read(string(1:index(string,",")-1),*,err=1,end=1) ilist(m)
142 10 string=string(index(string,",")+1:72)
146 subroutine fmcan(c,mmax,mc,flist)
147 c get optional real argument with multiple comma separated values
152 call stcan(c,string," ")
153 string(index(string," "):index(string," "))=","
155 if(index(string,",").le.1) goto 1
156 read(string(1:index(string,",")-1),*,err=1,end=1) flist(m)
157 10 string=string(index(string,",")+1:72)