SUBROUTINE UA_MSFC ( report, lenr, irptr, iret ) C************************************************************************ C* UA_MSFC * C* * C* This subroutine decodes the surface data from a temp AA report. * C* * C* UA_MSFC ( REPORT, LENR, IRPTR, IRET ) * C* * C* Input parameters: * C* REPORT CHAR* Report * C* LENR INTEGER Length of REPORT * C* * C* Input and output parameters: * C* IRPTR INTEGER Pointer within REPORT * C* * C* Output parameters: * C* IRET INTEGER Return code * C* 0 = normal return * C* -1 = critical error in REPORT * C* or reached end of REPORT * C** * C* Log: * C* J. Ator/NCEP 03/96 * C* J. Ator/NCEP 10/96 ERRGRP -> UA_EGRP, removed ERRRPT * C* J. Ator/NCEP 12/97 New interface format, style changes * C* J. Ator/NCEP 10/99 Clean up function declarations * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'uacmn.cmn' C* CHARACTER*(*) report C* CHARACTER field*(MXLENF) C* LOGICAL UA_EGRP C* INCLUDE 'ERMISS.FNC' C------------------------------------------------------------------------ iret = 0 C C* Initialize the output values. C vsig = 64.0 pres = RMISSD tmpc = RMISSD dwpc = RMISSD drct = RMISSD sped = RMISSD C C* Get the surface pressure group. C ipt1 = irptr CALL UA_GFLD ( report, lenr, irptr, field, lenf, ier ) IF ( ier .ne. 0 ) THEN iret = -1 RETURN ELSE IF ( UA_EGRP ( field, lenf ) ) THEN RETURN END IF C IF ( field (1:2) .ne. '99' ) THEN irptr = ipt1 ELSE C C* Decode the surface pressure. C CALL UA_PRS3 ( field (3:5), pres, ier ) C C* Get and decode the temperature group. C CALL UA_GFLD ( report, lenr, irptr, field, lenf, ier ) IF ( ier .ne. 0 ) THEN iret = -1 ELSE IF ( .not. UA_EGRP ( field, lenf ) ) THEN CALL UA_TEMP ( field, tmpc, dwpc, ier ) END IF C C* Get and decode the wind group. C IF ( iret .eq. 0 ) THEN CALL UA_GFLD ( report, lenr, irptr, field, lenf, ier ) IF ( ier .ne. 0 ) THEN iret = -1 ELSE IF ( .not. UA_EGRP ( field, lenf ) ) THEN CALL UA_WIND ( field, drct, sped, ier ) END IF END IF C C* If the pressure is available, then store all output values C* into the interface arrays. C IF ( .not. ERMISS ( pres ) ) THEN CALL UA_STLV ( vsig, pres, RMISSD, tmpc, dwpc, + drct, sped, RMISSD, RMISSD, ierstv ) IF ( ierstv .lt. 0 ) THEN iret = -1 RETURN END IF END IF END IF C* RETURN END