Crystal-field effects in rare earth compounds with the ThCr2Si2 structure