NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fc05.f
Go to the documentation of this file.
1C> @file
2C> @brief Earth U,V wind components to dir and spd.
3C> @author John Stackpole @date 1981-12-30
4
5C> Given the true (Earth oriented) wind components
6C> compute the wind direction and speed.
7C> Input winds at the pole are assumed to follow the WMO
8C> conventions, with the output direction computed in accordance
9C> with WMO standards for reporting winds at the pole.
10C> (see office note 241 for WMO definition.)
11C>
12C> Program history log:
13C> - John Stackpole 1981-12-30
14C> - P. Chase 1988-10-19 Allow output values to overlay input
15C> - Ralph Jones 1991-03-05 Changes for cray cft77 fortran
16C> - Dennis Keyser 1992-10-21 Added 1.e-3 to direction to allow truncation
17C> to nearest whole degree to be correct (keeps agreement between cray & nas versions)
18C>
19C> @param[in] U REAL Earth-oriented U-component.
20C> @param[in] V REAL Earth-oriented V-component.
21C> @param[out] DIR REAL Wind direction, degrees. Values will
22C> be from 0 to 360 inclusive.
23C> @param[out] SPD REAL Wind speed in same units as input.
24C>
25C> @note If speed is less than 1e-10 then direction will be set to zero.
26C>
27C> @author John Stackpole @date 1981-12-30
28 SUBROUTINE w3fc05(U, V, DIR, SPD) 11700000
29C
30C VARIABLES.....
31C
32 REAL U, V, DIR, SPD, XSPD
33C
34C CONSTANTS.....
35C
36 DATA spdtst/1.0e-10/
37 DATA rtod /57.2957795/
38 DATA dchalf/180.0/
39C
40 xspd = sqrt(u * u + v * v)
41 IF (xspd .LT. spdtst) THEN
42 dir = 0.0
43 ELSE
44 dir = atan2(u,v) * rtod + dchalf + 1.e-3
45 ENDIF
46 spd = xspd
47 RETURN
48 END
subroutine w3fc05(u, v, dir, spd)
Given the true (Earth oriented) wind components compute the wind direction and speed.
Definition w3fc05.f:29