SUBROUTINE AF_HRPT ( bullx, lenbx, ibxptr, report, lenr, iret ) C************************************************************************ C* AF_HRPT * C* * C* This subroutine locates and returns the next report from within an * C* HDOB aircraft bulletin. These bulletins do not have an '=' * C* to delineate the end of each report. Upon entry, IBXPTR points to * C* the character in the bulletin with which to begin the search for the * C* next report. * C* * C* AF_HRPT ( BULLX, LENBX, IBXPTR, REPORT, LENR, IRET ) * C* * C* Input parameters: * C* BULLX CHAR* Text portion of bulletin * C* LENBX INTEGER Length of BULLX * C* * C* Input and output parameters: * C* IBXPTR INTEGER Pointer within BULLX * C* * C* Output parameters: * C* REPORT CHAR* Report * C* LENR INTEGER Length of report * C* IRET INTEGER Return code * C* 0 = normal return * C* -1 = no more reports in * C* bulletin * C** * C* Log: * C* J. Cahoon/NCEP 10/11 Based on AF_GRPT * C* J. Cahoon/NCEP 01/12 Changed from char count to find * C* the 2char field for end * C* J. Ator/NCEP 03/13 Add declaration for field * C************************************************************************ INCLUDE 'GEMPRM.PRM' INCLUDE 'afcmn.cmn' C* CHARACTER*(*) report, bullx C* CHARACTER field*(MXLENF) C* LOGICAL end C------------------------------------------------------------------------ iret = 0 C C* Check for the end of the bulletin. C IF ( ibxptr .gt. lenbx ) THEN iret = -1 RETURN ELSE IF ( bullx ( ibxptr : ibxptr + 1 ) .eq. '$$' ) THEN iret = -1 RETURN END IF C C* Set the current bulletin pointer as the start of the next C* report. C istart = ibxptr C C* Look for the end of the next report. C IF ( istart .eq. 0 ) THEN iret = -1 RETURN END IF end = .false. DO WHILE ( .not. end ) CALL AF_GFLD ( bullx, lenbx, ibxptr, field, lenf, ier ) IF ( ier .ne. 0 ) THEN RETURN ELSE IF ( lenf .eq. 2 ) THEN end = .true. END IF END DO C C* Set up the end and pointer C iend = ibxptr - 1 ibxptr = ibxptr C C* Set the output values. C report = bullx ( istart : iend ) lenr = iend - istart + 1 C* RETURN END