-
Notifications
You must be signed in to change notification settings - Fork 0
/
w3flx3md.ftn
209 lines (209 loc) · 6.67 KB
/
w3flx3md.ftn
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
204
205
206
207
208
209
#include "w3macros.h"
!/ ------------------------------------------------------------------- /
MODULE W3FLX3MD
!/
!/ +-----------------------------------+
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 20-Apr-2010 |
!/ +-----------------------------------+
!/
!/ 05-Jul-2006 : Origination. ( version 3.09 )
!/ 29-May-2009 : Preparing distribution version. ( version 3.14 )
!/ 20-Apr-2010 : Fix INTENT of UST. ( version 3.14.1 )
!/
!/ Copyright 2009-2010 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 :
!
! FLux/stress computations according Tolman and Chalikov (1996).
! Cap on flux added compared to W3FLX2.
!
! 2. Variables and types :
!
! 3. Subroutines and functions :
!
! Name Type Scope Description
! ----------------------------------------------------------------
! W3FLX3 Subr. Public Stresses according to TC (1996).
! ----------------------------------------------------------------
!
! 4. Subroutines and functions used :
!
! Name Type Module Description
! ----------------------------------------------------------------
! STRACE Subr. W3SERVMD Subroutine tracing.
! ----------------------------------------------------------------
!
! 5. Remarks :
!
! - Originally used with source term !/ST2.
!
! 6. Switches :
!
! !/S Enable subroutine tracing.
!
! 7. Source code :
!/
!/ ------------------------------------------------------------------- /
PUBLIC
!/
CONTAINS
!/ ------------------------------------------------------------------- /
SUBROUTINE W3FLX3 ( ZWIND, DEPTH, FP, U, UDIR, UST, USTD, Z0, CD )
!/
!/ +-----------------------------------+
!/ | WAVEWATCH III NOAA/NCEP |
!/ | H. L. Tolman |
!/ | FORTRAN 90 |
!/ | Last update : 10-Jan-2014 |
!/ +-----------------------------------+
!/
!/ 05-Jul-2006 : Origination. ( version 3.09 )
!/ 20-Apr-2010 : Fix INTENT of UST. ( version 3.14.1 )
!/ 10-Jan-2014 : Add max on division by UST ( version 4.18 )
!/ (This was already done for W3FLX2 on 16 Sep 2011)
!/ 10-Jan-2014 : Add a min value for FP ( version 4.18 )
!/
! 1. Purpose :
!
! FLux/stress computations according Tolman and Chalikov (1996).
! Cap on flux added compared to W3FLX2.
!
! 2. Method :
!
! 3. Parameters :
!
! Parameter list
! ----------------------------------------------------------------
! ZWIND Real I Hight of wind.
! DEPTH Real I Depth.
! FP Real I Peak frequency.
! U Real I Wind speed.
! UDIR Real I Wind direction.
! 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
USE W3GDATMD, ONLY: NITTIN, CINXSI, CD_MAX, CAP_ID
USE W3ODATMD, ONLY: NDSE, IAPROC, NAPERR
USE W3SERVMD, ONLY: EXTCDE
!/S USE W3SERVMD, ONLY: STRACE
USE W3DISPMD, ONLY: DSIE, N1MAX, EWN1
!/
IMPLICIT NONE
!/
!/ ------------------------------------------------------------------- /
!/ Parameter list
!/
REAL, INTENT(IN) :: ZWIND, DEPTH, FP, U, UDIR
REAL, INTENT(INOUT) :: UST
REAL, INTENT(OUT) :: USTD, Z0, CD
!/
!/ ------------------------------------------------------------------- /
!/ Local parameters
!/
INTEGER :: I1, ITT
!/S INTEGER, SAVE :: IENT = 0
REAL :: SQRTH, SIX, R1, WNP, CP, UNZ, ALPHA, &
RDCH, AFP
!/
!/ ------------------------------------------------------------------- /
!/
!/S CALL STRACE (IENT, 'W3FLX3')
!
! 1. Peak phase velocity -------------------------------------------- *
!
! ----- start of inlined and reduced WAVNU1 -----
!
AFP = TPI * MAX ( FP, 0.001)
!
SQRTH = SQRT ( DEPTH )
SIX = AFP * SQRTH
I1 = INT ( SIX / DSIE )
IF (I1.LE.N1MAX) THEN
R1 = SIX/DSIE - REAL(I1)
WNP = ( (1.-R1)*EWN1(I1) + R1*EWN1(I1+1) ) / DEPTH
ELSE
WNP = AFP * AFP / GRAV
END IF
!
! ----- end of inlined and reduced WAVNU1 -----
!
CP = AFP / WNP
!
! 2. Itterative stress computation ---------------------------------- *
!
UNZ = MAX ( 0.01 , U )
USTD = UDIR
!
DO ITT=1, NITTIN
ALPHA = 0.57 / ( CP / MAX (UST,0.0001) )**(1.5)
RDCH = MAX ( 0. , &
LOG ( ( ZWIND * GRAV) / ( CINXSI * SQRT(ALPHA) * UNZ**2) ) )
CD = 0.001 * ( 0.021 + 10.4 / (RDCH**1.23+1.85) )
UST = SQRT(CD) * UNZ
Z0 = ZWIND * EXP ( -0.4 / SQRT(CD) )
END DO
!
! 3. Apply limit to drag coefficient -------------------------------- *
!
IF ( CAP_ID .EQ. 0 ) THEN
CD = MIN ( CD_MAX, CD )
ELSE
CD = CD_MAX * TANH ( CD / CD_MAX )
END IF
!
UST = SQRT(CD) * UNZ
Z0 = ZWIND * EXP ( -0.4 / SQRT(CD) )
!
RETURN
!
! Formats
!
!/
!/ End of W3FLX3 ----------------------------------------------------- /
!/
END SUBROUTINE W3FLX3
!/
!/ End of module W3FLX3MD -------------------------------------------- /
!/
END MODULE W3FLX3MD