SUBROUTINE UA_PSHT ( field, hgtdat, nhgt, iret ) C************************************************************************ C* UA_PSHT * C* * C* This subroutine decodes a pilot signifcant level height group of * C* the form ATUUU, where A = 8, 9, or 1. * C* * C* UA_PSHT ( FIELD, HGTDAT, NHGT, IRET ) * C* * C* Input parameters: * C* FIELD CHAR* Pilot significant level * C* height group * C* * C* Output parameters: * C* HGTDAT (NHGT) REAL Pilot significant level heights * C* NHGT INTEGER Number of pilot significant * C* level heights * C* IRET INTEGER Return code: * C* 0 = normal return * C* -1 = the pilot significant * C* level height group was bad* C** * C* Log: * C* J. Ator/NCEP 03/96 * C* J. Ator/NCEP 12/97 New interface format, style changes * C* J. Ator/NCEP 03/98 Require prttyp=DD when A=1 * C* J. Ator/NCEP 10/99 Clean up function declarations * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'uacmn.cmn' C* REAL hgtdat ( * ) C* CHARACTER*(*) field C------------------------------------------------------------------------ C C* Initialize variables. C iret = 0 nhgt = 0 C C* Decode the indicator figure contained in the first byte of C* the group. C IF ( ( field (1:1) .eq. '8' ) .or. + ( field (1:1) .eq. '9' ) ) THEN IF ( field (1:1) .eq. '9' ) THEN rhtinc = 300. ELSE rhtinc = 500. END IF rhtadd = 0. C C* If the surface level was coded as '0/', then change it C* to '00' so that it will be decoded properly. C IF ( field (2:3) .eq. '0/' ) THEN field (2:3) = '00' END IF ELSE IF ( ( field (1:1) .eq. '1' ) .and. + ( prttyp .eq. DD ) ) THEN rhtinc = 300. rhtadd = 30000. ELSE iret = -1 RETURN END IF C C* Decode the tens digit. C CALL ST_INTG ( field (2:2), iten, ier ) IF ( ier .ne. 0 ) THEN iret = -1 RETURN END IF C C* Decode the units digits and compute the corresponding heights. C DO ii = 3, 5 CALL ST_INTG ( field (ii:ii), iunit, ier ) IF ( ier .eq. 0 ) THEN rhtnum = FLOAT ( ( iten * 10 ) + iunit ) nhgt = nhgt + 1 hgtdat ( nhgt ) = ( rhtnum * rhtinc ) + rhtadd END IF END DO C* RETURN END