33 netCDF::NcGroup timeGroup = metaGroup.addGroup(timeNodeName());
35 netCDF::NcVar unixVar = timeGroup.addVar(unformattedName(), netCDF::ncInt64);
37 std::uint64_t secondsSinceEpoch = sinceEpoch.seconds();
38 unixVar.putVar(&secondsSinceEpoch);
39 unixVar.putAtt(std::string(
"units"),
"seconds since 1970-01-01T00:00:00Z");
43 unixVar.putAtt(std::string(
"format"), TimePoint::ymdhmsFormat);
44 unixVar.putAtt(formattedName(), metadata.m_time.format());
47 netCDF::NcGroup configGroup = metaGroup.addGroup(configurationNode());
49 for (
auto entry : metadata.m_config) {
50 switch (entry.second.index()) {
51 case (CONFIGMAP_DOUBLE): {
52 configGroup.putAtt(entry.first, netCDF::ncDouble, *std::get_if<double>(&entry.second));
55 case (CONFIGMAP_UNSIGNED): {
56 configGroup.putAtt(entry.first, netCDF::ncUint, *std::get_if<unsigned>(&entry.second));
59 case (CONFIGMAP_INT): {
60 configGroup.putAtt(entry.first, netCDF::ncInt, *std::get_if<int>(&entry.second));
63 case (CONFIGMAP_STRING): {
64 std::string extring = std::get<std::string>(entry.second);
65 configGroup.putAtt(entry.first, std::get<std::string>(entry.second));