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

operating

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: 2269
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 89408c20
#
# $Id: Makefile,v 1.8 2007-05-09 10:31:28 tforb Exp $
# $Id: Makefile,v 1.9 2007-05-09 11:07:38 tforb Exp $
#
# Makefile for prog/lib
#
......@@ -73,7 +73,7 @@ libtf.doc: $(DOCSRC)
.PHONY: clean edit
clean:
-/bin/rm *.o *.bak *.o77 flist
-/bin/rm -fv *.o *.bak *.o77 flist *.xxx
edit: flist ; vim flist
flist: *.c *.h *.f Makefile ; echo $^ | tr ' ' '\n' | sort > $@
......@@ -95,3 +95,11 @@ libtf.a: $(SUBS)
$(AR) rcv libtf.a $(SUBS)
$(RANLIB) libtf.a
newlib libtf.a
testlibtf: testlibtf.o libtf.a
$(CC) -o $@ $< -ltf -lf2c -lm -lgsl -lgslcblas \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
testlibtf77: testlibtf.o77 libtf77.a
$(FC) -o $@ $< -ltf77 -lm -lgsl -lgslcblas \
-L$(LOCLIBDIR) -L$(SERVERLIBDIR)
c this is <testlibtf.f>
c ----------------------------------------------------------------------------
c ($Id: testlibtf.f,v 1.1 2007-05-09 11:07:38 tforb Exp $)
c
c Copyright (c) 2007 by Thomas Forbriger (BFO Schiltach)
c
c program to test libtf functions
c
c REVISIONS and CHANGES
c 09/05/2007 V1.0 Thomas Forbriger
c
c ============================================================================
c
program testlibtf
c
character*(*) version
parameter(version=
&'TESTLIBTF V1.0 program to test libtf functions')
character*(*) TESTLIBTF_CVS_ID
parameter(TESTLIBTF_CVS_ID='$Id: testlibtf.f,v 1.1 2007-05-09 11:07:38 tforb Exp $')
c
integer m,i
parameter(m=150)
double precision a(m)
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=4)
character*5 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c
logical testrng, fileoutput
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v, 4h-rng, 2h-f/
data opthasarg/4*.FALSE./
data optarg/4*1h-/
c
c------------------------------------------------------------------------------
c basic information
c
c
argument=' '
if (iargc().eq.1) call getarg(1, argument)
if ((argument(1:5).eq.'-help').or.(iargc().lt.1)) then
print *,version
print *,'Usage: testlibtf [-v] [-f]'
print *,' [-rng]'
print *,' or: testlibtf -help'
if (argument(1:5).ne.'-help')
& stop 'ERROR: wrong number of arguments'
print *,' '
print *,'test libtf.a components'
print *,' '
print *,TESTLIBTF_CVS_ID
print *,' '
print *,'-v be verbose'
print *,'-f write results to files'
print *,' '
print *,'select tests:'
print *,'-rng test gsl random number generator'
stop
endif
c
c------------------------------------------------------------------------------
c read command line arguments
c
call tf_cmdline(1, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
debug=optset(1)
verbose=optset(2)
testrng=optset(3)
fileoutput=optset(4)
c
c------------------------------------------------------------------------------
c go
if (testrng) then
print *,'test gsl random number generators'
print *,' '
print *,'gaussian distribution:'
call tf_gsl_rng_ugaussian(a, m)
print '(8(2x,f7.4))', (a(i), i=1,m)
open(10, name='test_gaussian.xxx', err=99)
write(10, '(f7.4)', err=98) (a(i), i=1,m)
close(10, err=97)
print *,'uniform distribution:'
call tf_gsl_rng_uniform(a, m)
print '(8(2x,f7.4))', (a(i), i=1,m)
open(10, name='test_uniform.xxx', err=99)
write(10, '(f7.4)', err=98) (a(i), i=1,m)
close(10, err=97)
endif
c
stop
99 stop 'ERROR: opening file'
98 stop 'ERROR: writing file'
97 stop 'ERROR: closing file'
end
c
c
c ----- END OF testlibtf.f -----
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