Commit 43dd321b authored by thomas.forbriger's avatar thomas.forbriger
Browse files

[WP] (issue7 refract): fix variable in subroutine mpcfactors

- discard obsolete variables
- rename maxamp to refamp
- add version comment
parent 0a798408
......@@ -31,6 +31,8 @@ c offset for scaling mode 3 as the actual offset
c dependency is unknown
c 20/11/12 V1.2 use field offset for scaling purposes, not plot
c offset
c 07/12/15 V1.3 mode 2 and 3 now refer scaling to average scaled
c amplitude in defined offset range
c
c==============================================================================
cS
......@@ -45,8 +47,8 @@ c
include 'refract_para.inc'
c
cE
integer i,j,tref
real trefoff, refmpc, maxamp, thisamp
integer i,j
real refmpc, refamp
real refract_avgamp
c
c scaling mode 1: individual scaling
......@@ -54,13 +56,13 @@ c ----------------------------------
if (plpar_mode.eq.1) then
do j=1,ntraces
if (plpar_remav) then
maxamp=max(abs(maxval(j)-average(j)),abs(minval(j)-average(j)))
refamp=max(abs(maxval(j)-average(j)),abs(minval(j)-average(j)))
else
maxamp=max(abs(maxval(j)),abs(minval(j)))
refamp=max(abs(maxval(j)),abs(minval(j)))
endif
trv_mpc(j)=plpar_amp/maxamp
trv_mpc(j)=plpar_amp/refamp
if (debug) print *,'DEBUG (mpcfactors): trace, mpc ',j,trv_mpc(j)
if (debug) print *,'DEBUG (mpcfactors): maxamp ',maxamp
if (debug) print *,'DEBUG (mpcfactors): refamp ',refamp
if (debug) print *,'DEBUG (mpcfactors): maxval ',maxval(j)
if (debug) print *,'DEBUG (mpcfactors): minval ',minval(j)
enddo
......@@ -69,8 +71,8 @@ c scaling mode 2: least offset trace is reference
c -----------------------------------------------
elseif (plpar_mode.eq.2) then
j=1
maxamp=refract_avgamp(j, .true.)
refmpc=plpar_amp/(fieldoffset(tref)**plpar_expo)/maxamp
refamp=refract_avgamp(j, .true.)
refmpc=plpar_amp/refamp
c set mpc factors
do j=1,ntraces
trv_mpc(j)=refmpc*(fieldoffset(j)**plpar_expo)
......@@ -82,8 +84,8 @@ c -------------------------------------------------------------------
elseif (plpar_mode.eq.3) then
c go for files
do i=1,nfiles
maxamp=refract_avgamp(i, .false.)
refmpc=plpar_amp/maxamp
refamp=refract_avgamp(i, .false.)
refmpc=plpar_amp/refamp
c set mpc factors within file
do j=1,ntraces
if (fileindex(j).eq.i) then
......
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