Skip to content

Commit

Permalink
Add attributes to time variables in Netcdf output
Browse files Browse the repository at this point in the history
  • Loading branch information
tnipen committed Feb 11, 2015
1 parent 04a61a3 commit e89a1c9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/File/Netcdf.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,9 @@ void FileNetcdf::writeTimes() {
timesArr[t] = times[t];
}
vTime->put(timesArr, getNumTime());
addAttribute(vTime, "long_name", "time");
addAttribute(vTime, "standard_name", "time");
addAttribute(vTime, "units", "seconds since 1970-01-01 00:00:00 +00:00");
}
void FileNetcdf::writeReferenceTime() {
if(!hasVar("forecast_reference_time")) {
Expand All @@ -138,4 +141,6 @@ void FileNetcdf::writeReferenceTime() {
if(!Util::isValid(referenceTime))
referenceTime = ncBad_double;
vTime->put(&referenceTime, 1);
addAttribute(vTime, "standard_name", "forecast_reference_time");
addAttribute(vTime, "units", "seconds since 1970-01-01 00:00:00 +00:00");
}

0 comments on commit e89a1c9

Please sign in to comment.