#cloud-config
package_upgrade: true
packages:
 - python-astropy
 - python-matplotlib
 - gfortran
 - python-pyfits
 - make

mounts:
 - [ /dev/vdb, /mnt/, "ext4", "defaults,nofail,discard", "0", "0" ]

write_files:
 - content: |
      [Global]
      code root dir: /mnt/esoclimi/

      [Code]
      Input File: input.dat
      Output File: output.dat
      Restart File: restart.dat
      Non Converging Models File: nonconverging.dat
      CPU File: cpu.dat
      Executed runs: executed.out
      Uncompleted Models File: uncompleted.dat

      [Results]
      SnowBall File: SnowBall-Params.dat
      RunawayGreenhouse File: RunawayGreenhouse-Params.dat
      PressExceeded File: PressExceeded-Params.dat
      IntegrationError File: IntegrationError-Params.dat

      [Checkpoint]
      Restart Interval: 180  ; in seconds
      Number of runs before restart: 1000
      Stop Time: 36000 ; in seconds
      Stop File: stop ; to add in the work dir
   path: /home/ubuntu/Config.ini

runcmd:
 - [ ls, /home/ubuntu ]
 - mv /home/ubuntu/Config.ini /mnt
 - [ cd, /mnt]
 - git clone -b EsoMPI https://github.com/gtaffoni/esoclimi.git
 - python /mnt/esoclimi/src/serial.py


