Add git SHA1 hash to --version output and summary/statepoint files

This commit is contained in:
Paul Romano 2017-02-17 10:41:51 -06:00
parent 7848a97edc
commit 6793ca9836
5 changed files with 18 additions and 1 deletions

View file

@ -27,6 +27,10 @@ The current revision of the statepoint file format is 15.
Release version number for OpenMC
**/git_sha1** (*char[40]*)
Git commit SHA-1 hash
**/date_and_time** (*char[]*)
Date and time the state point was written.

View file

@ -27,6 +27,10 @@ The current revision of the summary file format is 4.
Release version number for OpenMC
**/git_sha1** (*char[40]*)
Git commit SHA-1 hash
**/date_and_time** (*char[]*)
Date and time the summary was written.

View file

@ -173,10 +173,13 @@ contains
if (master) then
write(UNIT=OUTPUT_UNIT, FMT='(1X,A,1X,I1,".",I1,".",I1)') &
"OpenMC version", VERSION_MAJOR, VERSION_MINOR, VERSION_RELEASE
#ifdef GIT_SHA1
write(UNIT=OUTPUT_UNIT, FMT='(1X,A,A)') "Git SHA1: ", GIT_SHA1
#endif
write(UNIT=OUTPUT_UNIT, FMT=*) "Copyright (c) 2011-2015 &
&Massachusetts Institute of Technology"
write(UNIT=OUTPUT_UNIT, FMT=*) "MIT/X license at &
&<http://mit-crpg.github.io/openmc/license.html>"
&<http://openmc.readthedocs.io/en/latest/license.html>"
end if
end subroutine print_version

View file

@ -77,6 +77,9 @@ contains
call write_dataset(file_id, "version_major", VERSION_MAJOR)
call write_dataset(file_id, "version_minor", VERSION_MINOR)
call write_dataset(file_id, "version_release", VERSION_RELEASE)
#ifdef GIT_SHA1
call write_dataset(file_id, "git_sha1", GIT_SHA1)
#endif
! Write current date and time
call write_dataset(file_id, "date_and_time", time_stamp())

View file

@ -96,6 +96,9 @@ contains
call write_dataset(file_id, "version_major", VERSION_MAJOR)
call write_dataset(file_id, "version_minor", VERSION_MINOR)
call write_dataset(file_id, "version_release", VERSION_RELEASE)
#ifdef GIT_SHA1
call write_dataset(file_id, "git_sha1", GIT_SHA1)
#endif
! Write current date and time
call write_dataset(file_id, "date_and_time", time_stamp())