Skip to content

Commit

Permalink
Fix transpiration regions
Browse files Browse the repository at this point in the history
- rSW_CTL_obtain_inputs() now calls onSet_SW_SOILS() before onSet_SW_SIT_transp() -- this change was needed because onSet_SW_SIT_transp() requires soil depth information that is only available after it was obtained by onSet_SW_SOILS()

- see SOILWAT2 commit "Input specification of transpiration regions changed from layers to soil depth" (DrylandEcology/SOILWAT2@8c6432f)
  • Loading branch information
dschlaep committed Jan 10, 2025
1 parent 3c2e755 commit 85056a6
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions src/rSW_Control.c
Original file line number Diff line number Diff line change
Expand Up @@ -136,28 +136,28 @@ void rSW_CTL_obtain_inputs(Bool from_files, SEXP InputData, SEXP weatherList, LO
return; // Exit function prematurely due to error
}

onSet_SW_SIT_transp(GET_SLOT(InputData, install("site")), LogInfo);
onSet_SW_SOILS(GET_SLOT(InputData, install("soils")), LogInfo);
#ifdef RSWDEBUG
if (debug) sw_printf(" > 'swrc/ptf-type'");
if (debug) sw_printf(" > 'soils' + 'swrc parameters'");
#endif
if (LogInfo->stopRun) {
return; // Exit function prematurely due to error
}

if (isNull(weatherList)) {
weatherList = GET_SLOT(InputData, install("weatherHistory"));
}
onSet_WTH_DATA(weatherList, LogInfo);
onSet_SW_SIT_transp(GET_SLOT(InputData, install("site")), LogInfo);
#ifdef RSWDEBUG
if (debug) sw_printf(" > 'weather-history'");
if (debug) sw_printf(" > 'tr-regions'");
#endif
if (LogInfo->stopRun) {
return; // Exit function prematurely due to error
}

onSet_SW_SOILS(GET_SLOT(InputData, install("soils")), LogInfo);
if (isNull(weatherList)) {
weatherList = GET_SLOT(InputData, install("weatherHistory"));
}
onSet_WTH_DATA(weatherList, LogInfo);
#ifdef RSWDEBUG
if (debug) sw_printf(" > 'soils' + 'swrc parameters'");
if (debug) sw_printf(" > 'weather-history'");
#endif
if (LogInfo->stopRun) {
return; // Exit function prematurely due to error
Expand Down

0 comments on commit 85056a6

Please sign in to comment.