WAVEWATCH III  beta 0.0.1
w3flx2md.F90
Go to the documentation of this file.
1 
7 
8 #include "w3macros.h"
9 !/ ------------------------------------------------------------------- /
21 MODULE w3flx2md
22  !/
23  !/ +-----------------------------------+
24  !/ | WAVEWATCH III NOAA/NCEP |
25  !/ | H. L. Tolman |
26  !/ | FORTRAN 90 |
27  !/ | Last update : 20-Apr-2010 |
28  !/ +-----------------------------------+
29  !/
30  !/ 03-Jul-2006 : Origination. ( version 3.09 )
31  !/ 29-May-2009 : Preparing distribution version. ( version 3.14 )
32  !/ 20-Apr-2010 : Fix INTENT of UST. ( version 3.14.1 )
33  !/
34  !/ Copyright 2009-2010 National Weather Service (NWS),
35  !/ National Oceanic and Atmospheric Administration. All rights
36  !/ reserved. WAVEWATCH III is a trademark of the NWS.
37  !/ No unauthorized use without permission.
38  !/
39  ! 1. Purpose :
40  !
41  ! FLux/stress computations according Tolman and Chalikov (1996).
42  !
43  ! 2. Variables and types :
44  !
45  ! 3. Subroutines and functions :
46  !
47  ! Name Type Scope Description
48  ! ----------------------------------------------------------------
49  ! W3FLX2 Subr. Public Stresses according to TC (1996).
50  ! ----------------------------------------------------------------
51  !
52  ! 4. Subroutines and functions used :
53  !
54  ! Name Type Module Description
55  ! ----------------------------------------------------------------
56  ! STRACE Subr. W3SERVMD Subroutine tracing.
57  ! ----------------------------------------------------------------
58  !
59  ! 5. Remarks :
60  !
61  ! - Originally used with source term !/ST2.
62  !
63  ! 6. Switches :
64  !
65  ! !/S Enable subroutine tracing.
66  !
67  ! 7. Source code :
68  !/
69  !/ ------------------------------------------------------------------- /
70  PUBLIC
71  !/
72 CONTAINS
73  !/ ------------------------------------------------------------------- /
90  SUBROUTINE w3flx2 ( ZWIND, DEPTH, FP, U, UDIR, UST, USTD, Z0, CD )
91  !/
92  !/ +-----------------------------------+
93  !/ | WAVEWATCH III NOAA/NCEP |
94  !/ | H. L. Tolman |
95  !/ | FORTRAN 90 |
96  !/ | Last update : 10-Jan-2014 |
97  !/ +-----------------------------------+
98  !/
99  !/ 03-Jul-2006 : Origination. ( version 3.09 )
100  !/ 20-Apr-2010 : Fix INTENT of UST. ( version 3.14.1 )
101  !/ 16-Sep-2011 : Add max on division by UST ( version 4.05 )
102  !/ 10-Jan-2014 : Add a min value for FP ( version 4.18 )
103  !/
104  ! 1. Purpose :
105  !
106  ! FLux/stress computations according Tolman and Chalikov (1996).
107  !
108  ! 2. Method :
109  !
110  ! 3. Parameters :
111  !
112  ! Parameter list
113  ! ----------------------------------------------------------------
114  ! ZWIND Real I Hight of wind.
115  ! DEPTH Real I Depth.
116  ! FP Real I Peak frequency.
117  ! U Real I Wind speed.
118  ! UDIR Real I Wind direction.
119  ! UST Real O Friction velocity.
120  ! USTD Real 0 Direction of friction velocity.
121  ! Z0 Real O z0 in profile law.
122  ! CD Real O Drag coefficient.
123  ! ----------------------------------------------------------------
124  !
125  ! 4. Subroutines used :
126  !
127  ! Name Type Module Description
128  ! ----------------------------------------------------------------
129  ! STRACE Subr. W3SERVMD Subroutine tracing.
130  ! ----------------------------------------------------------------
131  !
132  ! 5. Called by :
133  !
134  ! Name Type Module Description
135  ! ----------------------------------------------------------------
136  ! W3SRCE Subr. W3SRCEMD Source term integration.
137  ! ----------------------------------------------------------------
138  !
139  ! 6. Error messages :
140  !
141  ! None.
142  !
143  ! 7. Remarks :
144  !
145  ! 8. Structure :
146  !
147  ! See source code.
148  !
149  ! 9. Switches :
150  !
151  ! !/S Enable subroutine tracing.
152  !
153  ! 10. Source code :
154  !
155  !/ ------------------------------------------------------------------- /
156  USE constants
157  USE w3gdatmd, ONLY: nittin, cinxsi
158  USE w3odatmd, ONLY: ndse, iaproc, naperr
159  USE w3servmd, ONLY: extcde
160 #ifdef W3_S
161  USE w3servmd, ONLY: strace
162 #endif
163  USE w3dispmd, ONLY: dsie, n1max, ewn1
164  !/
165  IMPLICIT NONE
166  !/
167  !/ ------------------------------------------------------------------- /
168  !/ Parameter list
169  !/
170  REAL, INTENT(IN) :: ZWIND, DEPTH, FP, U, UDIR
171  REAL, INTENT(INOUT) :: UST
172  REAL, INTENT(OUT) :: USTD, Z0, CD
173  !/
174  !/ ------------------------------------------------------------------- /
175  !/ Local parameters
176  !/
177  INTEGER :: I1, ITT
178 #ifdef W3_S
179  INTEGER, SAVE :: IENT = 0
180 #endif
181  REAL :: SQRTH, SIX, R1, WNP, CP, UNZ, ALPHA, &
182  RDCH, AFP
183  !/
184  !/ ------------------------------------------------------------------- /
185  !/
186 #ifdef W3_S
187  CALL strace (ient, 'W3FLX2')
188 #endif
189  !
190  ! 1. Peak phase velocity -------------------------------------------- *
191  !
192  ! ----- start of inlined and reduced WAVNU1 -----
193  !
194  afp = tpi * max( fp, 0.001)
195  !
196  sqrth = sqrt( depth )
197  six = afp * sqrth
198  i1 = int( six / dsie )
199  IF (i1.LE.n1max) THEN
200  r1 = six/dsie - real(i1)
201  wnp = ( (1.-r1)*ewn1(i1) + r1*ewn1(i1+1) ) / depth
202  ELSE
203  wnp = afp * afp / grav
204  END IF
205  !
206  ! ----- end of inlined and reduced WAVNU1 -----
207  !
208  cp = afp / wnp
209  !
210  ! 2. Itterative stress computation ---------------------------------- *
211  !
212  unz = max( 0.01 , u )
213  ustd = udir
214  !
215  DO itt=1, nittin
216  alpha = 0.57 / ( cp / max(ust,0.0001) )**(1.5)
217  rdch = max( 0. , &
218  log( ( zwind * grav) / ( cinxsi * sqrt(alpha) * unz**2) ) )
219  cd = 0.001 * ( 0.021 + 10.4 / (rdch**1.23+1.85) )
220  ust = sqrt(cd) * unz
221  z0 = zwind * exp( -0.4 / sqrt(cd) )
222  END DO
223  !
224  RETURN
225  !
226  ! Formats
227  !
228  !/
229  !/ End of W3FLX2 ----------------------------------------------------- /
230  !/
231  END SUBROUTINE w3flx2
232  !/
233  !/ End of module INFLX1MD -------------------------------------------- /
234  !/
235 END MODULE w3flx2md
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3flx2md::w3flx2
subroutine w3flx2(ZWIND, DEPTH, FP, U, UDIR, UST, USTD, Z0, CD)
FLux/stress computations according Tolman and Chalikov (1996).
Definition: w3flx2md.F90:91
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3dispmd::ewn1
real, dimension(0:nar1d) ewn1
Definition: w3dispmd.F90:78
w3flx2md
FLux/stress computations according Tolman and Chalikov (1996).
Definition: w3flx2md.F90:21
w3odatmd::naperr
integer, pointer naperr
Definition: w3odatmd.F90:457
w3servmd
Definition: w3servmd.F90:3
w3odatmd
Definition: w3odatmd.F90:3
w3gdatmd::cinxsi
real, pointer cinxsi
Definition: w3gdatmd.F90:1282
constants::tpi
real, parameter tpi
TPI 2*Pi.
Definition: constants.F90:72
w3servmd::strace
subroutine strace(IENT, SNAME)
Definition: w3servmd.F90:148
constants
Define some much-used constants for global use (all defined as PARAMETER).
Definition: constants.F90:20
w3gdatmd::nittin
integer, pointer nittin
Definition: w3gdatmd.F90:1281
w3gdatmd
Definition: w3gdatmd.F90:16
w3servmd::extcde
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
Definition: w3servmd.F90:736
w3dispmd
Definition: w3dispmd.F90:3
w3dispmd::n1max
integer n1max
Definition: w3dispmd.F90:77
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61
w3dispmd::dsie
real dsie
Definition: w3dispmd.F90:78