      SUBROUTINE CKIDS1(KFILDO,N,ID,IDPARS,NOGRD,NOVEC,IER)
C 
C        DECEMBER 2000   GLAHN   TDL LAMP-2000
C        MARCH    2002   GLAHN   MODIFIED TEST TO INCLUDE RADAR DATA
C                                IN COMPUTING NOGRD AND NOVEC
C        MARCH    2002   GLAHN   MODIFIED TEST TO INCLUDE CONSTANT
C                                DATA IN COMPUTING NOGRD AND NOVEC
C        AUGUST   2002   GLAHN   MODIFIED TO ALLOW INTERPOLATION OF
C                                ZERO FOR MOISTURE FIELDS
C
C        PURPOSE 
C            TO CHECK CERTAIN INFORMATION IN A MOS ID AND IT'S 
C            PROCESSING INFORMATION.  THIS IS A REVISION OF CKIDS
C            TO BE USED FOR U203, TO (1) ALWAYS ALLOW AN INTERPOLATION
C            VALUE OF ZERO, IN ADDITION TO 1 AND 5, AND
C            (2) ESTIMATE THE NUMBER OF GRIDPOINT AND NUMBER OF
C            VECTOR RECORDS TO BE WRITTEN BY U203 PER CYCLE.
C
C        DATA SET USE 
C            KFILDO - DEFAULT UNIT NUMBER FOR OUTPUT (PRINT) FILE.
C                     (OUTPUT) 
C 
C        VARIABLES 
C              KFILDO = DEFAULT UNIT NUMBER FOR OUTPUT (PRINT) FILE.
C                       (INPUT)
C                   N = PREDICTOR NUMBER.  USED FOR PRINT ONLY. 
C                       (INPUT) 
C               ID(J) = THE PREDICTOR ID'S (J=1,4).  (INPUT)
C           IDPARS(J) = THE PARSED, INDIVIDUAL COMPONENTS OF THE
C                       PREDICTOR ID'S CORRESPONDING TO ID( ) (J=1,15).
C                       (INPUT)
C                       J=1--CCC (CLASS OF VARIABLE),
C                       J=2--FFF (SUBCLASS OF VARIABLE),
C                       J=3--B (BINARY INDICATOR),
C                       J=4--DD (DATA SOURCE, MODEL NUMBER),
C                       J=5--V (VERTICAL APPLICATION),
C                       J=6--LBLBLBLB (BOTTOM OF LAYER, 0 IF ONLY 
C                            1 LAYER),
C                       J=7--LTLTLTLT (TOP OF LAYER),
C                       J=8--T (TRANSFORMATION),
C                       J=9--RR (RUN TIME OFFSET, ALWAYS + AND BACK 
C                            IN TIME),
C                       J=10--OT (TIME APPLICATION),
C                       J=11--OH (TIME PERIOD IN HOURS),
C                       J=12--TAU (PROJECTION IN HOURS),
C                       J=13--I (INTERPOLATION TYPE),
C                       J=14--S (SMOOTHING INDICATOR), AND
C                       J=15--G (GRID INDICATOR).
C               NOGRD = ESTIMATED NUMBER OF GRID RECORDS TO WRITE.
C                       (INPUT/OUTPUT)
C               NOVEC = ESTIMATED NUMBER OF VECTOR RECORDS TO WRITE.
C                       (INPUT/OUTPUT)
C                 IER = STATUS RETURN.  (OUTPUT)
C                        0 = GOOD RETURN.
C                       43 = PRECIPITATION AMOUNT FIELD DOES NOT HAVE
C                            AN INTERPOLATION VALUE OF 3.
C                       44 = NON-PRECIPITATION AMOUNT FIELD HAS AN 
C                            INTERPOLATION VALUE OF 3.
C                       45 = A BINARY INDICATOR IS NOT 0, 1, OR 5, OR
C                            A GRID BINARY DOES NOT HAVE AN 
C                            INTERPOLATION INDICATOR OF 0, 1, OR 2, OR 
C                            SMOOTHING IS NOT 0, 1, 2, 3, 4, OR 5.
C                       46 = INTERPOLATION INDICATOR NOT 1, 2, O3 3.
C        1         2         3         4         5         6         7 X
C 
C        NONSYSTEM SUBROUTINES CALLED 
C            NONE
C
      DIMENSION ID(4),IDPARS(15)
