update writenetcdf()