Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
SWIFT
SWIFTsim
Commits
2b9c96d6
Commit
2b9c96d6
authored
Aug 20, 2018
by
Matthieu Schaller
Browse files
Write the time and date of the snapshot output in the header.
parent
117013d5
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/parallel_io.c
View file @
2b9c96d6
...
...
@@ -31,6 +31,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<time.h>
/* This object's header. */
#include
"parallel_io.h"
...
...
@@ -968,6 +969,8 @@ void prepare_file(struct engine* e, const char* baseName, long long N_total[6],
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
time_t
tm
=
time
(
NULL
);
io_write_attribute_s
(
h_grp
,
"Snapshot date"
,
ctime
(
&
tm
));
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
src/serial_io.c
View file @
2b9c96d6
...
...
@@ -31,6 +31,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<time.h>
/* This object's header. */
#include
"serial_io.h"
...
...
@@ -822,6 +823,8 @@ void write_output_serial(struct engine* e, const char* baseName,
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
time_t
tm
=
time
(
NULL
);
io_write_attribute_s
(
h_grp
,
"Snapshot date"
,
ctime
(
&
tm
));
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
src/single_io.c
View file @
2b9c96d6
...
...
@@ -30,6 +30,7 @@
#include
<stdio.h>
#include
<stdlib.h>
#include
<string.h>
#include
<time.h>
/* This object's header. */
#include
"single_io.h"
...
...
@@ -672,6 +673,8 @@ void write_output_single(struct engine* e, const char* baseName,
io_write_attribute
(
h_grp
,
"Redshift"
,
DOUBLE
,
&
e
->
cosmology
->
z
,
1
);
io_write_attribute
(
h_grp
,
"Scale-factor"
,
DOUBLE
,
&
e
->
cosmology
->
a
,
1
);
io_write_attribute_s
(
h_grp
,
"Code"
,
"SWIFT"
);
time_t
tm
=
time
(
NULL
);
io_write_attribute_s
(
h_grp
,
"Snapshot date"
,
ctime
(
&
tm
));
/* GADGET-2 legacy values */
/* Number of particles of each type */
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment