Code for HMC sampling with stan and saving samples in 4 files for each simulation.