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

new option

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: 1453
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 0eec6821
c this is <susei.f>
c------------------------------------------------------------------------------
c $Id: susei.f,v 1.2 2001-10-22 09:23:56 forbrig Exp $
c $Id: susei.f,v 1.3 2004-01-27 12:53:33 tforb Exp $
c
c 16/06/98 by Thomas Forbriger (IfG Stuttgart)
c
......@@ -12,13 +12,14 @@ c REVISIONS and CHANGES
c 16/06/98 V1.0 Thomas Forbriger
c 27/02/99 V1.1 add more than two
c 22/10/01 V1.2 calculate arithmetic mean of traces
c 27/01/04 V1.3 switch for normalization
c
c==============================================================================
c
program susei
c
character*79 version
parameter(version='SUSEI V1.2 SUm of SEIsmograms')
parameter(version='SUSEI V1.3 SUm of SEIsmograms')
c
c dimensions
integer maxsamps, maxfree
......@@ -55,22 +56,24 @@ c sff extras
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=1)
parameter(maxopt=2)
character*2 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c
logical nonormalize
c debugging
logical debug
c here are the keys to our commandline options
data optid/2h-d/
data opthasarg/.FALSE./
data optarg/1h-/
data optid/2h-d,3h-nn/
data opthasarg/2*.FALSE./
data optarg/2*1h-/
c
c------------------------------------------------------------------------------
c basic information
c
print *,version
print *,'Usage: susei file1 file2 ... outfile'
print *,'Usage: susei [-nn] file1 file2 ... outfile'
print *,' or: susei -help'
c
if (iargc().lt.1) stop 'ERROR: missing arguments'
......@@ -79,7 +82,13 @@ c
print *,' '
print *,'SUm of SEIsmograms'
print *,' '
print *,'$Id: susei.f,v 1.2 2001-10-22 09:23:56 forbrig Exp $'
print *,'-nn do not normalize'
print *,' The program is inteded to be used for stacking.'
print *,' In that case the amplitude should be normalized'
print *,' by the number of traces stacked. This option'
print *,' turns off amplitude normalization.'
print *,' '
print *,'$Id: susei.f,v 1.3 2004-01-27 12:53:33 tforb Exp $'
stop
endif
if (iargc().lt.3) stop 'ERROR: too few arguments'
......@@ -91,11 +100,12 @@ c
call tf_cmdline(1, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
debug=optset(1)
nonormalize=optset(2)
c
nsumfiles=iargc()-2
nsumfiles=iargc()-lastarg-2
c
call getarg(1, inxname)
call getarg(nsumfiles+2, outname)
call getarg(lastarg+1, inxname)
call getarg(lastarg+nsumfiles+2, outname)
c
c------------------------------------------------------------------------------
c
......@@ -119,7 +129,7 @@ c
& type, cs, c1, c2, c3, date, time, ierr)
if (ierr.ne.0) stop 'ERROR: opening output file'
do ifile=1,nsumfiles
call getarg(ifile+1, inyname)
call getarg(lastarg+ifile+1, inyname)
print *,'open ',inyname(1:index(inyname,' ')),'for input'
call sff_ROpenS(lui+ifile, inyname,
& libversion, timestamp, code,
......@@ -158,9 +168,11 @@ c
data(i)=(data(i)+ydata(i))
enddo
enddo
do i=1,nsamp
data(i)=data(i)/float(nsumfiles+1)
enddo
if (.not.nonormalize) then
do i=1,nsamp
data(i)=data(i)/float(nsumfiles+1)
enddo
endif
wid2line(36:38)='NSP'
c
call sff_WTraceI(luo, wid2line, nsamp, data, idata, last,
......
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