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

implemented libfapidxx reading

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: 3657
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent 4628e2ac
......@@ -103,6 +103,7 @@ c spectra is sample index
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
c==============================================================================
c
......@@ -112,7 +113,7 @@ c first we declare some general variables
c
character*79 version,CVSID
parameter(version=
&'GREDA V3.20 Calculate Fourier-Bessel expansion coefficients')
&'GREDA V3.21 Calculate Fourier-Bessel expansion coefficients')
parameter(CVSID=
& '$Id$')
c
......@@ -128,7 +129,7 @@ c----------------------------------------------------------------------
c here follows everything we need for the input data hold
c
c datafile
character*80 filename, Fourierfile
character*80 filename, Fourierfile, informat
real fdata(maxsamp)
integer idata(maxsamp)
equivalence(fdata, idata)
......@@ -184,27 +185,28 @@ c parameters
logical pwofile, pwoautofile, pwosel
c command line
integer maxopt, lastarg, iargc
parameter(maxopt=35)
parameter(maxopt=36)
character*4 optid(maxopt)
character*80 optarg(maxopt)
logical optset(maxopt), opthasarg(maxopt)
c here are the keys to our commandline options
data optid/2h-d,2h-t,2h-s,2h-n,2h-f,2h-o,2h-1,2h-2,2h-v,2h-T,2h-S,
& 2h-M,2h-L,2h-q,2h-E,2h-K,2h-D,2h-a,2h-b,2h-g,2h-H,2h-O,2h-Q,2h-B,
& 2h-P,2h-r,2h-F,2h-N,2h-X,2h-W,4h-tap,4h-spo,3h-pw,4h-pwf,4h-pwa/
& 2h-P,2h-r,2h-F,2h-N,2h-X,2h-W,4h-tap,4h-spo,3h-pw,4h-pwf,4h-pwa,
& '-ty'/
data opthasarg/.FALSE.,4*.TRUE.,4*.FALSE.,.TRUE.,3*.FALSE.,2*.TRUE.,
& 6*.FALSE.,2*.TRUE.,.TRUE.,.FALSE.,.TRUE.,.FALSE.,.TRUE.,.FALSE.,
& 6*.TRUE./
& 7*.TRUE./
data optarg/1h-,3h10.,2h8.,1h5,4h100.,4*1h-,2h0.,3*1h-,5h1.,1.,
& 2h1.,6*1h-,4h0.01,5h1.,1.,4*1h-,3h10.,1h-,6h1.,10.,
& 11h0.,0.,0.,0.,4*3hnil/
& 11h0.,0.,0.,0.,4*3hnil,'sff'/
c
c======================================================================
c
c go on with executable code
c
print *,version
print *,'Usage: greda datafile coeffile'
print *,'Usage: greda datafile coeffile [-ty format]'
print *,' [-L] [-K] [-P] [-D] [-M] [-H]'
print *,' [-n nslo] [-s smax] [-f fmax]'
print *,' [-t frac] [-T frac] [-E edge]'
......@@ -218,10 +220,14 @@ c
print *,' [-pwf filename]'
print *,' [-pwa filename]'
print *,'or greda -help'
print *,'or greda -xhelp'
c
if (iargc().lt.1) stop 'ERROR: missing parameters'
call getarg(1, filename)
if (filename(1:5).eq.'-help') then
if (filename(1:6).eq.'-xhelp') then
call sff_help_details
stop
else if (filename(1:5).eq.'-help') then
print *,' '
print *,'Calculate Fourier-Bessel expansion coefficients'
print *,'for a single-shot seismic profile'
......@@ -237,6 +243,7 @@ c
print *,' the same time of first sample and the same'
print *,' sampling interval.'
print *,'coeffile Name of file to contain results.'
print *,'-ty format input file format (see list below)'
print *,' '
print *,'Available alternatives to the Fourier-Bessel transform:'
print *,'-L Calculate by linear inversion (exp-damping).'
......@@ -405,6 +412,8 @@ c
print *,'magic numbers:'
print *,' Fourier-Bessel coefficient files: ',cmagic
print *,' Trace coefficient files: ',cspmagic
print *,' '
call sff_help_formats
stop
endif
c
......@@ -494,6 +503,7 @@ c print *,'DEBUG: returned from tf_cmdline'
pwffilename=optarg(34)
pwoautofile=optset(35)
pwafilename=optarg(35)
informat=optarg(36)
if (debug) print *,'DEBUG: read options'
c
if ((.not.(planewave)).and.(smax.lt.0.))
......@@ -538,6 +548,8 @@ c go for the real calculations
c
c read seismic data
if (debug) print *,'DEBUG: call readdata'
call sff_select_input_format(informat, ierr)
if (ierr.ne.0) stop 'ERROR: selecting input file format'
call readdata(filename, fdata, idata, spectra, r, maxr,
& maxtr, maxsamp, ntr, nsamp, dt, tfirst)
if (debug) print *,'DEBUG: returned from readdata'
......@@ -1092,7 +1104,7 @@ c open sff-file
if ((ntr.lt.maxtr).and.(.not.last)) goto 1
if (.not.(last)) then
print *,'NOTICE: will ignore traces after ',ntr
close(lu)
call sff_close(lu)
endif
print *,'file read and closed'
return
......
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