SUBROUTINE BT_PLTL ( report, ip, iret ) C************************************************************************ C* BT_PLTL * C* * C* This subroutine decodes the higher precision latitude and longitude * C* groups, which are six characters each. The lat/long position is * C* reported in decimal degrees rather than in degrees and minutes. * C* * C* DB_PLTL ( REPORT, IP, IRET ) * C* * C* Input parameters: * C* REPORT CHAR* Report array * C* * C* Input and Output Parameters: * C* IP INTEGER Pointer to position of * C* characters in report * C* * C* Output parameters: * C* RIVALS(IRSLAT) REAL High precision latitude in deg * C* RIVALS(IRSLON) REAL High precision longitude in deg* C* IRET INTEGER Return code * C* 0 = Normal return * C* 1 = Problems * C* * C** * C* Log: * C* R. Hollern/NCEP 4/00 * C************************************************************************ INCLUDE 'btcmn.cmn' C* CHARACTER*(*) report C* CHARACTER fld1*1 C------------------------------------------------------------------------ iret = 0 C C* Get quadrant of the globe. C ip = ip + 2 fld1 = report ( ip:ip ) CALL ST_INTG ( fld1, ival, ier ) IF ( ier .eq. 0 ) THEN iquad = ival ELSE iret = 1 RETURN END IF C C* Get latitude. C lenm1 = 0 ip = ip + 1 IF ( report ( ip+3:ip+4 ) .eq. '//' ) THEN C C* Latitude is reported in tenths of degrees. C lenm1 = 2 y = .1 ELSE IF ( report ( ip+4:ip+4 ) .eq. '/' ) THEN C C* Latitude is reported in hundredths of degrees. C lenm1 = 3 y = .01 ELSE C C* Latitude is reported in thousandths of degrees. C lenm1 = 4 y = .001 END IF C CALL ST_INTG ( report ( ip:ip+lenm1 ), ival, ier ) IF ( ier .eq. 0 ) THEN xlat = y * FLOAT ( ival ) ELSE iret = 1 RETURN END IF C IF ( xlat .gt. 90.0 ) THEN iret = 1 RETURN END IF C C* Get longitude. C lenm1 = 0 ip = ip + 6 C IF ( report ( ip+4:ip+5 ) .eq. '//' ) THEN C C* Longitude is reported in tenths of degrees. C lenm1 = 3 y = .1 ELSE IF ( report ( ip+5:ip+5 ) .eq. '/' ) THEN C C* Longitude is reported in hundredths of degrees. C lenm1 = 4 y = .01 ELSE C C* Longitude is reported in thousandths of degrees. C lenm1 = 5 y = .001 END IF C CALL ST_INTG ( report ( ip:ip+lenm1 ), ival, ier ) IF ( ier .eq. 0 ) THEN xlong = y * FLOAT ( ival ) ELSE iret = 1 RETURN END IF C IF ( xlong .gt. 180.0 ) THEN iret = 1 RETURN END IF C ip = ip + 7 C C* Determine the sign of the lat/long from quadrant of globe. C IF ( iquad .eq. 7 ) THEN xlong = -xlong ELSE IF ( iquad .eq. 5 ) THEN xlat = -xlat xlong = -xlong ELSE IF ( iquad .eq. 3 ) THEN xlat = -xlat ELSE IF ( iquad .eq. 1 ) THEN ELSE iret = 1 RETURN END IF C rivals ( irslat ) = xlat rivals ( irslon ) = xlong C* RETURN END