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