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

merged recent trunk changes

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/branches/su1
SVN Revision: 3693
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent daa8ac50
......@@ -109,6 +109,18 @@ Environment variables in Makefiles
Libraries
---------
Most libraries are available from subdirectory src/libs in the repository.
Just call 'make install' in this subdirectory.
Libraries available from other places are:
libgremlin1xx.a
in subdirectory src/green/gremlin1/cxx
librefread.a
in subdirectory src/synt/ref/refmet
libginmod.a, libgindat.a, libgininv.a, libginpar.a, libginpg.a, libgin.a,
libginres.a
in subdirectory src/green/gremlin1/libs
The library packages depend on each other. If you start compiling from
scratch, you should install them in the following order:
libaff: base library, depends only on common system libraries
......@@ -131,7 +143,8 @@ Libraries
too.
The code also depends on some external libraries:
liblapack, libblas, libgslcblas, libgsl, libboost, libfftw3
liblapack, libblas, libgslcblas, libgsl, libboost, libfftw3, libpgplot
For these libraries the appropriate header files are required too.
The libraries required are usually listed in the preamble of the individual
Makefiles.
......
......@@ -104,6 +104,8 @@ c 13/11/10 V3.20 - do not expose misleading term "green" to the
c user
c - use GSL instead of numerical recipes
c 30.12.2010 V3.21 - implemented libfapidxx
c 12/01/2011 V3.21b - added definition of Fourier transformation
c online help text
c
c==============================================================================
c
......@@ -113,7 +115,7 @@ c first we declare some general variables
c
character*79 version,CVSID
parameter(version=
&'GREDA V3.21 Calculate Fourier-Bessel expansion coefficients')
&'GREDA V3.21b Calculate Fourier-Bessel expansion coefficients')
parameter(CVSID=
& '$Id$')
c
......@@ -342,7 +344,9 @@ c
print *,' '
print *,'Parameters defining the expansion:'
print *,'-1 Use the Hankel function H^(1)_0 instead of J_0'
print *,' (see remark on Fourier transformation below)'
print *,'-2 Use the Hankel function H^(2)_0 instead of J_0'
print *,' (see remark on Fourier transformation below)'
print *,'-q f,e Damping factor for inner product.'
print *,' The inner product damping will be calculated'
print *,' as rho=delta_r_min*f*omega**e.'
......@@ -400,6 +404,22 @@ c
print *,'rho should be chosen somewhere around delta_r_min*omega,'
print *,'where delta_r_min is the minimal offset difference.'
print *,' '
print *,'Definition of the Fourier transformation:'
print *,'The Fourier transformation used in this program and in'
print *,'related programs (like gremlin, syg, and gresy) is'
print *,'defined as'
print *,' '
print *,' U(omega) = int_-infnity^+infnity u(t) exp(-i*omega*t) dt'
print *,' '
print *,'Theoretical descriptions of wave propagation often use'
print *,'exp(i*omega*t) as transform kernel instead of exp(-i*omega*t)'
print *,'in order to make positive wavenumbers equivalent to wave'
print *,'propagation in positive coordinate direction. The Fourier'
print *,'coefficients calculated by this program consequently are'
print *,'the complex conjugates of those used in theory. Where'
print *,'H^(2)_0 is used in theory, you have to use H^(1)_0'
print *,'in greda.'
print *,' '
print *,'$Id$'
call pwo_cvsid
print *,' '
......
......@@ -22,6 +22,21 @@
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
# required libraries:
# libgin:
# will be compiled by the Makefile in subdirectory libs
# libtf, libgrrefsub (only for gremlin), libwrefsub (only for wgremlin):
# are available from directory src/libs
# just call 'make install' in directory src/libs of your working copy
# librefread:
# is available in directory src/synt/ref/refmet
# just call 'make librefread.a' in directory src/synt/ref/refmet of your
# working copy
# libpgplot:
# is expected to be installed from external
# libblas, liblapack:
# are expected to be installed in some system library path
#
# 19/01/2001 tidy up
# 01/03/2002 copy glq_dim.inc from standard if not present
#
......@@ -30,16 +45,29 @@
# 30/12/2002 V1.1 added C++ directory
# 09/02/2010 V1.2 transition to gfortran
# 17/11/2010 V1.3 migrated to SVN scheme; avoid incdep
# 10/01/2010 V1.4 libgin.a must be compiled before gremlin is going to
# be linked
# 14/01/2011 V1.5 call cxx/Makefile in top-level targets
#
# ============================================================================
#
.PHONY: all
all: install
install: allhere allgremlin
(cd libs; make libs)
make allhere
allhere: gremlin wgremlin gredim gremlin.pdf
.PHONY: install
install:
(cd cxx; $(MAKE) install)
$(MAKE) libraries
$(MAKE) allhere
.PHONY: libraries
libraries:
(cd cxx; $(MAKE) install)
(cd libs; $(MAKE) libs)
.PHONY: allhere
allhere: gremlin wgremlin gredim gremlin.pdf
# check mandatory environment variable settings
# ---------------------------------------------
......@@ -90,10 +118,6 @@ libs/glq_dim.inc: libs/glq_dimstd.inc; /bin/cp -v $< $@
%.o: %.f
$(FC) -o $@ -c $< $(FFLAGS)
allgremlin:
(cd libs; make libgin.a)
make gremlin
gremlin: gremlin.o gremlin_help.o
$(FC) -o gremlin $^ \
-L$(LOCLIBDIR) \
......@@ -115,12 +139,6 @@ wgremlin: gremlin.o gremlin_help.o
gredim: gredim.o
$(FC) -o gredim gredim.o $(GFLAG) $(F2CLIB)
#----------------------------------------------------------------------
# C++ interface
# -------------
libgremlin1xx.a:
cd cxx; $(MAKE) $@
#======================================================================
# documentation
......
......@@ -41,12 +41,17 @@
# REVISIONS and CHANGES
# 30/12/2002 V1.0 Thomas Forbriger
# 09/02/2010 V1.1 checked for new compiler
# 14/01/2011 V1.2 provide reinstall target
#
# ============================================================================
#
# You will find the installed library header files in $(LOCINCLUDEDIR)/aff
all: install-include libgremlin1xx.a doxydoc
.PHONY: all
all: install doxydoc
.PHONY: install
install: install-include libgremlin1xx.a
# check mandatory environment variable settings
# ---------------------------------------------
......@@ -103,7 +108,7 @@ endif
#----------------------------------------------------------------------
# files which are to be edited
flist: Makefile doxyfull.cfg $(README) $(HEADERS) $(SRC)
flist: Makefile doxydoc.cfg $(README) $(HEADERS) $(SRC)
echo $^ | tr ' ' '\n' | sort >> $@
# Offers you a list of files to edit (ask Thomas for appropriate vim
......@@ -185,6 +190,19 @@ $(INCINSTALLPATH)/%.h: %.h.strip
install-include: $(INSTHEADER)
echo $^ | tr ' ' '\n'
#======================================================================
# reinstall target
# is necessary in case of header file problems (e.g. remcmmnt not installed)
.PHONY: clean-include
clean-include:
/bin/rm -fv $(INSTHEADER)
.PHONY: reinstall
reinstall:
$(MAKE) clean
$(MAKE) clean-include
$(MAKE) install
#======================================================================
# documentation part
# ------------------
......
......@@ -21,6 +21,34 @@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
# ----
#
# Required libraries:
# polex requires:
# libtf
# moche requires:
# libtf, librefread
# moshift, moval, motab, mops, clemo, and splimo require:
# libgin, libtf
# mocon requires:
# libtf, librefread, libgin
# mop and pmotra require:
# libgin, libtf, libpgplot
# mocoxx and grestf require:
# libgremlin1xx, libfourierxx, libtfxx, libaff
#
# libgin, libgremlin1xx.a:
# is available from directory src/green/gremlin1
# just call 'make libraries' in directory src/green/gremlin1 of your
# working copy
# libtf, libtfxx, libaff, libfourierxx:
# are available from directory src/libs
# just call 'make install' in directory src/libs of your working copy
# librefread:
# is available in directory src/synt/ref/refmet
# just call 'make librefread.a' in directory src/synt/ref/refmet of your
# working copy
# libpgplot:
# is expected to be installed from external
#
# REVISIONS and CHANGES
# 09/02/2010 V1.0 Thomas Forbriger
......@@ -104,13 +132,8 @@ mocon: %: %.o
$(FC) -o $@ $^ $(FFLAGS) -lgin -lrefread -ltf $(LDFLAGS)
/bin/mv -fv $@ $(LOCBINDIR)
mop: %: %.o
$(FC) -o $@ $^ $(FFLAGS) -lgin -ltf -ltf \
$(LDFLAGS) $(TF_LINK_PGPLOT)
/bin/mv -fv $@ $(LOCBINDIR)
pmotra: %: %.o
$(FC) -o $@ $^ $(FFLAGS) -lgin -ltf -ltf \
mop pmotra: %: %.o
$(FC) -o $@ $^ $(FFLAGS) -lgin -ltf \
$(LDFLAGS) $(TF_LINK_PGPLOT)
/bin/mv -fv $@ $(LOCBINDIR)
......
......@@ -47,12 +47,14 @@ c the problem disappeared for unkown reason...
c 26/02/10 V1.12 introduced line-source mode
c 01/03/10 V1.13 correction (linesource summation was simply wrong)
c 02/03/10 V1.14 corrected (hopefully) line source integration
c 12/01/2011 V1.14b - added definition of Fourier transformation
c online help text
c
c==============================================================================
c
program gresy
character*79 version
parameter(version='GRESY V1.14 GREens function SYnthetics')
parameter(version='GRESY V1.14b GREens function SYnthetics')
c dimensions
integer maxtr, maxsamp, maxom, maxu
parameter(maxu=10000, maxtr=maxu, maxom=4100, maxsamp=maxom*2)
......@@ -151,10 +153,28 @@ c
print *,' produced by ''gremlin'' '
print *,'-S suppress zero frequency and zero slowness'
print *,'-1 use Hankel 1 instead of Bessel'
print *,' (see remark on Fourier transformation below)'
print *,'-2 use Hankel 2 instead of Bessel'
print *,' (see remark on Fourier transformation below)'
print *,'-L simulate seismograms from line source (2D)'
print *,'-R calculate radial component'
print *,' '
print *,'Definition of the Fourier transformation:'
print *,'The Fourier transformation used in this program and in'
print *,'related programs (like gremlin, syg, and greda) is'
print *,'defined as'
print *,' '
print *,' U(omega) = int_-infnity^+infnity u(t) exp(-i*omega*t) dt'
print *,' '
print *,'Theoretical descriptions of wave propagation often use'
print *,'exp(i*omega*t) as transform kernel instead of exp(-i*omega*t)'
print *,'in order to make positive wavenumbers equivalent to wave'
print *,'propagation in positive coordinate direction. The Fourier'
print *,'coefficients calculated by this program consequently are'
print *,'the complex conjugates of those used in theory. Where'
print *,'H^(2)_0 is used in theory, you have to use H^(1)_0'
print *,'in gresy.'
print *,' '
print *,'Input file units:'
print *,' '
print *,' Slowness unit: s/m'
......
......@@ -30,6 +30,8 @@ c 14/03/02 V1.3 do not calculate static case with flgevas
c 15/03/02 V1.4 iragc was declared twice
c 26/03/02 V1.5 now optionally support complex angular frequencies
c 04/03/10 V1.6 comment regarding the source amplitude was wrong!
c 12/01/2011 V1.6b - added definition of Fourier transformation
c online help text
c
c==============================================================================
c
......@@ -38,7 +40,7 @@ c
c variables
character*79 version
parameter (version=
& 'SYG V1.6 calculate synthetic greens matrix')
& 'SYG V1.6b calculate synthetic greens matrix')
c
integer mu, mom
parameter (mu=10000, mom=4100)
......@@ -107,6 +109,20 @@ c go
print *,' -s sigma set imaginary part of angular frequency'
print *,' to -sigma.'
print *,' '
print *,'Definition of the Fourier transformation:'
print *,'The Fourier transformation used in this program and in'
print *,'related programs (like gremlin, greda, and gresy) is'
print *,'defined as'
print *,' '
print *,' U(omega) = int_-infnity^+infnity u(t) exp(-i*omega*t) dt'
print *,' '
print *,'Theoretical descriptions of wave propagation often use'
print *,'exp(i*omega*t) as transform kernel instead of exp(-i*omega*t)'
print *,'in order to make positive wavenumbers equivalent to wave'
print *,'propagation in positive coordinate direction. The Fourier'
print *,'coefficients calculated by this program consequently are'
print *,'the complex conjugates of those used in theory.'
print *,' '
c 4.3.2010 notice: the following comment was wrong!
c gr_refsub reads the source amplitude and uses it for scaling
c print *,'Notice: the source amplitude is ignored.'
......
......@@ -11,6 +11,7 @@
# 20/11/2007 V1.1 discontinued libbuggy
# 19/12/2007 V1.2 first install headers then compile
# first remove .d-files then the rest
# 12/01/2010 V1.3 provide target install for consistency
#
# ============================================================================
#
......@@ -32,6 +33,9 @@ LIBDIRS=libaff \
libtsxx \
libserialxx \
libfapidxx \
libgrrefsub \
libwrefsub \
librheology \
libttsynt
TARGETS=$(addsuffix .install,$(LIBDIRS))
......@@ -40,9 +44,17 @@ INSTINCLUDE=$(addsuffix .install-include,$(LIBDIRS))
DOCTARGETS=$(addsuffix .doc,$(LIBDIRS))
CLEANTARGETS=$(addsuffix .clean,$(LIBDIRS))
all: $(INSTINCLUDE) $(TARGETS)
.PHONY: all
all: install doc
.PHONY: install
install: $(INSTINCLUDE) $(TARGETS)
.PHONY: install-include
install-include: $(INSTINCLUDE)
.PHONY: reinstall
reinstall: $(REINSTALL)
.PHONY: doc
doc: $(DOCTARGETS)
.PHONY: show
show: ; @echo $(TARGETS)
flist: $(shell find . -name Makefile)
......@@ -61,7 +73,7 @@ clean:
%.install: %; cd $<; $(MAKE) install
%.reinstall: %; -(cd $<; $(MAKE) reinstall)
%.install-include: %; -(cd $<; $(MAKE) install-include)
%.doc: %; -(cd $<; $(MAKE) install doxyfull doc; $(MAKE))
%.doc: %; -(cd $<; $(MAKE) doxyfull doxydoc doc; $(MAKE))
%.clean: %; cd $<; $(MAKE) clean
# ----- END OF Makefile -----
......@@ -8,7 +8,7 @@
#
# provide Fourier coefficients of filter responses etc.
#
# this library make use of libtfxx
# this library makes use of libtfxx
# libtfxx must be installed first
#
# REVISIONS and CHANGES
......@@ -28,6 +28,9 @@
# 07/10/2010 V1.4 - migrate to FFTW3
# 15/11/2010 V1.5 - avoid makefdoc.pl
# 18.12.2010 V1.6 - shared library does not work satisfactory
# 11.01.2011 V1.7 - renamed Fortran source code such that
# Fotran object files to not conflict with
# C++ object files
#
# ============================================================================
#
......@@ -145,7 +148,7 @@ HEADERS=$(shell find . -name \*.h)
# in the binary version of the library
# (see below for the configuration of a preinstantiated version of template
# code)
SRC=fcommand.cc filter.cc polesnzeroes.cc fftwaff.cc error.cc
SRC=fcommand.cc filters.cc polesnzeroes.cc fftwaff.cc error.cc
# test programs are placed in a subdirectory
TESTS=$(wildcard tests/*.cc)
# whereever we find a README, we will use it
......
......@@ -100,7 +100,7 @@ int main(int iargc, char* argv[])
char usage_text[]=
{
CXXFFTWTEST_VERSION "\n"
"usage: cxxfftwtest" "\n"
"usage: cxxfftwtest [-n n] [-m f]" "\n"
" or: cxxfftwtest --help|-h" "\n"
};
......@@ -108,6 +108,9 @@ int main(int iargc, char* argv[])
char help_text[]=
{
CXXFFTWTEST_CVSID
"\n"
"-n n set number of samples to n\n"
"-m f set frequency to f\n"
};
// define commandline options
......
......@@ -84,6 +84,8 @@ enum {psls, ps, gif} filetypes; */
/*! \brief hold any parameter range
* \sa basic_device::rnge
* \sa Trect
* \todo
* The definition of total() and absmax() is counter-intuitive!
*/
struct Trange {
//! range \a [min....max]
......
......@@ -30,8 +30,10 @@
# ============================================================================
#
ifndef CHECKVARS
ifndef CHECKVAR
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
endif
ifndef CHECKVARS
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
endif
......@@ -43,17 +45,28 @@ endif
# TF_PUBLICATIONPATH: path to drop packages
# PACKAGETARGETS: targets to build with packaged Makefile
# PACKAGEEXPORT: repository paths to export to src directory
#
$(call CHECKVARS,PACKAGE SVNTF TF_PUBLICATIONPATH)
$(call CHECKVARS,PACKAGECONTENTS PACKAGETARGETS PACKAGEEXPORT)
#----------------------------------------------------------------------
# basic preparation
#
# version code based on current date
VERSIONCODE=$(shell date +'%Y%m%d')
# name of the package (including version code)
THEPACKAGE=$(PACKAGE)$(VERSIONCODE)
# path where the package will be created
TMPPATH=$(HOME)/tmp/$(PACKAGE)
# tar file
PACKAGETARFILE=$(THEPACKAGE).tar
# gzipped tar file
PACKAGEGZIPFILE=$(PACKAGETARFILE).gz
# bzipped tar file
PACKAGEBZIPFILE=$(PACKAGETARFILE).bz2
# create package files
package: $(TF_PUBLICATIONPATH)/$(PACKAGEBZIPFILE) \
$(TF_PUBLICATIONPATH)/$(PACKAGEGZIPFILE)
rm -fv $(PACKAGETARFILE)
......@@ -73,8 +86,10 @@ TMPPATHCONTENTS=README.compile README.1st TFbashrc LICENSE.GPL \
ifdef THEFROZZLEHASDONEITALREADY
package:
/bin/rm -rfv $(TMPPATH); mkdir -pv $(TMPPATH)
cd $(TMPPATH)/..; cvs -d $(CVSSERVER) \
/bin/rm -rfv $(TMPPATH)
mkdir -pv $(TMPPATH)
mkdir -pv $(TMPPATH)/src
cd $(TMPPATH); mkdi/..; cvs -d $(CVSSERVER) \
export -r HEAD -d $(PACKAGE) libaff
cd $(TMPPATH)/..; cvs export -r HEAD -d $(PACKAGE) thof/src/LICENSE.GPL
cd $(TMPPATH)/..; cvs export -r HEAD \
......
......@@ -256,7 +256,7 @@ tidofi.%.report.ps: %.t.xxx.sff
a2ps -1 -o $@ $(patsubst %.sff,%.out,$<)
control.%.xxx.out: %.s.xxx.sff %.t.xxx.sff %.s.xxx.fil %.t.xxx.fil
tail -999 $(patsubst %.sff,%.out,$^) > $@
tail -n 999 $(patsubst %.sff,%.out,$^) > $@
control.%.ps: control.%.xxx.out
cat $< \
| a2ps -A virtual -o $@ -1 -r -l 100 \
......
......@@ -46,6 +46,8 @@
* - 14/12/2010 V1.8 implemented segment averaging
* distinguish between input series, output spectrum
* and segment (analysis) series
* - 10/01/2011 V1.8b corrected Fourier transformation formula in
* doxygen documentation
*
* \note 08/01/2010:
* Scaling for foutra power spectrum was tested against theory.
......@@ -1152,12 +1154,12 @@ int main(int iargc, char* argv[])
* We understand
* \f[
* \tilde{f}(\omega)=\int\limits_{-\infty}^{+\infty}
* f(t) \,e^{i\omega t} \frac{\textrm{d}{\omega}}{2\pi}
* f(t) \,e^{-i\omega t} \textrm{d}{t}.
* \f]
* as the Fourier transformation of the time domain signal
* \f[
* f(t)=\int\limits_{-\infty}^{+\infty}
* \tilde{f}(\omega) \,e^{-i\omega t} \textrm{d}{t}.
* \tilde{f}(\omega) \,e^{i\omega t} \frac{\textrm{d}{\omega}}{2\pi}.
* \f]
* If we apply a time domain window function \f$w(t)\f$ to the function
* \f$f(t)\f$, we obtain the tapered function
......@@ -1303,7 +1305,7 @@ int main(int iargc, char* argv[])
* \skip # test foutra scaling for harmonic signals
* \until #----------------------------------------------------------------------
*
* \date 12.12.2010 \author thof
* \date 10.01.2011 \author thof
*/
/* ----- END OF foutra.cc ----- */
......@@ -30,11 +30,12 @@
* REVISIONS and CHANGES
* - 15/03/2005 V1.0 Thomas Forbriger
* - 09/03/2010 V1.1 added normalization
* - 22.12.2010 V1.2 implement libdatrwxx writing functions
*
* ============================================================================
*/
#define GATHERDIFF_VERSION \
"GATHERDIFF V1.1 calculate difference between shot gathers"
"GATHERDIFF V1.2 calculate difference between shot gathers"
#define GATHERDIFF_CVSID \
"$Id$"
......@@ -43,8 +44,9 @@
#include <string>
#include <tfxx/commandline.h>
#include <tfxx/error.h>
#include <sffostream.h>
#include <datrwxx/sff.h>
#include <tfxx/misc.h>
#include <datrwxx/readany.h>
#include <datrwxx/writeany.h>
#include <aff/series.h>
#include <aff/seriesoperators.h>
#include <aff/functions/absmax.h>
......@@ -56,7 +58,9 @@ using std::endl;
/*----------------------------------------------------------------------*/
struct Options {
bool verbose, debug, normalize;
bool verbose, debug, normalize, overwrite;
datrw::Eformat inputformat, outputformat;
double srtol;
}; // struct Options
typedef aff::Series<double> Tseries;
......@@ -71,7 +75,10 @@ int main(int iargc, char* argv[])
{
GATHERDIFF_VERSION "\n"
"usage: gatherdiff infile1 infile2 outfile [-v] [-n]" "\n"
" [--overwrite] [--type f] [--Type f]" "\n"
" [--srtol r]" "\n"
" or: gatherdiff --help|-h" "\n"
" or: gatherdiff --xhelp" "\n"
};
// define full help text
......@@ -91,6 +98,11 @@ int main(int iargc, char* argv[])
"\n"
"-v be verbose" "\n"
"-n normalize input time series to their absolute maximum" "\n"
"--overwrite overwrite out put file (in case it already exists)" "\n"
"--type f input files have data file format \"f\"" "\n"
"--Type f output file will be written in data file format \"f\"" "\n"
"--srtol r set sampling rate tolerance for comaprison of" "\n"
" input data" "\n"
"\n"
GATHERDIFF_CVSID
};
......@@ -107,6 +119,14 @@ int main(int iargc, char* argv[])
{"DEBUG",arg_no,"-"},
// 3: normalize
{"n",arg_no,"-"},
// 4: overwrite output
{"overwrite",arg_no,"-"},
// 5: input data format
{"type",arg_yes,"sff"},
// 6: output data format
{"Type",arg_yes,"sff"},
// 7: output data format
{"srtol",arg_yes,"0.001"},
{NULL}
};
......@@ -128,34 +148,14 @@ int main(int iargc, char* argv[])
exit(0);
}
/*
// dummy operation: print option settings
for (int iopt=0; iopt<2; iopt++)
{