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

new program offli

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: 191
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 38ab6b41
# ---------------------------------------
#
# $Id: Makefile,v 1.1 2000-05-30 08:43:21 thof Exp $
#
# Makefile fuer tools /src/ts/hd
#
# ---------------------------------------
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
PGPLOTLIB=-lf2cpgplot52 -lX11 -L/usr/X11/lib
LIBSFF=-lf2cstuff -L$(SERVERLIBDIR)
LIBTF=-ltf -L$(LOCLIBDIR)
CC=gcc
CFLAGS=-O2
F2CFLAGS=-f -u
.f.o:
f2c $(F2CFLAGS) $<
gcc $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
@rm $(<:.f=.c)
clean:
-/bin/rm *.o *.bak
offli: %: %.o
$(CC) -o $@ $< $(LIBTF) -lsffu -ltime $(LIBSFF) $(F2CLIB)
newprog $@
c this is <offli.f>
c------------------------------------------------------------------------------
c ($Source: /home/tforb/svnbuild/cvssource/CVS/thof/src/ts/hd/offli.f,v $)
c ($Id: offli.f,v 1.1 2000-05-30 08:43:21 thof Exp $)
c
c 30/05/2000 by Thomas Forbriger (IfG Stuttgart)
c
c OFFset LIsting
c
c REVISIONS and CHANGES
c 30/05/2000 V1.0 Thomas Forbriger
c
c==============================================================================
c
program offli
c
character*(*) version
parameter(version='OFFLI V1.0 OFFset LIsting')
character*(*) OFFLI_CVS_ID
parameter(OFFLI_CVS_ID='$Id: offli.f,v 1.1 2000-05-30 08:43:21 thof Exp $')
c
integer ierr,nsamp,msamp,nstack
parameter(msamp=100000)
real data(msamp)
integer idata(msamp)
equivalence (data,idata)
real tanf,dt,sc1,sc2,sc3,rc1,rc2,rc3,sffversion
character scs*1, rcs*1, wid2line*132,date*7,time*11,code*20
character timestamp*13,source*20
integer lu
parameter(lu=10)
logical last
c
real sffu_offset
c
integer itrace,mtrace,ntrace
parameter(mtrace=600)
real offset(mtrace)
c commandline
integer maxopt, lastarg, iargc
character*80 argument, infile
parameter(maxopt=3)
character*2 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c
logical refmetform
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v,2h-r/
data opthasarg/3*.FALSE./
data optarg/3*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: offli filename [-r]'
print *,' or: offli -help'
if (argument(1:5).ne.'-help') stop 'ERROR: wrong number of arguments'
print *,' '
print *,'OFFset LIsting'
print *,' '
print *,'filename SFF data file to list offsets from'
print *,' '
print *,'-r write file appropriate for refmet'
print *,' '
print *,OFFLI_CVS_ID
stop
endif
c
c------------------------------------------------------------------------------
c read command line arguments
c
call getarg(1,infile)
call tf_cmdline(1, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
debug=optset(1)
verbose=optset(2)
refmetform=optset(3)
c
c------------------------------------------------------------------------------
c go
if (verbose) print *,'open ',infile(1:index(infile,' '))
call sff_ROpenS(lu, infile, sffversion, timestamp, code,
& source, scs, sc1, sc2, sc3, date, time, ierr)
if (ierr.ne.0) stop 'ERROR (readdata): opening data file'
last=.false.
ntrace=0
do while (.not.(last))
nsamp=msamp
call sff_RTraceI(lu, tanf, dt,
& wid2line, nsamp, data, idata, code, last,
& rcs, rc1, rc2, rc3, nstack, ierr)
if (ierr.ne.0) stop 'ERROR (readdata): reading trace'
ntrace=ntrace+1
if (ntrace.gt.mtrace) stop 'ERROR: too many traces'
offset(ntrace)=sffu_offset(scs,sc1,sc2,sc3, rcs,rc1,rc2,rc3)
enddo
c
if (refmetform) then
print 52,version,infile(1:index(infile,' ')-1),ntrace
do itrace=1,ntrace
print 53,offset(itrace)
enddo
else
print 50,ntrace,infile(1:index(infile,' ')-1)
do itrace=1,ntrace
print 51,itrace,offset(itrace)
enddo
endif
c
stop
50 format(i3,' offsets read from file ',a,':')
51 format(i3,' ',f12.3,'m')
52 format(a,/,a,/,'mode, v_red, Tl, Tr, N',/
& ,' 1, 0., 0., 0.,',i4,//,11x,'r, phi')
53 format(f12.3,', 0.')
end
c
c ----- END OF offli.f -----
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