SUBROUTINE UA_WIND ( field, dir, spd, iret ) C************************************************************************ C* UA_WIND * C* * C* This subroutine decodes a wind group of the form DDFFF. * C* * C* UA_WIND ( FIELD, DIR, SPD, IRET ) * C* * C* Input parameters: * C* FIELD CHAR* Wind group * C* WSPDU CHAR Wind speed units indicator * C* * C* Output parameters: * C* DIR REAL Wind direction * C* SPD REAL Wind speed in meters/second * C* IRET INTEGER Return code: * C* 0 = normal return * C** * C* Log: * C* J. Ator/NCEP 03/96 * C* J. Ator/NCEP 12/97 New interface format, style changes * C* J. Ator/NCEP 10/99 Clean up function declarations * C* J. Ator/NCEP 03/00 Use UA_WSMS to compute wind speed * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'uacmn.cmn' C* CHARACTER*(*) field C------------------------------------------------------------------------ C C* Initialize variables. C iret = 0 dir = RMISSD spd = RMISSD C C* The wind direction in tens of degrees is encoded in the C* first two digits. C CALL ST_INTG ( field (1:2), idir, ier ) IF ( ier .ne. 0 ) THEN RETURN END IF C C* The wind speed is encoded in the last three digits. C CALL ST_INTG ( field (3:5), ispd, ier ) IF ( ier .ne. 0 ) THEN RETURN END IF C C* Compute the wind direction. C idir = idir * 10 IF ( ispd .ge. 500 ) THEN ispd = ispd - 500 idir = idir + 5 END IF IF ( idir .eq. 360 ) THEN idir = 0 END IF C C* If the wind direction is less than 360 degrees, then set C* the output values. C IF ( idir .lt. 360 ) THEN spd = UA_WSMS ( FLOAT ( ispd ) ) dir = FLOAT ( idir ) END IF C* RETURN END