      SUBROUTINE READCONTV_CO2(LCON,LCM,LSH,MGS,NGAS,IDG,IDGN,NET,NLMX,
     &ML,IRAD,CMFILE,SHFILE,CONTROL,VIBTRAN,VIBSTS,ITVOPT,ITVOPTN2,
     &IFLUXAL,ICCM,ISLH,FILENE)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C READCONTV READS CONTROL INFORMATION FROM LCON
C
C PARAMETER LIST:
C 
C   LCON----- UNIT NUMBER OF CONTROL FILE.
C   LCM------ UNIT NUMBER OF TABULATED CURTIS MATRIX.
C   LSH------ UNIT NUMBER OF TABULATED SOLAR HEATING RATE.
C   MGS------ MAXIMUM NUMBER OF GASES SIMULATED.
C   NGAS----- NUMBER OF GASES TO SIMULATE.
C   IDG------ 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   NLMX----- NUMBER OF TERMS TO INCLUDE IN Qv(NLTE) PER GAS.
C   ML------- MAXIMUM NUMBER OF LEVELS IN MODEL ATMOSPHERE.
C   IRAD----- EGA TECHNIQUE: (1) PMA, (2) CGA, (3) AVG, AND (4) CONT.
C   CMFILE--- TABULATED CURTIS MATRIX DATA FILE.
C   SHFILE--- TABULATED SOLAR HEATING RATE DATA FILE.
C   CONTROL-- CONTROL FILE.
C   VIBTRAN-- ARRAY OF SIMULATED NON-LTE VIBTRATIONAL TRANSITIONS.
C   VIBSTS--- ARRAY OF NON-LTE SIMULATED NON-LTE VIBTRATIONAL STATES.
C   ITVOPT--- INITIALIZATION OPTION IF INITTV=TRUE: (1) TV=TK,
C             (2) READ TV FROM UNIT LTV.
C   ITVOPTN2- N2(1) TV INITIALIZATION OPTION:
C             (1) TVTN2=TT
C             (2) TVTN2=TVT(10011)
C             (3) SOLVE 626 N2(1)-001 SYSTEM WITHOUT COUPLING TO
C                 G1-STATES, ISO 4.3FB, AND 626 4.3FH.
C   IFLUXAL-- ANGLULAR INTEGRATION OPTION (see FLUXOPT below).
C   ICCM----- CURTIS MATRIX CALCULATION OPTION:
C             (1) Calculated explicitly
C             (2) Read from unit number LCM
C             (3) No update (this option used in retrievals)
C   ISLH----- DIRECT SOLAR HEATING RATE CALCULATION OPTION:
C             (1) Calculated explicitly
C             (2) Read from unit number LSH
C             (3) No update (this option used in retrievals)
C             (4) Calculated with specified lower state populations.
C   FILENE--- SINGLE GAS EMISSIVITY TABLE FILE NAMES
C
C SOFTWARE WRITTEN BY: Christopher J. Mertens
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C      (c) Copyright 1987-2000 by GATS, Inc.
C          11864 Canon Blvd., Suite 101, Newport News, Virginia, 23606
C          Phone: (757) 873-5920
C
C  All Rights Reserved. No part of this software or publication may be
C  reproduced, stored in a retrieval system, or transmitted, in any form
C  or by any means, electronic, mechanical, photocopying, recording, or
C  otherwise without the prior written permission of GATS, Inc.
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
      CHARACTER*(*) CONTROL,CMFILE,SHFILE,FILENE(MGS)
      CHARACTER*(*) VIBTRAN(MGS),VIBSTS(2,MGS)
      CHARACTER*50  TVOPT(2),TVOPTN2(4),FLUXOPT(18),CMOPT(3),SHOPT(0:4)
      DIMENSION IDG(MGS),IDGN(MGS),NLMX(MGS),IRAD(MGS)
      DATA TVOPT/'Tk','Read Tv from Atmosphere Data Path'/
      DATA CMOPT/'Calculated initially','','No update'/
      DATA SHOPT/'NA','Calculated','','No Update',
     &           'Calculated with specified lower states'/ 
      DATA TVOPTN2/'N2(1)=Tk','N2(1)=Tv(10011)',
     &             'Solve 626 001-N2(1) w/o coupling','NA'/ 
      DATA FLUXOPT/'Diffusivity approximation r=1.66',
     &             'Diffusivity approximation r=1.81', 
     &             'One-point zeroth-moment Gauss',
     &             'Two-point zeroth-moment Gauss',
     &             'Three-point zeroth-moment Gauss',
     &             'Four-point zeroth-moment Gauss',
     &             'Five-point zeroth-moment Gauss',
     &             'Six-point zeroth-moment Gauss',
     &             'Seven-point zeroth-moment Gauss',
     &             'Eight-point zeroth-moment Gauss',
     &             'One-point first-moment Gauss',
     &             'Two-point first-moment Gauss',
     &             'Three-point first-moment Gauss',
     &             'Four-point first-moment Gauss',
     &             'Five-point first-moment Gauss',
     &             'Six-point first-moment Gauss',
     &             'Seven-point first-moment Gauss',
     &             'Eight-point first-moment Gauss'/
