da_earth_2_model_wind.inc
References to this file elsewhere.
1 subroutine da_earth_2_model_wind(eu,ev,mu,mv,lon)
2
3 !---------------------------------------------------------------------------
4 ! Purpose: Convert earth wind to model wind.
5 !
6 ! Need map projection parameters.
7 !
8 ! IPROJ: Projection type
9 ! PHIC: Central latitude
10 ! XLONC: Central longitude
11 ! XN: Cone projection
12 ! CONV: 180/Pi
13 !---------------------------------------------------------------------------
14
15 implicit none
16
17 real, intent (in) :: eu, ev
18 real, intent (out) :: mu, mv
19 real, intent (in) :: lon
20
21 real :: XLONRT, ANG
22
23 ! FOR MERCATOR PROJECTION, THE WinDS ARE AS in EARTH COORDinATES
24
25 if (map_projection == 3) then
26 mu = eu
27 mv = ev
28 return
29 end if
30
31 ! FOR CONVERSION TO GRID COORDinATES,
32 ! SEE program DATAMAP, SUBR VECT, AND
33 ! ANTHES METEO. 597 NOTES, EQUA. 2.23, 2.25, 2.28.
34
35 XLONRT = XLONC-LON
36
37 if (XLONRT > 180.) XLONRT=XLONRT-360.
38 if (XLONRT <-180.) XLONRT=XLONRT+360.
39
40 ANG=XLONRT*CONE_FACTOR*pi/180.0
41
42 if (PHIC < 0.0) ANG=-ANG
43
44 mu = ev*Sin(ANG) + eu*COS(ANG)
45 mv = ev*COS(ANG) - eu*Sin(ANG)
46
47 end subroutine da_earth_2_model_wind
48
49