36300 

 36400 

 36500 

 36600 

 36700 

 36800 

 36900 

 37000 

 37 100 

 37200 

 37300 

 37400 

 37500 

 37600 

 37700 

 37800 

 37900 

 38000 

 38100 

 38200 

 38300 

 38400 

 38500 

 38600 

 38700 

 38800 

 38900 

 39000 

 39100 

 39200 

 39300 

 39400 

 39500 

 39600 

 39700 

 39800 

 39900 

 40000 

 40100 

 40200 

 40300 

 40400 

 40500 

 40600 

 40700 

 40800 

 40900 

 4 1000 

 4 1 100 

 4 1200 

 4 1300 

 41400 

 41500 

 4 1600 

 4 1700 

 4 1800 

 4 1900 

 42000 

 42100 

 42200 

 42300 

 42400 

 42500 

 42600 

 42700 

 42800 

 42900 

 43000 

 43100 

 4 3200 

 43300 

 4 3400 



307 ABAND(K, JMAX)=-Z1 



312 IF(d.NE . UMAX) GO TO 308 



AWARE (I , J)=AWARE(I , J)+Z2*Y(I , JMAX+ 1 ) 

 GO TO 309 



308 ABAND(K, JMAX+2)=-Z2 



309 BMATRX(K)=AWARE(I .J) 

 304 CONTINUE 



KMAX=K 

 C**CALL IMSL ROUTINE LEQTIB TO SOLVE THE BANDED MATRIX. 



CALL LE0T1B(ABAND,KMAX, JMAX, JMAX.432,BMATRX, 1 .432,0, XL, lER) 

 C*NOW, GIVE Y'S THEIR NEW VALUES STORING OLD VALUES IN YOLD. 



K=0 



DO 315 1=2, IMAX-1 



YOLD (I , JMAX+1 )=Y(I , JMAX+1 ) 



DO 315 J= 1 .JMAX 



K = K+1 



YOLDd, J)=Y(I , J) 



Yd , J)=BMATRX(K) 

 315 CONTINUE 



DO 320 0=1 ,dMAX+3 



YOLD( 1 , J)=Y( 1 , J) 

 320 YOLDdMAX, J)=Y( IMAX, J) 

 C*WILL USE ABBOTT'S DIS5IPATIVE INTERFACE TO RID HIGH FREO OSCILLATIONS 



DO 650 d=1 ,dMAX 



DO 650 1=2, IMAX- 1 



YDISSd ,d)=TAU*Y(I-1 , J) + ( 1 .-2.*TAU)*Y(I ,l)) + TAU*Y( 1 + 1 ,d) 



IF(SdETTY.EO.O.O) GO TO 650 



DO 649 M=1 ,MMAX 



IF(I .NE . IJET(M) .AND. I .NE . IJET(M)+1) GO TO 649 



IF(Y(I>JET(M) , J) .GT.SdETTY.OR. YdJET(M) + 1 ,d) .GT.SdETTY)GO TO 649 



IF(I .E0.IdET(M))YDISS(I,J)=TAU*Y(I-1,J)+(1.-TAU)*Y(I,d) 



IF(I. EQ. ( I dET(M)+1)) YDISSd , d ) =TAU* Y ( 1+ 1 ,d)+(1 .-TAU)*Y(I ,d) 



649 CONTINUE 



650 CONTINUE 



DO 651 d=1 ,dMAX 

 DO 651 1=2, IMAX-1 



651 Yd ,d)=YDISSd ,d) 



C*THIS LOOP WILL STORE THE IMPLICIT Y VALUES REO'D TO COMP QY&OX 



DO 40 1=1 , IMAX+1 



DO 40 d=1 ,dMAX+3 

 40 YIMPd , J) = Y(I ,d) 

 C+THIS LOOP WILL EXPLICITLY MOVE CONTOURS SEAWARD IF REPOSE EXCEEDED. 



KOUNT=0 



SL0PEM=TAN(0.9*REP0SE) 



DO 48 1 = 1 , IMAX 

 43 K0UNT=K0UNT+1 



IF(KOUNTGT. 50000) GO TO 41 

 C*LET US COMPUTE ALL THE SLOPES( PSLOP ) FOR EACH CHANGE IN DEPTH. 



DO 47 d=1 ,dMAX+1 



DUM=-BERM/2 .0 



IF(d.NE.1) DUM = DEEP(I ,d-1 ) 



DELH=0.5*(DEEP(I,d+1)+DEEPd,d))-0.5*(DEEP(I,d)+DUM) 



PSLOP = DELH/(Y(I , d+ 1 ) -Y( I , d ) ) 

 47 SANGLE(d)=ATAN(PSLOP) 

 C*FIND THE MIN NEG SLOPE ANGLE OR THEN THE POS SLDPE>REPOSE OR FORGET IT 



ASLOPM=- 1 OE50 



ASLOPP=0.0 



DO 46 d=1 ,dMAX+1 



IF(SANGLE(d) .GT 0.0) GO TO 45 



IF(SANGLE(d) GT . ASLOPM)ASLOPM=S ANGLE ( d) 



IF(ASLOPM.EO.SANGLE(d)) dM=d 



GO TO 46 



45 IF(SANGLE(d) .GT. REPOSE . AND . BANGLE ( d ) . GT . ASLOPP ) ASLOPP=SANGLE ( d ) 

 IF(ASLOPP.EO.SANGLE(d)) dP=d 



46 CONTINUE 



IF(ASLOPM.EO. -1 .0E50. AND. ASLOPP. EO. 0.0) GO TO 42 

 IF(ASL0PM.E0.-1 .0E50) GO TO 44 

 DUM=-BERM/2. 



IF(dM.NE.I) DUM = DEEP(I ,dM-1 ) 



ALTER =( (0.5/SL0PEM*(DEEP(I , dM+ 1 )-DUM) )-(Y(I . dM+ 1 )-Y(I ,dM)) )/ 

 * (1.0+((DEEP(I ,dM+1 )-DEEP(I ,dM) )/(DEEPd ,dM)-DUM))) 

 Yd ,dM+1 )=Y( I ,dM+1 ) + ALTER 



