
      SUBROUTINE CHEKDG(cicm,IR)                                         
	integer cicm

c	include 'tcommon.for'
	%include tcommon.for

C     ...THIS ROUTINE CHECKS IF FACILITY REQUESTED IN COMMAND IS DAMAGED
      DIMENSION IC(23)                                                  
      DATA IC/0,6,7,3,4,5,4*0,1,0,0,9,6,0,6,0,8,9,0,10,10/              
      IR=0                                                              
      JC=IC(cicm)                                                       
      IF(JC.EQ.0)GO TO 998                                              
      IF(cicm.EQ.17.AND.PSP.GE.1.)JC=7                                  
      IF(IDMG(JC).EQ.0)GO TO 998                                        
      IR=1                                                              
      WRITE(6,1)NAMD(JC)                                                
1     FORMAT(1X,A10,' DAMAGED')                                         
999   RETURN                                                            
998   IF(NDRA.NE.1)GO TO 999                                            
      IF(cicm.EQ.1.OR.cicm.EQ.10.OR.cicm.EQ.11.OR.cicm.EQ.22.OR.
     1cicm.EQ.23)GO TO 997
      GO TO 999                                                         
997   WRITE(6,2)                                                        
2     FORMAT(' IMPOSSIBLE- ENTERPRISE UNDER ALIEN CONTROL!!')           
      IR=1                                                              
      GO TO 999                                                         
      END                                                               
