#pragma rtGlobals=1 // Use modern global access method. Proc makeMATpath() Silent 1 PathInfo Igor if (!V_Flag) Abort "path named 'Igor' does not exist!" endif String pathName=S_path+"User Procedures:materials:" if (!exists("root:MATpath")) String/G root:MATpath=pathName else root:MATpath=pathName endif EndMacro Function/T ElementName(zed) Variable zed // atomic number of the element zed -= 1 if (zed<20) return StringFromList(zed, "H,He,Li,Be,B,C,N,O,F,Ne,Na,Mg,Al,Si,P,S,Cl,Ar,K,Ca",",") endif zed -= 20 if (zed<20) return StringFromList(zed, "Sc,Ti,V,Cr,Mn,Fe,Co,Ni,Cu,Zn,Ga,Ge,As,Se,Br,Kr,Rb,Sr,Y,Zr",",") endif zed -= 20 if (zed<20) return StringFromList(zed, "Nb,Mo,Tc,Ru,Rh,Pd,Ag,Cd,In,Sn,Sb,Te,I,Xe,Cs,Ba,La,Ce,Pr,Nd",",") endif zed -= 20 if (zed<20) return StringFromList(zed, "Pm,Sm,Eu,Gd,Tb,Dy,Ho,Er,Ym,Yb,Lu,Hf,Ta,W,Re,Os,Ir,Pt,Au,Hg",",") endif zed -= 20 if (zed<20) return StringFromList(zed, "Tl,Pb,Bi,Po,At,Rn,Fr,Ra,Ac,Th,Pa,U,Np,Pu,Am,Cm,Bk,Cf,Es,Fm",",") endif zed -= 20 if (zed<2) return StringFromList(zed, "Md,No,Lw",",") endif Abort "bad input, atomic number must be in range [1,103]" End