adjust write to file code to changesd formats in gridded data and area time series