C     
      OPEN(LCON,FILE=CONTROL)  
C      WRITE(*,900)
      READ(LCON,*) ITVOPT
      READ(LCON,*) ITVOPTN2
      READ(LCON,*) IFLUXAL
      READ(LCON,*) ICCM
      READ(LCON,*) ISLH
      READ(LCON,*) IRADD
      READ(LCON,'(A)') CMFILE
      READ(LCON,'(A)') SHFILE

C
C .... Begin Input Diagnostic Tests ....
C

      IF(ITVOPT.NE.1.AND.ITVOPT.NE.2) THEN
        WRITE(*,*) 'INVALID TV INITIALIZATION OPTION, ITVOPT=',ITVOPT
	STOP 'ERROR IN REACONTV'
      ENDIF

      IF(ITVOPTN2.LT.1.OR.ITVOPTN2.GT.3) THEN
        WRITE(*,*) 'INVALID N2(1) TV INITIALIZATION,ITVOPTN2=',ITVOPTN2
        STOP 'ERROR IN READCONTV'
      ENDIF	
      
      IF(IFLUXAL.LT.1.OR.IFLUXAL.GT.18) THEN
        WRITE(*,*) 'INVALID ANGULAR INTEGRATION OPTION, IFLUXAL=',
     &   IFLUXAL
        STOP 'ERROR IN READCONTV'
      ENDIF	

      IF(ICCM.LT.1.OR.ICCM.GT.3) THEN
        WRITE(*,*) 'INVALID CURTIS MATRIX OPTION, ICCM = ',ICCM
	STOP 'ERROR IN READCONTV'
      ENDIF	

      IF(ISLH.LT.1.OR.ISLH.GT.4) THEN
        WRITE(*,*) 'INVALID SOLAR HEATING RATE OPTION, ISLH = ',ISLH
	STOP 'ERROR IN READCONTV'
      ENDIF

C
C .... Write Out Input to Screen
C
      IF(ICCM.EQ.2) THEN
	CALL OPENFILE(1,LCM,CMFILE,0)
	CMOPT(2)=CMFILE
      ENDIF
      IF(ISLH.EQ.2) THEN
	CALL OPENFILE(1,LSH,SHFILE,0)
	SHOPT(2)=SHFILE
      ENDIF
      
         	 
      ITVN2=ITVOPTN2
C      WRITE(*,*)
C      WRITE(*,'(A26,A50)') 'Control Input           = ',CONTROL
C      WRITE(*,'(A26,A50)') 'Angular integration     = ',FLUXOPT(IFLUXAL)
C      WRITE(*,'(A26,A50)') 'CO2 Tv Initialization   = ',TVOPT(ITVOPT)
C      WRITE(*,'(A26,A50)') 'N2(1) Tv Initialization = ',TVOPTN2(ITVN2)
C      WRITE(*,'(A26,A50)') 'Curtis matrix           = ',CMOPT(ICCM)
C      WRITE(*,'(A26,A50)') 'Solar heating rate      = ',SHOPT(ISLH)
 100  FORMAT(A26,F10.4)
C      
      CALL READNLTE(LCON,MGS,NGAS,IDG,IDGN,NLMX,VIBTRAN,VIBSTS)
      DO IG=1,NGAS
        IRAD(IG)=IRADD
      ENDDO	
C      WRITE(*,200) '# of Gases to Simulate     = ',NGAS
C      WRITE(*,300) (IDG(I),VIBTRAN(I),I=1,NGAS)
 200  FORMAT(A30,I4)
 300  FORMAT(I8,2X,A20)
 400  FORMAT(A30,(6I8))
      
      NET=NGAS
      DO I = 1,NET
        READ(LCON,'(A)')  FILENE(I)
C        WRITE(*,'(A100)') FILENE(I)
      ENDDO
      CLOSE(LCON)
      RETURN
 900  FORMAT(/,'!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',/,
     &         '!                                          !',/,
     &         '! READING CONTROL FILE: CO2 TV MODEL       !',/,
     &         '!                                          !',/,
     &         '!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!',/)
      END
