      integer function ielect (elem2)                                   IELE001
c ----------------------------------------------------------------------IELE002
c     returns Z of the atomic symbol ityp, 0 if not found               IELE003
c ----------------------------------------------------------------------IELE004
c     This program module is part of the PhysiSoft X-ray Library        IELE005
c     and may not be sold or reproduced for commercial purposes.        IELE006
c     Although it has been tested carefully, there is no warranty       IELE007
c     regarding accuracy or freedom from side-effects.                  IELE008
c                   (C) 1986-1990 Bernhard Rupp                         IELE009
c ----------------------------------------------------------------------IELE010
                                                                        IELE011
      parameter (nel=105,nl=17,ipdbsy=20)                               IELE012
                                                                        IELE013
      character*2 i(nel),elem2,l(nl),pdbsym(ipdbsy)                     IELE014
                                                                        IELE015
c --- nel regular elements ---                                          IELE016
      data(i(k),k=1,nel)/'H','HE','LI','BE','B','C','N','O','F','NE'    IELE017
     &  ,'NA','MG','AL','SI','P','S','CL','AR','K','CA','SC','TI','V'   IELE018
     &  ,'CR','MN','FE','CO','NI','CU','ZN','GA','GE','AS','SE','BR'    IELE019
     &  ,'KR','RB','SR','Y','ZR','NB','MO','TC','RU','RH','PD','AG'     IELE020
     &  ,'CD','IN','SN','SB','TE','I','XE','CS','BA','LA','CE','PR'     IELE021
     &  ,'ND','PM','SM','EU','GD','TB','DY','HO','ER','TM','YB','LU'    IELE022
     &  ,'HF','TA','W' ,'RE','OS','IR','PT','AU','HG','TL','PB','BI'    IELE023
     &  ,'PO','AT','RN','FR','RA','AC','TH','PA','U', 'NP','PU','AM'    IELE024
     &  ,'CM','BK','CF','ES','FM','MD','NO','LR','RF','HA'/             IELE025
                                                                        IELE026
c --- pdb special symbols ---                                           IELE027
      data(pdbsym(k),k=1,ipdbsy)/'O1','O2','O3','O4','O5',              IELE028
     &                           'O6','O7','O8','O9','OH',              IELE029
     &                           'OP','N2','N3','N4','N5',              IELE030
     &                           'N6','N7','N8','N9','N1'/              IELE031
                                                                        IELE032
c --- Lazy Pulverix special elements ---                                IELE033
      data(l(k),k=1,nl)/'H.','C.','D.','F1','O2','O1','I1','H1','K1'    IELE034
     &  ,'U3','U4','U6','V2','V3','V5','W6','Y3'/                       IELE035
                                                                        IELE036
      ielect=0                                                          IELE037
      do 0001 k=1,nel                                                   IELE038
         if(i(k).eq.elem2) then                                         IELE039
            ielect=k                                                    IELE040
            return                                                      IELE041
         endif                                                          IELE042
 0001 continue                                                          IELE043
                                                                        IELE044
      do 0003 k=1,ipdbsy                                                IELE045
         if(pdbsym(k).eq.elem2) then                                    IELE046
            if (k.le.11) then                                           IELE047
               ielect=8                                                 IELE048
            else                                                        IELE049
               ielect=7                                                 IELE050
            end if                                                      IELE051
            return                                                      IELE052
         endif                                                          IELE053
 0003 continue                                                          IELE054
                                                                        IELE055
      do 0002 k=1,nl                                                    IELE056
         if(l(k).eq.elem2) then                                         IELE057
            ielect=200+k                                                IELE058
            return                                                      IELE059
         endif                                                          IELE060
 0002 continue                                                          IELE061
      return                                                            IELE062
      end                                                               IELE063
                                                                        IELE064
