C ********************************************************************** C * * C * SOFTWARE LICENSING * C * * C * This program is free software; you can redistribute * C * it and/or modify it under the terms of the GNU * C * General Public License as published by the Free * C * Software Foundation, either Version 2 of the * C * license, or (at your option) any later version. * C * * C * This program is distributed in the hope that it * C * will be useful, but without any warranty; without * C * even the implied warranty of merchantability or * C * fitness for a particular purpose. See the GNU * C * General Public License for more details. * C * * C * A copy of the GNU General Public License is * C * available at http://www.gnu.org/copyleft/gpl.html * C * or by writing to the Free Software Foundation, Inc.,* C * 59 Temple Place - Suite 330, Boston, MA 02111, USA. * C * * C ********************************************************************** SUBROUTINE NORTH(WX,WY,dir) c c This program was updated by Ray Sheppard. After a couple of bugs c are removed, it is incorporated into ECOMSED (hli, 03/06/01) c C WX=wind in x-dir, WY=wind in y-dir C DIRECTION GIVES ANGLE WITH X- C AXIS (NORTH) POSITIVE- CLOCKWISE, NEGATIVE- ANTI CLOCKWISE C this gives the direction of wind blow from (meteorological conv) C data RAD/57.29577/ IF (WX .EQ. 0.) THEN IF (WY .GE. 0.) THEN dir = 180. ELSE dir = 0.0 ENDIF ELSE GRAD = WY/WX dir = ATAN(GRAD) * RAD IF (WY .GE. 0.) THEN IF (WX .GT. 0.) then dir = 270. - dir ELSE dir = abs(dir) + 90. ENDIF ELSE IF (WX .LT. 0.) THEN dir=90-abs(dir) ELSE dir=abs(dir)+270 ENDIF ENDIF ENDIF RETURN END