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 options
24 c author T. Schreiber (1998)
25 c===========================================================================
27 function iopt(c,ith,ierr)
28 c get ith occurence of switch -c as integer
36 if(argv(1:2).eq.'-'//c) then
38 if(ifound.eq.ith) then
40 if(argv(3:72).ne.' ') then
41 iopt=i_s(argv(3:72),ierr)
42 else if(i+1.le.iargc()) then
45 if(ierr.eq.0) call argdel(i+1)
56 function fopt(c,ith,ierr)
57 c get ith occurence of switch -c as real
65 if(argv(1:2).eq.'-'//c) then
67 if(ifound.eq.ith) then
69 if(argv(3:72).ne.' ') then
70 fopt=f_s(argv(3:72),ierr)
71 else if(i+1.le.iargc()) then
74 if(ierr.eq.0) call argdel(i+1)
85 subroutine sopt(c,ith,string,ierr)
86 c get ith occurence of switch -c as string
93 if(string(1:2).eq.'-'//c) then
95 if(ifound.eq.ith) then
97 if(string(3:).ne.' ') then
100 else if(i+1.le.iargc()) then
101 call getarg(i+1,string)
102 if(string(1:1).eq."-") then
119 c test if ith occurence of switch -c is present
127 if(argv(1:2).eq.'-'//c) then
129 if(ifound.eq.ith) then
139 c get inum'th argument as integer
143 call getarg(inum,argv)
145 .write(istderr(),'(a,i10)') "iget: missing integer argument",inum
148 .write(istderr(),'(a,i10)') "iget: integer argument expected:",inum
152 c get inum'th argument as real
156 call getarg(inum,argv)
158 . write(istderr(),'(a)') "fget: missing real argument",inum
161 . write(istderr(),'(a)') "fget: real argument expected:;",inum