      SUBROUTINE CMBADJ(DMLNMP,BUFLEN,OVLEN,MXGDLN)
      IMPLICIT NONE
C***********************************************************************
C
C   NAME- CMBADJ
C
C   LANGUAGE- FORTRAN 77     TYPE- SUBROUTINE    COMPUTER- IBM SP
C
C   VERSION- 1.0        DATE- 1/15/04  PROGRAMMER- FRANK TILLEY (RAYTHEON)
C
C   FUNCTION- THIS SUBROUTINE COMPUTES THE MAXIMUM NUMBER OF ADJACENT
C             USABLE (I.E. NOT FILLED WITH MISSING VALUES) SCAN LINES
C             OVER AN AMSU-B 256 SECOND DATA FRAME.
C
C   CALLING SEQUENCE PARAMETERS-
C   NAME      TYPE   I/O   DESCRIPTION
C   ----      ----   ---   -----------
C   DMLNMP    LOG     I    INSTRUMENT DUMMY LINE MAP-
C                          ARRAY OF LENGTH BUFLEN WHERE ELEMENT IS
C                          SET TO TRUE IF SCAN LINE CONTAINS USABLE
C                          DATA, SET TO FALSE IF DATA IS NOT USABLE
C   BUFLEN    INT     I    NUMBER OF SCAN LINES IN EXTENDED DATA FRAME
C                          BUFFER FOR INSTRUMENT
C   OVLEN     INT     I    LENGTH OF DATA FRAME OVERLAP FOR INSTRUMENT
C   MXGDLN    INT     O    MAXIMUM NUMBER OF ADJACENT USABLE LINES
C                          IN 256 SECOND DATA FRAME
C
C   LOCAL VARIABLES
C   NAME     TYPE    DESCRIPTION
C   ----     ----    -----------
C   STRPNT   INT     STARTING LINE OF 256 SECOND DATA FRAME IN EXTENDED
C                    DATA FRAME BUFFER
C   ENDPNT   INT     ENDING LINE OF 256 SECOND DATA FRAME IN EXTENDED
C                    DATA FRAME BUFFER
C   INDX     INT     DO LOOP INDEX
C   GDLNCT   INT     COUNTER FOR NUMBER OF USABLE LINES
C
C   EXIT STATES:  NONE
C
C***********************************************************************
      INTEGER   BUFLEN, OVLEN, STRPNT, ENDPNT, INDX, MXGDLN, GDLNCT
      LOGICAL*1 DMLNMP(BUFLEN)
C
C   INITIALIZE VARIABLES
C
      MXGDLN = 0
      GDLNCT = 0
C
C   SET THE STARTING AND ENDING POINTS OF 256 SECOND FRAME IN
C   EXTENDED AMSU-B DATA FRAME
C
      STRPNT = 24
      ENDPNT = 117
C
C   COMPUTE MAXIMUM NUMBER OF USABLE LINES OVER 256 SECOND DATA FRAME
C
      DO 10 INDX = STRPNT, ENDPNT
        IF (DMLNMP(INDX)) THEN
           GDLNCT = GDLNCT + 1
           IF (GDLNCT.GT.MXGDLN) MXGDLN = GDLNCT
        ELSE
           GDLNCT = 0
        ENDIF
   10 CONTINUE
C
      RETURN
      END
