@@ -319,8 +319,8 @@ the CMIP file system standards, for ease of future processing.
319319output_fn <- "../data/climate_data/tas_day_BEST_historical_station_19800101-19891231.nc"
320320
321321# Define dimensions
322- dimlon <- ncdim_def("lon", "degrees_east", longitude[longitude >= lonlims[1] & longitude <= lonlims[2]], longname='longitude')
323- dimlat <- ncdim_def("lat", "degrees_north", latitude[latitude >= latlims[1] & latitude <= latlims[2]], longname='latitude')
322+ dimlon <- ncdim_def("lon", "degrees_east", lon[lon >= lonlims[1] & lon <= lonlims[2]], longname='longitude')
323+ dimlat <- ncdim_def("lat", "degrees_north", lat[lat >= latlims[1] & lat <= latlims[2]], longname='latitude')
324324dimtime <- ncdim_def("time", "days since 1980-01-01 00:00:00", as.numeric(time - as.Date("1980-01-01")),
325325 unlim=T, calendar="proleptic_gregorian")
326326
@@ -332,11 +332,6 @@ ncnew <- nc_create(output_fn, vartas)
332332# Add the variable data
333333ncvar_put(ncnew, vartas, tas2)
334334
335- # Add an attribute mentioning how this file was created
336- # This is good practice, especially for NetCDF files,
337- # whose metadata can help you keep track of your workflow.
338- ncvar_put(ncnew,0,'origin_script','preprocess_best.R')
339-
340335# Close file
341336nc_close(ncnew)
342337```
0 commit comments