Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion share/run/UA/inputs/defaults.json
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,8 @@
"Sources" : {
"Grid" : {
"Centripetal" : true,
"Coriolis" : true },
"Coriolis" : true,
"Cent_acc": true },
"Neutrals" : {
"NO_cool" : false,
"O_cool": false } },
Expand Down
5 changes: 4 additions & 1 deletion src/inputs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -547,10 +547,13 @@ std::vector<std::string> Inputs::get_omniweb_files() {

precision_t Inputs::get_dt_output(int iOutput) {
precision_t value = 0.0;
int nOutputs = settings.at("Outputs").at("type").size();
int nOutputs = settings.at("Outputs").at("dt").size();

if (iOutput < nOutputs)
value = settings.at("Outputs").at("dt").at(iOutput);
else{
report.error("Output Error; more output types than dt's provided.");
}

return value;
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ int main() {
didWork = output(neutralsMag, ionsMag, mGrid, time, planet);
}
if (!didWork)
throw std::string("output failed!");
throw std::string("Initial output failed!");

// This is advancing now... We are not coupling, so set dt_couple to the
// end of the simulation
Expand Down
11 changes: 9 additions & 2 deletions src/output.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,14 @@ bool output(const Neutrals &neutrals,

for (int iOutput = 0; iOutput < nOutputs; iOutput++) {

if (time.check_time_gate(input.get_dt_output(iOutput))) {
// make sure the output dt is set correctly. Otherwise these errors aren't caught correctly.
precision_t dt_output = input.get_dt_output(iOutput);
if (dt_output == 0.0){
report.exit(function);
return false;
}

if (time.check_time_gate(dt_output)) {

// ------------------------------------------------------------
// Store time in all of the files:
Expand Down Expand Up @@ -244,7 +251,7 @@ bool output(const Neutrals &neutrals,
grid.radius_scgc);
}

if (type_output == "bfield") {
if (type_output == "bfield" || type_output == "ions") {
AllOutputContainers[iOutput].store_variable("mlat",
"Magnetic Latitude",
"degrees",
Expand Down
Loading