      SUBROUTINE READCONRET_NLTE(ICHID,ICHIDL,LCON,MGB,MG1,MDET,MT,NDET,
     &NCH,NGB,IDGB,IDGN,NET,NOT,NLMX,CONTROL,VIBTRAN,VIBSTS,
     &FILENE,FILENO)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C READCONRET READS CONTROL INFORMATION FROM LCON 
C
C PARAMETER LIST:
C 
C   ICHID---- CHANNEL ID
C   ICHIDL--- CHANNEL LOCATOR.
C   LCON----- UNIT NUMBER OF CONTROL FILE.
C   MGB------ MAXIMUM NUMBER OF TRANSITIONS SIMULATED.
C   MG1------ MAXIMUM NUMBER OF MOLECULAR OVERLAP TABLES.
C   MDET----- MAXIMUM NUMBER OF DETECTORS.
C   MT------- MAXIMUM NUMBER OF CHANNELS TO SIMULATE.
C   NDET----- NUMBER OF DETECTORS.
C   NCH------ NUMBER OF BROADBAND CHANNELS TO MODEL.
C   NGB------ NUMBER OF TRANSITIONS TO SIMULATE.
C   IDGB----- SIMULATED GASID's (formatted for non-LTE if necessary).
C   IDGN----- SIMULATED GASID's BEFORE FORMATTED FOR NON-LTE.
C   NET------ NUMBER OF SINGLE GAS EMISSIVITY TABLES PER CHANNEL.
C   NOT------ NUMBER OF OVERLAP EMISSIVITY TABLES PER CHANNEL.
C   NLMX----- NUMBER OF TERMS TO INCLUDE IN Qv(NLTE) PER GAS.
C   CONTROL-- CONTROL FILE.
C   VIBTRAN-- ARRAY OF SIMULATED NON-LTE VIBTRATIONAL TRANSITIONS.
C   VIBSTS--- ARRAY OF SIMULATED NON-LTE VIBTRATIONAL STATES.
C   FILENE--- EMISSIVITY TABLE FILE NAMES.
C   FILENO--- MOLECULAR OVERLAP EMISSIVITY TABLE FILE NAMES.
C
C SOFTWARE WRITTEN BY Christopher J. Mertens
C                     NASA Langley Research Center
C                     Atmospheric Sciences Competency
C                     21 Langley Blvd., Mail Stop 401B
C                     Hampton, VA 23681-2199
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      SAVE
      CHARACTER*(*) CONTROL,FILENE(MGB,MDET,MT),FILENO(MG1,MDET,MT)
      CHARACTER*(*) VIBTRAN(MGB,MT),VIBSTS(2,MGB,MT)
      DIMENSION NGB(MT),IDGB(MGB,MT),IDGN(MGB,MT),NLMX(MGB,MT),NET(MT),
     &NOT(MT)
C     
      IF(NCH.GT.MT) THEN
        WRITE(*,*) '!!!!!! DIMENSION ERROR NCH > MT',NCH,MT
        STOP 'ERROR IN READCONRET'
      ENDIF
      IF(NDET.GT.MDET) THEN
        WRITE(*,*) '!!!!!! DIMENSION ERROR NDET > MDET',NDET,MDET
        STOP 'ERROR IN READCONRET'
      ENDIF
      IF(ICHIDL.LT.0.OR.ICHIDL.GT.NCH) THEN
        WRITE(*,*) '!!!!!! INVALID CHANNEL ID: ICHIDL = ',ICHIDL
        STOP 'ERROR IN READCONRET'
      ENDIF 
     
c      print*, len(vibtran(1,1))
c       stop 
      DO IGS=1,MGB
        VIBTRAN(IGS,ICHIDL)='LTE'
      ENDDO
         print*,control 
      OPEN(LCON,FILE=CONTROL)  
      WRITE(*,900)
      CALL READNLTE(LCON,MGB,NGB(ICHIDL),IDGB(1,ICHIDL),IDGN(1,ICHIDL),
     &NLMX(1,ICHIDL),VIBTRAN(1,ICHIDL),VIBSTS(1,1,ICHIDL))

      IF(NGB(ICHIDL).GT.MGB) THEN
        WRITE(*,*) !!!!!! DIMENSION ERROR: NGB > MGB',NGB,MGB
        STOP 'ERROR IN READCONRET'
      ENDIF

      DO IGB=1,NGB(ICHIDL)
        WRITE(*,'(I3,2I10,2X,A20,(A),(A))') IGB,IDGB(IGB,ICHIDL),
     &  IDGN(IGB,ICHIDL),VIBTRAN(IGB,ICHIDL),
     &  (VIBSTS(I,IGB,ICHIDL),I=1,2)
      ENDDO

      WRITE(*,'(A26,A50)') 'Control Input           = ',CONTROL
      WRITE(*,'(A26,I4)')  'Channel ID              = ',ICHID
      DO II=1,NDET
        READ(LCON,*) NET(ICHIDL) ! number of single gas emissivity table
        WRITE(*,*) 'SINGLE GAS EMISSIVITY TABLES: '
        DO III=1,NET(ICHIDL)
          READ(LCON,'(A)') FILENE(III,II,ICHIDL)
          WRITE(*,'(A100)') FILENE(III,II,ICHIDL)
        ENDDO
        READ(LCON,*) NOT(ICHIDL)!number of overlap gas emissivity tables
        IF(NOT(ICHIDL) .GT. 0) THEN
          WRITE(*,*) 'OVERLAP GAS EMISSIVITY TABLES: '
	  DO III=1,NOT(ICHIDL)
	    READ(LCON,'(A)') FILENO(III,II,ICHIDL)
            WRITE(*,'(A100)') FILENO(III,II,ICHIDL)
	  ENDDO
        ENDIF
      ENDDO
      CLOSE(LCON)
      RETURN
 900  FORMAT(/,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',/,
     &         '!                                              !',/,
     &         '! READING CONTROL FILE: FORWARD RADIANCE MODEL !',/,
     &         '!                                              !',/,
     &         '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',/)
      END
