WAVEWATCH III  beta 0.0.1
w3src0md Module Reference

Mean wave parameter computation for case without input and dissipation. More...

Functions/Subroutines

subroutine w3spr0 (A, CG, WN, EMEAN, FMEAN, WNMEAN, AMAX)
 Calculate mean wave parameters. More...
 

Detailed Description

Mean wave parameter computation for case without input and dissipation.

Author
H. L. Tolman
Date
29-May-2009

Function/Subroutine Documentation

◆ w3spr0()

subroutine w3src0md::w3spr0 ( real, dimension(nth,nk), intent(in)  A,
real, dimension(nk), intent(in)  CG,
real, dimension(nk), intent(in)  WN,
real, intent(out)  EMEAN,
real, intent(out)  FMEAN,
real, intent(out)  WNMEAN,
real, intent(out)  AMAX 
)

Calculate mean wave parameters.

Parameters
[in]AAction as a function of direction and wavenumber.
[in]CGGroup velocities.
[in]WNWavenumbers.
[out]EMEANMean wave energy.
[out]FMEANMean wave frequency.
[out]WNMEANMean wavenumber.
[out]AMAXMaximum action density in spectrum.
Author
H. L. Tolman
Date
05-Jul-2006

Definition at line 82 of file w3src0md.F90.

82  !/
83  !/ +-----------------------------------+
84  !/ | WAVEWATCH III NOAA/NCEP |
85  !/ | H. L. Tolman |
86  !/ | FORTRAN 90 |
87  !/ | Last update : 05-Jul-2006 |
88  !/ +-----------------------------------+
89  !/
90  !/ 05-Jul-2006 : Origination. ( version 3.09 )
91  !/
92  ! 1. Purpose :
93  !
94  ! Calculate mean wave parameters.
95  !
96  ! 2. Method :
97  !
98  ! See source term routines.
99  !
100  ! 3. Parameters :
101  !
102  ! Parameter list
103  ! ----------------------------------------------------------------
104  ! A R.A. I Action as a function of direction and
105  ! wavenumber.
106  ! CG R.A. I Group velocities.
107  ! WN R.A. I Wavenumbers.
108  ! EMEAN Real O Mean wave energy.
109  ! FMEAN Real O Mean wave frequency.
110  ! WNMEAN Real O Mean wavenumber.
111  ! AMAX Real O Maximum action density in spectrum.
112  ! ----------------------------------------------------------------
113  !
114  ! 4. Subroutines used :
115  !
116  ! Name Type Module Description
117  ! ----------------------------------------------------------------
118  ! STRACE Subr. W3SERVMD Subroutine tracing.
119  ! ----------------------------------------------------------------
120  !
121  ! 5. Called by :
122  !
123  ! Name Type Module Description
124  ! ----------------------------------------------------------------
125  ! W3SRCE Subr. W3SRCEMD Source term integration.
126  ! W3EXPO Subr. N/A Point output post-processor.
127  ! GXEXPO Subr. N/A GrADS point output post-processor.
128  ! ----------------------------------------------------------------
129  !
130  ! 6. Error messages :
131  !
132  ! None.
133  !
134  ! 7. Remarks :
135  !
136  ! 8. Structure :
137  !
138  ! See source code.
139  !
140  ! 9. Switches :
141  !
142  ! !/S Enable subroutine tracing.
143  ! !/T Enable test output.
144  !
145  ! 10. Source code :
146  !
147  !/ ------------------------------------------------------------------- /
148  USE constants
149  USE w3gdatmd, ONLY: nk, nth, sig, dden, fte, ftf, ftwn
150 #ifdef W3_T
151  USE w3odatmd, ONLY: ndst
152 #endif
153 #ifdef W3_S
154  USE w3servmd, ONLY: strace
155 #endif
156  !
157  IMPLICIT NONE
158  !/
159  !/ ------------------------------------------------------------------- /
160  !/ Parameter list
161  !/
162  REAL, INTENT(IN) :: A(NTH,NK), CG(NK), WN(NK)
163  REAL, INTENT(OUT) :: EMEAN, FMEAN, WNMEAN, AMAX
164  !/
165  !/ ------------------------------------------------------------------- /
166  !/ Local parameters
167  !/
168  INTEGER :: IK, ITH
169 #ifdef W3_S
170  INTEGER, SAVE :: IENT = 0
171 #endif
172  REAL :: EB(NK), EBAND
173  !/
174  !/ ------------------------------------------------------------------- /
175  !/
176 #ifdef W3_S
177  CALL strace (ient, 'W3SPR0')
178 #endif
179  !
180  emean = 0.
181  fmean = 0.
182  wnmean = 0.
183  amax = 0.
184  !
185  ! 1. Integral over directions
186  !
187  DO ik=1, nk
188  eb(ik) = 0.
189  DO ith=1, nth
190  eb(ik) = eb(ik) + a(ith,ik)
191  amax = max( amax , a(ith,ik) )
192  END DO
193  END DO
194  !
195  ! 2. Integrate over directions
196  !
197  DO ik=1, nk
198  eb(ik) = eb(ik) * dden(ik) / cg(ik)
199  emean = emean + eb(ik)
200  fmean = fmean + eb(ik) / sig(ik)
201  wnmean = wnmean + eb(ik) / sqrt(wn(ik))
202  END DO
203  !
204  ! 3. Add tail beyond discrete spectrum
205  ! ( DTH * SIG absorbed in FTxx )
206  !
207  eband = eb(nk) / dden(nk)
208  emean = emean + eband * fte
209  fmean = fmean + eband * ftf
210  wnmean = wnmean + eband * ftwn
211  !
212  ! 4. Final processing
213  !
214  fmean = tpiinv * emean / max( 1.e-7 , fmean )
215  wnmean = ( emean / max( 1.e-7 , wnmean ) )**2
216  !
217 #ifdef W3_T
218  WRITE (ndst,9000) emean, fmean, wnmean
219 #endif
220  !
221  RETURN
222  !
223  ! Formats
224  !
225 #ifdef W3_T
226 9000 FORMAT (' TEST W3SPR0 : E,F,WN MEAN ',3e10.3)
227 #endif
228  !/
229  !/ End of W3SPR0 ----------------------------------------------------- /
230  !/

References w3gdatmd::dden, w3gdatmd::fte, w3gdatmd::ftf, w3gdatmd::ftwn, w3odatmd::ndst, w3gdatmd::nk, w3gdatmd::nth, w3gdatmd::sig, w3servmd::strace(), and constants::tpiinv.

Referenced by w3srcemd::w3srce().

w3gdatmd::nk
integer, pointer nk
Definition: w3gdatmd.F90:1230
w3gdatmd::sig
real, dimension(:), pointer sig
Definition: w3gdatmd.F90:1234
w3servmd
Definition: w3servmd.F90:3
constants::tpiinv
real, parameter tpiinv
TPIINV Inverse of 2*Pi.
Definition: constants.F90:74
w3gdatmd::nth
integer, pointer nth
Definition: w3gdatmd.F90:1230
w3odatmd
Definition: w3odatmd.F90:3
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
w3gdatmd::fte
real, pointer fte
Definition: w3gdatmd.F90:1232
w3odatmd::ndst
integer, pointer ndst
Definition: w3odatmd.F90:456
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
w3gdatmd::dden
real, dimension(:), pointer dden
Definition: w3gdatmd.F90:1234
w3gdatmd
Definition: w3gdatmd.F90:16
w3gdatmd::ftf
real, pointer ftf
Definition: w3gdatmd.F90:1232
w3gdatmd::ftwn
real, pointer ftwn
Definition: w3gdatmd.F90:1232