      SUBROUTINE SETGASNAME(MR,NGG,NGAS,NAM,NAME,IDG,IGS,Q,FACT)
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC
C
C VERSION 1.0
C VERSION 2.0 (c.j.mertens, july, 1998)
C
C SETGASNAME 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
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*8 NAM(NGG),NAME(NGAS)
      DIMENSION IGS(NGG),IDG(NGAS),Q(MR,NGG),FACT(NGAS)
C
      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 SETOPT2'
        WRITE(*,105) ID
	STOP 'PROGRAM TERMINATING'
   5    NAME(I)=NAM(II)
        CALL PERTURB(MR,Q(1,II),FACT(I))
      ENDDO
      WRITE(*,*)
      WRITE(*,*) ' GAS SIMULATED    AFGL ID'
      WRITE(*,*)
      DO I=1,NGAS
	ID=IDG(I)
	IF(ID.GT.10000) ID=ID/10000 
        WRITE(*,115) NAME(I),ID
      ENDDO
  105 FORMAT(1X,'GAS,',I5,' IS NOT IN INPUT DATA FILE.')
  115 FORMAT(4X,A8,9X,I4,7X,A17)
      RETURN
      END
