Skip to content

Commit

Permalink
Merge pull request #401 from DrylandEcology/feature_v800_for_rSOILWAT2
Browse files Browse the repository at this point in the history
Finalize v800 updates to work with rSOILWAT2
  • Loading branch information
dschlaep authored May 7, 2024
2 parents 3d349b9 + 536c91a commit 6467716
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 13 deletions.
2 changes: 0 additions & 2 deletions include/SW_Output_outarray.h
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ extern "C" {
#if defined(SWNETCDF)
#undef iOUT
#undef iOUT2
#else
#undef iOUTnc
#endif


Expand Down
19 changes: 17 additions & 2 deletions src/SW_Control.c
Original file line number Diff line number Diff line change
Expand Up @@ -657,6 +657,17 @@ void SW_CTL_run_spinup(SW_ALL* sw, LOG_INFO* LogInfo) {
int debug = 0;
#endif

#ifdef SWDEBUG
if (debug) {
swprintf(
"'SW_CTL_run_spinup': "
"mode = %d, duration = %d (# years), "
"scope = %d [# calendar years out of %d-%d]\n",
mode, duration, scope, sw->Model.startyr, finalyr
);
}
#endif

switch ( mode ) {
case 2:
// initialize structured array
Expand Down Expand Up @@ -705,7 +716,11 @@ void SW_CTL_run_spinup(SW_ALL* sw, LOG_INFO* LogInfo) {
*cur_yr = years[ yrIdx ];

#ifdef SWDEBUG
if (debug) swprintf("\n'SW_CTL_run_spinup': simulate year = %d\n", *cur_yr);
if (debug) {
swprintf(
"'SW_CTL_run_spinup': simulate year = %d | %d\n", yrIdx + 1, *cur_yr
);
}
#endif

SW_CTL_run_current_year(sw, NULL, LogInfo);
Expand Down Expand Up @@ -914,7 +929,7 @@ void SW_CTL_run_sw(SW_ALL* sw_template, SW_DOMAIN* SW_Domain, unsigned long ncSu

SW_CTL_main(&local_sw, SW_OutputPtrs, LogInfo);
if(LogInfo->stopRun) {
return; // Exit function prematurely due to error
goto freeMem; // Free memory and exit function prematurely due to error
}

#if defined(SWNETCDF)
Expand Down
9 changes: 0 additions & 9 deletions src/SW_Output_get_functions.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,6 @@

#include "include/SW_Output.h"

#ifdef RSOILWAT
#include <R.h>
#include <Rdefines.h>
#include <Rinternals.h>
#endif

#ifdef STEPWAT
#include <math.h>
#endif

#if defined(SWNETCDF)
#include <netcdf.h> // defines NC_FILL_DOUBLE
Expand Down

0 comments on commit 6467716

Please sign in to comment.