Add grid cell id to output file

The grid cell id is set such that 0 is the lower left corner and increases from left to right, then bottome to top.
fix shebang problem
Clean up of coup_conv, implement some of Bart's comments

fixed flow.coordinates attribute in outfile