Changed implemetation to populate an array of values, then write all at once.
Now uses OpenMP for parallelism. A 100 minute file can be generated in roughly 30 sec.