Skip to content

Commit

Permalink
Revert "Only read SimParamsFile if requested"
Browse files Browse the repository at this point in the history
This reverts commit 28318f8.
  • Loading branch information
smutch authored Feb 1, 2024
1 parent 8045035 commit f4c2e03
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/core/read_params.c
Original file line number Diff line number Diff line change
Expand Up @@ -151,9 +151,8 @@ void read_parameter_file(char* fname, int mode)

strncpy(params_tag[n_param], "SimParamsFile", tag_length);
params_addr[n_param] = run_params->SimParamsFile;
required_tag[n_param] = 0;
required_tag[n_param] = 1;
params_type[n_param++] = PARAM_TYPE_STRING;
*(run_params->SimParamsFile) = '\0';

strncpy(params_tag[n_param], "OutputDir", tag_length);
params_addr[n_param] = run_params->OutputDir;
Expand Down Expand Up @@ -1234,16 +1233,17 @@ void read_parameter_file(char* fname, int mode)
// Parse the user parameter file first
n_entries = parse_paramfile(fname, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read input.par", MLOG_MESG);

// Now parse the default parameter file
n_entries = parse_paramfile(run_params->DefaultsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read defaults.par", MLOG_MESG);

// Finally, parse the simulation parameter file
if (strlen(run_params->SimParamsFile) > 0) {
n_entries = parse_paramfile(run_params->SimParamsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
}
n_entries = parse_paramfile(run_params->SimParamsFile, entry);
store_params(entry, n_entries, params_tag, n_param, used_tag, params_type, params_addr);
mlog("Read sims file", MLOG_MESG);

// Check to see if we are missing any required parameters
for (ii = 0; ii < n_param; ii++)
Expand Down

0 comments on commit f4c2e03

Please sign in to comment.