Skip to content
Snippets Groups Projects
Commit 7880ef3a authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Merge branch 'select_output' into 'master'

Fix generation of parameter file for selecting the output

See merge request !836
parents 11300e89 99810289
No related branches found
No related tags found
1 merge request!836Fix generation of parameter file for selecting the output
......@@ -58,8 +58,8 @@ Parameters:
-n, --steps=<int> Execute a fixed number of time steps.
When unset use the time_end parameter
to stop.
-o, --output-params=<str> Generate a default output parameter
file.
-o, --output-params=<str> Generate a parameter file with the options
for selecting the output fields.
-P, --param=<str> Set parameter value, overiding the value
read from the parameter file. Can be used
more than once {sec:par:value}.
......
......@@ -109,8 +109,8 @@ Parameters:
-n, --steps=<int> Execute a fixed number of time steps.
When unset use the time_end parameter
to stop.
-o, --output-params=<str> Generate a default output parameter
file.
-o, --output-params=<str> Generate a parameter file with the options
for selecting the output fields.
-P, --param=<str> Set parameter value, overiding the value
read from the parameter file. Can be used
more than once {sec:par:value}.
......
......@@ -52,8 +52,8 @@ can be found by typing ``./swift -h``::
-n, --steps=<int> Execute a fixed number of time steps.
When unset use the time_end parameter
to stop.
-o, --output-params=<str> Generate a default output parameter
file.
-o, --output-params=<str> Generate a parameter file with the options
for selecting the output fields.
-P, --param=<str> Set parameter value, overiding the value
read from the parameter file. Can be used
more than once {sec:par:value}.
......
......@@ -242,7 +242,9 @@ int main(int argc, char *argv[]) {
"time_end parameter to stop.",
NULL, 0, 0),
OPT_STRING('o', "output-params", &output_parameters_filename,
"Generate a default output parameter file.", NULL, 0, 0),
"Generate a parameter file with the options for selecting the "
"output fields.",
NULL, 0, 0),
OPT_STRING('P', "param", &buffer,
"Set parameter value, overiding the value read from the "
"parameter file. Can be used more than once {sec:par:value}.",
......@@ -273,6 +275,13 @@ int main(int argc, char *argv[]) {
"example of parameter file.");
int nargs = argparse_parse(&argparse, argc, (const char **)argv);
/* Write output parameter file */
if (myrank == 0 && output_parameters_filename != NULL) {
io_write_output_field_parameter(output_parameters_filename);
printf("End of run.\n");
return 0;
}
/* Need a parameter file. */
if (nargs != 1) {
if (myrank == 0) argparse_usage(&argparse);
......@@ -332,13 +341,6 @@ int main(int argc, char *argv[]) {
}
}
/* Write output parameter file */
if (myrank == 0 && output_parameters_filename != NULL) {
io_write_output_field_parameter(output_parameters_filename);
printf("End of run.\n");
return 0;
}
if (!with_self_gravity && !with_hydro && !with_external_gravity) {
if (myrank == 0) {
argparse_usage(&argparse);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment