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

offlix can handle SU data

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: 3705
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 1847bfce
......@@ -76,8 +76,15 @@
# This option will disappear somewhere in the future!
#
.PHONY: all
all: install
install: sehefi coma epi chaco sesoc offli sesot merse cooset
PROGRAMS=sehefi coma epi chaco sesoc offli sesot merse cooset offlix
install: $(PROGRAMS)
/bin/mv -fv $^ $(LOCBINDIR)
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *.cc)
echo $^ | tr ' ' '\n' | sort > $@
......@@ -89,76 +96,45 @@ edit: flist; vim $<
clean: ;
-find . -name \*.bak | xargs --no-run-if-empty /bin/rm -v
-/bin/rm -vf flist *.o
-/bin/rm -vf $(PROGRAMS)
FLAGS += $(MYFLAGS)
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
G2CLIB=-lg2c -lm -L${SERVERLIBDIR}
F2CFLAGS=-f -u
FCFLAGS=-Wall -ff2c -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS=-O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR) $(FLAGS)
CPPFLAGS=-I$(LOCINCLUDEDIR) $(FLAGS)
ifeq ($(TF_FALLBACK),yes)
.f.o:
f2c $(F2CFLAGS) $<
gcc $(CFLAGS) $(<:.f=.c) -c -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR}
@rm $(<:.f=.c)
else
%.o: %.f; $(FC) -o $@ -c $(FCFLAGS) $<
endif
#----------------------------------------------------------------------
ifeq ($(TF_FALLBACK),yes)
sehefi coma epi chaco sesoc: %: %.o
$(CC) -o $@ $< -ltf -lsff $(F2CLIB)
/bin/mv -fv $@
# check mandatory environment variable settings
# ---------------------------------------------
offli sesot merse: %: %.o
$(CC) -o $@ $< -ltf -lsffu -ltime_trad -lsff $(F2CLIB)
/bin/mv -fv $@
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
FLAGS += $(MYFLAGS) -fPIC
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += $(FLAGS)
CXXFLAGS+=-Wall $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
#----------------------------------------------------------------------
%.o: %.f; $(FC) -o $@ -c $(FCFLAGS) $<
cooset: %: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \
-ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
/bin/mv -fv $@
else
sehefi coma epi chaco sesoc: %: %.o
$(FC) -o $@ $< -ltf -lsff -L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
offli sesot merse: %: %.o
$(FC) -o $@ $< -ltf -lsffu -ltime_trad -lsff -L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
cooset: %: %.o
$(CXX) -o $@ $^ -I$(LOCINCLUDEDIR) -lsffxx -ltime++ -lgsexx -laff \
-ltfxx -L$(LOCLIBDIR) $(CXXFLAGS) $(FLAGS)
/bin/mv -fv $@ $(LOCBINDIR)
endif
offlix: %x: %.o
$(FC) -o $@ $< -ltf -lsffu -ltime_trad \
-lfapidxx -ldatrwxx -lsffxx -lgsexx -ltime++ -laff -L$(LOCLIBDIR)
#======================================================================
# create package
# --------------
VERSIONCODE=$(shell date +'%Y%m%d')
PACKAGE=sffutilhd$(VERSIONCODE)
PUBLICATIONPATH=$(HOME)/public_html/download/software
TMPPATH=$(HOME)/tmp/$(PACKAGE)
package:
/bin/rm -rfv $(TMPPATH); mkdir -pv $(TMPPATH)
cd $(TMPPATH)/..; cvs export -l -r HEAD \
-d $(PACKAGE) thof/src/conv/sff
cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/LICENSE.GPL
cd $(TMPPATH)/..; cvs export -r HEAD \
-d $(PACKAGE) thof/src/README.compile
cd $(TMPPATH)/..; cvs export -r HEAD \
-d $(PACKAGE) thof/src/README.1st
/bin/bash -c 'cd $(TMPPATH); \
export LOCBINDIR=bin; mkdir -v bin; \
make all; make clean'
cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
gzip --force -9 $(PUBLICATIONPATH)/$(PACKAGE).tar
cd $(TMPPATH)/..; tar cvf $(PUBLICATIONPATH)/$(PACKAGE).tar $(PACKAGE)
bzip2 -f $(PUBLICATIONPATH)/$(PACKAGE).tar
# ----- END OF Makefile -----
......@@ -26,7 +26,8 @@ c REVISIONS and CHANGES
c 30/05/2000 V1.0 Thomas Forbriger
c 20/09/2000 V1.1 introduced chaco option
c 23/09/2002 V1.2 introduced wolle infofile option
c 09709/2004 V1.3 teleseismic mode
c 09/09/2004 V1.3 teleseismic mode
c 17/01/2011 V1.4 use libfapidxx interface for file reading
c
c==============================================================================
c
......@@ -59,9 +60,9 @@ c
real offset(mtrace)
c commandline
integer maxopt, lastarg, iargc
character*80 argument, infile
parameter(maxopt=9)
character*2 optid(maxopt)
character*80 argument, infile, informat
parameter(maxopt=10)
character*3 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c
......@@ -76,9 +77,9 @@ c
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v,2h-r,2h-c,2h-i,2h-I,2h-S,2h-s,2h-t/
data opthasarg/5*.FALSE.,3*.TRUE.,.FALSE./
data optarg/6*1h-,1h2,12h0. 0. 1. -1.,1h-/
data optid/2h-d, 2h-v,2h-r,2h-c,2h-i,2h-I,2h-S,2h-s,2h-t,'-ty'/
data opthasarg/5*.FALSE.,3*.TRUE.,.FALSE.,.true./
data optarg/6*1h-,1h2,12h0. 0. 1. -1.,1h-,'sff'/
c
c------------------------------------------------------------------------------
c basic information
......@@ -86,11 +87,15 @@ c
c
argument=' '
if (iargc().eq.1) call getarg(1, argument)
if ((argument(1:5).eq.'-help').or.(iargc().lt.1)) then
if ((argument(1:6).eq.'-xhelp')) then
call sff_help_details
stop
else if ((argument(1:5).eq.'-help').or.(iargc().lt.1)) then
print *,version
print *,'Usage: offli filename [-r|-c|-i|-t]'
print *,'Usage: offli filename [-r|-c|-i|-t] [-ty f]'
print *,' [-I ID] [-S typ] [-s line]'
print *,' or: offli -help'
print *,' or: offli -xhelp'
if (argument(1:5).ne.'-help')
& stop 'ERROR: wrong number of arguments'
print *,' '
......@@ -102,6 +107,7 @@ c
print *,'-c write file appropriate for chaco'
print *,'-i write wolle info-file format'
print *,'-t teleseismic mode'
print *,'-ty f read date file of type f'
print *,' '
print *,'-I ID define event ID'
print *,'-S typ define source type'
......@@ -113,6 +119,8 @@ c
print *,' default is vertical force or explosion'
print *,' '
print *,OFFLI_CVS_ID
print *,' '
call sff_help_formats
stop
endif
c
......@@ -133,13 +141,16 @@ c
read(optarg(7), *) argstyp
argsline=optarg(8)
teleseismic=optset(9)
informat=optarg(10)
c
c------------------------------------------------------------------------------
c go
if (verbose) print *,'open ',infile(1:index(infile,' '))
call sff_select_input_format(informat, ierr)
if (ierr.ne.0) stop 'ERROR: selecting input file format'
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'
if (ierr.ne.0) stop 'ERROR: opening data file'
last=.false.
ntrace=0
c
......
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