      real function getchg (elem2)                                      GETC001
c ----------------------------------------------------------------------GETC002
c     returns Z of the atomic symbol ityp, 0 if not found               GETC003
c ----------------------------------------------------------------------GETC004
c     This program module is part of the PhysiSoft X-ray Library        GETC005
c     and may not be sold or reproduced for commercial purposes.        GETC006
c     Although it has been tested carefully, there is no warranty       GETC007
c     regarding accuracy or freedom from side-effects.                  GETC008
c                   (C) 1986-1990 Bernhard Rupp                         GETC009
c ----------------------------------------------------------------------GETC010
                                                                        GETC011
      parameter (nel=105)                                               GETC012
                                                                        GETC013
      character*2 i(nel),elem2                                          GETC014
      real chags(nel)                                                   GETC015
                                                                        GETC016
c --- nel regular elements ---                                          GETC017
      data(i(k),k=1,nel)/'H','HE','LI','BE','B','C','N','O','F','NE'    GETC018
     &  ,'NA','MG','AL','SI','P','S','CL','AR','K','CA','SC','TI','V'   GETC019
     &  ,'CR','MN','FE','CO','NI','CU','ZN','GA','GE','AS','SE','BR'    GETC020
     &  ,'KR','RB','SR','Y','ZR','NB','MO','TC','RU','RH','PD','AG'     GETC021
     &  ,'CD','IN','SN','SB','TE','I','XE','CS','BA','LA','CE','PR'     GETC022
     &  ,'ND','PM','SM','EU','GD','TB','DY','HO','ER','TM','YB','LU'    GETC023
     &  ,'HF','TA','W' ,'RE','OS','IR','PT','AU','HG','TL','PB','BI'    GETC024
     &  ,'PO','AT','RN','FR','RA','AC','TH','PA','U', 'NP','PU','AM'    GETC025
     &  ,'CM','BK','CF','ES','FM','MD','NO','LR','RF','HA'/             GETC026
                                                                        GETC027
      data(chags(k),k=1,nel)/1,0,1,2,3,4,5,-2,-1,0,                     GETC028
     &   1,2,3,4,5,6,-1,0,1,2,3,4,5,                                    GETC029
     &   3,2,3,3,2,2,2,3,4,5,6,-1,                                      GETC030
     &   0,1,2,3,4,5,6,2,1,1,1,1,                                       GETC031
     &   2,3,4,5,6,-1,0,1,2,3,3,3,                                      GETC032
     &   3,3,3,2,3,3,3,3,3,3,3,3,                                       GETC033
     &   4,5,6,1,1,1,1,1,2,3,2,3,                                       GETC034
     &   5,-1,0,1,2,3,4,4,6,6,6,6,                                      GETC035
     &   3,3,3,3,3,3,3,3,3,3/                                           GETC036
                                                                        GETC037
      do 0001 k=1,nel                                                   GETC038
         if(i(k).eq.elem2) then                                         GETC039
            getchg=chags(k)                                             GETC040
            return                                                      GETC041
         endif                                                          GETC042
 0001 continue                                                          GETC043
      getchg=0.0                                                        GETC044
      return                                                            GETC045
      end                                                               GETC046
                                                                        GETC047
