Skip to content

Commit 5b7f90c

Browse files
authored
Merge pull request #162 from AetherModel/io_bugfixes
[BUGS]: Some quick i/o bugfixes
2 parents 43a3c67 + 58c1f4e commit 5b7f90c

File tree

4 files changed

+16
-5
lines changed

4 files changed

+16
-5
lines changed

share/run/UA/inputs/defaults.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,8 @@
101101
"Sources" : {
102102
"Grid" : {
103103
"Centripetal" : true,
104-
"Coriolis" : true },
104+
"Coriolis" : true,
105+
"Cent_acc": true },
105106
"Neutrals" : {
106107
"NO_cool" : false,
107108
"O_cool": false } },

src/inputs.cpp

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -547,10 +547,13 @@ std::vector<std::string> Inputs::get_omniweb_files() {
547547

548548
precision_t Inputs::get_dt_output(int iOutput) {
549549
precision_t value = 0.0;
550-
int nOutputs = settings.at("Outputs").at("type").size();
550+
int nOutputs = settings.at("Outputs").at("dt").size();
551551

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

555558
return value;
556559
}

src/main/main.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ int main() {
168168
didWork = output(neutralsMag, ionsMag, mGrid, time, planet);
169169
}
170170
if (!didWork)
171-
throw std::string("output failed!");
171+
throw std::string("Initial output failed!");
172172

173173
// This is advancing now... We are not coupling, so set dt_couple to the
174174
// end of the simulation

src/output.cpp

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,14 @@ bool output(const Neutrals &neutrals,
8787

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

90-
if (time.check_time_gate(input.get_dt_output(iOutput))) {
90+
// make sure the output dt is set correctly. Otherwise these errors aren't caught correctly.
91+
precision_t dt_output = input.get_dt_output(iOutput);
92+
if (dt_output == 0.0){
93+
report.exit(function);
94+
return false;
95+
}
96+
97+
if (time.check_time_gate(dt_output)) {
9198

9299
// ------------------------------------------------------------
93100
// Store time in all of the files:
@@ -244,7 +251,7 @@ bool output(const Neutrals &neutrals,
244251
grid.radius_scgc);
245252
}
246253

247-
if (type_output == "bfield") {
254+
if (type_output == "bfield" || type_output == "ions") {
248255
AllOutputContainers[iOutput].store_variable("mlat",
249256
"Magnetic Latitude",
250257
"degrees",

0 commit comments

Comments
 (0)