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

migrated to new scheme; avoid incdep; activated all code

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: 3398
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent b57bcbc9
......@@ -13,56 +13,43 @@
# 01/03/2002 V1.0 Thomas Forbriger
# 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
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
all: install
ifeq ($(TF_FALLBACK),yes)
install: allhere allgremlin
LINLIB=-llapex -lblasex
else
install: allhere allgremlin
(cd libs; make libs)
make allhere
allhere: gremlin wgremlin gredim
# check mandatory environment variable settings
# ---------------------------------------------
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
LINLIB=-llapack -lblas
endif
#
FLAGS += $(MYFLAGS)
BUGGY=
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
F2CFLAGS=-f -u
PGPLOTLIB=-lf2cpgplot52 -lX11 -L/usr/X11/lib
PGPLOTLIB77=-lpgplot52 -lX11 -L/usr/X11/lib -L${SERVERLIBDIR}
CC=gcc
GFLAG=
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += -O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
CFLAGS += $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
AR=ar
RANLIB=ranlib
ifeq ($(TF_FALLBACK),yes)
.f.o:
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c
@rm $(<:.f=.c)
%.o77: %.f
g77 -O2 -o $@ -c $< -Wall -ffixed-line-length-0 -fno-backslash
else
%.o: %.f
$(FC) -o $@ -c $< $(FFLAGS)
endif
#----------------------------------------------------------------------
.PHONY: clean edit
clean:
-/bin/rm *.o *.bak flist make.incdep
-/bin/rm *.o *.bak flist make.incdep *.d
edit: flist
vim flist
......@@ -70,46 +57,24 @@ edit: flist
flist: *.f */*.f *.inc */*.inc Makefile */Makefile */*.h */*.cc
echo $^ | tr ' ' '\n' | sort > $@
make.incdep: *.f
incdep > make.incdep
-include make.incdep
all:
(cd libs; make libs)
make allhere
#----------------------------------------------------------------------
# Fortran dependencies
# --------------------
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
allhere: gremlin wgremlin gredim
libs/glq_dim.inc: libs/glq_dimstd.inc; /bin/cp -v $< $@
flow:
flow -f -R gremlin.f gremlin_help.f libs/*.f
#----------------------------------------------------------------------
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
ifeq ($(TF_FALLBACK),yes)
gremlin: gremlin.o gremlin_help.o
gcc -o gremlin $^ \
-lgin \
-lgrrefsub -lrefread \
$(LINLIB) -ltf $(PGPLOTLIB) \
$(BUGGY) $(F2CLIB) -L$(LOCLIBDIR)
newprog gremlin
# version using wang code
wgremlin: gremlin.o gremlin_help.o
gcc -o $@ $^ \
-lgin \
-lwrefsub -lrefread \
$(LINLIB) -ltf $(PGPLOTLIB) \
$(BUGGY) $(F2CLIB) -L$(LOCLIBDIR)
newprog $@
gredim: gredim.o
gcc -o gredim gredim.o $(GFLAG) $(F2CLIB)
else
gremlin: gremlin.o gremlin_help.o
$(FC) -o gremlin $^ \
-L$(LOCLIBDIR) \
......@@ -124,13 +89,12 @@ wgremlin: gremlin.o gremlin_help.o
$(FC) -o $@ $^ \
-lgin \
-lwrefsub -lrefread \
$(LINLIB) -ltf -l$(TF_g77_PGPLOT) \
$(BUGGY) -L$(LOCLIBDIR) $(TF_LINK_PGPLOT)
$(LINLIB) -ltf $(TF_LINK_PGPLOT) \
$(BUGGY) -L$(LOCLIBDIR)
/bin/mv -fv $@ $(LOCBINDIR)
gredim: gredim.o
$(FC) -o gredim gredim.o $(GFLAG) $(F2CLIB)
endif
#----------------------------------------------------------------------
# C++ interface
......
......@@ -18,29 +18,30 @@
# 04/07/2002 V1.3 new mseisfk offset removal
# 09/02/2010 V1.4 transition to gfortran
# 15/11/2010 V1.5 avoid makefdoc.pl
# 17/11/2010 V1.6 migrated to SVN scheme; avoid incdep
#
# ============================================================================
#
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
all: install
ifeq ($(TF_FALLBACK),yes)
install: libs
else
install: libs
endif
F2CLIB=-lf2c -lm -L${SERVERLIBDIR}
F2CFLAGS=-f -u
CC=gcc
libs: libginmod.a libgindat.a libgininv.a libginpar.a libginpg.a libgin.a \
libginres.a
# check mandatory environment variable settings
# ---------------------------------------------
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
FLAGS += $(MYFLAGS)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += -O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
CFLAGS += $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
AR=ar
RANLIB=ranlib
......@@ -76,25 +77,13 @@ RESOBS=res_part.o res_opt.o res_orth.o res_wgpart.o res_wresmod.o \
OLDOBS=mod_parcor1.o mod_chop1.o
OLGPGOBS=
ALLOBS=$(PGOBS) $(PAROBS) $(MODOBS) $(DATOBS) $(INVOBS) $(RESOBS)
ALLOBS77=$(ALLOBS:.o=.o77)
ifeq ($(TF_FALLBACK),yes)
.f.o:
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(GFLAG) $(<:.f=.c) -c
@rm $(<:.f=.c)
%.o77: %.f
g77 -O2 -o $@ -c $< -Wall -ffixed-line-length-0 -fno-backslash
else
%.o77: %.f
$(FC) -O2 -o $@ -c $< -Wall $(FFLAGS)
endif
#----------------------------------------------------------------------
clean:
-/bin/rm *.o *.bak *.o77
-/bin/rm *.o *.bak *.o77 *.d
glq_dim.inc: glq_dimstd.inc; /bin/cp -v $< $@
#----------------------------------------------------------------------
docs: libmod.doc libdat.doc libpar.doc libpg.doc libinv.doc libres.doc
......@@ -119,12 +108,15 @@ libres.doc: $(patsubst %.o,%.f,$(RESOBS)) glq_invres.inc
/^cE/ { hot=0; } \
{ if (hot==1) { print " " $$0; } }' $^ > $@
make.incdep: *.f
incdep > make.incdep
-include make.incdep
#----------------------------------------------------------------------
libs: libginmod.a libgindat.a libgininv.a libginpar.a libginpg.a libgin.a \
libginres.a
glq_dim.inc: glq_dimstd.inc; /bin/cp -v $< $@
# Fortran dependencies
# --------------------
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
libginres.a: $(RESOBS)
ar rcv libginres.a $(RESOBS)
......@@ -156,11 +148,6 @@ libgin.a: $(PGOBS) $(PAROBS) $(MODOBS) $(DATOBS) $(INVOBS) $(RESOBS)
ranlib libgin.a
/bin/mv -fv $@ $(LOCLIBDIR)
libgin77.a: $(ALLOBS77)
ar rcv $@ $^
ranlib $@
/bin/mv -fv $@ $(LOCLIBDIR)
libginpg.a: $(PGOBS)
ar rcv libginpg.a $(PGOBS)
ranlib libginpg.a
......
......@@ -13,70 +13,51 @@
#
# ============================================================================
#
# NOTICE: fallback solution (f2c is default) can be activated by the
# environment variable TF_FALLBACK
# This option will disappear somewhere in the future!
all: install
ifeq ($(TF_FALLBACK),yes)
install: alltools
else
install: alltools
endif
FLAGS=
alltools: polex moche moval motab clemo splimo mocon mop pmotra mocox
# check mandatory environment variable settings
# ---------------------------------------------
LIBGIN=-lgin
FFLAGS=-ffixed-line-length-0 -Wall -fno-backslash -O2
TFLIB=-ltf -L$(LOCLIBDIR)
TFLIB77=-ltf77 -L$(LOCLIBDIR)
LIBNUMREC=-lnumrec -L$(LOCLIBDIR)
LIBREFREAD=-lrefread -L$(LOCLIBDIR)
LIBNUMREC77=-lnumrec77 -L$(LOCLIBDIR)
PGLIB=-lpgplot52 -L$(SERVERLIBDIR) -lX11 -L/usr/X11/lib
PGLIB77=-lpgplot77 -L$(SERVERLIBDIR) -lX11 -L/usr/X11/lib
F2CPGLIB=-lf2cpgplot52 -L$(SERVERLIBDIR) -lX11 -L/usr/X11/lib
F2CFLAGS=-u -f -I../
LIBF2C=-lf2c -lm -L$(SERVERLIBDIR)
CXXFLAGS=-Wall $(FLAGS)
LDFLAGS=-L$(LOCLIBDIR)
CPPFLAGS=-I$(LOCINCLUDEDIR)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS) -I../
CFLAGS += -O3 -I${SERVERINCLUDEDIR} -I${LOCINCLUDEDIR} $(FLAGS)
CHECKVAR=$(if $($(1)),,$(error ERROR: missing variable $(1)))
CHECKVARS=$(foreach var,$(1),$(call CHECKVAR,$(var)))
CXXSRC=mocox.cc grestf.cc
$(call CHECKVARS,LOCINCLUDEDIR LOCLIBDIR LOCBINDIR)
ifeq ($(TF_FALLBACK),yes)
.f.o:
f2c $(F2CFLAGS) $<
$(CC) $(CFLAGS) $(<:.f=.c) -c
@rm $(<:.f=.c)
else
%.o: %.f
$(FC) -o $@ -c $< $(FFLAGS)
endif
LINLIB=-llapack -lblas
alltools: polex moche moval motab clemo splimo mocon mop pmotra mocox
FLAGS += $(MYFLAGS)
FFLAGS += -ff2c -Wall -ffixed-line-length-0 -fno-backslash $(FLAGS)
CFLAGS += $(FLAGS)
LDFLAGS+=-L$(LOCLIBDIR)
CPPFLAGS+=-I$(LOCINCLUDEDIR) $(FLAGS)
clean:
-/bin/rm *.o *.bak *.o77 *.d
AR=ar
RANLIB=ranlib
LIBGIN=-lgin
%.d: %.f
$(SHELL) -ec 'fdep.sh -S .o -s .f -I .. $^ | \
sed '\''s,^/,,'\'' | \
sed '\''s,\($*\)\.o[ :]*,$@ \1.o : ,g'\''> $@; \
[ -s $@ ] || rm -f $@'
CXXSRC=mocox.cc grestf.cc
#----------------------------------------------------------------------
flist: Makefile $(wildcard *.f *.inc *.cc)
echo $^ | tr ' ' '\n' | sort > $@
.PHONY: edit
edit: flist; vim $<
-include $(subst .f,.d,$(wildcard *.f))
clean:
-/bin/rm *.o *.bak *.o77 *.d
#----------------------------------------------------------------------
# Fortran dependencies
# --------------------
%.d: %.f
echo $<: $(shell cat $< | egrep '^ +include' | cut -f 2 -d \' | sort | uniq) > $@
-include $(patsubst %.f,%.d,$(wildcard *.f))
%.d: %.cc
$(SHELL) -ec '$(CXX) -M $(CPPFLAGS) $(TMPPARDEF) $< \
......@@ -86,47 +67,10 @@ edit: flist; vim $<
-include $(patsubst %.cc,%.d,$(CXXSRC))
#make.incdep: *.f
# incdep > make.incdep
#
#-include make.incdep
#----------------------------------------------------------------------
ifeq ($(TF_FALLBACK),yes)
polex: %: %.o
gcc -o $@ $< -O3 $(TFLIB) $(LIBF2C)
newprog $@
moche: %: %.o
gcc -o $@ $< -O3 $(LIBREFREAD) $(TFLIB) $(LIBF2C)
newprog $@
moshift moval motab mops clemo splimo: %: %.o
gcc -o $@ $< -O3 $(LIBGIN) $(TFLIB) $(LIBF2C)
newprog $@
mocon: %: %.o
gcc -o $@ $< -O3 $(LIBGIN) $(LIBREFREAD) $(TFLIB) $(LIBF2C)
newprog $@
mop: %: %.o
gcc -o $@ $< -O3 $(LIBGIN) $(TFLIB) $(F2CPGLIB) $(LIBF2C)
newprog $@
pmotra: %: %.o
gcc -o $@ $< -O3 $(FFLAGS) $(LIBGIN) $(TFLIB) $(LIBNUMREC) \
$(F2CPGLIB) $(LIBF2C)
newprog $@
$(CXXSRC:.cc=): %: %.o
$(CXX) -o $@ $< $(LDFLAGS) -lgremlin1xx -lfourierxx -ltfxx -laff
newprog $@
%77: %.f
g77 -o $@ $< -O3 -I.. $(FFLAGS) $(LIBGIN) $(TFLIB77) \
$(LIBNUMREC77) $(PGLIB77) -static
newprog $@
else
%.o: %.f
$(FC) -o $@ -c $< $(FFLAGS)
polex: %: %.o
$(FC) -o $@ $^ $(FFLAGS) -ltf $(LDFLAGS)
......@@ -157,7 +101,6 @@ pmotra: %: %.o
$(CXXSRC:.cc=): %: %.o
$(CXX) -o $@ $< $(LDFLAGS) -lgremlin1xx -lfourierxx -ltfxx -laff
/bin/mv -fv $@ $(LOCBINDIR)
endif
# ----- END OF Makefile -----
......@@ -12,17 +12,18 @@ c - no coph_hs anymore
c argument means now bottom of deepest section
c - section depth means now bottom of section
c 28/11/99 V1.2 - introduced chopping master
c 17/11/10 V1.3 - use correct include path
c
c==============================================================================
c
program mocon
c
character*79 version
parameter(version='MOCON V1.2 MOdel CONversion')
parameter(version='MOCON V1.3 MOdel CONversion')
c
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
include 'libs/glq_para.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
include '../libs/glq_para.inc'
c
character*1 mode
character*80 infile,outfile,comment
......@@ -184,8 +185,8 @@ c
c
c write refmet output file
c
include 'libs/glq_dim.inc'
include 'libs/glq_para.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_para.inc'
c
character outfile*(*), comment*(*)
integer n, ms, lu
......
......@@ -11,18 +11,19 @@ c 14/01/99 V1.1 model definition changed (see glq_model.inc)
c there is no more halfspace parameter
c 25/01/99 V1.2 some more options and title plotting
c 01/12/99 V1.3 introduced chopping master
c 17/11/10 V1.4 use correct include path
c
c==============================================================================
c
program mop
c
character*79 version
parameter(version='MOP V1.3 plot polynomial model')
parameter(version='MOP V1.4 plot polynomial model')
c
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
include 'libs/glq_para.inc'
include 'libs/glq_pgpara.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
include '../libs/glq_para.inc'
include '../libs/glq_pgpara.inc'
c
integer narg, arg
real csfactor
......
......@@ -7,6 +7,7 @@ c MOdel P to model S with factor 1./sqrt(3)
c
c REVISIONS and CHANGES
c 30/01/98 V1.0 Thomas Forbriger
c 17/11/10 V1.1 use correct include path
c
c==============================================================================
c
......@@ -14,14 +15,14 @@ c
character*79 version
parameter(version=
& 'MOPS V1.0 MOdel P to model S with factor 1./sqrt(3)')
& 'MOPS V1.1 MOdel P to model S with factor 1./sqrt(3)')
integer iargc, npol, i, j
real factor
character*80 modelname
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
print *,version
if (iargc().ne.1) then
......
......@@ -8,6 +8,7 @@ c shift a gremlin subsurface model
c
c REVISIONS and CHANGES
c 01/06/2006 V1.0 Thomas Forbriger
c 17/11/2010 V1.1 use correct include path
c
c ============================================================================
c
......@@ -15,13 +16,14 @@ c
c
character*(*) version
parameter(version=
& 'MOSHIFT V1.0 shift a gremlin subsurface model')
& 'MOSHIFT V1.1 shift a gremlin subsurface model')
character*(*) MOSHIFT_CVS_ID
parameter(MOSHIFT_CVS_ID='$Id$')
parameter(MOSHIFT_CVS_ID=
& '$Id$')
c
c use subroutines from gremlin1
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
c
integer lu, i, j, k
parameter(lu=20)
......
c this is <motab.f>
c------------------------------------------------------------------------------
c ($Source: /home/tforb/svnbuild/cvssource/CVS/thof/src/green/gremlin1/tools/motab.f,v $)
c ($Id$)
c
c 12/04/2000 by Thomas Forbriger (IfG Stuttgart)
......@@ -17,7 +16,8 @@ c
character*(*) version
parameter(version='MOTAB V1.0 tabulate model parameters')
character*(*) MOTAB_CVS_ID
parameter(MOTAB_CVS_ID='$Id$')
parameter(MOTAB_CVS_ID=
& '$Id$')
c use subroutines from gremlin1
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
......
c this is <moval.f>
c------------------------------------------------------------------------------
c $Id$
c
c 03/03/99 by Thomas Forbriger (IfG Stuttgart)
c
......@@ -9,15 +10,17 @@ c REVISIONS and CHANGES
c 03/03/99 V1.0 Thomas Forbriger
c 24/03/99 V1.1 tell vp/vs
c 11/02/10 V1.2 added note regarding derivatives
c 17/11/10 V1.3 use correct include path
c
c==============================================================================
c
program moval
c
character*79 version
parameter(version='MOVAL V1.2 MOdel parameter VALue at given depth')
parameter(version=
& 'MOVAL V1.3 MOdel parameter VALue at given depth')
c
include 'libs/glq_dim.inc'
include '../libs/glq_dim.inc'
c
logical doeval, doconvert
real depth, a(glqm_mpol), pval(glqm_mpol, glqm_mpar)
......
c this is <splimo.f>
c------------------------------------------------------------------------------
c $Id$
c
c 15/04/98 by Thomas Forbriger (IfG Stuttgart)
c
......@@ -11,13 +12,14 @@ c 14/01/99 V1.1 model definition changed (see glq_model.inc)
c - depth means now bottom of section
c - follow flag handling has changed
c - parameter value calculation has changed
c 17/11/10 V1.2 use correct include path
c
c==============================================================================
c
program splimo
c
character*79 version
parameter(version='SPLIMO V1.1 SPLIt MOdel section')
parameter(version='SPLIMO V1.2 SPLIt MOdel section')
c
character*80 infile, outfile, sdepth
real depth
......@@ -28,8 +30,8 @@ c
integer isec, mod_isec, thissec, ipar, ipol
logical dofollow
c
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
include '../libs/glq_dim.inc'
include '../libs/glq_model.inc'
c commandline
integer maxopt, lastarg, iargc
character*80 argument
......
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