@@ -31,74 +31,72 @@ bool Inputs::read_inputs_json(Times &time) {
31
31
isOk = set_verbose (settings);
32
32
33
33
try {
34
-
35
34
// Then read in user perturbations on those defaults:
36
35
user_inputs = read_json (" aether.json" );
37
- isOk = set_verbose (user_inputs);
38
-
39
- // Read in a restart file also if user specified it.
40
- // - Here we merge the restart inputs with the defaults inputs
41
- // - This is BEFORE the user inputs are merged!!!
42
-
43
- if (user_inputs.contains (" Restart" )) {
44
- if (user_inputs[" Restart" ].contains (" do" )) {
45
- if (user_inputs[" Restart" ][" do" ]) {
46
- std::string restart_file = get_setting_str (" Restart" , " InDir" );
47
- restart_file = restart_file + " /settings.json" ;
48
- json restart_inputs;
49
- restart_inputs = read_json (restart_file);
50
- // This forces the logfile to append. User can override
51
- // if they really want:
52
- restart_inputs[" Logfile" ][" append" ] = true ;
53
- settings.merge_patch (restart_inputs);
54
- }
36
+ } catch (...) {
37
+ report.error (" Error in reading inputs!" );
38
+ isOk = false ;
39
+ }
40
+
41
+ isOk = set_verbose (user_inputs);
42
+
43
+ // Read in a restart file also if user specified it.
44
+ // - Here we merge the restart inputs with the defaults inputs
45
+ // - This is BEFORE the user inputs are merged!!!
46
+ if (user_inputs.contains (" Restart" )) {
47
+ if (user_inputs[" Restart" ].contains (" do" )) {
48
+ if (user_inputs[" Restart" ][" do" ]) {
49
+ std::string restart_file = get_setting_str (" Restart" , " InDir" );
50
+ restart_file = restart_file + " /settings.json" ;
51
+ json restart_inputs;
52
+ restart_inputs = read_json (restart_file);
53
+ // This forces the logfile to append. User can override
54
+ // if they really want:
55
+ restart_inputs[" Logfile" ][" append" ] = true ;
56
+ settings.merge_patch (restart_inputs);
55
57
}
56
58
}
59
+ }
57
60
58
- // Merge the defaults/restart settings with the user provided
59
- // settings, with the default/restart settings being the default:
60
- settings.merge_patch (user_inputs);
61
-
62
- // change planet file to the one specified on aether.json:
63
- if (isOk)
64
- settings[" PlanetSpeciesFile" ] = get_setting_str (" Planet" , " file" );
61
+ // Merge the defaults/restart settings with the user provided
62
+ // settings, with the default/restart settings being the default:
63
+ settings.merge_patch (user_inputs);
65
64
66
- std::string planet_filename = get_setting_str (" PlanetSpeciesFile" );
67
- report.print (1 , " Using planet file : " + planet_filename);
65
+ // change planet file to the one specified on aether.json:
66
+ if (isOk)
67
+ settings[" PlanetSpeciesFile" ] = get_setting_str (" Planet" , " file" );
68
68
69
- // Debug Stuff:
70
- if (isOk)
71
- report.set_verbose (get_setting_int (" Debug" , " iVerbose" ));
69
+ std::string planet_filename = get_setting_str (" PlanetSpeciesFile" );
70
+ report.print (1 , " Using planet file : " + planet_filename);
72
71
73
- if (isOk)
74
- report.set_DefaultVerbose (get_setting_int (" Debug" , " iVerbose" ));
72
+ // Debug Stuff:
73
+ if (isOk)
74
+ report.set_verbose (get_setting_int (" Debug" , " iVerbose" ));
75
75
76
- if (isOk)
77
- report.set_doInheritVerbose ( get_setting_bool (" Debug" , " doInheritVerbose " ));
76
+ if (isOk)
77
+ report.set_DefaultVerbose ( get_setting_int (" Debug" , " iVerbose " ));
78
78
79
- if (isOk)
80
- report.set_timing_depth ( get_setting_int (" Debug" , " iTimingDepth " ));
79
+ if (isOk)
80
+ report.set_doInheritVerbose ( get_setting_bool (" Debug" , " doInheritVerbose " ));
81
81
82
- if (isOk)
83
- report.set_timing_percent ( get_setting_float (" Debug" , " TimingPercent " ));
82
+ if (isOk)
83
+ report.set_timing_depth ( get_setting_int (" Debug" , " iTimingDepth " ));
84
84
85
- if (isOk)
86
- report.set_iProc ( get_setting_int (" Debug" , " iProc " ));
85
+ if (isOk)
86
+ report.set_timing_percent ( get_setting_float (" Debug" , " TimingPercent " ));
87
87
88
- for ( auto &item : settings[ " Debug " ][ " iFunctionVerbose " ]. items () )
89
- report.set_FunctionVerbose (item. key (), item. value ( ));
88
+ if (isOk )
89
+ report.set_iProc ( get_setting_int ( " Debug " , " iProc " ));
90
90
91
- // Capture time information:
92
- if (isOk)
93
- time.set_times (get_setting_timearr (" StartTime" ));
91
+ for (auto &item : settings[" Debug" ][" iFunctionVerbose" ].items ())
92
+ report.set_FunctionVerbose (item.key (), item.value ());
94
93
95
- if (isOk)
96
- time.set_end_time (get_setting_timearr (" EndTime" ));
94
+ // Capture time information:
95
+ if (isOk)
96
+ time.set_times (get_setting_timearr (" StartTime" ));
97
97
98
- } catch (...) {
99
- report.error (" Error in reading inputs!" );
100
- isOk = false ;
101
- }
98
+ if (isOk)
99
+ time.set_end_time (get_setting_timearr (" EndTime" ));
102
100
103
101
return isOk;
104
102
}
0 commit comments