First-principles calculations of the Berry curvature of Bloch states for charge and spin transport of electrons