tetmoy.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\tomawac\tetmoy.f
00002 !
00062                      SUBROUTINE TETMOY
00063 !                    *****************
00064 !
00065      &( TETAM , F     , COSTET, SINTET, NPLAN , FREQ  , DFREQ , NF    ,
00066      &  NPOIN2, TAILF , COSMOY, SINMOY, TAUXC , TAUXS )
00067 !
00068 !***********************************************************************
00069 ! TOMAWAC   V6P1                                   28/06/2011
00070 !***********************************************************************
00071 !
00072 !
00073 !
00074 !
00075 !
00076 !
00077 !
00078 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00079 !| COSMOY         |<->| WORK TABLE
00080 !| COSTET         |-->| COSINE OF TETA ANGLE
00081 !| DFREQ          |-->| FREQUENCY STEPS BETWEEN DISCRETIZED FREQUENCIES
00082 !| F              |-->| VARIANCE DENSITY DIRECTIONAL SPECTRUM
00083 !| FREQ           |-->| DISCRETIZED FREQUENCIES
00084 !| NF             |-->| NUMBER OF FREQUENCIES
00085 !| NPLAN          |-->| NUMBER OF DIRECTIONS
00086 !| NPOIN2         |-->| NUMBER OF POINTS IN 2D MESH
00087 !| SINMOY         |<->| WORK TABLE
00088 !| SINTET         |-->| SINE OF TETA ANGLE
00089 !| TAILF          |-->| FACTEUR DE QUEUE DU SPECTRE
00090 !| TAUXC          |<->| WORK TABLE
00091 !| TAUXS          |<->| WORK TABLE
00092 !| TETAM          |<--| DIRECTIONAL SPECTRUM MEAN DIRECTION
00093 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00094 !
00095       USE DECLARATIONS_TOMAWAC, ONLY : DEUPI
00096 !
00097       IMPLICIT NONE
00098 !
00099 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00100 !
00101       INTEGER  NF    , NPLAN , NPOIN2
00102       DOUBLE PRECISION TAILF
00103       DOUBLE PRECISION TETAM(NPOIN2) , DFREQ(NF)    , COSMOY(NPOIN2)
00104       DOUBLE PRECISION COSTET(NPLAN) , SINTET(NPLAN), SINMOY(NPOIN2)
00105       DOUBLE PRECISION TAUXC(NPOIN2) , TAUXS(NPOIN2)
00106       DOUBLE PRECISION F(NPOIN2,NPLAN,NF), FREQ(NF)
00107 !
00108 !+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
00109 !
00110       INTEGER  IP    , JP    , JF
00111       DOUBLE PRECISION AUXC  , AUXS  ,SEUIL , COEFT , DFDTET
00112       DOUBLE PRECISION DTETAR
00113 !
00114 !-----------------------------------------------------------------------
00115 !
00116       DTETAR=DEUPI/DBLE(NPLAN)
00117       SEUIL =1.D-10
00118 !
00119       DO IP=1,NPOIN2
00120         COSMOY(IP)=0.D0
00121         SINMOY(IP)=0.D0
00122       ENDDO
00123 !
00124 !-----C-------------------------------------------------------C
00125 !-----C  SUMS UP THE DISCRETISED PART OF THE SPECTRUM         C
00126 !-----C-------------------------------------------------------C
00127 !
00128       DO JF=1,NF
00129 !
00130         DFDTET=DFREQ(JF)*DTETAR
00131 !
00132         DO IP=1,NPOIN2
00133           TAUXC(IP)=0.D0
00134           TAUXS(IP)=0.D0
00135         ENDDO
00136 !
00137         DO JP=1,NPLAN
00138           AUXC=COSTET(JP)*DFDTET
00139           AUXS=SINTET(JP)*DFDTET
00140           DO IP=1,NPOIN2
00141             TAUXC(IP)=TAUXC(IP)+F(IP,JP,JF)*AUXC
00142             TAUXS(IP)=TAUXS(IP)+F(IP,JP,JF)*AUXS
00143           ENDDO
00144         ENDDO
00145 !
00146         DO IP=1,NPOIN2
00147           COSMOY(IP)=COSMOY(IP)+TAUXC(IP)
00148           SINMOY(IP)=SINMOY(IP)+TAUXS(IP)
00149         ENDDO
00150 !
00151       ENDDO ! JF
00152 !
00153 !-----C-------------------------------------------------------------C
00154 !-----C  TAKES THE HIGH FREQUENCY PART INTO ACCOUNT (OPTIONAL)      C
00155 !-----C-------------------------------------------------------------C
00156 !
00157       IF(TAILF.GT.1.D0) THEN
00158         COEFT=FREQ(NF)/((TAILF-1.D0)*DFREQ(NF))
00159         DO IP=1,NPOIN2
00160           COSMOY(IP)=COSMOY(IP)+TAUXC(IP)*COEFT
00161           SINMOY(IP)=SINMOY(IP)+TAUXS(IP)*COEFT
00162         ENDDO
00163       ENDIF
00164 !
00165 !-----C-------------------------------------------------------------C
00166 !-----C  COMPUTES THE MEAN DIRECTION                                C
00167 !-----C  (IN RADIANS BETWEEN 0 AND 2.PI)                            C
00168 !-----C-------------------------------------------------------------C
00169 !
00170       DO IP=1,NPOIN2
00171         IF(ABS(SINMOY(IP)).LT.SEUIL.AND.
00172      &      ABS(COSMOY(IP)).LT.SEUIL) THEN
00173           TETAM(IP) = 0.D0
00174         ELSE
00175           TETAM(IP)=ATAN2(SINMOY(IP),COSMOY(IP))
00176           IF(TETAM(IP).LT.0.D0) TETAM(IP)=TETAM(IP)+DEUPI
00177         ENDIF
00178       ENDDO
00179 !
00180 !-----------------------------------------------------------------------
00181 !
00182       RETURN
00183       END

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