totnrj.f

Go to the documentation of this file.
00001 C:\opentelemac\v7p0\sources\tomawac\totnrj.f
00002 !
00063                      SUBROUTINE TOTNRJ
00064 !                    *****************
00065 !
00066      &(VARIAN,F,FREQ,DFREQ,TAILF,NF,NPLAN,NPOIN2)
00067 !
00068 !***********************************************************************
00069 ! TOMAWAC   V6P1                                   28/06/2011
00070 !***********************************************************************
00071 !
00072 !
00073 !
00074 !
00075 !
00076 !
00077 !
00078 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00079 !| DFREQ          |-->| FREQUENCY STEPS BETWEEN DISCRETIZED FREQUENCIES
00080 !| F              |---| VARIANCE DENSITY DIRECTIONAL SPECTRUM
00081 !| FREQ           |-->| DISCRETIZED FREQUENCIES
00082 !| NF             |-->| NUMBER OF FREQUENCIES
00083 !| NPLAN          |-->| NUMBER OF DIRECTIONS
00084 !| NPOIN2         |-->| NUMBER OF POINTS IN 2D MESH
00085 !| TAILF          |-->| SPECTRUM QUEUE FACTOR
00086 !| VARIAN         |<--| SPECTRUM VARIANCE
00087 !~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
00088 !
00089       USE DECLARATIONS_TOMAWAC, ONLY : DEUPI
00090 !
00091       IMPLICIT NONE
00092 !
00093 !.....VARIABLES IN ARGUMENT
00094 !     """"""""""""""""""""
00095       INTEGER          NF    , NPLAN , NPOIN2
00096       DOUBLE PRECISION TAILF , VARIAN(NPOIN2), FREQ(NF), DFREQ(NF)
00097       DOUBLE PRECISION F(NPOIN2,NPLAN,NF)
00098 !
00099 !.....LOCAL VARIABLES
00100 !     """""""""""""""""
00101       INTEGER          IP    , JP    , JF
00102       DOUBLE PRECISION AUX1  , DTETAR
00103 !
00104 !
00105       DTETAR=DEUPI/FLOAT(NPLAN)
00106       DO IP = 1,NPOIN2
00107         VARIAN(IP) = 0.D0
00108       ENDDO
00109 !
00110 !-----C-------------------------------------------------------C
00111 !-----C  SUMS UP THE DISCRETISED PART OF THE SPECTRUM         C
00112 !-----C-------------------------------------------------------C
00113 !
00114       DO JF = 1,NF-1
00115         AUX1=DFREQ(JF)*DTETAR
00116         DO JP = 1,NPLAN
00117           DO IP=1,NPOIN2
00118             VARIAN(IP) = VARIAN(IP) + F(IP,JP,JF)*AUX1
00119           ENDDO ! IP
00120         ENDDO ! JP
00121       ENDDO ! JF
00122 !
00123 !-----C-------------------------------------------------------------C
00124 !-----C  TAKES THE HIGH FREQUENCY PART INTO ACCOUNT (OPTIONAL)      C
00125 !-----C-------------------------------------------------------------C
00126 !
00127       IF(TAILF.GT.1.D0) THEN
00128         AUX1=DTETAR*(DFREQ(NF)+FREQ(NF)/(TAILF-1.D0))
00129       ELSE
00130         AUX1=DTETAR*DFREQ(NF)
00131       ENDIF
00132       DO JP = 1,NPLAN
00133         DO IP=1,NPOIN2
00134           VARIAN(IP) = VARIAN(IP) + F(IP,JP,NF)*AUX1
00135         ENDDO ! IP
00136       ENDDO ! JP
00137 !
00138       RETURN
00139       END

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