Skip to content

Commit

Permalink
Fixed STEPWAT-side output
Browse files Browse the repository at this point in the history
- Changed order of surface temperatures to max | min | avg
- Fixed incorrect indices for soil layer temperatures
  • Loading branch information
Nicholas Persley committed Jun 11, 2022
1 parent b45bb69 commit 3098eac
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions SW_Output_get_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -491,9 +491,9 @@ void get_temp_agg(OutPeriod pd)
do_running_agg(p, psd, iOUT(0, pd), Globals->currIter, vo->temp_max);
do_running_agg(p, psd, iOUT(1, pd), Globals->currIter, vo->temp_min);
do_running_agg(p, psd, iOUT(2, pd), Globals->currIter, vo->temp_avg);
do_running_agg(p, psd, iOUT(3, pd), Globals->currIter, vo->surfaceAvg);
do_running_agg(p, psd, iOUT(4, pd), Globals->currIter, vo->surfaceMax);
do_running_agg(p, psd, iOUT(5, pd), Globals->currIter, vo->surfaceMin);
do_running_agg(p, psd, iOUT(3, pd), Globals->currIter, vo->surfaceMax);
do_running_agg(p, psd, iOUT(4, pd), Globals->currIter, vo->surfaceMin);
do_running_agg(p, psd, iOUT(5, pd), Globals->currIter, vo->surfaceAvg);

if (print_IterationSummary) {
sw_outstr_agg[0] = '\0';
Expand Down Expand Up @@ -2441,19 +2441,18 @@ void get_soiltemp_agg(OutPeriod pd)
{
LyrIndex i;
SW_SOILWAT_OUTPUTS *vo = SW_Soilwat.p_oagg[pd];
int nlyrs = SW_Site.n_layers, doubleOffset = 2 * nlyrs;

RealD
*p = p_OUT[eSW_SoilTemp][pd],
*psd = p_OUTsd[eSW_SoilTemp][pd];

ForEachSoilLayer(i)
{
do_running_agg(p, psd, iOUT(i, pd), Globals->currIter, vo->maxLyrTemperature[i]);
do_running_agg(p, psd, iOUT(i + nlyrs, pd), Globals->currIter, vo->minLyrTemperature[i]);
do_running_agg(p, psd, iOUT(i + doubleOffset, pd), Globals->currIter, vo->avgLyrTemp[i]);
}

ForEachSoilLayer(i)
{
do_running_agg(p, psd, iOUT((i * 3), pd), Globals->currIter, vo->maxLyrTemperature[i]);
do_running_agg(p, psd, iOUT((i * 3) + 1, pd), Globals->currIter, vo->minLyrTemperature[i]);
do_running_agg(p, psd, iOUT((i * 3) + 2, pd), Globals->currIter, vo->avgLyrTemp[i]);
}
if (print_IterationSummary) {
sw_outstr_agg[0] = '\0';
format_IterationSummary(p, psd, pd, ncol_OUT[eSW_SoilTemp]);
Expand Down

0 comments on commit 3098eac

Please sign in to comment.