A header for files and output.
This is a type rather than a function so that we can use a consistent date/time and UUID across different files by reusing the same object.
Call standard_header_type::to_string
to get the header as text.
Type | Visibility | Attributes | Name | Initial | |||
---|---|---|---|---|---|---|---|
character(len=:), | public, | allocatable | :: | date_time | |||
character(len=uuid_len), | public | :: | run_uuid |
Constructor for standard_header_type
.
Stores the date using date_is08601
and the UUID using
simulation_run_uuid
. Note that this may involve collective
communication, so all processors should be involved in
construction.
Return a multiline string with a standard header of the form:
Created by GS2 at 2021-02-02T15:01:26.370Z+00:00
Run UUID: 36310A48-6A73-4941-9366-410C5731027A
"fedora": ubuntu
Compiler: gfortran
<optional file description>
If \p comment_character is passed, it is prepended to the start of each line. Note that it is used as-is, including any whitespace.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(standard_header_type), | intent(in) | :: | this | |||
character(len=*), | intent(in), | optional | :: | comment_character |
Optional character(s) to start each line. Whitespace is not stripped or added. Default is empty string |
|
character(len=*), | intent(in), | optional | :: | file_description |
Optional file description. Treated as a single line, that is, new lines in this string will not begin with comment_character |
type :: standard_header_type
character(:), allocatable :: date_time
character(len=uuid_len) :: run_uuid
contains
procedure :: to_string => standard_header_to_string
end type standard_header_type