SUBROUTINE LS_WSPD ( lsfrpt, iparam, ipt, iret ) C************************************************************************ C* LS_WSPD * C* * C* This subroutine decodes the wind speed in the Nddff group and the * C* wind gust in the 910ff, 911ff, and 912ff groups. If the speed is * C* reported in knots, it is converted to meters per second. When the * C* speed is greater than 98 units, the ff is set to 99, and a 00fff * C* group follows. In this case the fff contains the wind speed. * C* * C* LS_WSPD ( LSFRPT, IPARAM, IPT, IRET ) * C* * C* Input parameters: * C* LSFRPT CHAR* Report array * C* IPARAM INTEGER Flag value * C* 0 = decoding Nddff * C* 1 = decoding 910ff * C* 2 = decoding 912ff * C* 3 = decoding 911ff * C* RIVALS (IRISWS) REAL Indicator for source and * C* units of wind speed * C* (WMO Code Table 1855) * C* XM907G REAL Duration of gust reference period * C* * C* Input and output parameters: * C* IPT INTEGER On input, points to start of data; * C* on output, points to last f * C* * C* Output parameters: * C* RIVALS(IRSPED) REAL Wind speed in m/sec * C* XDTFVM REAL Duration in minutes of wind gust * C* measurement * C* IRET INTEGER Return code * C* 0 = normal return * C* 1 = problems * C* * C** * C* Log: * C* R. Hollern/NCEP 4/96 * C* R. Hollern/NCEP 11/96 Added call to PR_KNMS * C* D. Kidwell/NCEP 4/97 Removed interface calls, reorganized * C* header and comments * C* R. Hollern/NCEP 10/97 Changes based on MA_WSPD * C* A. Hardy/GSC 1/98 Reordered calling sequence * C* R. Hollern/NCEP 1/00 Added calls to LS_SPWD * C* R. Hollern/NCEP 4/00 Removed extrapolated wind speed logic * C* J. Ator/NCEP 01/02 Use ISWS for units of wind speed * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'lscmn.cmn' C* CHARACTER*(*) lsfrpt C* CHARACTER fld3*3, fld2*2 C* INCLUDE 'ERMISS.FNC' C------------------------------------------------------------------------ iret = 0 C C* Check if wind indicator is missing. C IF ( ERMISS ( rivals ( irisws ) ) ) THEN ipt = ipt + 1 RETURN END IF C IF ( iparam .ge. 0 .and. iparam .le. 3 ) THEN C IF ( lsfrpt ( ipt:ipt ) .ne. '/' .and. + lsfrpt ( ipt+1:ipt+1 ) .ne. '/' ) THEN fld2 = lsfrpt ( ipt:ipt+1 ) CALL ST_INTG ( fld2, ival, ier ) ipt = ipt + 1 IF ( ier .eq. 0 ) THEN IF ( ival .ge. 0 .and. ival .le. 99 ) THEN xval = ival ELSE RETURN END IF ELSE RETURN END IF ELSE ipt = ipt + 1 RETURN END IF C C* If wind speed equals 99 units, then the next group 00fff C* contains the wind speed. C IF ( ival .eq. 99 ) THEN ipt = ipt + 1 IF ( lsfrpt ( ipt:ipt+2 ) .eq. ' 00' ) THEN ipt = ipt + 3 fld3 = lsfrpt ( ipt:ipt+2 ) CALL ST_INTG ( fld3, jval, ier ) ipt = ipt + 2 IF ( ier .eq. 0 ) THEN xval = jval ELSE RETURN END IF END IF END IF C END IF C IF ( rivals ( irisws ) .gt. 2 ) THEN C C* Convert from knots to m/sec. C wdspd = PR_KNMS ( xval ) ELSE wdspd = xval END IF C IF ( iparam .eq. 0 ) THEN rivals ( irsped ) = wdspd ELSE IF ( iparam .eq. 1 ) THEN C C* Get highest gust during the 10-minute period preceding obs. C CALL LS_SPWD ( iparam, wdspd, iret ) ELSE IF ( iparam .eq. 2 ) THEN C C* Get highest mean wind. C CALL LS_SPWD ( iparam, wdspd, iret ) ELSE IF ( iparam .eq. 3 ) THEN C C* Get highest gust. C CALL LS_SPWD ( iparam, wdspd, iret ) C END IF C* RETURN END