C
      IER=0
C
C        DO NOT CHECK IDS IF THE "MODEL NUMBER" IDPARS(4, ) =
C        80, 81, OR 82.  THESE ARE AEV FORECASTS AND DON'T
C        OBEY THE BINARY AND INTERPOLATION RULES.
C 
      IF(IDPARS(4).EQ.80.OR.
     1   IDPARS(4).EQ.81.OR.
     2   IDPARS(4).EQ.82)GO TO 900
C
C        CHECK SMOOTHING INDICATOR.  IT MUST BE O, 1, 2, 3, 4, OR 5.
C
      IF(IDPARS(14).EQ.0.OR.
     1   IDPARS(14).EQ.1.OR.
     2   IDPARS(14).EQ.2.OR.
     3   IDPARS(14).EQ.3.OR.
     4   IDPARS(14).EQ.4.OR.
     5   IDPARS(14).EQ.5)GO TO 102
      WRITE(KFILDO,101)N,(ID(J),J=1,4)
 101  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,' INDICATES INCORRECT SMOOTHING.')
      IER=45
C        ALLOW IT TO CONTINUE CHECKING.
     
C        CHECK INTERPOLATION VALUE OF 0, 1, OR 2 FOR A GRID
C        BINARY.
C
 102  IF(IDPARS(3).NE.5)GO TO 104
      IF(IDPARS(13).EQ.0.OR.
     1   IDPARS(13).EQ.1.OR.
     2   IDPARS(13).EQ.2)GO TO 200
      WRITE(KFILDO,103)N,(ID(J),J=1,4)
 103  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,
     2       ' INDICATES INCORRECT INTERPOLATION FOR GRID BINARY.')
      IER=45
      GO TO 200
     
C        CHECK THAT BINARY INDICATOR IS EITHER 0, 1, 2, 3, OR 5.
C
 104  IF(IDPARS(3).EQ.0.OR.
     1   IDPARS(3).EQ.1.OR.
     2   IDPARS(3).EQ.5)GO TO 110
      WRITE(KFILDO,105)N,(ID(J),J=1,4)
 105  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,' INDICATES INCORRECT BINARY INDICATOR.')
      IER=45
      GO TO 110
C
C        CHECK THAT PRECIPITATION AMOUNT FIELDS HAVE AN INTERPOLATION
C        VALUE OF 0 OR 3, EXCEPT A GRID BINARY SHOULD NOT HAVE A VALUE
C        OF 3.
C
 110  IF(IDPARS(1).NE.003)GO TO 120
C        THIS IS A MOISTURE VARIABLE.
      IF(IDPARS(2).NE.205.AND.
     1   IDPARS(2).NE.210.AND.
     2   IDPARS(2).NE.220.AND.
     3   IDPARS(2).NE.235.AND.
     4   IDPARS(2).NE.240.AND.
     5   IDPARS(2).NE.250)GO TO 120
C        THIS IS PRECIPITATION AMOUNT, EITHER TOTAL, CONVECTIVE, OR
C        NONCONVECTIVE.
      IF(IDPARS(13).EQ.3.OR.IDPARS(13).EQ.0)GO TO 200
C        THIS IS A PRECIPITATION AMOUNT FIELD, AND INTERPOLATION IS NOT
C        INDICATED CORRECTLY.
      WRITE(KFILDO,115)N,(ID(J),J=1,4)
 115  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,' INDICATES PRECIPITATION AMOUNT,',/,
     2       '     BUT INTERPOLATION TYPE OTHER THAN 3 IN CKIDS1.')
      IER=43
      GO TO 900
C
C        CHECK THAT NON PRECIPITATION AMOUNT FIELDS DO NOT HAVE AN 
C        INTERPOLATION VALUE OF 3.
C
 120  IF(IDPARS(13).NE.3)GO TO 130
