From d8c326565169568e148e2199a900174c79feb8c5 Mon Sep 17 00:00:00 2001 From: Kyle Klenk <kyle.c.klenk@gmail.com> Date: Thu, 18 Aug 2022 20:35:16 +0000 Subject: [PATCH] made new location for var_lookup structure definition --- build/includes/global/global.hpp | 1 + build/includes/global/var_lookup.hpp | 18 ++++++++++++++++++ build/source/actors/global/global.cpp | 18 ------------------ build/source/actors/job_actor/job_actor.cpp | 5 ++--- 4 files changed, 21 insertions(+), 21 deletions(-) create mode 100644 build/includes/global/var_lookup.hpp diff --git a/build/includes/global/global.hpp b/build/includes/global/global.hpp index 69b695b..3d2914c 100644 --- a/build/includes/global/global.hpp +++ b/build/includes/global/global.hpp @@ -21,6 +21,7 @@ int getSettingsTest(std::vector<std::string> keys, T return_value) { return 0; } + /** * Return the time between to time points */ diff --git a/build/includes/global/var_lookup.hpp b/build/includes/global/var_lookup.hpp new file mode 100644 index 0000000..e7dfc23 --- /dev/null +++ b/build/includes/global/var_lookup.hpp @@ -0,0 +1,18 @@ +#pragma once + +struct iLookVarType { + // These values should be one index less than the Fortran structure + // This is so they align with C++ vectors that start at 0 + int scalarv = -9999; + int wLength = -9999; + int midSnow = -9999; + int midSoil = -9999; + int midToto = -9999; + int ifcSnow = -9999; + int ifcSoil = -9999; + int ifcToto = -9999; + int parSoil = -9999; + int routing = -9999; + int outstat = -9999; + int unknown = -9999; +}; \ No newline at end of file diff --git a/build/source/actors/global/global.cpp b/build/source/actors/global/global.cpp index c906fd5..0ef6989 100644 --- a/build/source/actors/global/global.cpp +++ b/build/source/actors/global/global.cpp @@ -1,24 +1,6 @@ #include "global.hpp" #include <chrono> -struct iLookVarType { - // These values should be one index less than the Fortran structure - // This is so they align with C++ vectors that start at 0 - int scalarv = -9999; - int wLength = -9999; - int midSnow = -9999; - int midSoil = -9999; - int midToto = -9999; - int ifcSnow = -9999; - int ifcSoil = -9999; - int ifcToto = -9999; - int parSoil = -9999; - int routing = -9999; - int outstat = -9999; - int unknown = -9999; -}; - - double calculateTime(std::chrono::time_point<std::chrono::system_clock> start, diff --git a/build/source/actors/job_actor/job_actor.cpp b/build/source/actors/job_actor/job_actor.cpp index 1c0924a..11e5b6d 100644 --- a/build/source/actors/job_actor/job_actor.cpp +++ b/build/source/actors/job_actor/job_actor.cpp @@ -42,7 +42,6 @@ behavior job_actor(stateful_actor<job_state>* self, int start_gru, int num_gru, self->quit(); return {}; // Failure } - self->state.output_csv = getSettings(self->state.config_path, "JobActor", "outputCSV", self->state.output_csv).value_or(false); if (self->state.output_csv) { @@ -89,10 +88,10 @@ behavior job_actor(stateful_actor<job_state>* self, int start_gru, int num_gru, return {}; // Failure } + initCsvOutputFile(self); - - initCsvOutputFile(self); + // Spawn the file_access_actor. This will return the number of forcing files we are working with self->state.file_access_actor = self->spawn(file_access_actor, self->state.start_gru, self->state.num_gru, -- GitLab