AM: write xyz file before starting the calculation