Magnetocaloric effect at the exchange–inversion with magnetoelastic coupling