From 7cefb150674c47c40f912df60af59b6714255d99 Mon Sep 17 00:00:00 2001 From: sjanzou Date: Fri, 3 Dec 2021 05:07:47 -0700 Subject: [PATCH] Host developer update for SAM issue 835 --- ssc/cmod_host_developer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ssc/cmod_host_developer.cpp b/ssc/cmod_host_developer.cpp index 5fa7b12a7..a1edbd6c1 100644 --- a/ssc/cmod_host_developer.cpp +++ b/ssc/cmod_host_developer.cpp @@ -2755,8 +2755,8 @@ class cm_host_developer : public compute_module for (size_t d = 1; d <= util::days_in_month(int(m - 1)); d++) { for (size_t h = 0; h < 24; h++) { //monthly iteration for each year for (size_t n = 0; n < n_steps_per_hour; n++) { - monthly_e_fromgrid[m] += year1_hourly_e_from_grid[util::hour_of_year(m, d, h) * n_steps_per_hour + n]; - monthly_gen_purchases[(a - 1) * 12 + m] += -gen_purchases[n_steps_per_hour * util::hour_of_year(m, d, h) + n]; + monthly_e_fromgrid[m-1] += year1_hourly_e_from_grid[util::hour_of_year(m, d, h) * n_steps_per_hour + n]; + monthly_gen_purchases[(a - 1) * 12 + m-1] += -gen_purchases[n_steps_per_hour * util::hour_of_year(m, d, h) + n]; if (year1_hourly_e_from_grid[h] != 0.0) { cf.at(CF_parasitic_cost, a) += -gen_purchases[n_steps_per_hour * util::hour_of_year(m, d, h) + n] * cf.at(CF_degradation, a) / year1_hourly_e_from_grid[h] * (year1_hourly_ec[h * n_steps_per_hour + n] + year1_hourly_dc[h * n_steps_per_hour + n]) * cf.at(CF_util_escal_rate, a); //use the electricity rate data by year (also trueup) //* charged_grid[a] / charged_grid[1] * cf.at(CF_util_escal_rate, a); }