1 SUBROUTINE FFDDUV(F,D,U,V,YLON,XLONC,PHIC,IPROJ,II,ID)
2 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
4 C WIND SPEED AND DIRECTION <-------> WIND COMPONENTS U AND V C
6 C ID = 1, F, D ------> U, V C
7 C ID = 2, U, V ------> F, D C
9 C II = 0, SAME UNIT IN BOTH INPUT AND OUTPUT C
10 C II = 1, INPUT UNIT = KNOT, OUTPUT UNIT = M/S C
11 C II = 2, INPUT UNIT = M/S, OUTPUT UNIT = KNOT C
13 C ** The definition of wind components at the South/North poles C
14 C is based on the YLON provided by the station information as C
15 C usual:i.e. the D = 0 degree is the wind coming from NORTH C
16 C along the longitude YLON. C
17 C Y.-R. Guo 02/14/2003 C
18 CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
20 CHARACTER*6 NPROJ(3),IPROJ
21 DATA NPROJ/'LAMCON','POLSTR','MERCAT'/
23 c print '("F,D,U,V,YLON,XLONC,PHIC,IPROJ,II,ID:")'
24 c print '(7f10.2,1x,A,2I3)',F,D,U,V,YLON,XLONC,PHIC,IPROJ,II,ID
27 IF(IPROJ .EQ. NPROJ(2)) XN = 1.0
28 DEGRAN = 3.1415927/180.
36 C (1) TO CONVERT THE WIND FROM VELOCITY FORM TO COMPONENT FORM ON
37 C EARTH, AND THEN TO LAMBERT CONFORMAL PROJECTION, OR POLAR
38 C STEREOGRAPHIC PROJECTION, U AND V COMPONENTS. CHANGEING
39 C PROJECTIONS REQUIRES ONLY A CHANGE OF THE CONE CONSTANT, XN
40 C -- THE EQUATIONS REMAIN THE SAME.
43 UEARTH = -F*SIN(AEARTH)
44 VEARTH = -F*COS(AEARTH)
45 C FOR CONVERSION TO GRID COORDINATES,
46 C SEE PROGRAM DATAMAP, SUBR VECT, AND
47 C ANTHES' METEO. 597 NOTES, EQUA. 2.23, 2.25, 2.28.
48 C ALSO, CONVERT FROM KNOTS TO M/S.
50 IF(XLONRT .GT. 180.) XLONRT=XLONRT-360.
51 IF(XLONRT .LT.-180.) XLONRT=XLONRT+360.
54 C FOR MERCATOR PROJECTION, THE WINDS ARE AS IN EARTH COORDINATES
56 IF(IPROJ.EQ.NPROJ(3)) ANG=0.
57 IF(PHIC.LT.0.0) ANG=-ANG
58 U = VEARTH*SIN(ANG) + UEARTH*COS(ANG)
59 V = VEARTH*COS(ANG) - UEARTH*SIN(ANG)
66 IF(XLONRT .GT. 180.) XLONRT=XLONRT-360.
67 IF(XLONRT .LT.-180.) XLONRT=XLONRT+360.
70 C FOR MERCATOR PROJECTION, THE WINDS ARE AS IN EARTH COORDINATES
72 IF(IPROJ.EQ.NPROJ(3)) ANG=0.
73 IF(PHIC.LT.0.0) ANG=-ANG
74 UE = U*COS(ANG) - V*SIN(ANG)
75 VE = U*SIN(ANG) + V*COS(ANG)
77 F = SQRT(UE*UE + VE*VE)
84 IF (UE.GT.0.0) D = 270.
85 IF (UE.LT.0.0) D = 90.
88 AEARTH = ATAN(UE/VE)/DEGRAN
89 IF (UE.LE.0.0 .AND. VE.LE.0.0 ) D = AEARTH
90 IF (UE.LE.0.0 .AND. VE.GE.0.0 ) D = AEARTH + 180.0
91 IF (UE.GE.0.0 .AND. VE.GE.0.0 ) D = AEARTH + 180.0
92 IF (UE.GE.0.0 .AND. VE.LE.0.0 ) D = AEARTH + 360.0
102 ELSE IF (ID.EQ.2) THEN
105 ELSE IF (II.EQ.2) THEN
109 ELSE IF (ID.EQ.2) THEN