-
Notifications
You must be signed in to change notification settings - Fork 568
/
Copy pathw3flx5md.F90
203 lines (203 loc) · 6.43 KB
/
w3flx5md.F90
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
#include "w3macros.h"
!/ ------------------------------------------------------------------- /
MODULE W3FLX5MD
!/
!/ +-----------------------------------+
!/ | WAVEWATCH III NOAA/NCEP |
!/ | |
!/ | N.G. Valiente |
!/ | J. Edward |
!/ | A. Saulter |
!/ | FORTRAN 90 |
!/ | Last update : 01-Jul-2021 |
!/ +-----------------------------------+
!/
!/ 22-Mar-2021 : Origination. ( version 7.xx )
!/ 22-Mar-2021 : Enable direct use of atmospheric model wind stress
!/ by source terms ST6
!/ 01-Jul-2021 : Enable direct use of atmospheric model wind stress
!/ by source terms ST4
!/
!/ Copyright 2009 National Weather Service (NWS),
!/ National Oceanic and Atmospheric Administration. All rights
!/ reserved. WAVEWATCH III is a trademark of the NWS.
!/ No unauthorized use without permission.
!/
! 1. Purpose :
!
! Unified process to obtain friction velocity and drag when stresses are an
! input (from atmospheric model).
!
! References:
! XX
!
! 2. Variables and types :
!
! 3. Subroutines and functions :
!
! Name Type Scope Description
! ----------------------------------------------------------------
! W3FLX5 Subr. Public Stresses closure
! ----------------------------------------------------------------
!
! 4. Subroutines and functions used :
!
! Name Type Module Description
! ----------------------------------------------------------------
! STRACE Subr. W3SERVMD Subroutine tracing.
! ----------------------------------------------------------------
!
! 5. Remarks :
!
! 6. Switches :
!
! !/S Enable subroutine tracing.
!
! 7. Source code :
!/
!/ ------------------------------------------------------------------- /
!/
PUBLIC
!/
CONTAINS
!/ ------------------------------------------------------------------- /
SUBROUTINE W3FLX5 ( ZWND, U10, U10D, TAUA, TAUADIR, RHOAIR, UST, USTD, Z0, CD )
!/
!/ +-----------------------------------+
!/ | WAVEWATCH III NOAA/NCEP |
!/ | |
!/ | N.G. Valiente |
!/ | J. Edward |
!/ | A. Saulter |
!/ | FORTRAN 90 |
!/ | Last update : 01-Jul-2021 |
!/ +-----------------------------------+
!/
!/ 22-Mar-2021 : Origination. ( version 7.xx )
!/ 22-Mar-2021 : Enable direct use of atmospheric model wind stress
!/ by source terms ST6
!/ 01-Jul-2021 : Enable direct use of atmospheric model wind stress
!/ by source terms ST4
!/
! 1. Purpose :
!
! Unified process to obtain friction velocity and drag when stresses are an
! input (from atmospheric model).
!
! 2. Method :
!
! UST = SQRT(TAUA / RHOAIR)
! USTD = TAUADIR
! CD = (UST/U10)**2
! SQRTCDM1 = MIN(U10/UST,100.0)
! Z0 = ZWND*EXP(-KAPPA*SQRTCDM1)
!
! 3. Parameters :
!
! Parameter list
! ----------------------------------------------------------------
! ZWND Real I Wind height.
! U10 Real I Wind speed.
! U10D Real I Wind direction.
! TAUA Real I Atm. total stress.
! TAUADIR Real I Atm. total stress direction.
! RHOAIR Real I Air density.
! UST Real O Friction velocity.
! USTD Real 0 Direction of friction velocity.
! Z0 Real O z0 in profile law.
! CD Real O Drag coefficient.
! ----------------------------------------------------------------
!
! 4. Subroutines used :
!
! Name Type Module Description
! ----------------------------------------------------------------
! STRACE Subr. W3SERVMD Subroutine tracing.
! ----------------------------------------------------------------
!
! 5. Called by :
!
! Name Type Module Description
! ----------------------------------------------------------------
! W3SRCE Subr. W3SRCEMD Source term integration.
! ----------------------------------------------------------------
!
! 6. Error messages :
!
! None.
!
! 7. Remarks :
!
! 8. Structure :
!
! See source code.
!
! 9. Switches :
!
! !/S Enable subroutine tracing.
!
! 10. Source code :
!
!/ ------------------------------------------------------------------- /
USE CONSTANTS, ONLY: KAPPA
USE W3ODATMD, ONLY: NDSE, IAPROC, NAPERR
! USE W3GDATMD, ONLY: FLX5A0
USE W3SERVMD, ONLY: EXTCDE
#ifdef W3_S
USE W3SERVMD, ONLY: STRACE
#endif
!/
IMPLICIT NONE
!/
!/ ------------------------------------------------------------------- /
!/ Parameter list
!/
REAL, INTENT(IN) :: ZWND, U10, U10D, TAUA, TAUADIR, RHOAIR
REAL, INTENT(OUT) :: UST, USTD, Z0, CD
REAL :: UNZ, SQRTCDM1
!/
!/ ------------------------------------------------------------------- /
!/ Local parameters
!/
#ifdef W3_S
INTEGER, SAVE :: IENT = 0
#endif
!/
!/ ------------------------------------------------------------------- /
!/
#ifdef W3_S
CALL STRACE (IENT, 'W3FLX5')
#endif
!
! 1. Tests ---------------------------------------------------------- *
!
IF ( ABS(ZWND-10.) .GT. 0.01 ) THEN
IF ( IAPROC .EQ. NAPERR ) WRITE (NDSE,1000) ZWND
CALL EXTCDE (1)
END IF
!
! 2. Computation ---------------------------------------------------- *
!
!
UST = SQRT(TAUA/RHOAIR)
UNZ = MAX ( 0.01 , U10 )
CD = (UST/UNZ)**2
USTD = TAUADIR
SQRTCDM1 = MIN(UNZ/UST,100.0)
Z0 = ZWND*EXP(-KAPPA*SQRTCDM1)
!
RETURN
!
! Formats
!
1000 FORMAT (/' *** WAVEWATCH III ERROR IN W3FLX5 : '/ &
' HEIGHT OF WIND SHOULD BE 10m IN THIS APPROACH '/ &
' ZWND =',F8.2,'m'/)
!/
!/ End of W3FLX5 ----------------------------------------------------- /
!/
END SUBROUTINE W3FLX5
!/
!/ End of module W3FLX5MD -------------------------------------------- /
!/
END MODULE W3FLX5MD