Commit 7d0b40e8 authored by thomas.forbriger's avatar thomas.forbriger Committed by thomas.forbriger
Browse files

proceeding

This is a legacy commit from before 2015-03-01.
It may be incomplete as well as inconsistent.
See COPYING.legacy and README.history for details.


SVN Path:     http://gpitrsvn.gpi.uni-karlsruhe.de/repos/TFSoftware/trunk
SVN Revision: 2939
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 19e7f8c0
c this is <testlibtf.f>
c ----------------------------------------------------------------------------
c ($Id: testlibtf.f,v 1.4 2007-12-17 16:24:00 tforb Exp $)
c ($Id: testlibtf.f,v 1.5 2009-11-27 10:37:21 tforb Exp $)
c
c Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
c
......@@ -25,6 +25,7 @@ c
c REVISIONS and CHANGES
c 09/05/2007 V1.0 Thomas Forbriger
c 17/12/2007 V1.1 use keyword file in open statement
c 27/11/2009 V1.2 test magic numbers
c
c ============================================================================
c
......@@ -32,29 +33,30 @@ c
c
character*(*) version
parameter(version=
&'TESTLIBTF V1.0 program to test libtf functions')
&'TESTLIBTF V1.2 program to test libtf functions')
character*(*) TESTLIBTF_CVS_ID
parameter(TESTLIBTF_CVS_ID=
&'$Id: testlibtf.f,v 1.4 2007-12-17 16:24:00 tforb Exp $')
&'$Id: testlibtf.f,v 1.5 2009-11-27 10:37:21 tforb Exp $')
c
integer m,i,n
parameter(m=10000)
double precision a(m)
character*4 cmagic
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=5)
character*5 optid(maxopt)
parameter(maxopt=6)
character*7 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c
logical testrng, fileoutput
logical testrng, fileoutput, testmagic
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v, 4h-rng, 2h-f, 2h-n/
data opthasarg/4*.FALSE.,.TRUE./
data optarg/4*1h-,3h150/
data optid/2h-d, 2h-v, 4h-rng, 2h-f, 2h-n, '-magic'/
data opthasarg/4*.FALSE.,.TRUE.,.FALSE./
data optarg/4*1h-,3h150,'-'/
c
c------------------------------------------------------------------------------
c basic information
......@@ -65,7 +67,7 @@ c
if ((argument(1:5).eq.'-help').or.(iargc().lt.1)) then
print *,version
print *,'Usage: testlibtf [-v] [-f] [-n n]'
print *,' [-rng]'
print *,' [-rng] [-magic]'
print *,' or: testlibtf -help'
if (argument(1:5).ne.'-help')
& stop 'ERROR: wrong number of arguments'
......@@ -80,6 +82,7 @@ c
print *,' '
print *,'select tests:'
print *,'-rng test gsl random number generator'
print *,'-magic test magic numbers'
stop
endif
c
......@@ -93,6 +96,7 @@ c
testrng=optset(3)
fileoutput=optset(4)
read(optarg(5), *, err=96) n
testmagic=optset(6)
c
c------------------------------------------------------------------------------
c go
......@@ -113,6 +117,13 @@ c go
write(unit=10, fmt='(f7.4)', err=98) (a(i), i=1,n)
close(unit=10, err=97)
endif
c----------------------------------------------------------------------
if (testmagic) then
print *,'test magic numbers'
cmagic='1234'
call tf_magic(cmagic, n)
print *,'magic number for "',cmagic,'" is ',n
endif
c
stop
99 stop 'ERROR: opening file'
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment