After completion of SMOOTH, the times and elevations of major peaks and 

 valleys are stored in the first ITEMS elements of EXTIM. The value of ITEMS 

 has been reduced in accordance with the number of small peaks and valleys 

 eliminated. Since the smoothing algorithm .cannot work properly at the end of 

 a record, the last few points are usually accepted regardless of whether or 

 not they satisfy the acceptance criteria. Thus, the last six elements in 

 EXTIM may not represent major peaks or valleys and should either be checked 

 or categorically eliminated. 



A complete list of subroutine SMOOTH with comments is provided in Figure 



C-2. 



SUBSOuT]Nt S"OOTM (FUi'SIt ITfHj) 



SUpBOUlINf SmouTm TikfS A wecnRn nF PFa<S »NU VALLEvS and 



fLl"lNATtS f«CUWSEi.l)fMT7AL PF««S Ai.D VALLfTS, T«t ELIMINATION 

 CBITtoiA AXE A flNJHU" DIfFFBFNCE bET"tE'< PtAH AMfl VALLEY 

 ELtVATIO^S f—l"! AND A »'I^:^•ll" riOKUONTAU S^ACIhf, (bE IT 

 TImEi POsniUN. trC) PET-EtN PEAK A-D VAULt" (CHP), 

 INPUl PihAMETfXS aSE ritFl"to AS FOLLOWS. 

 FiJ^JST - STaktimg II"t 

 ITE-S = TOTAL ~U"BEB OF fXTBEi-fc VALUES (INCLUBES TJhE AND 



tLfV'TlU'" VALUES) 

 CkP « CBPICAL -«L> PtSIOD 

 Hi-I.-j . HlNjh„« MElttMT TU BE CDNSIOE«E0 

 E»'I"(tlUD) = TI"E 

 ElTI-[Evt>") I E«ThE"E ELtVATIC aSSOCJaIEB "ITm EXT 1 h ( fvEN. 1 ) VALUE 



OF Tl"t 

 CQMi-O^ /S.>nT/ E«TI»tlUO) 



SET VALUES OF C"P AND r.-I^ TO BE USED 



DATA Ifl-' ""I** / U.UOl J.O / 



INITIALIZE VjSUeLtS AND flNO S'aPTImG POINT FO* PROOESSINS 

 1503 IITE-S=IT[M8 



Jil 



ITE"7«ITE"S-7 



DO l5o? l«liIITE"S.i 



IS«lP»I 



IF (EXTI"( n.CE.FUPST) to TO 1500 



J = J»? 



I TEHSiIT£"S.? 

 ISO? CONTINUE 

 150U ISTABT=IS«1P 



C BECIN "Altj PROLtSSUl. LOOP 



00 ISJO ItlST aSt.ITE'<7,J 



L=l 



IM 1ST A>.T,CT,ltt»7)C0 TU 15?ri 



IF Ct«T ;^-( n«CMP,r.T.tii i-t l'?l )r,o rn 15)1 



IF (ADS(t«Tl-(l.i).txTI-(l.?)) .LT.H-IN)CO TO 1511 

 : IF NO TBanSfeb, Th]S E«T-E-t ACCtPTEO 



EiTI-t JJztrTIMC I) 



EXT1b;J,| J=£xTIh(lM) 



J=J.J 



CO TO ISiO 

 : .«£■* TmE next instwuCTJon IS PEACHEOi Cl-iE hICh ASO One lO- "ILL 

 : BE OtLETEn 



1511 IF CEXt;-(I»1 ) .GT.tXT I"(l»}) JCO TO 1510 

 : IF NEXT INiTBucTION IS USED, T-IS IS * LO" 

 IF tEXTl'-(I..>) ,GT.tiIl"( !• I nCO TO 15U 

 IFtE'TIl^t UJ) ,GT.EITI^ ( I-i IICO TO 151J 

 GO TU lil7 

 151? IKEXTI"( 1.5) ,CT,t«TI'-(I«7) JGO TO l6H 

 GO TO 1516 

 : -HEN NriT I>57BuCTI0^ Is USED. THI5 IS « mjgK 

 151" IF (E«Tl-( 1.5) .GT.tiT I"rl»ll )G0 TC 1515 

 IF (tITl"( 1.7) .GT.txT I^t l«i) JGn TO 1519 

 GC TO 151b 



1515 IF (tlTI»(I. Jl.GT.EXTI-d-n )G0 TO ISIT 

 CO TU 1516 



C SET THE VALUE OF ICaSE 



1516 ICASErl 



GO TO 1521 

 ISlT ]CaSE»2 



GD TO 1521 



Figure C-2. List of subroutine SMOOTH (from Thompson, 1980) 



95 