C        THIS IS A NON PRECIPITATION AMOUNT FIELD, AND INTERPOLATION IS 
C        INDICATED INCORRECTLY AS PERTAINING TO PRECIPITATION AMOUNT.
      WRITE(KFILDO,125)N,(ID(J),J=1,4)
 125  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,' INDICATES NON-PRECIPITATION AMOUNT,',/,
     2       '     BUT INTERPOLATION TYPE OF 3 IN CKIDS1.')
      IER=44
      GO TO 900
C
C        CHECK FOR INTERPOLATION TYPE OF 0, 1, 2, OR 3, EXCEPT FOR
C        OBSERVATIONS WITH CCC IN RANGE 700-799 AND TRIG FUNCTIONS.
C
 130  IF(IDPARS(13).EQ.0.OR.
     1   IDPARS(13).EQ.1.OR.
     2   IDPARS(13).EQ.2.OR.
     3   IDPARS(13).EQ.3)GO TO 200
      IF(IDPARS(1).GE.400.AND.IDPARS(1).LE.499)GO TO 200
C        FOR CONSTANTS, INTERPOLATION IS NOT NEEDED.  FOR MORE COMPLEX
C        PREDICTORS REQUIRING CONSTANTS, AND HAVE A CCC IN THE 400-499
C        RANGE, ANY VALUE IS ACCEPTED HERE.
      IF(IDPARS(1).GE.700.AND.IDPARS(1).LE.799)GO TO 200
C        FOR OBSERVATIONS, INTERPOLATION IS NOT NEEDED.
      IF(IDPARS(1).EQ.010)GO TO 200
C        TRIG FUNCTIONS ARE NOT INTERPOLATED.
      WRITE(KFILDO,131)N,(ID(J),J=1,4)
 131  FORMAT(' ****PREDICTOR ID NO.',I4,1X,I9.9,1X,I9.9,1X,I9.9,
     1       1X,I10.3,' DOES NOT HAVE A VALID INTERPOLATION INDICATOR',
     2       ' IN CKIDS1.')
      IER=46
      GO TO 900
C
C         ESTIMATE THE NUMBER OF GRIDPOINT OUTPUT RECORDS, NOGRD,
C         AND THE NUMBER OF VECTOR OUTPUT RECORDS, NOVEC.  IT IS
C         ASSUMED THAT CCC = 0XX OR 3XX ARE GRIDPOINT UNLESS IDPARS(13)
C         INDICATES INTERPOLATION.  ALSO, RADAR DATA HAVE CCCFFF =
C         7076XX OR 7077XX WHICH WILL BE GRIDPOINT UNLESS IDPARS(13)
C         INDICATES INTERPOLATION.  CONSTANT DATA ARE CCC = 4XX
C         AND CAN BE EITHER GRIDPOINT OR VECTOR DEPENDING ON IDPARS(13).
C         OTHERWISE, THE RECORD WILL BE VECTOR.
C
 200  IF(IDPARS(1)/100.EQ.0.AND.IDPARS(13).EQ.0)THEN
C           THIS TEST IS FOR MODEL DATA.
         NOGRD=NOGRD+1
C
      ELSEIF(IDPARS(1)/100.EQ.3.AND.IDPARS(13).EQ.0)THEN
C           THIS TEST IS FOR A COMBINATION OF MODELS.
         NOGRD=NOGRD+1
C
      ELSEIF(IDPARS(1)/100.EQ.4)THEN
C
         IF(IDPARS(13).EQ.0)THEN
C              THIS TEST IS FOR GRIDPOINT CONSTANT DATA
            NOGRD=NOGRD+1
         ELSE
C              THIS TEST IS FOR VECTOR CONSTANT DATA
            NOVEC=NOVEC+1
         ENDIF
C
      ELSEIF(IDPARS(1).EQ.707.AND.IDPARS(2)/100.EQ.6.
     1                        AND.IDPARS(13).EQ.0)THEN
C           THIS TEST IS FOR RADAR DATA.
         NOGRD=NOGRD+1
C
      ELSEIF(IDPARS(1).EQ.707.AND.IDPARS(2)/100.EQ.7.
     1                        AND.IDPARS(13).EQ.0)THEN
C           THIS TEST IS FOR RADAR DATA.
         NOGRD=NOGRD+1
C
      ELSE
         NOVEC=NOVEC+1
      ENDIF   
C     
 900  RETURN
      END
