1 | subroutine windalign(u,v,ffap,ffcp,ux,vy) |
---|
2 | ! i i i i o o |
---|
3 | !***************************************************************************** |
---|
4 | ! * |
---|
5 | ! Transformation from along- and cross-wind components to u and v * |
---|
6 | ! components. * |
---|
7 | ! * |
---|
8 | ! Author: A. Stohl * |
---|
9 | ! * |
---|
10 | ! 3 June 1996 * |
---|
11 | ! * |
---|
12 | !***************************************************************************** |
---|
13 | ! * |
---|
14 | ! Variables: * |
---|
15 | ! ffap turbulent wind in along wind direction * |
---|
16 | ! ffcp turbulent wind in cross wind direction * |
---|
17 | ! u main wind component in x direction * |
---|
18 | ! ux turbulent wind in x direction * |
---|
19 | ! v main wind component in y direction * |
---|
20 | ! vy turbulent wind in y direction * |
---|
21 | ! * |
---|
22 | !***************************************************************************** |
---|
23 | |
---|
24 | implicit none |
---|
25 | |
---|
26 | real :: u,v,ffap,ffcp,ux,vy,ffinv,ux1,ux2,vy1,vy2,sinphi,cosphi |
---|
27 | real,parameter :: eps=1.e-30 |
---|
28 | |
---|
29 | |
---|
30 | ! Transform along wind components |
---|
31 | !******************************** |
---|
32 | |
---|
33 | ffinv=1./max(sqrt(u*u+v*v),eps) |
---|
34 | sinphi=v*ffinv |
---|
35 | vy1=sinphi*ffap |
---|
36 | cosphi=u*ffinv |
---|
37 | ux1=cosphi*ffap |
---|
38 | |
---|
39 | |
---|
40 | ! Transform cross wind components |
---|
41 | !******************************** |
---|
42 | |
---|
43 | ux2=-sinphi*ffcp |
---|
44 | vy2=cosphi*ffcp |
---|
45 | |
---|
46 | |
---|
47 | ! Add contributions from along and cross wind components |
---|
48 | !******************************************************* |
---|
49 | |
---|
50 | ux=ux1+ux2 |
---|
51 | vy=vy1+vy2 |
---|
52 | |
---|
53 | end subroutine windalign |
---|