Commit 797585d5 by Francois Gygi

Added ISO date stamp in upf2qso output

parent 4f93df79
CXXFLAGS=-g
upf2qso: upf2qso.o PeriodicTable.o spline.o
upf2qso: upf2qso.o PeriodicTable.o spline.o isodate.o
$(CXX) -o $@ $^
clean:
rm -f *.o upf2qso
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// isodate.C
//
////////////////////////////////////////////////////////////////////////////////
#include "isodate.h"
#include <ctime>
std::string isodate(void)
{
const time_t t = time(NULL);
struct tm* tms = gmtime(&t);
char s[32];
const char* fmt = "%Y-%m-%dT%TZ";
strftime(s,32,fmt,tms);
return std::string(s);
}
////////////////////////////////////////////////////////////////////////////////
//
// Copyright (c) 2008 The Regents of the University of California
//
// This file is part of Qbox
//
// Qbox is distributed under the terms of the GNU General Public License
// as published by the Free Software Foundation, either version 2 of
// the License, or (at your option) any later version.
// See the file COPYING in the root directory of this distribution
// or <http://www.gnu.org/licenses/>.
//
////////////////////////////////////////////////////////////////////////////////
//
// isodate.h:
//
////////////////////////////////////////////////////////////////////////////////
#ifndef ISODATE_H
#include <string>
std::string isodate(void);
#endif
......@@ -33,6 +33,7 @@
#include <cstdlib>
#include <stdexcept>
#include "spline.h"
#include "isodate.h"
#include "PeriodicTable.h"
using namespace std;
......@@ -753,7 +754,8 @@ int main(int argc, char** argv)
cout << " xsi:schemaLocation=\"http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0" << endl;
cout << " species.xsd\">" << endl;
cout << "<description>" << endl;
cout << "Translated from UPF format by upf2qso " << release << endl;
cout << "Translated from UPF format by upf2qso " << release
<< " on " << isodate() << endl;
cout << upf_pp_info;
cout << "</description>" << endl;
cout << "<symbol>" << upf_symbol << "</symbol>" << endl;
......@@ -1392,7 +1394,8 @@ int main(int argc, char** argv)
cout << " xsi:schemaLocation=\"http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0" << endl;
cout << " species.xsd\">" << endl;
cout << "<description>" << endl;
cout << "Translated from UPF format by upf2qso " << release << endl;
cout << "Translated from UPF format by upf2qso " << release
<< " on " << isodate() << endl;
cout << upf_pp_info;
cout << "</description>" << endl;
cout << "<symbol>" << upf_symbol << "</symbol>" << endl;
......@@ -1617,7 +1620,8 @@ int main(int argc, char** argv)
cout << " xsi:schemaLocation=\"http://www.quantum-simulation.org/ns/fpmd/fpmd-1.0" << endl;
cout << " species.xsd\">" << endl;
cout << "<description>" << endl;
cout << "Translated from UPF format by upf2qso " << release << endl;
cout << "Translated from UPF format by upf2qso " << release
<< " on " << isodate() << endl;
cout << upf_pp_info;
cout << "</description>" << endl;
cout << "<symbol>" << upf_symbol << "</symbol>" << endl;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment