1C Copyright 1981-2016 ECMWF.
2C
3C This software is licensed under the terms of the Apache Licence
4C Version 2.0 which can be obtained at http://www.apache.org/licenses/LICENSE-2.0.
5C
6C In applying this licence, ECMWF does not waive the privileges and immunities
7C granted to it by virtue of its status as an intergovernmental organisation
8C nor does it submit to any jurisdiction.
9C
10
11      SUBROUTINE YROTATE(RANGLE,X,Y,Z,RX,RY,RZ,INROW)
12C---->
13C**** YROTATE
14C
15C     Purpose
16C     -------
17C
18C     Rotate an array of (x,y,z) values about the y-axis.
19C
20C
21C     Interface
22C     ---------
23C
24C     CALL YROTATE(RANGLE,X,Y,Z,RX,RY,RZ,INROW)
25C
26C     Input
27C     -----
28C
29C     RANGLE  - The angle of rotation (degrees)
30C     (X,Y,Z) - Arrays of input (x,y,z) values.
31C     INROW   - Number of coordinate values.
32C
33C
34C     Output
35C     ------
36C
37C     (RX,RY,RZ) - Arrays of rotated (x,y,z) values.
38C
39C
40C     Method
41C     ------
42C
43C     Y remains unchanged.
44C
45C
46C     Externals
47C     ---------
48C
49C     None.
50C
51C
52C     Author
53C     ------
54C
55C     J.D.Chambers     ECMWF
56C
57C----<
58C
59      IMPLICIT NONE
60C
61C     Subroutine arguments
62C
63      REAL RANGLE,X,Y,Z,RX,RY,RZ
64      DIMENSION X(*),Y(*),Z(*),RX(*),RY(*),RZ(*)
65      INTEGER INROW
66C
67C     Local variables
68C
69      REAL FACTOR, ANGLE, SINA, COSA
70      DATA FACTOR/0.017453293/
71      INTEGER LOOP
72C
73      ANGLE = RANGLE * FACTOR
74      SINA  = SIN(ANGLE)
75      COSA  = COS(ANGLE)
76C
77      DO LOOP = 1, INROW
78        RY(LOOP) = Y(LOOP)
79        RX(LOOP) =  X(LOOP)*COSA + Z(LOOP)*SINA
80        RZ(LOOP) = -X(LOOP)*SINA + Z(LOOP)*COSA
81      ENDDO
82C
83      RETURN
84      END
85