SUBROUTINE UA_PAHD ( report, lenr, nahd, irptr, + field, lenf, iret ) C************************************************************************ C* UA_PAHD * C* * C* This subroutine "peeks ahead" within REPORT and returns the NAHDth * C* field, where counting begins with the field currently pointed to by * C* IRPTR (i.e. the 1st field). This subroutine is called from within * C* the error recovery logic of several other subroutines, and it uses * C* successive calls to subroutine UA_GFLD in order to locate the * C* requested field. In fact, a call to this subroutine with NAHD=1 * C* is functionally equivalent to a call to UA_GFLD itself! * C* * C* UA_PAHD ( REPORT, LENR, NAHD, IRPTR, * C* FIELD, LENF, IRET ) * C* * C* Input parameters: * C* REPORT CHAR* Report * C* LENR INTEGER Length of REPORT * C* NAHD INTEGER Ordinal position of field to be * C* retrieved, beginning with field * C* currently pointed to by IRPTR * C* * C* Input and output parameters: * C* IRPTR INTEGER Pointer within REPORT * C* * C* Output parameters: * C* FIELD CHAR* Requested field * C* LENF INTEGER Length of FIELD * C* IRET INTEGER Return code: * C* 0 = normal return * C* -1 = could not find * C* requested field * C** * C* Log: * C* J. Ator/NCEP 10/99 * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'uacmn.cmn' C* CHARACTER*(*) report, field C------------------------------------------------------------------------ iret = -1 C C* Check that NAHD is greater than 0. C IF ( nahd .le. 0 ) THEN RETURN END IF C C* Get the requested field. C DO ii = 1, nahd CALL UA_GFLD ( report, lenr, irptr, field, lenf, ier ) IF ( ier .ne. 0 ) THEN RETURN END IF END DO C iret = 0 C* RETURN END