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

new nice program

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: 2125
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 5263dd27
#
# Makefile for src/green/gremlin1/tools
#
# $Id: Makefile,v 1.15 2005-03-09 15:43:01 tforb Exp $
# $Id: Makefile,v 1.16 2006-06-01 17:53:13 tforb Exp $
#
# 26/05/2000 - thof - new dependency generator (fdep.sh)
# 19/01/2001 reactivated them all
......@@ -80,7 +80,7 @@ moche: %: %.o
gcc -o $@ $< -O3 $(LIBREFREAD) $(TFLIB) $(LIBF2C)
newprog $@
moval motab mops clemo splimo: %: %.o
moshift moval motab mops clemo splimo: %: %.o
gcc -o $@ $< -O3 $(LIBGIN) $(TFLIB) $(LIBF2C)
newprog $@
......
c this is <moshift.f>
c ----------------------------------------------------------------------------
c ($Id: moshift.f,v 1.1 2006-06-01 17:53:13 tforb Exp $)
c
c Copyright (c) 2006 by Thomas Forbriger (BFO Schiltach)
c
c shift a gremlin subsurface model
c
c REVISIONS and CHANGES
c 01/06/2006 V1.0 Thomas Forbriger
c
c ============================================================================
c
program moshift
c
character*(*) version
parameter(version=
& 'MOSHIFT V1.0 shift a gremlin subsurface model')
character*(*) MOSHIFT_CVS_ID
parameter(MOSHIFT_CVS_ID='$Id: moshift.f,v 1.1 2006-06-01 17:53:13 tforb Exp $')
c
c use subroutines from gremlin1
include 'libs/glq_dim.inc'
include 'libs/glq_model.inc'
c
integer lu, i, j, k
parameter(lu=20)
logical overwrite
double precision v
character*80 infile, outfile,shiftfile
c commandline
integer maxopt, lastarg, iargc
character*80 argument
parameter(maxopt=3)
character*2 optid(maxopt)
character*40 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c debugging
logical debug, verbose
c here are the keys to our commandline options
data optid/2h-d, 2h-v, 2h-o/
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.4)) then
print *,version
print *,'Usage: moshift [-v] [-o] infile outfile shiftfile v'
print *,' or: moshift -help'
if (argument(1:5).ne.'-help')
& stop 'ERROR: wrong number of arguments'
print *,' '
print *,'infile input model file'
print *,'outfile output model file'
print *,'shiftfile model to be used for shifting'
print *,'v factor to shift model'
print *,' '
print *,'-v be verbose'
print *,'-o overwrite output file'
print *,' '
print *,'The output will be'
print *,'outfile = infile + v * shiftfile'
print *,' '
print *,MOSHIFT_CVS_ID
stop
endif
c
c------------------------------------------------------------------------------
c read command line arguments
c
call tf_cmdline(1, lastarg, maxopt, optid,
& optarg, optset, opthasarg)
debug=optset(1)
verbose=optset(2)
overwrite=optset(3)
call getarg(lastarg+4, infile)
read (infile, *) v
call getarg(lastarg+1, infile)
call getarg(lastarg+2, outfile)
call getarg(lastarg+3, shiftfile)
if (verbose) then
print *,' input model: ',infile(1:index(infile,' ')-1)
print *,' write model to: ',outfile(1:index(outfile,' ')-1)
print *,' shift by model: ',shiftfile(1:index(shiftfile,' ')-1)
print *,' shift factor: ',v
endif
c
if (verbose) print *,'read ',infile(1:index(shiftfile,' ')-1)
call mod_read(shiftfile, mb_work)
if (verbose) print *,'read ',infile(1:index(infile,' ')-1)
call mod_read(infile, mb_ref)
if (verbose) print *,'apply changes'
do i=1,glqm_nsec
mdepth(i, mb_ref)=v*mdepth(i, mb_work)+mdepth(i, mb_ref)
do j=1,glqm_mpar
do k=1,glqm_mpol
model(k, i, j, mb_ref)=
& v*model(k, i, j, mb_work)+model(k, i, j, mb_ref)
enddo
enddo
enddo
call mod_follow(mb_ref)
if (verbose) print *,'write ',infile(1:index(outfile,' ')-1)
call mod_save(outfile, mb_ref, overwrite, version)
c
c------------------------------------------------------------------------------
c go
c
stop
end
c
c
c ----- END OF moshift.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