Commit 45f7de23 authored by Daniel Armbruster's avatar Daniel Armbruster Committed by thomas.forbriger
Browse files

check for nsamples

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: 4717
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 61607047
......@@ -303,6 +303,10 @@ c
read(optarg(18), *) s
if (optset(19)) outformat=optarg(19)
c perform some checks
nsamples=int(t/d)
if (nsamples.gt.maxsamples) stop 'ERROR: too many samples'
c
c------------------------------------------------------------------------------
c go
......@@ -316,7 +320,6 @@ c
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -334,7 +337,6 @@ c
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -360,7 +362,6 @@ c
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -385,7 +386,6 @@ c
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -415,7 +415,6 @@ c
print 50,'initial frequency','f1',f1,'Hz'
print 50,'final frequency','f2',f2,'Hz'
endif
nsamples=int(t/d)
tend=ta+2.*ncyc/(f1+f2)
bx=(f2**2-f1**2)/(4.*ncyc)
if (verbose) then
......@@ -450,7 +449,6 @@ c
print 50,'end of wavelet','Te',te,'s'
print 50,'damping time constant','Td',td,'s'
endif
nsamples=int(t/d)
bx=log(0.5)/log(1.-(Tm-ta)/(te-ta))
if (verbose) then
print *,'derived parameters:'
......@@ -484,7 +482,6 @@ c
print 50,'end of wavelet','Te',te,'s'
print 50,'damping time constant','Td',td,'s'
endif
nsamples=int(t/d)
bx=log(2./3.)/log(1.-Tm/te)
if (verbose) then
print *,'derived parameters:'
......@@ -514,7 +511,6 @@ c
print 50,'onset of wavelet','Ta',ta,'s'
print 51,'number of non-zero samples','n',ncyc,' '
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -541,7 +537,6 @@ c
print 50,'weight impact','Tm',tm,'s'
print 50,'impulse transfer e-time','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -568,7 +563,6 @@ c
print 50,'weight release','Ta',ta,'s'
print 50,'weight impact','Tm',tm,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -597,7 +591,6 @@ c
print 50,'onset of wavelet','Ta',ta,'s'
print 50,'end of wavelet','Te',te,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -626,12 +619,10 @@ c
do i=1,ncyc
bx=tf_rand()
enddo
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
endif
if (nsamples .gt. maxsamples) stop 'too many samples'
do i=1,nsamples
series(i)=a*(2.*tf_rand()-1.)
enddo
......@@ -648,7 +639,6 @@ c
endif
c half period
bx=1/(2.*f)
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......@@ -673,15 +663,14 @@ c slope
print *,'parameters:'
print 50,'amplitude','a',a,' '
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
print 50,'time series length','T',t,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
endif
if (nsamples .gt. maxsamples) stop 'too many samples'
call tf_gsl_rng_ugaussian(dseries, nsamples)
print *,'derived parameters:'
do i=1,nsamples
series(i)=a*dseries(i)
enddo
......@@ -696,12 +685,10 @@ c slope
print 50,'initial frequency','f',f,'Hz'
print 51,'number of cycle per decade','n',ncyc,' '
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
endif
if (nsamples .gt. maxsamples) stop 'too many samples'
h=(ncyc*log10(exp(1.d0))/f)-d
g=-log10(d+h)
do i=1,nsamples
......@@ -716,7 +703,6 @@ c slope
print 50,'sampling interval','d',d,'s'
print 50,'time series lentgh','T',t,'s'
endif
nsamples=int(t/d)
if (verbose) then
print *,'derived parameters:'
print 52,'number of samples',nsamples,' '
......
Markdown is supported
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