//Created.By.MaksimBDyshlevsky/Under.Gunpoint/4.SURGUTNIPINEFT/27-03-2007 //Updated17-10-2011 //Script use a next parameters: NTG, CUTOFF, LITOLOGY, NTG_, delta Int eptl, fin, zn=1 ///////Set number your zone Float MD=0.0025 ///////Set maximum tolerance for residual between NTG & NTG_ String Job4ntg_="doit" /////// Float mind, maxd, avgd, stp=0.1, stp7=0.0000001 Float pmind, pmaxd, pavgd, ppmind, ppmaxd, ppavgd Job J1 @ZONES[zn].LITOLOGY=0 @ZONES[zn].delta=0 @ZONES[zn].CUTOFF=0 @ZONES[zn].NTG_=0 J1 = "Zone["+zn+"].LITOLOGY."+Job4ntg_ @ZONES[zn].LITOLOGY=0 if @ZONES[zn].LITO_cont>= @ZONES[zn].CUTOFF then @ZONES[zn].LITOLOGY=1 endif ExecuteJob(J1) @ZONES[zn].delta=@ZONES[zn].NTG-@ZONES[zn].NTG_ WHILE fin=0 DO if @ZONES[zn].NTG=0 then @ZONES[zn].CUTOFF=1.1 endif if @ZONES[zn].delta<-MD then @ZONES[zn].CUTOFF=@ZONES[zn].CUTOFF+stp endif if @ZONES[zn].delta>MD then @ZONES[zn].CUTOFF=@ZONES[zn].CUTOFF-stp endif @ZONES[zn].LITOLOGY=0 if @ZONES[zn].LITO_cont>= @ZONES[zn].CUTOFF then @ZONES[zn].LITOLOGY=1 endif ExecuteJob(J1) @ZONES[zn].delta=@ZONES[zn].NTG-@ZONES[zn].NTG_ if eptl>0 then GetMinMaxAvg(@ZONES[zn].delta,mind, maxd, avgd) endif Print ("Iteration No. ",eptl," ",stp," ",mind," ",maxd," ",avgd) if mind>=-MD and maxd<=MD and eptl>3 then Print("Residual range is complite!") fin=1 endif if (mind=pmind or mind=ppmind) and (maxd=pmaxd or maxd=ppmaxd) and (avgd=pavgd or avgd=ppavgd) and eptl>3 then if Abs(pavgd) < Abs(avgd) then if @ZONES[zn].delta>-MD then @ZONES[zn].CUTOFF=@ZONES[zn].CUTOFF-stp endif if @ZONES[zn].delta= @ZONES[zn].CUTOFF then @ZONES[zn].LITOLOGY=1 endif if @ZONES[zn].LITO_cont=0 or @ZONES[zn].LITO_cont=1 then @ZONES[zn].LITOLOGY=@ZONES[zn].LITO_cont endif ExecuteJob(J1) @ZONES[zn].delta=@ZONES[zn].NTG-@ZONES[zn].NTG_ GetMinMaxAvg(@ZONES[zn].delta,mind, maxd, avgd) Print ("Iteration No. ",eptl," ",stp," ",mind," ",maxd," ",avgd," <<==") endif stp=stp/10 if stp