@@ -60,6 +60,7 @@ static long mcseed = 0; /* seed for random generator */
6060static long mcstartdate = 0 ; /* start simulation time */
6161static int mcdisable_output_files = 0 ; /* --no-output-files */
6262mcstatic int mcgravitation = 0 ; /* use gravitation flag, for PROP macros */
63+ mcstatic int mcusedefaults = 0 ; /* assume default value for all parameters */
6364mcstatic int mcdotrace = 0 ; /* flag for --trace and messages for DISPLAY */
6465mcstatic int mcnexus_embed_idf = 0 ; /* flag to embed xml-formatted IDF file for Mantid */
6566#pragma acc declare create ( mcdotrace )
@@ -4432,6 +4433,7 @@ mchelp(char *pgmname)
44324433" -h --help Show this help message.\n"
44334434" -i --info Detailed instrument information.\n"
44344435" --list-parameters Print the instrument parameters to standard out\n"
4436+ " -y --yes Assume default values for all parameters with a default\n"
44354437" --meta-list Print names of components which defined metadata\n"
44364438" --meta-defined COMP[:NAME] Print component defined metadata names, or (0,1) if NAME provided\n"
44374439" --meta-type COMP:NAME Print metadata format type specified in definition\n"
@@ -4720,6 +4722,10 @@ mcparseoptions(int argc, char *argv[])
47204722 mcgravitation = 1 ;
47214723 else if (!strcmp ("-g" , argv [i ]))
47224724 mcgravitation = 1 ;
4725+ else if (!strcmp ("--yes" , argv [i ]))
4726+ mcusedefaults = 1 ;
4727+ else if (!strcmp ("-y" , argv [i ]))
4728+ mcusedefaults = 1 ;
47234729 else if (!strncmp ("--format=" , argv [i ], 9 )) {
47244730 mcformat = & argv [i ][9 ];
47254731 }
@@ -4802,6 +4808,20 @@ mcparseoptions(int argc, char *argv[])
48024808 mcusage (argv [0 ]);
48034809 }
48044810 }
4811+ if (mcusedefaults ) {
4812+ MPI_MASTER (
4813+ printf ("Using all default parameter values\n" );
4814+ );
4815+ for (j = 0 ; j < numipar ; j ++ ) {
4816+ int status ;
4817+ if (mcinputtable [j ].val && strlen (mcinputtable [j ].val )){
4818+ status = (* mcinputtypes [mcinputtable [j ].type ].getparm )(mcinputtable [j ].val ,
4819+ mcinputtable [j ].par );
4820+ paramsetarray [j ] = 1 ;
4821+ paramset = 1 ;
4822+ }
4823+ }
4824+ }
48054825 if (!paramset )
48064826 mcreadparams (); /* Prompt for parameters if not specified. */
48074827 else
0 commit comments