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 if (trace_use) call da_trace_entry("da_earth_2_model_wind")
24
25 ! for mercator projection, the winds are as in earth coordinates
26
27 if (map_projection == 3) then
28 mu = eu
29 mv = ev
30 return
31 end if
32
33 ! for conversion to grid coordinates,
34 ! see program datamap, subr vect, and
35 ! ANTHES METEO. 597 NOTES, EQUA. 2.23, 2.25, 2.28.
36
37 xlonrt = xlonc-lon
38
39 if (xlonrt > 180.0) xlonrt=xlonrt-360.0
40 if (xlonrt <-180.0) xlonrt=xlonrt+360.0
41
42 ang=xlonrt*cone_factor*pi/180.0
43
44 if (phic < 0.0) ang=-ang
45
46 mu = ev*sin(ang) + eu*cos(ang)
47 mv = ev*cos(ang) - eu*sin(ang)
48
49 if (trace_use) call da_trace_exit("da_earth_2_model_wind")
50
51 end subroutine da_earth_2_model_wind
52
53