101700 10 CONTINUE 



101800 C*FIRST ALL OF REGION 2 WILL GET REFRACTED. 



101900 NPTS=0 



102000 DO 100 I=IJET(M)+1 , IDUMR 



102100 J2(I)=J1(I) 



102200 100 did ) = 1 



102300 DO 101 I=IJET(M)+1 , IDUMR 



102400 DO 101 J=J1(I ) , J2(I )-1 



102500 101 NPTS=NPTS+1 



102600 IMAXT^IDUMR 



102700 IDUMLL=IDUML 



102800 IdETT=IJET(M) 



102900 IJETP1=IJET(M)+1 



103000 CALL REFRAC(d1 ,d2.NPTS. IJETPI , IMAXT, IMAXT.M) 



103100 IMAXT=IDUMR 



103200 IdETT=IdET(M) 



103300 IJETP1=IJET(M)+1 



103400 IDUMLL=IDUML 



103500 C*N0W MUST DO REGION 3 OF NEG THETAO CASE-SHADOW ZONE. 



103600 DO 102 I=IDUML, IJET(M) 



103700 J2(I)=J1(I) 



103800 102 J1(I)=1 



103900 DO 103 I=IDUML. IJET(M) 



104000 J1REF(I)=1 



104100 DO 104 J = d1(I ) ,d2( I ) + 1 



104200 XC00R = (I-1 .0)*DX 



104300 YC00R=O.5*(Y(I , d )+Y ( I , d+ 1 ) ) 



104400 ANGLE=ATAN( (XDISTN-XCOOR)/(SdETTY-YCOOR) ) 



104500 IF(YCOOR.GT.SdETTY) ANGLE=PI+ANGLE 



104600 C*IF MOST SHOREWARD PT OUT OF SHAD ZONE, SO ARE THE OTHERS FOR THAT I. 



104700 IF(ABS(ANGLE ) GT . ABS(THETAO(M) ) ) GO TO 105 



104800 RAD=S0RT((XDISTN-XC0OR)**2+(SdETTY-YC0OR)**2) 



104900 RHOND=RAD*TWOPI/ELTIP 



105000 C*DIFFRACTION TREATS THE POS THETAO CASE. 



105100 THE=ABS(THETAO(M) ) 



105200 CALL DI FF ( RHOND , THE , ANGLE , AMP ) 



105300 H(I ,d)-AMP*HINC 



105400 ANGRAD=-ANGLE 



105500 C*WILL NOW REFRACT DIFF WAVES IN THE SHAD ZONE USING SNELL'S. 



105600 CTIP=ELTIP/T 



105700 ALPHAS (I , d ) =ATAN( (0 . 5* ( Y (1 + 1 , d ) + Y( 1 + 1 , d+ 1 ) )-0 . 5* 



105800 * (Y(I-1 ,d) + Y(I-1 .d+1 )) )/(2.*DX) ) 



105900 IF(I .EO. IdET(M))ALPHAS(I ,d)=ATAN( (0.5*(Y(I,d)+Y(I.d+1))-0.5*(Y(I-1 



106000 * .d) + Y(I-1 ,d+1 )))/DX) 



106100 DALPHA=ANGRAD-ALPHAS(I ,d) 



106200 THETAd ,d)-ARSIN((C(I . d )/CTIP ) *SIN(DALPHA ) ) 



106300 THETA( I ,d)=THETA( I ,d)+ALPHAS( I .d) 



106400 C*MUST CHECK TO SEE IF WAVE WOULD HAVE BROKEN. 



106500 IF(HB(I.d).LE.H(I,d) . AND.HBd , d+ 1 ) . GT . H( I , d+ 1 ) ) IBRE AK ( I ) =d 



106600 IF(HBd ,d) .LT .H( I ,d) ) H( I , d ) =HB( I , d ) 



106700 104 CONTINUE 



106800 GO TO 103 



106900 105 d1REF(I)=d 



107000 103 CONTINUE 



107100 C*NOW MUST DO REFRACTION FOR REGION 4. 



107200 NPTS=0 



107300 DO 106 I=IDUML, IdET(M) 



107400 DO 106 d = d1REF(I ) .d2(I)-1 



107500 106 NPTS=NPTS+1 



107600 IDUMLL=IDUML 



107700 IMAXT=IDUMR 



107800 IdETT=IdET(M) 



107900 IdETP1=IdET(M)+1 



108000 CALL REFRAC(d1REF .d2,NPTS. IDUMLL, IdETT. IDUMLL.M) 



108100 IDUMLL=IDUML 



108200 IMAXT=IDUMR 



108300 IdETT=IdET(M) 



108400 IdETP1=IdET(M)+1 



108500 GO TO 13 



108600 C*THIS HANDLES REFRAC/DIFF IF THETAO IS 0.0. 



108700 C*FOR THIS CASE, ONLY THREE REGIONS EXIST. 



108800 11 CONTINUE 



108900 NPTS=0 



80 



