From 22ef72b59d3703298da808e070d862c81efa5209 Mon Sep 17 00:00:00 2001 From: Aaron Bukowski Date: Tue, 7 Jan 2025 15:41:53 -0500 Subject: [PATCH 1/5] BUG: Centripetal acceleration is checked, but not included in input files. This seems redundant, since "Centripetal" is also checked, but this prevents the error... Mayber instead we should check just one or the other. --- share/run/UA/inputs/defaults.json | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/share/run/UA/inputs/defaults.json b/share/run/UA/inputs/defaults.json index e4735e1b..1f9c296a 100644 --- a/share/run/UA/inputs/defaults.json +++ b/share/run/UA/inputs/defaults.json @@ -101,7 +101,8 @@ "Sources" : { "Grid" : { "Centripetal" : true, - "Coriolis" : true }, + "Coriolis" : true, + "Cent_acc": true }, "Neutrals" : { "NO_cool" : false, "O_cool": false } }, From 194853b1536b70b99ff548dc5495078af0f87c45 Mon Sep 17 00:00:00 2001 From: Aaron Bukowski Date: Tue, 7 Jan 2025 15:54:52 -0500 Subject: [PATCH 2/5] BUG: If outputting from main fails, note that it's the "initial" output --- src/main/main.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/main.cpp b/src/main/main.cpp index aa5f465a..f8395890 100644 --- a/src/main/main.cpp +++ b/src/main/main.cpp @@ -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 From d1137eee63de4f71e1d56e4f1aa6c4b39435c834 Mon Sep 17 00:00:00 2001 From: Aaron Bukowski Date: Tue, 7 Jan 2025 15:56:23 -0500 Subject: [PATCH 3/5] BUG: Check output "dt" separately from "type", allows us to make sure each type has a dt > Otherwise, there are out-of-range json errors with mo more info. --- src/inputs.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/inputs.cpp b/src/inputs.cpp index f5fa1065..50981d04 100644 --- a/src/inputs.cpp +++ b/src/inputs.cpp @@ -547,10 +547,13 @@ std::vector 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; } From cfdabb07f3e45795ea09408777339074bc759caf Mon Sep 17 00:00:00 2001 From: Aaron Bukowski Date: Tue, 7 Jan 2025 15:57:08 -0500 Subject: [PATCH 4/5] FEAT: Check if dt was specified for each output type (better error handling) --- src/output.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/output.cpp b/src/output.cpp index 2c0e58f6..db9a77b6 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -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: From 58c1f4e20b20b1a287b43a3bacfadaaadf615dd6 Mon Sep 17 00:00:00 2001 From: Aaron Bukowski Date: Tue, 7 Jan 2025 15:57:59 -0500 Subject: [PATCH 5/5] FEAT: if "ion" output type is specified, output magnetic coordinates > I really wanted to get these out. That's why I did all those previous commits. --- src/output.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/output.cpp b/src/output.cpp index db9a77b6..2a16a8c0 100644 --- a/src/output.cpp +++ b/src/output.cpp @@ -251,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",