caltetap.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\artemis\caltetap.f
00002 !
00040                      SUBROUTINE CALTETAP
00041 !                    *******************
00042      &(TETA,XNEBOR,YNEBOR,XSGBOR,YSGBOR,ADIR,NPTFR)
00043 !
00044 !
00045 !***********************************************************************
00046 ! ARTEMIS   V7P0                                             18/03/2014
00047 !***********************************************************************
00048 !
00049 !         TETAP is given in degrees, in the interval [0 ; 90]
00050 !
00051 !
00052 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00053 !| TETA           |-->| ANGLE BETWEEN WAVE DIRECTION AND BOUNDARY NORMAL
00054 !                       (TETAP)
00055 !| XNEBOR         |-->| X COMPONENT OF THE NORMAL TO THE BOUNDARY NODE
00056 !| YNEBOR         |-->| Y COMPONENT OF THE NORMAL TO THE BOUNDARY NODE
00057 !| XSGBOR         |-->| X COMPONENT OF THE NORMAL TO THE BOUNDARY SEGMENT
00058 !| YSGBOR         |-->| Y COMPONENT OF THE NORMAL TO THE BOUNDARY SEGMENT
00059 !| ADIR           |-->| INCIDENCE ANGLE OF WAVES
00060 !| NPTFR          |-->| NUMBER OF BOUNDARY POINTS
00061 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00062 !
00063       USE BIEF
00064 !
00065       IMPLICIT NONE
00066       INTEGER LNG,LU
00067       COMMON/INFO/LNG,LU
00068 !
00069       INTEGER I,IG,NPTFR
00070 !
00071       DOUBLE PRECISION PI
00072       DOUBLE PRECISION PSCALA,XNA,YNA,XI,YI,NORM,PSCALB,XNB,YNB
00073       DOUBLE PRECISION, INTENT(IN)  :: XNEBOR(NPTFR,2),YNEBOR(NPTFR,2)
00074       DOUBLE PRECISION, INTENT(IN)  :: XSGBOR(NPTFR,4),YSGBOR(NPTFR,4)
00075       DOUBLE PRECISION              :: TETA(NPTFR),ADIR(NPTFR)
00076 !
00077       INTRINSIC SQRT, ATAN2, DMOD, ABS, COS, SIN
00078 
00079       PARAMETER (PI = 3.1415926535897932384626433D0)
00080 !
00081       DO I=1,NPTFR
00082 !
00083 !       STEP 1 : VECTOR NORMAL TO "THE POINT" (SEGMENT AFTER/BEFORE)
00084 !       ======================================================
00085 !       NORMAL TO SEGMENT AFTER
00086         XNA=XSGBOR(I,1)
00087         YNA=YSGBOR(I,1)
00088 !       NORMAL TO SEGMENT BEFORE
00089         XNB=XSGBOR(I,2)
00090         YNB=YSGBOR(I,2)
00091 !       NORMALIZATION NOT NECESSARY AS (XSGBOR(K,1),YSGBOR(K,1)) AND
00092 !       (XSGBOR(K,2),YSGBOR(K,2)) ARE ALREADY OF NORM 1
00093 !
00094 !       STEP 2 : VECTOR INCIDENCE AT NODE
00095 !       =========================
00096         XI=COS(ADIR(I))
00097         YI=SIN(ADIR(I))
00098 !
00099 !       STEP 3 : ANGLE BETWEEN NORMAL DIRECTION AND INCIDENCE DIRECTION
00100 !       ===============================================================
00101         PSCALA=XNA*XI+YNA*YI
00102         PSCALB=XNB*XI+YNB*YI
00103 !       SMALLEST ANGLE BETWEEN NORMAL AND INCIDENCE (0<TETAP<90)
00104         IF(PSCALA.LT.0D0) THEN
00105           PSCALA=-PSCALA
00106         ENDIF
00107         IF(PSCALB.LT.0D0) THEN
00108           PSCALB=-PSCALB
00109         ENDIF
00110 !
00111 !       STEP 4 = TETAP IS GIVEN IN DEGRES
00112 !       =================================
00113 !       CHOOSE OF THE LOWER VALUE OF TETA (SEEMS BETTER AT CORNER CONSIDERING
00114 !       THE PHBOR ROUTINE RULES)
00115         TETA(I)=MIN(180D0*ACOS(PSCALA)/PI,180D0*ACOS(PSCALB)/PI)
00116       ENDDO
00117 !=======================================================================
00118 !
00119       RETURN
00120       END

Generated on Fri Aug 31 2013 18:12:58 by S.E.Bourban (HRW) using doxygen 1.7.0