NCEPLIBS-w3emc 2.12.0
Loading...
Searching...
No Matches
w3fc02.f
Go to the documentation of this file.
1C> @file
2C> @brief Grid U,V wind comps. to dir. and speed.
3C> @author John Stackpole @date 1981-12-30
4
5C> Given the grid-oriented wind components on a northern
6C> hemisphere polar stereographic grid point, compute the direction
7C> and speed of the wind at that point. Input winds at the north
8C> pole point are assumed to have their components follow the wmo
9C> standards for reporting winds at the north pole.
10C> (see office note 241 for wmo definition). Output direction
11C> will follow wmo convention.
12C>
13C> Program history log:
14C> - John Stackpole 1981-12-30
15C> - Ralph Jones 1989-01-20 Convert to microsoft fortran 4.10.
16C> - Ralph Jones 1990-06-11 Convert to sun fortran 1.3.
17C> - Ralph Jones 1991-03-30 Convert to silicongraphics fortran.
18C> - Ralph Jones 1993-03-29 Add save statement.
19C> - Ralph Jones 1995-08-09 Compile on cray.
20C>
21C> @param[in] FFID REAL*4 I(north pole) - i(point).
22C> @param[in] FFJD REAL*4 J(north pole) - j(point).
23C> @param[in] FGU REAL*4 Grid-oriented u-component.
24C> @param[in] FGV REAL*4 Grid-oriented v-component.
25C>
26C> @param[out] DIR REAL*4 Wind direction, degrees.
27C> @param[out] SPD REAL*4 Wind speed.
28C>
29C> @note This job will not vectorize on a cray.
30C>
31C> @author John Stackpole @date 1981-12-30
32 SUBROUTINE w3fc02(FFID,FFJD,FGU,FGV,DIR,SPD)
33C
34 SAVE
35C
36 spd = sqrt(fgu * fgu + fgv * fgv)
37 IF (spd.NE.0.) GO TO 1000
38 fgu = 0.
39 fgv = 0.
40 GO TO 3000
41 1000 CONTINUE
42 dfp = sqrt(ffid * ffid + ffjd * ffjd)
43 IF (dfp.NE.0.) GO TO 2000
44 xlam = acos(fgu / spd)
45 xlam = xlam * 57.29578
46 IF (fgv.LT.0.) dir = 170. + xlam
47 IF ((fgv.GT.0.).AND.(xlam.LT.170.)) dir = 170. - xlam
48 IF ((fgv.GT.0.).AND.(xlam.GE.170.)) dir = 530. - xlam
49 IF ((abs(fgv).LE.0.001).AND.(fgu.GT.0.)) dir = 170.
50 IF ((abs(fgv).LE.0.001).AND.(fgu.LT.0.)) dir = 350.
51 GO TO 3000
52 2000 CONTINUE
53 cal = ffjd / dfp
54 sal = ffid / dfp
55 u = fgu * cal - fgv * sal
56 v = fgu * sal + fgv * cal
57 dir = 57.29578 * atan2(u,v) + 180.
58 3000 CONTINUE
59 RETURN
60 END
subroutine w3fc02(ffid, ffjd, fgu, fgv, dir, spd)
Given the grid-oriented wind components on a northern hemisphere polar stereographic grid point,...
Definition w3fc02.f:33