Write version information into gs2 output files

Issue #94 resolved
Stephen Biggs-Fox created an issue

When you run BOUT++, the version number of the BOUT++ library, the compile time flags and the run time flags are written to the output files, e.g.

BOUT++ version 4.3.0
Revision: 123e774f865d4c98d378b909b89accd7efd56dc3
MD5 checksum: e73724c443a58d33671e8f4a7c8f1937
Code compiled on Jan 27 2020 at 17:35:21

B.Dudson (University of York), M.Umansky (LLNL) 2007
Based on BOUT by Xueqiao Xu, 1999

Processor number: 0 of 2

pid: 16340

Compile-time options:
    Checking enabled, level 2
    Signal handling enabled
    netCDF support enabled
    Parallel NetCDF support disabled
    OpenMP parallelisation disabled
    Compiled with flags : "-DMD5SUM=e73724c443a58d33671e8f4a7c8f1937 -DREVISION=123e774f865d4c98d378b909b89accd7efd56dc3 -g -D
    Command line options for this run : ./conduction 
Reading options file data/BOUT.inp
Writing options to file data/BOUT.settings

It would be useful to have similar information in GS2. In particular, the gs2 code version, linked library versions and compiler flags would be most useful.

Some information is given but it is unclear (date and time - of what?), irrelevant (units), or out-of-date (sourceforge), e.g.

    char code_info(char10) ;
        code_info:long_name = "GS2" ;
        code_info:c1 = "Date: 20200117" ;
        code_info:c2 = "Time: 174923.999 -0000" ;
        code_info:c3 = "netCDF version 4.3.3.1 of Sep  9 2015 09:44:44 $" ;
        code_info:c4 = "Units are determined with respect to reference temperature (T_ref)," ;
        code_info:c5 = "reference charge (q_ref), reference mass (mass_ref)," ;
        code_info:c6 = "reference field (B_ref), and reference length (a_ref)" ;
        code_info:c7 = "from which one may construct rho_ref and vt_ref/a," ;
        code_info:c8 = "which are the basic units of perpendicular length and time." ;
        code_info:c9 = "Macroscopic lengths are normalized to the minor radius." ;
        code_info:c10 = "The difference between rho (normalized minor radius) and rho (gyroradius)" ;
        code_info:c11 = "should be clear from the context in which they appear below." ;
// global attributes:
        :title = "GS2 Simulation Data" ;
        :Conventions = "https://sourceforge.net/projects/gyrokinetics/" ;
        :long_name = "Qpperpj1 (theta=0) over time" ;

Comments (3)

  1. David Dickinson

    The date and time and that of the start of the run (or at least when the netcdf file is created). This may be different in the new diagnostics.

    The utils module runtime_tests captures some of this information (compiler used, git hash, if the code has been modified etc). I believe the new diagnostics uses at least some of this (see diagnostics_metadata) but we could probably port this to the original diagnostics as well.

  2. David Dickinson

    From 8.1 GS2 runs now display a header containing version information and also provides some command line arguments to check the version and build configuration. This could be extended but addresses the main points.

  3. Log in to comment