Professional Documents
Culture Documents
Appendixb
Appendixb
WEI: A simpledemonstration
programfor nonlinearinversionof
Wenet soundings
by ridgeregression.
programVV-ENINV
C A simpledemonstration of non]Jnea
dc resistivity
C inversionby ridgeregression
usingthe SYD method.
C The Wennet/Offset
Wennetconfixationin assnmed
and
C inverts data ar spacings
of 0.5,1,2,4,8,1,
......
C Handles a maxirn-m of 5 layersin the presentform.
C Alteration o handlemore layersis trivial.
C Author: Meju, M.A.
COMMON/SOLUTION/MOD,N2
PAL RM(5),DM(4),Y(22),MOD(9),DOBS(22),AB(22),DCALC(22)
PAL A(22,9),U(22,9),V(9,9),Q(9),DMB(4),RMB(5)
INTEGER EXTIT
CttACTER*20 INFILE
C setup flagsandperforminitializations
SSQ=l.E+10
TOL=0.0003
EXTIT = 0
INTIT=0
N2=l
c readfielddatastoredas[ab,d]pairs'ab=exper/mental
geometry,
d=data.
WRXTE(,,'(/A,$)')' ENTEt DATA FILENAME'> '
PmAD(,,' (A0)')IFmV,
OPEN(UNIT=3,FILE=LNFIZE,
STATUS=' OLD')
N=I
t0 mA(a,,,ENV=0) ^n(N),nOnS(N)
N=N+I
GOTO 10
99 CONTXIUE
NDAT=N-1
CLOSE(UNIT=a,STATUS='KEEP')
WPaTE(,20)nmv,,NnAT
20 FORMAT(/2X,A20,
' NUMBER OFDATARAD = ',i3)
C readguess
model;
inputparameters
reNLAYlayerresistivities,
tLM
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
27O
U and NLAY-1 depths to layer boundariesfrom the surface, DM.
WRITE(*,'(/A,$)') 'ENTER NUMBER OF LAYEI?SIN GUESSMODEL :> '
PAD(*,-) NLAY
NCOL=NLAY,2-1
i (SS(SSQ-SSE).LE.TOL) Tn,N
WUTE(*,,)' SLOW CONVEENCE: ITEPATON ABOTEn'
GOTO 999
ENDIF
SSQ=SSE
C save best solution in arrays KMB and D MB
o 40 = :,NnAY-:
m (i)=m(I)
DM(I)=DM(I)
4O CONTh'qUE
PaS(NLY) =m(NLAY)
C write out current model
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
271
CALL PAltTIAL(ND AT,DCALC,NLAY,1tM,DM,A)
C calculate SVD of A
CALL SVD(NDAT,NCOL,A,U,V,Q)
c calculatemodel correctionby ridgeregressionand return updatedmodel
c MOD in commonblock/SOLUTION/
CALL 1tlDGE(Y,NCOL,NDAT,U,V,Q,SSQ,INTIT,NLAY,R_M,D
M,DOBS)
C checkthat controlflag is in order and update parameters
IF(N2.EQ.0)THEN
GOTO 999
ELSEIF(N2.EQ.)THEN
DO 50 I=I,NLAY-1
J=I+NLAY
aM()=MO()
DM(I)=MOD(J)
5O CONTINUE
tLM(NLA)=M 0 D(NLAY)
ENDIF
EXTIT=EXTIT+I
C repeat iterative operation
GOTO 1
999 CONTINUE
subroutineBIDGE(Y,NCOL,NROW,U,V,Q,SSQ0,INTIT,Nlt,R.M,DM,DOBS)
C RIDGE REGRESSION 1tOUTIhrE. M.A.MEJU 1986
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
272
C INITIAL CONSTANTS AND FLAGS
ND=NR-1
FC=./0.
N2=0
SSQT0=SSQ0
ND=NR-1
NPAPI=NR+ND
C SET MARQUARDT DAMPING FACTORS FOR R2DGE lGPSSION
C FIND SMALLEST/LARGEST SINGAR VALUES QS AND QL
QL=O.00000001
QS=10000000.
DO 10 I=i,NCOL
IF(Q(I).GT. QL)TttEN
QL=Q(I)
ELSEIF(Q(I) .LT. QS)TttEN
QS=Q(I)
END IF
10 CONTINUE
QL=10,QL
QS=QS/lO.
CALCULATE TEN SAMPLES OF TI FUNCTION QK = A + BK**2
DO 20 K=l,10
QK(K)=( 100,QS-QL+ (QL-QS),FLOAT(K)** 2)/ 99.
2O CONTINUE
QK(0)=0.0
DO 30 IK--1,11.
INTIT=INTIT+I
CALCULATE DAMPING FACTOK
BETA=QK(ll-IK)**2
C dampQ to avoidsingultrix, get Q-inverse,andU-trnpose
DO 40 I=I,NCOL
DO 50 J=I,NROW
UT(I,J)=U(J,I)
50 CONTINUE
CALCULATE V/LAMBDA
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
273
DO 60 K=I,NCOL
VQ(K,I)=Q1.V(K,I)
6O CONTINUE
4O CONTINUE
DO 80 M=i,NCOL
SMC=X(M)**2+SMC
C IF X TOO LARGE,SET FLAG NN=l
IF( AB S(X (M)). GT. 3.0)NN= 1
8O CONTINUE
H(1)=DM(1)
DO 75 I=2,ND
H(I)=DM(I)-DM(I-1)
75 CONTINUE
C UPDATE PAILSMETER. VALUE AFTER RF,-SCALING X
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
27
PdvI
D () = 0.**( AL0 C10(RM(I)) +X (I)* FC)
IF(I.LE.ND)THEN
J=I+NR
RT(I)=R/VlD(I)
DT(I)=R.MD($)
95 CONTINUE
I{T(NR)=RMD(NR)
CALL MISFIT (NR,RT,DT,NROW,DOBS,DCALC,YT,S
SQT)
IF(INTIT.LE.11)TWEN
IF(IK.EQ.1)TtIEN
WRITE(,,'(A)')' **STAGE2 (INTERAL) ITERATIONS:RIDGE**'
WRITE(,,'(" ESTIMATEDMISFIT AND DAMPING FACTOI{")')
END IF
WR/TE(,,,)SSQT,BETA
ENDIF
C STOPPING CRITERION
IF( SSQT.GT.SSQTD)THEN
RETUR/
ELSE
SSQT0=SSQT
CHECK THAT INTEltFACE DEPTHS ARE IN ORDER
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
275
DO 100 J=2,.'D
DO =,NPAaM
110 CONTINUE
N2=l
BETA0=BETA
END IF
END IF
3O CONTINUE
ITUR.N
END
subroutineINP R0 D ( ,n,m,n,matrix,vec,x)
c multiplies a matrix by vector vec nd returns vector x
real vec(n.u),x(rnm),matrix(mm,an)
do 10 i=l,m
s,,m=0.0
do 20 j=l,n
s,,m=vec(j),matx(i,j) +s-m
20 continue
10 continue
retro
end
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
276
SSE=0.0
DO 10 I=i:NDAT
Y (I)= ALOG10(DOBS(I)/D CALC(I))
SSE=SSE+Y(),,
lO CONTINUE
CONTINUE
END
subroutineFWl{D(nlay,rm,am,Azho)
c Computeslayeredearthresponse for the DC Weuner/Oet Wennetcase.
c Pesponses
= apparentresistivities
(Arho)at spacings
a =0.5,1,2,4,...1024.
c modelprameters arerm andhrn. rm = layerresis.; h = layerthicesses;
c t = resistivity
traudorms; c -- filtercoefcients
ofBiwenandBarker(1994).
realt(21), c(11),rm(5), h(4), Arho(22),din(4)
data c/-0.000409,-0.009047,0.065211,-0.1741571,
0.38731,
&:-0.0431,
2.093407,-1.622729.,
0.3383152,-0.039963,
0.004206/
get layer t;hicknesses
,,() = am()
if(nlay.gt.2)then
do 100 i=2, nlay-1
,(i)=a(i)-a(i-)
100 continue
xx=a/og(xr)+0.246844
x=,(x)
=(my)
(my.t.)t,
do 300 kk= 1,nly- 1
r=rm(nlay-kk)
zw=(m.v-)/x
= ( + m,)/( 1.+ m, / )
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
277
300 continue
endif
t(nk)=bb
200 continue
c **evaluate convolution*
do 400 nk=l,ll
do 500 nkk=l,ll
=r+ ( +m- ),c( 2-k)
500 continue
j=nk
Arto(j)=rrm
400 continue
re%urn
end
subroutine
PAPTIAL
(NDAT,DCALC,NLA
Y,RM,D
M,A)
Compute partiM derivativeby nnmericMforwardcHerencimg
c perturb each model,find forwardresponse,
subtractcalc (urnperturbed
c responsefrom subroutineMISFIT) from perturbedresponse mudfill up
c correspondingcolwnnso A-matrix. NOTE: for rapid convergetrace,
forward
c differencesnot divided by perturbation factor D1ELbut solution scmled
c accordinglyin R1'DGElater.
REAL A(22,9),DCALC(22),PDATA(22),RM(5),DM(4)
DEL=0.03
D O 10 J= 1,NLAY
SAFE=R.M(J)
C perturb by del-m in log space
R.M(J) = 10.**(ALOG10(RM(J))+DEL)
CALL FWRD (NLAY,RM,DM,PDATA)
C FILLG COLUMNS OF MATRIX A
D O 20 I= 1,ND AT
A(I,J) = ALOG10(PDATA(I)/DCALC(I))
2O CONTUE
R.M(J) = SAFE
10 CONTINUE
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
278
C repeat for depth parameters
DO 30 J = 1,NLAY-1
SAFE -- DM(J)
DM(J)=10.,-(ALOG10(DM(J))+DEL)
CALL FWtLD(NLAY,tLI,DM,PD ATA)
C FILLIN G C 0 LUMN S 0 F MATRIX A
DO 40 I=I,NDAT
A(I,J+NLAY) = ALOG10(PDATA(I)/DCALC(I))
4O CONTN
DM(J) = SAFE
3O CONTINUE
KETUKN
END
subroutineSVD(n,m,a,u,v,q)
C insert originalroutine5om SVDINV here .tousethis program.
return
end
Downloaded 30 Oct 2012 to 192.159.106.200. Redistribution subject to SEG license or copyright; Terms of Use: http://segdl.org/
279