Changeset 1046 for XIOS/trunk/src/io/nc4_data_output.cpp
- Timestamp:
- 02/02/17 14:40:34 (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/io/nc4_data_output.cpp
r1045 r1046 16 16 /// ////////////////////// Dfinitions ////////////////////// /// 17 17 CNc4DataOutput::CNc4DataOutput 18 ( const StdString & filename, bool exist)18 (CFile* file, const StdString & filename, bool exist) 19 19 : SuperClass() 20 20 , SuperClassWriter(filename, exist) 21 21 , filename(filename) 22 , file(file) 22 23 { 23 24 SuperClass::type = MULTI_FILE; … … 25 26 26 27 CNc4DataOutput::CNc4DataOutput 27 ( const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention,28 (CFile* file, const StdString & filename, bool exist, bool useClassicFormat, bool useCFConvention, 28 29 MPI_Comm comm_file, bool multifile, bool isCollective, const StdString& timeCounterName) 29 30 : SuperClass() … … 32 33 , filename(filename) 33 34 , isCollective(isCollective) 35 , file(file) 34 36 { 35 37 SuperClass::type = (multifile) ? MULTI_FILE : ONE_FILE; … … 1971 1973 struct tm * timeinfo = NULL; 1972 1974 char buffer [buffer_size]; 1973 1975 StdString formatStr; 1976 if (file->time_stamp_format.isEmpty()) formatStr="%Y-%b-%d %H:%M:%S %Z" ; 1977 else formatStr=file->time_stamp_format; 1978 1979 // time ( &rawtime ); 1980 // timeinfo = localtime ( &rawtime ); 1974 1981 time ( &rawtime ); 1975 timeinfo = localtime ( &rawtime );1976 strftime (buffer, buffer_size, "%Y-%b-%d %H:%M:%S %Z", timeinfo);1982 timeinfo = gmtime ( &rawtime ); 1983 strftime (buffer, buffer_size, formatStr.c_str(), timeinfo); 1977 1984 1978 1985 return (StdString(buffer)); … … 2010 2017 field->getOperationTimeType() != func::CFunctor::once) 2011 2018 { 2012 2013 2014 factorUnit=context->getCalendar()->getDayLengthInSeconds() ; 2015 2019 double factorUnit; 2020 if (!field->file->time_units.isEmpty() && field->file->time_units==CFile::time_units_attr::days) 2021 factorUnit=context->getCalendar()->getDayLengthInSeconds() ; 2022 else factorUnit=1 ; 2016 2023 field->resetNStep(getRecordFromTime(field->last_Write_srv,factorUnit) + 1); 2017 2024 } … … 2561 2568 SuperClassWriter::addAttribute("Conventions", conventions); 2562 2569 // SuperClassWriter::addAttribute("production" , production); 2563 SuperClassWriter::addAttribute("timeStamp" , timeStamp); 2570 StdString timeStampStr ; 2571 if (file->time_stamp_name.isEmpty()) timeStampStr="timeStamp" ; 2572 else timeStampStr=file->time_stamp_name ; 2573 SuperClassWriter::addAttribute(timeStampStr, timeStamp); 2564 2574 } 2565 2575 catch (CNetCdfException& e)
Note: See TracChangeset
for help on using the changeset viewer.