Density Functional Calculation of the Crystal Field Interaction in Rare Earth Intermetallic Compounds