      SUBROUTINE ADDMOD
C Additions to model

      INCLUDE 'BINFIT.INC'
      INCLUDE 'MODEL.INC'

      WRITE (OUTC,1110)
      CALL MODHELP
      II = NCOMP+1
      WRITE (OUTC,1120) IC
      CALL CREADMDL(INC,ICTMP,MODLAMBDA,P3,P4,P5,P6,P7,P8,P9,
     1              DMAGMAX,*95,0)
      NCOMP = MAX(IC,ICTMP)
      IC = ICTMP
      IF ( IC .LE. MXMOD ) THEN
          DO IG = 1, NFILT
              IF ( ABS(MODLAMBDA-LAMBDA0(IG)) .LT. 1.0 )
     1        THEN
                  IF ( (IC.EQ.1) .AND. (IG.EQ.1) ) THEN
                      PARM(1,1,1) = P3        ! Separation
                      PARM(1,1,2) = P4        ! Position angle
                      PARM(1,1,3) = P5        ! Diam
                      PARM(1,1,8) = P6        ! Total flux(1)
                  ELSE IF ( (IC.EQ.1) .AND. (IG.NE.1) ) THEN
                      PARM(1,IG,4) = P3       ! Diam(IG)/Diam(1)
                      PARM(1,IG,8) = P4       ! Total flux(IG)
                  ELSE IF ( (IC.NE.1) .AND. (IG.EQ.1) ) THEN
                      PARM(IC,1,1) = P3       ! Separation(IC)
                      PARM(IC,1,2) = P4       ! Position angle
                      PARM(IC,1,3) = P5       ! Diam
                      PARM(IC,1,5) = P6       ! Mag. difference
                  ELSE IF ( (IC.NE.1) .AND. (IG.NE.1) ) THEN
                      PARM(IC,IG,4) = P3      ! Diam(IG)/Diam(1)
                      PARM(IC,IG,6) = P4      ! Color
                  END IF
                  WRITE(OUTC,'(1X,F5.1,A,I2)') LAMBDA0(IG),
     1                  ' nm wavelength is filter number ',IG
                  GO TO 90    ! Stop looking for filter match
              END IF
          END DO
          WRITE(OUTC,'(1X,F5.1,A)') MODLAMBDA,
     1    ' nm does not match wavelengths of data in data files'
   90     CONTINUE        ! Come here after filter match found
      ELSE
          WRITE(OUTC,'(1X,I4,A,I4,A)') ICTMP,
     1        ' components are too many; limit is',MXMOD,'.'
      END IF
   95 CONTINUE            ! Come here on ^Z exit from CREADMDL
      RETURN
 1110 FORMAT (/' Enter new components (separate parameter values by',
     +          ' blanks);'/' End input with ^Z:')
 1120 FORMAT ('$',I5,')')
      END

