Copy of abinit code