      SUBROUTINE SETTVGASNAME(NGG,NGAS,NAM,NAME,IDG,IGS,IRAD,VIBTRAN)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C VERSION 1.0
C VERSION 2.0 (c.j.mertens, july, 1998)
C
C SETTVGASNAME SETS SIMULATED GASE NAMES
C
C PARAMETER LIST:
C
C   MGG----- MAXIMUM NUMBER OF GASES IN MODEL ATMOSPHERE.
C   MGS----- MAXIMUM NUMBER OF GASES SIMULATED.
C   NGG----- ACTUAL NUMBER OF GASES IN MODEL ATMOSPHERE.
C   NGAS---- ACTUAL NUMBER OF GASES SIMULATED.
C   NAM----- GAS NAMES IN MODEL ATMOSPHERE.
C   NAME---- SIMULATED GAS NAMES.
C   IDG----- GASID's OF SIMULATED GASES.
C   IGS----- GASID's OF MODEL ATMSOPHERIC GASES.
C   IRAD---- EGA TECHNIQUE: (1) PMA, (2) CGA, (3) AVG, AND (4) CONT.
C   VIBTRAN- SIMULATED VIBRATIONAL TRANSITIONS.
C
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C      (c) Copyright 1987-1998 by GATS, Inc.
C          28 Research Drive, Hampton, Virginia, 23666
C          Phone: (757) 865-7491
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*(*) NAM(NGG),NAME(NGAS),VIBTRAN(NGAS)
      CHARACTER*17 VTRANS,EGAMD*23,EGAOPT*23,BLANCK*1
      DIMENSION IGS(NGG),IDG(NGAS),IRAD(NGAS),EGAOPT(4)
      DATA EGAOPT/'PMA','CGA','Average: 0.5*(PMA+CGA)','Continuum'/
C
********************************************************************
c       print*, 'in settvgasname ', ngg
c      DO I = 1, NGg
c        WRITE(*,*)Igs(I)
c      ENDDO
c      stop
********************************************************************
      DO I=1,NGAS
        IF (IDG(I).GT.10000) THEN
	  IFACT=10000
        ELSE
	  IFACT=1
        ENDIF
	ID=IDG(I)/(IFACT*100)
        DO J=1,NGG
          II=J
          IF(ID.EQ.IGS(J)/100) GO TO 5
        ENDDO
	WRITE(*,*) 'ERROR ENCOUNTERED IN SUBROUTINE SETTVGASNAME'
        WRITE(*,105) ID
        write(*,*) NGAS,' IDG ',IDG
        write(*,*) NGG,' IGS ',IGS
	STOP 'PROGRAM TERMINATING'
   5    NAME(I)=NAM(II)
      ENDDO
C      WRITE(*,110)
      DO I=1,NGAS
	ID=IDG(I)
	VTRANS=VIBTRAN(I)
	EGAMD=EGAOPT(IRAD(I))
	IF(VTRANS.NE.'LTE') ID=ID/10000 
C        WRITE(*,115) NAME(I),ID,VTRANS,EGAMD
      ENDDO
  105 FORMAT(1X,'GAS,',I5,' IS NOT IN INPUT DATA FILE.')
  110 FORMAT(/,' GAS SIMULATED    AFGL ID   VIBRATIONAL TRANSITION',
     &      '    EGA METHOD',/)  
  115 FORMAT(4X,A8,7X,I4,9X,A17,8X,A23)
      RETURN
      END
