WAVEWATCH III  beta 0.0.1
w3flx5md.F90
Go to the documentation of this file.
1 
10 
11 #include "w3macros.h"
12 
13 !/ ------------------------------------------------------------------- /
28 MODULE w3flx5md
29  !/
30  !/ +-----------------------------------+
31  !/ | WAVEWATCH III NOAA/NCEP |
32  !/ | |
33  !/ | N.G. Valiente |
34  !/ | J. Edward |
35  !/ | A. Saulter |
36  !/ | FORTRAN 90 |
37  !/ | Last update : 01-Jul-2021 |
38  !/ +-----------------------------------+
39  !/
40  !/ 22-Mar-2021 : Origination. ( version 7.14 )
41  !/ 22-Mar-2021 : Enable direct use of atmospheric model wind stress
42  !/ by source terms ST6
43  !/ 01-Jul-2021 : Enable direct use of atmospheric model wind stress
44  !/ by source terms ST4
45  !/
46  !/ Copyright 2009 National Weather Service (NWS),
47  !/ National Oceanic and Atmospheric Administration. All rights
48  !/ reserved. WAVEWATCH III is a trademark of the NWS.
49  !/ No unauthorized use without permission.
50  !/
51  ! 1. Purpose :
52  !
53  ! Unified process to obtain friction velocity and drag when stresses are an
54  ! input (from atmospheric model).
55  !
56  ! References:
57  ! XX
58  !
59  ! 2. Variables and types :
60  !
61  ! 3. Subroutines and functions :
62  !
63  ! Name Type Scope Description
64  ! ----------------------------------------------------------------
65  ! W3FLX5 Subr. Public Stresses closure
66  ! ----------------------------------------------------------------
67  !
68  ! 4. Subroutines and functions used :
69  !
70  ! Name Type Module Description
71  ! ----------------------------------------------------------------
72  ! STRACE Subr. W3SERVMD Subroutine tracing.
73  ! ----------------------------------------------------------------
74  !
75  ! 5. Remarks :
76  !
77  ! 6. Switches :
78  !
79  ! !/S Enable subroutine tracing.
80  !
81  ! 7. Source code :
82  !/
83  !/ ------------------------------------------------------------------- /
84  !/
85  PUBLIC
86  !/
87 CONTAINS
88  !/ ------------------------------------------------------------------- /
118  SUBROUTINE w3flx5 ( ZWND, U10, U10D, TAUA, TAUADIR, RHOAIR, UST, USTD, Z0, CD, CHARN )
119  !/
120  !/ +-----------------------------------+
121  !/ | WAVEWATCH III NOAA/NCEP |
122  !/ | |
123  !/ | N.G. Valiente |
124  !/ | J. Edward |
125  !/ | A. Saulter |
126  !/ | FORTRAN 90 |
127  !/ | Last update : 01-Jul-2021 |
128  !/ +-----------------------------------+
129  !/
130  !/ 22-Mar-2021 : Origination. ( version 7.14 )
131  !/ 22-Mar-2021 : Enable direct use of atmospheric model wind stress
132  !/ by source terms ST6
133  !/ 01-Jul-2021 : Enable direct use of atmospheric model wind stress
134  !/ by source terms ST4
135  !/
136  ! 1. Purpose :
137  !
138  ! Unified process to obtain friction velocity and drag when stresses are an
139  ! input (from atmospheric model).
140  !
141  ! 2. Method :
142  !
143  ! UST = SQRT(TAUA / RHOAIR)
144  ! USTD = TAUADIR
145  ! CD = (UST/U10)**2
146  ! SQRTCDM1 = MIN(U10/UST,100.0)
147  ! Z0 = ZWND*EXP(-KAPPA*SQRTCDM1)
148  !
149  ! 3. Parameters :
150  !
151  ! Parameter list
152  ! ----------------------------------------------------------------
153  ! ZWND Real I Wind height.
154  ! U10 Real I Wind speed.
155  ! U10D Real I Wind direction.
156  ! TAUA Real I Atm. total stress.
157  ! TAUADIR Real I Atm. total stress direction.
158  ! RHOAIR Real I Air density.
159  ! UST Real O Friction velocity.
160  ! USTD Real 0 Direction of friction velocity.
161  ! Z0 Real O z0 in profile law.
162  ! CD Real O Drag coefficient.
163  ! CHARN Real O Charnock coefficient
164  ! ----------------------------------------------------------------
165  !
166  ! 4. Subroutines used :
167  !
168  ! Name Type Module Description
169  ! ----------------------------------------------------------------
170  ! STRACE Subr. W3SERVMD Subroutine tracing.
171  ! ----------------------------------------------------------------
172  !
173  ! 5. Called by :
174  !
175  ! Name Type Module Description
176  ! ----------------------------------------------------------------
177  ! W3SRCE Subr. W3SRCEMD Source term integration.
178  ! ----------------------------------------------------------------
179  !
180  ! 6. Error messages :
181  !
182  ! None.
183  !
184  ! 7. Remarks :
185  !
186  ! 8. Structure :
187  !
188  ! See source code.
189  !
190  ! 9. Switches :
191  !
192  ! !/S Enable subroutine tracing.
193  !
194  ! 10. Source code :
195  !
196  !/ ------------------------------------------------------------------- /
197  USE constants, ONLY: kappa, grav, nu_air
198  USE w3odatmd, ONLY: ndse, iaproc, naperr
199  USE w3servmd, ONLY: extcde
200 #ifdef W3_S
201  USE w3servmd, ONLY: strace
202 #endif
203  !/
204  IMPLICIT NONE
205  !/
206  !/ ------------------------------------------------------------------- /
207  !/ Parameter list
208  !/
209  REAL, INTENT(IN) :: ZWND, U10, U10D, TAUA, TAUADIR, RHOAIR
210  REAL, INTENT(OUT) :: UST, USTD, Z0, CD, CHARN
211  REAL :: UNZ, SQRTCDM1
212  !/
213  !/ ------------------------------------------------------------------- /
214  !/ Local parameters
215  !/
216 #ifdef W3_S
217  INTEGER, SAVE :: IENT = 0
218 #endif
219  !/
220  !/ ------------------------------------------------------------------- /
221  !/
222 #ifdef W3_S
223  CALL strace (ient, 'W3FLX5')
224 #endif
225  !
226  ! 1. Tests ---------------------------------------------------------- *
227  !
228  IF ( abs(zwnd-10.) .GT. 0.01 ) THEN
229  IF ( iaproc .EQ. naperr ) WRITE (ndse,1000) zwnd
230  CALL extcde (1)
231  END IF
232  !
233  ! 2. Computation ---------------------------------------------------- *
234  !
235  !
236  ust = max( 1e-4, sqrt(taua/rhoair) )
237  unz = max( 0.01 , u10 )
238  cd = (ust/unz)**2
239  ustd = tauadir
240  sqrtcdm1 = min(unz/ust,100.0)
241  z0 = zwnd*exp(-kappa*sqrtcdm1)
242  IF (unz.GT.2.5) THEN
243  charn = (z0 - 0.11 * nu_air / ust) * grav / ust**2
244  charn = max( charn , 0.0095 )
245  charn = min( 0.035 , charn )
246  ELSE
247  charn = 0.0095
248  END IF
249  !
250  RETURN
251  !
252  ! Formats
253  !
254 1000 FORMAT (/' *** WAVEWATCH III ERROR IN W3FLX5 : '/ &
255  ' HEIGHT OF WIND SHOULD BE 10m IN THIS APPROACH '/ &
256  ' ZWND =',f8.2,'m'/)
257  !/
258  !/ End of W3FLX5 ----------------------------------------------------- /
259  !/
260  END SUBROUTINE w3flx5
261  !/
262  !/ End of module W3FLX5MD -------------------------------------------- /
263  !/
264 END MODULE w3flx5md
w3flx5md::w3flx5
subroutine w3flx5(ZWND, U10, U10D, TAUA, TAUADIR, RHOAIR, UST, USTD, Z0, CD, CHARN)
Unified process to obtain friction velocity and drag when stresses are an input (from atmospheric mod...
Definition: w3flx5md.F90:119
constants::nu_air
real, parameter nu_air
NU_AIR Kinematic viscosity of air (m2/s).
Definition: constants.F90:64
w3odatmd::iaproc
integer, pointer iaproc
Definition: w3odatmd.F90:457
w3odatmd::ndse
integer, pointer ndse
Definition: w3odatmd.F90:456
w3flx5md
Unified process to obtain friction velocity and drag when stresses are an input (from atmospheric mod...
Definition: w3flx5md.F90:28
w3odatmd::naperr
integer, pointer naperr
Definition: w3odatmd.F90:457
constants::kappa
real, parameter kappa
KAPPA von Karman's constant (N.D.).
Definition: constants.F90:69
w3servmd
Definition: w3servmd.F90:3
w3odatmd
Definition: w3odatmd.F90:3
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
w3servmd::extcde
subroutine extcde(IEXIT, UNIT, MSG, FILE, LINE, COMM)
Definition: w3servmd.F90:736
constants::grav
real, parameter grav
GRAV Acc.
Definition: constants.F90:61