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

prepared phasor walkout test

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: 925
SVN UUID:     67feda4a-a26e-11df-9d6e-31afc202ad0c
parent e5c9abf7
c this is <grepg_fourier.inc>
c ----------------------------------------------------------------------------
c ($Id: grepg_fourier.inc,v 1.1 2002-09-13 21:08:43 forbrig Exp $)
c
c Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
c
c data space for Fourier coefficients
c
c REVISIONS and CHANGES
c 13/09/2002 V1.0 Thomas Forbriger
c
c ============================================================================
c
c magic number
character*4 cmagic
parameter(cmagic='SP34')
c
c flag indicating available fourier data
logical fourieravail
c
c dimensions
integer fnom, fntr, fmaxom, fmaxtr
parameter(fmaxom=2000,fmaxtr=400)
c
c data
double complex fourier(fmaxtr, fmaxom)
c
c frequencies
real fom(fmaxom)
c
c offsets
real foffs(fmaxtr)
c
c common
common /fourierdata/ fourier,fom,foffs,fnom,fntr,fourieravail
c
c ----- END OF grepg_fourier.inc -----
c this is <grepg_phasor.f>
c ----------------------------------------------------------------------------
c ($Id: grepg_phasor.f,v 1.1 2002-09-13 21:08:43 forbrig Exp $)
c
c Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
c
c plot Fourier coefficient phasor walkout
c
c REVISIONS and CHANGES
c 13/09/2002 V1.0 Thomas Forbriger
c
c ============================================================================
c
c
c ----- END OF grepg_phasor.f -----
c this is <grepg_readfourier.f>
c ----------------------------------------------------------------------------
c ($Id: grepg_readfourier.f,v 1.1 2002-09-13 21:08:43 forbrig Exp $)
c
c Copyright (c) 2002 by Thomas Forbriger (IMG Frankfurt)
c
c read Fourier coefficients for traces
c
c REVISIONS and CHANGES
c 13/09/2002 V1.0 Thomas Forbriger
c
c ============================================================================
c
subroutine grepg_readfourier(filename, verbose, om, nom, maxom)
c
character filename*(*)
logical verbose
integer nom, maxom
real om(maxom)
c
include 'grepg_fourier.inc'
c
integer inmagic, cpu, match
character*4 incmagic
equivalence(incmagic, inmagic)
integer lu
parameter(lu=20)
integer i,j
real pi2
parameter(pi2=2.*3.1415926535)
c
print *,'read Fourier file ',filename(1:index(filename, ' '))
open(lu, file=filename, form='unformatted', status='old', err=99)
c check byte sex
read(lu, err=98, end=97) inmagic
call tf_bytesex(cmagic, inmagic, cpu, match)
if (cpu.eq.1) then
print *,'running on Intel...'
elseif (cpu.eq.2) then
print *,'running on Motorola...'
else
stop 'ERROR: unknown processor type...'
endif
if (match.eq.1) then
print *,'matching bytesex - good...'
elseif (match.eq.2) then
print *,'bytesex not matching - we will have to swap!'
stop 'ERROR: do not know how to do that...'
else
print *,'bytesex read (',incmagic,') ist not Fourier'
stop 'ERROR: unknown...'
endif
c
read(lu, err=98, end=97) fnom, fntr
if ((fnom.gt.fmaxom).or.(fntr.gt.fmaxtr)) then
close(lu, err=96)
stop 'ERROR: data exceeds array bounds'
else
read(lu, err=98, end=97) (fom(i), i=1,fnom),
& (foffs(i), i=1,fntr)
read(lu, err=98, end=97) ((fourier(j,i), i=1,fnom), j=1,fntr)
close(lu, err=96)
print *,'Fourier file read and closed'
endif
c plausibility checks
if (fnom.ne.nom) stop 'ERROR: inconsistent number of frequencies'
do i=1,fnom
if (abs((om(i)/fom(i))-1.).gt.0.001)
& stop 'ERROR: inconsistent frequencies'
enddo
if (verbose) then
print *,' read ',fnom,' Fourier coefficients'
print *,' for ',fntr,' seismic traces'
endif
print *,' '
return
99 stop 'ERROR: opening Fourier file'
98 stop 'ERROR: reading Fourier file'
97 stop 'ERROR: reading Fourier file - unexpected end'
96 stop 'ERROR: closing Fourier file'
end
c
c----------------------------------------------------------------------
c
subroutine grepg_fourierinfo
include 'grepg_fourier.inc'
print *,' '
print *,'magic number for Fourier data: ',cmagic
return
end
c
c----------------------------------------------------------------------
c
subroutine grepg_nofourier
include 'grepg_fourier.inc'
fourieravail=.true.
return
end
c ----- END OF grepg_readfourier.f -----
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