diff --git a/docs/source/io_formats/statepoint.rst b/docs/source/io_formats/statepoint.rst index e334f2bf11..a93e2f26d1 100644 --- a/docs/source/io_formats/statepoint.rst +++ b/docs/source/io_formats/statepoint.rst @@ -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. diff --git a/docs/source/io_formats/summary.rst b/docs/source/io_formats/summary.rst index 435cb45c87..3084c27383 100644 --- a/docs/source/io_formats/summary.rst +++ b/docs/source/io_formats/summary.rst @@ -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. diff --git a/src/output.F90 b/src/output.F90 index c719dbed97..b1b8320c68 100644 --- a/src/output.F90 +++ b/src/output.F90 @@ -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 & - &" + &" end if end subroutine print_version diff --git a/src/state_point.F90 b/src/state_point.F90 index 257753b5b4..5872fbadf4 100644 --- a/src/state_point.F90 +++ b/src/state_point.F90 @@ -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()) diff --git a/src/summary.F90 b/src/summary.F90 index 78a8276f16..a17aa5210d 100644 --- a/src/summary.F90 +++ b/src/summary.F90 @@ -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())