Added support for writing output to NetCDF