NCEPLIBS-w3emc  2.11.0
w3fc02.f
Go to the documentation of this file.
1 C> @file
2 C> @brief Grid U,V wind comps. to dir. and speed.
3 C> @author John Stackpole @date 1981-12-30
4 
5 C> Given the grid-oriented wind components on a northern
6 C> hemisphere polar stereographic grid point, compute the direction
7 C> and speed of the wind at that point. Input winds at the north
8 C> pole point are assumed to have their components follow the wmo
9 C> standards for reporting winds at the north pole.
10 C> (see office note 241 for wmo definition). Output direction
11 C> will follow wmo convention.
12 C>
13 C> Program history log:
14 C> - John Stackpole 1981-12-30
15 C> - Ralph Jones 1989-01-20 Convert to microsoft fortran 4.10.
16 C> - Ralph Jones 1990-06-11 Convert to sun fortran 1.3.
17 C> - Ralph Jones 1991-03-30 Convert to silicongraphics fortran.
18 C> - Ralph Jones 1993-03-29 Add save statement.
19 C> - Ralph Jones 1995-08-09 Compile on cray.
20 C>
21 C> @param[in] FFID REAL*4 I(north pole) - i(point).
22 C> @param[in] FFJD REAL*4 J(north pole) - j(point).
23 C> @param[in] FGU REAL*4 Grid-oriented u-component.
24 C> @param[in] FGV REAL*4 Grid-oriented v-component.
25 C>
26 C> @param[out] DIR REAL*4 Wind direction, degrees.
27 C> @param[out] SPD REAL*4 Wind speed.
28 C>
29 C> @note This job will not vectorize on a cray.
30 C>
31 C> @author John Stackpole @date 1981-12-30
32  SUBROUTINE w3fc02(FFID,FFJD,FGU,FGV,DIR,SPD)
33 C
34  SAVE
35 C
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