diff --git a/README b/README index 689386194d99d30b5f74394997a1b30048a2b7e5..274ea3dbe31fe4a591435970e0b0dc542873cb6b 100644 --- a/README +++ b/README @@ -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}. diff --git a/README.md b/README.md index cc1a0ff1c9ded5ff5a0a1359c5afb44df13bc1c5..233a2112ae1575d90c6d9e5347f393407e02430f 100644 --- a/README.md +++ b/README.md @@ -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}. diff --git a/doc/RTD/source/CommandLineOptions/index.rst b/doc/RTD/source/CommandLineOptions/index.rst index 68cf9bc82483e232502f96de2d34e6f3793c0640..1144477548062bb61e47a88d3a1ee062b89b97cf 100644 --- a/doc/RTD/source/CommandLineOptions/index.rst +++ b/doc/RTD/source/CommandLineOptions/index.rst @@ -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}. diff --git a/examples/main.c b/examples/main.c index 6f1341abe7256a08767d94689ce0342a3defc42b..e08999bdcf89e237fbf4f72ad756703bfa3291c8 100644 --- a/examples/main.c +++ b/examples/main.c @@ -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);