66 for (i = 1; i < argc ; i++){
68 if (!strcmp(argv[i],
"-dec")) {
76 D_SELECT(printf (
"! You must specify -dec n1\n"); ,
77 printf (
"! You must specify -dec n1 n2\n"); ,
78 printf (
"! You must specify -dec n1 n2 n3\n");)
85 printf (
"! Incorrect number of processor for g_dir = %d \n",
g_dir);
91 }
else if (!strcmp(argv[i],
"-i")) {
93 sprintf (ini_file,
"%s",argv[++i]);
95 }
else if (!strcmp(argv[i],
"-makegrid")) {
99 }
else if (!strcmp(argv[i],
"-maxsteps")){
102 if (
prank == 0) printf (
"! You must specify -maxsteps nn\n");
108 printf (
"! You must specify -maxsteps nn, with nn > 0 \n");
113 }
else if (!strcmp(argv[i],
"-no-write")) {
117 }
else if (!strcmp(argv[i],
"-no-x1par")) {
121 }
else if (!strcmp(argv[i],
"-no-x2par")) {
125 }
else if (!strcmp(argv[i],
"-no-x3par")) {
129 }
else if (!strcmp(argv[i],
"-show-dec")) {
133 }
else if (!strcmp(argv[i],
"-x1jet")) {
137 }
else if (!strcmp(argv[i],
"-x2jet")) {
141 }
else if (!strcmp(argv[i],
"-x3jet")) {
145 }
else if (!strcmp(argv[i],
"-xres")){
148 if (
prank == 0) printf (
"! You must specify -xres nn\n");
151 cmd->
xres = atoi(argv[i]);
152 if (cmd->
xres <= 1) {
153 if (
prank == 0) printf (
"! You must specify -xres nn, with nn > 1 \n");
158 }
else if (!strcmp(argv[i],
"-restart") || !strcmp(argv[i],
"-h5restart")) {
164 if (!strcmp(argv[i],
"-restart")) cmd->
restart =
YES;
171 cmd->
nrestart = (int)strtol(argv[i], &endptr, 10);
178 if (endptr == argv[i]){
184 }
else if (!strcmp(argv[i],
"--help")){
190 if (
prank == 0) printf (
"! Unknown option '%s'\n",argv[i]);
211 if (
prank != 0)
return;
213 printf (
"Usage: pluto [options]\n\n");
215 printf (
" mpirun -np NP ./pluto [options]\n\n");
216 printf (
"[options] are:\n\n");
217 printf (
" -dec n1 [n2] [n3]\n");
218 printf (
" Enable user-defined parallel decomposition mode. The integers\n");
219 printf (
" n1, n2 and n3 specify the number of processors along the x1,\n");
220 printf (
" x2, and x3 directions. There must be as many integers as the\n");
221 printf (
" number of dimensions and their product must equal the total\n");
222 printf (
" number of processors used by mpirun or an error will occurr.\n\n");
224 printf (
" -i <name>\n");
225 printf (
" Use <name> as initialization file instead of pluto.ini.\n\n");
227 printf (
" --help\n");
228 printf (
" Show this option summary.\n\n");
230 printf (
" -h5restart n\n");
231 printf (
" Restart computations from the n-th output file in HDF5\n");
232 printf (
" double precision format (.dbl.h5).\n\n");
234 printf (
" -makegrid\n");
235 printf (
" Generate grid only, do not start computations.\n\n");
237 printf (
" -maxsteps n\n");
238 printf (
" Stop computations after n steps.\n\n");
240 printf (
" -no-write\n");
241 printf (
" Do not write data to disk.\n\n");
243 printf (
" -no-x1par, -no-x2par, -no-x3par\n");
244 printf (
" Do not perform parallel domain decomposition along the x1, x2\n");
245 printf (
" or x3 direction, respectively.\n\n");
247 printf (
" -restart n\n");
248 printf (
" Restart computations from the n-th output file in double in\n");
249 printf (
" precision format (.dbl).\n\n");
251 printf (
" -show-dec\n");
252 printf (
" Show domain decomposition when running in parallel mode.\n\n");
254 printf (
" -x1jet, -x2jet, -x3jet\n");
255 printf (
" Exclude from integration regions of zero pressure gradient\n");
256 printf (
" that extends up to the end of the domain in x1, x2 or x3\n");
257 printf (
" direction, respectively. This option is specifically\n");
258 printf (
" designed for jets propagating along one of the coordinate\n");
259 printf (
" axis. In parallel mode, parallel decomposition is not\n");
260 printf (
" performed along the selected direction.\n\n");
262 printf (
" -xres n1\n");
263 printf (
" Set the grid resolution in the x1 direction to n1 zones\n");
264 printf (
" by overriding pluto.ini. Cell aspect ratio is preserved by\n");
265 printf (
" modifying the grid resolution in the other coordinate\n");
266 printf (
" directions accordingly.\n");
int g_dir
Specifies the current sweep or direction of integration.
void ParseCmdLineArgs(int argc, char *argv[], char *ini_file, Cmd_Line *cmd)
#define QUIT_PLUTO(e_code)