// Generated by using Rcpp::compileAttributes() -> do not edit by hand
// Generator token: 10BE3573-1514-4C36-9D1C-5A225CD40393

#ifndef RCPP_medfate_RCPPEXPORTS_H_GEN_
#define RCPP_medfate_RCPPEXPORTS_H_GEN_

#include <RcppArmadillo.h>
#include <Rcpp.h>

namespace medfate {

    using namespace Rcpp;

    namespace {
        void validateSignature(const char* sig) {
            Rcpp::Function require = Rcpp::Environment::base_env()["require"];
            require("medfate", Rcpp::Named("quietly") = true);
            typedef int(*Ptr_validate)(const char*);
            static Ptr_validate p_validate = (Ptr_validate)
                R_GetCCallable("medfate", "_medfate_RcppExport_validate");
            if (!p_validate(sig)) {
                throw Rcpp::function_not_exported(
                    "C++ function with signature '" + std::string(sig) + "' not found in medfate");
            }
        }
    }

    inline List _nswbInput(String land_cover_type, double snowpack = 0.0) {
        typedef SEXP(*Ptr__nswbInput)(SEXP,SEXP);
        static Ptr__nswbInput p__nswbInput = NULL;
        if (p__nswbInput == NULL) {
            validateSignature("List(*_nswbInput)(String,double)");
            p__nswbInput = (Ptr__nswbInput)R_GetCCallable("medfate", "_medfate__nswbInput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__nswbInput(Shield<SEXP>(Rcpp::wrap(land_cover_type)), Shield<SEXP>(Rcpp::wrap(snowpack)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List aspwbInput(double crop_factor, List control, DataFrame soil) {
        typedef SEXP(*Ptr_aspwbInput)(SEXP,SEXP,SEXP);
        static Ptr_aspwbInput p_aspwbInput = NULL;
        if (p_aspwbInput == NULL) {
            validateSignature("List(*aspwbInput)(double,List,DataFrame)");
            p_aspwbInput = (Ptr_aspwbInput)R_GetCCallable("medfate", "_medfate_aspwbInput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_aspwbInput(Shield<SEXP>(Rcpp::wrap(crop_factor)), Shield<SEXP>(Rcpp::wrap(control)), Shield<SEXP>(Rcpp::wrap(soil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List _defineASPWBDailyOutput(double latitude, double elevation, double slope, double aspect, CharacterVector dateStrings, List x) {
        typedef SEXP(*Ptr__defineASPWBDailyOutput)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__defineASPWBDailyOutput p__defineASPWBDailyOutput = NULL;
        if (p__defineASPWBDailyOutput == NULL) {
            validateSignature("List(*_defineASPWBDailyOutput)(double,double,double,double,CharacterVector,List)");
            p__defineASPWBDailyOutput = (Ptr__defineASPWBDailyOutput)R_GetCCallable("medfate", "_medfate__defineASPWBDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__defineASPWBDailyOutput(Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(dateStrings)), Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline void _fillASPWBDailyOutput(List l, List x, List sDay, int iday) {
        typedef SEXP(*Ptr__fillASPWBDailyOutput)(SEXP,SEXP,SEXP,SEXP);
        static Ptr__fillASPWBDailyOutput p__fillASPWBDailyOutput = NULL;
        if (p__fillASPWBDailyOutput == NULL) {
            validateSignature("void(*_fillASPWBDailyOutput)(List,List,List,int)");
            p__fillASPWBDailyOutput = (Ptr__fillASPWBDailyOutput)R_GetCCallable("medfate", "_medfate__fillASPWBDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__fillASPWBDailyOutput(Shield<SEXP>(Rcpp::wrap(l)), Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(sDay)), Shield<SEXP>(Rcpp::wrap(iday)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
    }

    inline List aspwb(List x, DataFrame meteo, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, double waterTableDepth = NA_REAL) {
        typedef SEXP(*Ptr_aspwb)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_aspwb p_aspwb = NULL;
        if (p_aspwb == NULL) {
            validateSignature("List(*aspwb)(List,DataFrame,double,double,double,double,double)");
            p_aspwb = (Ptr_aspwb)R_GetCCallable("medfate", "_medfate_aspwb");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_aspwb(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(meteo)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List _copy_model_output(List internalCommunication, List x, String model) {
        typedef SEXP(*Ptr__copy_model_output)(SEXP,SEXP,SEXP);
        static Ptr__copy_model_output p__copy_model_output = NULL;
        if (p__copy_model_output == NULL) {
            validateSignature("List(*_copy_model_output)(List,List,String)");
            p__copy_model_output = (Ptr__copy_model_output)R_GetCCallable("medfate", "_medfate__copy_model_output");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__copy_model_output(Shield<SEXP>(Rcpp::wrap(internalCommunication)), Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List _defineGrowthDailyOutput(double latitude, double elevation, double slope, double aspect, CharacterVector dateStrings, List x) {
        typedef SEXP(*Ptr__defineGrowthDailyOutput)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__defineGrowthDailyOutput p__defineGrowthDailyOutput = NULL;
        if (p__defineGrowthDailyOutput == NULL) {
            validateSignature("List(*_defineGrowthDailyOutput)(double,double,double,double,CharacterVector,List)");
            p__defineGrowthDailyOutput = (Ptr__defineGrowthDailyOutput)R_GetCCallable("medfate", "_medfate__defineGrowthDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__defineGrowthDailyOutput(Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(dateStrings)), Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline void _fillGrowthDailyOutput(List l, List x, List sDay, int iday) {
        typedef SEXP(*Ptr__fillGrowthDailyOutput)(SEXP,SEXP,SEXP,SEXP);
        static Ptr__fillGrowthDailyOutput p__fillGrowthDailyOutput = NULL;
        if (p__fillGrowthDailyOutput == NULL) {
            validateSignature("void(*_fillGrowthDailyOutput)(List,List,List,int)");
            p__fillGrowthDailyOutput = (Ptr__fillGrowthDailyOutput)R_GetCCallable("medfate", "_medfate__fillGrowthDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__fillGrowthDailyOutput(Shield<SEXP>(Rcpp::wrap(l)), Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(sDay)), Shield<SEXP>(Rcpp::wrap(iday)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
    }

    inline List growth(List x, DataFrame meteo, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, NumericVector CO2ByYear = NumericVector(0), double waterTableDepth = NA_REAL) {
        typedef SEXP(*Ptr_growth)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_growth p_growth = NULL;
        if (p_growth == NULL) {
            validateSignature("List(*growth)(List,DataFrame,double,double,double,double,NumericVector,double)");
            p_growth = (Ptr_growth)R_GetCCallable("medfate", "_medfate_growth");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_growth(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(meteo)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(CO2ByYear)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List growth_day(List x, CharacterVector date, NumericVector meteovec, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, double runon = 0.0, Nullable<NumericVector> lateralFlows = R_NilValue, double waterTableDepth = NA_REAL, bool modifyInput = true) {
        typedef SEXP(*Ptr_growth_day)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_growth_day p_growth_day = NULL;
        if (p_growth_day == NULL) {
            validateSignature("List(*growth_day)(List,CharacterVector,NumericVector,double,double,double,double,double,Nullable<NumericVector>,double,bool)");
            p_growth_day = (Ptr_growth_day)R_GetCCallable("medfate", "_medfate_growth_day");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_growth_day(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(date)), Shield<SEXP>(Rcpp::wrap(meteovec)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(runon)), Shield<SEXP>(Rcpp::wrap(lateralFlows)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)), Shield<SEXP>(Rcpp::wrap(modifyInput)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline double hydrology_rainfallIntensity(int month, double prec, NumericVector rainfallIntensityPerMonth) {
        typedef SEXP(*Ptr_hydrology_rainfallIntensity)(SEXP,SEXP,SEXP);
        static Ptr_hydrology_rainfallIntensity p_hydrology_rainfallIntensity = NULL;
        if (p_hydrology_rainfallIntensity == NULL) {
            validateSignature("double(*hydrology_rainfallIntensity)(int,double,NumericVector)");
            p_hydrology_rainfallIntensity = (Ptr_hydrology_rainfallIntensity)R_GetCCallable("medfate", "_medfate_hydrology_rainfallIntensity");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_rainfallIntensity(Shield<SEXP>(Rcpp::wrap(month)), Shield<SEXP>(Rcpp::wrap(prec)), Shield<SEXP>(Rcpp::wrap(rainfallIntensityPerMonth)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double hydrology_soilEvaporation(DataFrame soil, double snowpack, String soilFunctions, double pet, double LgroundSWR, bool modifySoil = true) {
        typedef SEXP(*Ptr_hydrology_soilEvaporation)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_soilEvaporation p_hydrology_soilEvaporation = NULL;
        if (p_hydrology_soilEvaporation == NULL) {
            validateSignature("double(*hydrology_soilEvaporation)(DataFrame,double,String,double,double,bool)");
            p_hydrology_soilEvaporation = (Ptr_hydrology_soilEvaporation)R_GetCCallable("medfate", "_medfate_hydrology_soilEvaporation");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_soilEvaporation(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(snowpack)), Shield<SEXP>(Rcpp::wrap(soilFunctions)), Shield<SEXP>(Rcpp::wrap(pet)), Shield<SEXP>(Rcpp::wrap(LgroundSWR)), Shield<SEXP>(Rcpp::wrap(modifySoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector hydrology_herbaceousTranspiration(double pet, double LherbSWR, double herbLAI, DataFrame soil, String soilFunctions, bool modifySoil = true) {
        typedef SEXP(*Ptr_hydrology_herbaceousTranspiration)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_herbaceousTranspiration p_hydrology_herbaceousTranspiration = NULL;
        if (p_hydrology_herbaceousTranspiration == NULL) {
            validateSignature("NumericVector(*hydrology_herbaceousTranspiration)(double,double,double,DataFrame,String,bool)");
            p_hydrology_herbaceousTranspiration = (Ptr_hydrology_herbaceousTranspiration)R_GetCCallable("medfate", "_medfate_hydrology_herbaceousTranspiration");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_herbaceousTranspiration(Shield<SEXP>(Rcpp::wrap(pet)), Shield<SEXP>(Rcpp::wrap(LherbSWR)), Shield<SEXP>(Rcpp::wrap(herbLAI)), Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(soilFunctions)), Shield<SEXP>(Rcpp::wrap(modifySoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector hydrology_infiltrationRepartition(double I, NumericVector widths, NumericVector macro, double a = -0.005, double b = 3.0) {
        typedef SEXP(*Ptr_hydrology_infiltrationRepartition)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_infiltrationRepartition p_hydrology_infiltrationRepartition = NULL;
        if (p_hydrology_infiltrationRepartition == NULL) {
            validateSignature("NumericVector(*hydrology_infiltrationRepartition)(double,NumericVector,NumericVector,double,double)");
            p_hydrology_infiltrationRepartition = (Ptr_hydrology_infiltrationRepartition)R_GetCCallable("medfate", "_medfate_hydrology_infiltrationRepartition");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_infiltrationRepartition(Shield<SEXP>(Rcpp::wrap(I)), Shield<SEXP>(Rcpp::wrap(widths)), Shield<SEXP>(Rcpp::wrap(macro)), Shield<SEXP>(Rcpp::wrap(a)), Shield<SEXP>(Rcpp::wrap(b)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double hydrology_infiltrationAmount(double rainfallInput, double rainfallIntensity, DataFrame soil, String soilFunctions, String model = "GreenAmpt1911", double K_correction = 1.0) {
        typedef SEXP(*Ptr_hydrology_infiltrationAmount)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_infiltrationAmount p_hydrology_infiltrationAmount = NULL;
        if (p_hydrology_infiltrationAmount == NULL) {
            validateSignature("double(*hydrology_infiltrationAmount)(double,double,DataFrame,String,String,double)");
            p_hydrology_infiltrationAmount = (Ptr_hydrology_infiltrationAmount)R_GetCCallable("medfate", "_medfate_hydrology_infiltrationAmount");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_infiltrationAmount(Shield<SEXP>(Rcpp::wrap(rainfallInput)), Shield<SEXP>(Rcpp::wrap(rainfallIntensity)), Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(soilFunctions)), Shield<SEXP>(Rcpp::wrap(model)), Shield<SEXP>(Rcpp::wrap(K_correction)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector hydrology_waterInputs(List x, double prec, double rainfallIntensity, double pet, double tday, double rad, double elevation, double Cm, double LgroundPAR, double LgroundSWR, bool modifyInput = true) {
        typedef SEXP(*Ptr_hydrology_waterInputs)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_waterInputs p_hydrology_waterInputs = NULL;
        if (p_hydrology_waterInputs == NULL) {
            validateSignature("NumericVector(*hydrology_waterInputs)(List,double,double,double,double,double,double,double,double,double,bool)");
            p_hydrology_waterInputs = (Ptr_hydrology_waterInputs)R_GetCCallable("medfate", "_medfate_hydrology_waterInputs");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_waterInputs(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(prec)), Shield<SEXP>(Rcpp::wrap(rainfallIntensity)), Shield<SEXP>(Rcpp::wrap(pet)), Shield<SEXP>(Rcpp::wrap(tday)), Shield<SEXP>(Rcpp::wrap(rad)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(Cm)), Shield<SEXP>(Rcpp::wrap(LgroundPAR)), Shield<SEXP>(Rcpp::wrap(LgroundSWR)), Shield<SEXP>(Rcpp::wrap(modifyInput)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector hydrology_agricultureWaterInputs(List x, double prec, double tday, double rad, double elevation, double LgroundSWR, bool modifyInput = true) {
        typedef SEXP(*Ptr_hydrology_agricultureWaterInputs)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_agricultureWaterInputs p_hydrology_agricultureWaterInputs = NULL;
        if (p_hydrology_agricultureWaterInputs == NULL) {
            validateSignature("NumericVector(*hydrology_agricultureWaterInputs)(List,double,double,double,double,double,bool)");
            p_hydrology_agricultureWaterInputs = (Ptr_hydrology_agricultureWaterInputs)R_GetCCallable("medfate", "_medfate_hydrology_agricultureWaterInputs");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_agricultureWaterInputs(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(prec)), Shield<SEXP>(Rcpp::wrap(tday)), Shield<SEXP>(Rcpp::wrap(rad)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(LgroundSWR)), Shield<SEXP>(Rcpp::wrap(modifyInput)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector hydrology_soilWaterBalance(DataFrame soil, String soilFunctions, double rainfallInput, double rainfallIntensity, double snowmelt, NumericVector sourceSink, double runon = 0.0, Nullable<NumericVector> lateralFlows = R_NilValue, double waterTableDepth = NA_REAL, String infiltrationMode = "GreenAmpt1911", double infiltrationCorrection = 5.0, String soilDomains = "buckets", int nsteps = 24, int max_nsubsteps = 3600, bool modifySoil = true) {
        typedef SEXP(*Ptr_hydrology_soilWaterBalance)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_soilWaterBalance p_hydrology_soilWaterBalance = NULL;
        if (p_hydrology_soilWaterBalance == NULL) {
            validateSignature("NumericVector(*hydrology_soilWaterBalance)(DataFrame,String,double,double,double,NumericVector,double,Nullable<NumericVector>,double,String,double,String,int,int,bool)");
            p_hydrology_soilWaterBalance = (Ptr_hydrology_soilWaterBalance)R_GetCCallable("medfate", "_medfate_hydrology_soilWaterBalance");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_soilWaterBalance(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(soilFunctions)), Shield<SEXP>(Rcpp::wrap(rainfallInput)), Shield<SEXP>(Rcpp::wrap(rainfallIntensity)), Shield<SEXP>(Rcpp::wrap(snowmelt)), Shield<SEXP>(Rcpp::wrap(sourceSink)), Shield<SEXP>(Rcpp::wrap(runon)), Shield<SEXP>(Rcpp::wrap(lateralFlows)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)), Shield<SEXP>(Rcpp::wrap(infiltrationMode)), Shield<SEXP>(Rcpp::wrap(infiltrationCorrection)), Shield<SEXP>(Rcpp::wrap(soilDomains)), Shield<SEXP>(Rcpp::wrap(nsteps)), Shield<SEXP>(Rcpp::wrap(max_nsubsteps)), Shield<SEXP>(Rcpp::wrap(modifySoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double hydrology_soilEvaporationAmount(double DEF, double PETs, double Gsoil) {
        typedef SEXP(*Ptr_hydrology_soilEvaporationAmount)(SEXP,SEXP,SEXP);
        static Ptr_hydrology_soilEvaporationAmount p_hydrology_soilEvaporationAmount = NULL;
        if (p_hydrology_soilEvaporationAmount == NULL) {
            validateSignature("double(*hydrology_soilEvaporationAmount)(double,double,double)");
            p_hydrology_soilEvaporationAmount = (Ptr_hydrology_soilEvaporationAmount)R_GetCCallable("medfate", "_medfate_hydrology_soilEvaporationAmount");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_soilEvaporationAmount(Shield<SEXP>(Rcpp::wrap(DEF)), Shield<SEXP>(Rcpp::wrap(PETs)), Shield<SEXP>(Rcpp::wrap(Gsoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double _hydrology_interceptionGashDay(double Rainfall, double Cm, double p, double ER = 0.05) {
        typedef SEXP(*Ptr__hydrology_interceptionGashDay)(SEXP,SEXP,SEXP,SEXP);
        static Ptr__hydrology_interceptionGashDay p__hydrology_interceptionGashDay = NULL;
        if (p__hydrology_interceptionGashDay == NULL) {
            validateSignature("double(*_hydrology_interceptionGashDay)(double,double,double,double)");
            p__hydrology_interceptionGashDay = (Ptr__hydrology_interceptionGashDay)R_GetCCallable("medfate", "_medfate__hydrology_interceptionGashDay");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__hydrology_interceptionGashDay(Shield<SEXP>(Rcpp::wrap(Rainfall)), Shield<SEXP>(Rcpp::wrap(Cm)), Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(ER)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double _hydrology_interceptionLiuDay(double Rainfall, double Cm, double p, double ER = 0.05) {
        typedef SEXP(*Ptr__hydrology_interceptionLiuDay)(SEXP,SEXP,SEXP,SEXP);
        static Ptr__hydrology_interceptionLiuDay p__hydrology_interceptionLiuDay = NULL;
        if (p__hydrology_interceptionLiuDay == NULL) {
            validateSignature("double(*_hydrology_interceptionLiuDay)(double,double,double,double)");
            p__hydrology_interceptionLiuDay = (Ptr__hydrology_interceptionLiuDay)R_GetCCallable("medfate", "_medfate__hydrology_interceptionLiuDay");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__hydrology_interceptionLiuDay(Shield<SEXP>(Rcpp::wrap(Rainfall)), Shield<SEXP>(Rcpp::wrap(Cm)), Shield<SEXP>(Rcpp::wrap(p)), Shield<SEXP>(Rcpp::wrap(ER)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double hydrology_infiltrationBoughton(double input, double Ssoil) {
        typedef SEXP(*Ptr_hydrology_infiltrationBoughton)(SEXP,SEXP);
        static Ptr_hydrology_infiltrationBoughton p_hydrology_infiltrationBoughton = NULL;
        if (p_hydrology_infiltrationBoughton == NULL) {
            validateSignature("double(*hydrology_infiltrationBoughton)(double,double)");
            p_hydrology_infiltrationBoughton = (Ptr_hydrology_infiltrationBoughton)R_GetCCallable("medfate", "_medfate_hydrology_infiltrationBoughton");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_infiltrationBoughton(Shield<SEXP>(Rcpp::wrap(input)), Shield<SEXP>(Rcpp::wrap(Ssoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double hydrology_infiltrationGreenAmpt(double t, double psi_w, double Ksat, double theta_sat, double theta_dry) {
        typedef SEXP(*Ptr_hydrology_infiltrationGreenAmpt)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_infiltrationGreenAmpt p_hydrology_infiltrationGreenAmpt = NULL;
        if (p_hydrology_infiltrationGreenAmpt == NULL) {
            validateSignature("double(*hydrology_infiltrationGreenAmpt)(double,double,double,double,double)");
            p_hydrology_infiltrationGreenAmpt = (Ptr_hydrology_infiltrationGreenAmpt)R_GetCCallable("medfate", "_medfate_hydrology_infiltrationGreenAmpt");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_infiltrationGreenAmpt(Shield<SEXP>(Rcpp::wrap(t)), Shield<SEXP>(Rcpp::wrap(psi_w)), Shield<SEXP>(Rcpp::wrap(Ksat)), Shield<SEXP>(Rcpp::wrap(theta_sat)), Shield<SEXP>(Rcpp::wrap(theta_dry)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline double hydrology_snowMelt(double tday, double rad, double LgroundSWR, double elevation) {
        typedef SEXP(*Ptr_hydrology_snowMelt)(SEXP,SEXP,SEXP,SEXP);
        static Ptr_hydrology_snowMelt p_hydrology_snowMelt = NULL;
        if (p_hydrology_snowMelt == NULL) {
            validateSignature("double(*hydrology_snowMelt)(double,double,double,double)");
            p_hydrology_snowMelt = (Ptr_hydrology_snowMelt)R_GetCCallable("medfate", "_medfate_hydrology_snowMelt");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_hydrology_snowMelt(Shield<SEXP>(Rcpp::wrap(tday)), Shield<SEXP>(Rcpp::wrap(rad)), Shield<SEXP>(Rcpp::wrap(LgroundSWR)), Shield<SEXP>(Rcpp::wrap(elevation)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline String soil_USDAType(double clay, double sand) {
        typedef SEXP(*Ptr_soil_USDAType)(SEXP,SEXP);
        static Ptr_soil_USDAType p_soil_USDAType = NULL;
        if (p_soil_USDAType == NULL) {
            validateSignature("String(*soil_USDAType)(double,double)");
            p_soil_USDAType = (Ptr_soil_USDAType)R_GetCCallable("medfate", "_medfate_soil_USDAType");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_USDAType(Shield<SEXP>(Rcpp::wrap(clay)), Shield<SEXP>(Rcpp::wrap(sand)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<String >(rcpp_result_gen);
    }

    inline NumericVector soil_thetaFC(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_thetaFC)(SEXP,SEXP);
        static Ptr_soil_thetaFC p_soil_thetaFC = NULL;
        if (p_soil_thetaFC == NULL) {
            validateSignature("NumericVector(*soil_thetaFC)(DataFrame,String)");
            p_soil_thetaFC = (Ptr_soil_thetaFC)R_GetCCallable("medfate", "_medfate_soil_thetaFC");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_thetaFC(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_thetaWP(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_thetaWP)(SEXP,SEXP);
        static Ptr_soil_thetaWP p_soil_thetaWP = NULL;
        if (p_soil_thetaWP == NULL) {
            validateSignature("NumericVector(*soil_thetaWP)(DataFrame,String)");
            p_soil_thetaWP = (Ptr_soil_thetaWP)R_GetCCallable("medfate", "_medfate_soil_thetaWP");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_thetaWP(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_thetaSAT(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_thetaSAT)(SEXP,SEXP);
        static Ptr_soil_thetaSAT p_soil_thetaSAT = NULL;
        if (p_soil_thetaSAT == NULL) {
            validateSignature("NumericVector(*soil_thetaSAT)(DataFrame,String)");
            p_soil_thetaSAT = (Ptr_soil_thetaSAT)R_GetCCallable("medfate", "_medfate_soil_thetaSAT");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_thetaSAT(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_waterFC(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_waterFC)(SEXP,SEXP);
        static Ptr_soil_waterFC p_soil_waterFC = NULL;
        if (p_soil_waterFC == NULL) {
            validateSignature("NumericVector(*soil_waterFC)(DataFrame,String)");
            p_soil_waterFC = (Ptr_soil_waterFC)R_GetCCallable("medfate", "_medfate_soil_waterFC");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_waterFC(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_waterSAT(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_waterSAT)(SEXP,SEXP);
        static Ptr_soil_waterSAT p_soil_waterSAT = NULL;
        if (p_soil_waterSAT == NULL) {
            validateSignature("NumericVector(*soil_waterSAT)(DataFrame,String)");
            p_soil_waterSAT = (Ptr_soil_waterSAT)R_GetCCallable("medfate", "_medfate_soil_waterSAT");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_waterSAT(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_waterWP(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_waterWP)(SEXP,SEXP);
        static Ptr_soil_waterWP p_soil_waterWP = NULL;
        if (p_soil_waterWP == NULL) {
            validateSignature("NumericVector(*soil_waterWP)(DataFrame,String)");
            p_soil_waterWP = (Ptr_soil_waterWP)R_GetCCallable("medfate", "_medfate_soil_waterWP");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_waterWP(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_waterPsi(DataFrame soil, double psi, String model = "SX") {
        typedef SEXP(*Ptr_soil_waterPsi)(SEXP,SEXP,SEXP);
        static Ptr_soil_waterPsi p_soil_waterPsi = NULL;
        if (p_soil_waterPsi == NULL) {
            validateSignature("NumericVector(*soil_waterPsi)(DataFrame,double,String)");
            p_soil_waterPsi = (Ptr_soil_waterPsi)R_GetCCallable("medfate", "_medfate_soil_waterPsi");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_waterPsi(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(psi)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_waterExtractable(DataFrame soil, String model = "SX", double minPsi = -5.0) {
        typedef SEXP(*Ptr_soil_waterExtractable)(SEXP,SEXP,SEXP);
        static Ptr_soil_waterExtractable p_soil_waterExtractable = NULL;
        if (p_soil_waterExtractable == NULL) {
            validateSignature("NumericVector(*soil_waterExtractable)(DataFrame,String,double)");
            p_soil_waterExtractable = (Ptr_soil_waterExtractable)R_GetCCallable("medfate", "_medfate_soil_waterExtractable");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_waterExtractable(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)), Shield<SEXP>(Rcpp::wrap(minPsi)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_theta(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_theta)(SEXP,SEXP);
        static Ptr_soil_theta p_soil_theta = NULL;
        if (p_soil_theta == NULL) {
            validateSignature("NumericVector(*soil_theta)(DataFrame,String)");
            p_soil_theta = (Ptr_soil_theta)R_GetCCallable("medfate", "_medfate_soil_theta");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_theta(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_water(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_water)(SEXP,SEXP);
        static Ptr_soil_water p_soil_water = NULL;
        if (p_soil_water == NULL) {
            validateSignature("NumericVector(*soil_water)(DataFrame,String)");
            p_soil_water = (Ptr_soil_water)R_GetCCallable("medfate", "_medfate_soil_water");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_water(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double soil_rockWeight2Volume(double pWeight, double bulkDensity, double rockDensity = 2.3) {
        typedef SEXP(*Ptr_soil_rockWeight2Volume)(SEXP,SEXP,SEXP);
        static Ptr_soil_rockWeight2Volume p_soil_rockWeight2Volume = NULL;
        if (p_soil_rockWeight2Volume == NULL) {
            validateSignature("double(*soil_rockWeight2Volume)(double,double,double)");
            p_soil_rockWeight2Volume = (Ptr_soil_rockWeight2Volume)R_GetCCallable("medfate", "_medfate_soil_rockWeight2Volume");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_rockWeight2Volume(Shield<SEXP>(Rcpp::wrap(pWeight)), Shield<SEXP>(Rcpp::wrap(bulkDensity)), Shield<SEXP>(Rcpp::wrap(rockDensity)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector soil_psi(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_psi)(SEXP,SEXP);
        static Ptr_soil_psi p_soil_psi = NULL;
        if (p_soil_psi == NULL) {
            validateSignature("NumericVector(*soil_psi)(DataFrame,String)");
            p_soil_psi = (Ptr_soil_psi)R_GetCCallable("medfate", "_medfate_soil_psi");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_psi(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_conductivity(DataFrame soil, String model = "SX", bool mmol = true) {
        typedef SEXP(*Ptr_soil_conductivity)(SEXP,SEXP,SEXP);
        static Ptr_soil_conductivity p_soil_conductivity = NULL;
        if (p_soil_conductivity == NULL) {
            validateSignature("NumericVector(*soil_conductivity)(DataFrame,String,bool)");
            p_soil_conductivity = (Ptr_soil_conductivity)R_GetCCallable("medfate", "_medfate_soil_conductivity");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_conductivity(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)), Shield<SEXP>(Rcpp::wrap(mmol)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_capacitance(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_capacitance)(SEXP,SEXP);
        static Ptr_soil_capacitance p_soil_capacitance = NULL;
        if (p_soil_capacitance == NULL) {
            validateSignature("NumericVector(*soil_capacitance)(DataFrame,String)");
            p_soil_capacitance = (Ptr_soil_capacitance)R_GetCCallable("medfate", "_medfate_soil_capacitance");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_capacitance(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline double soil_saturatedWaterDepth(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_saturatedWaterDepth)(SEXP,SEXP);
        static Ptr_soil_saturatedWaterDepth p_soil_saturatedWaterDepth = NULL;
        if (p_soil_saturatedWaterDepth == NULL) {
            validateSignature("double(*soil_saturatedWaterDepth)(DataFrame,String)");
            p_soil_saturatedWaterDepth = (Ptr_soil_saturatedWaterDepth)R_GetCCallable("medfate", "_medfate_soil_saturatedWaterDepth");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_saturatedWaterDepth(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<double >(rcpp_result_gen);
    }

    inline NumericVector soil_vanGenuchtenParamsCarsel(String soilType) {
        typedef SEXP(*Ptr_soil_vanGenuchtenParamsCarsel)(SEXP);
        static Ptr_soil_vanGenuchtenParamsCarsel p_soil_vanGenuchtenParamsCarsel = NULL;
        if (p_soil_vanGenuchtenParamsCarsel == NULL) {
            validateSignature("NumericVector(*soil_vanGenuchtenParamsCarsel)(String)");
            p_soil_vanGenuchtenParamsCarsel = (Ptr_soil_vanGenuchtenParamsCarsel)R_GetCCallable("medfate", "_medfate_soil_vanGenuchtenParamsCarsel");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_vanGenuchtenParamsCarsel(Shield<SEXP>(Rcpp::wrap(soilType)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_campbellParamsClappHornberger(String soilType) {
        typedef SEXP(*Ptr_soil_campbellParamsClappHornberger)(SEXP);
        static Ptr_soil_campbellParamsClappHornberger p_soil_campbellParamsClappHornberger = NULL;
        if (p_soil_campbellParamsClappHornberger == NULL) {
            validateSignature("NumericVector(*soil_campbellParamsClappHornberger)(String)");
            p_soil_campbellParamsClappHornberger = (Ptr_soil_campbellParamsClappHornberger)R_GetCCallable("medfate", "_medfate_soil_campbellParamsClappHornberger");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_campbellParamsClappHornberger(Shield<SEXP>(Rcpp::wrap(soilType)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_vanGenuchtenParamsToth(double clay, double sand, double om, double bd, bool topsoil) {
        typedef SEXP(*Ptr_soil_vanGenuchtenParamsToth)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_soil_vanGenuchtenParamsToth p_soil_vanGenuchtenParamsToth = NULL;
        if (p_soil_vanGenuchtenParamsToth == NULL) {
            validateSignature("NumericVector(*soil_vanGenuchtenParamsToth)(double,double,double,double,bool)");
            p_soil_vanGenuchtenParamsToth = (Ptr_soil_vanGenuchtenParamsToth)R_GetCCallable("medfate", "_medfate_soil_vanGenuchtenParamsToth");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_vanGenuchtenParamsToth(Shield<SEXP>(Rcpp::wrap(clay)), Shield<SEXP>(Rcpp::wrap(sand)), Shield<SEXP>(Rcpp::wrap(om)), Shield<SEXP>(Rcpp::wrap(bd)), Shield<SEXP>(Rcpp::wrap(topsoil)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline DataFrame soil(DataFrame x, String VG_PTF = "Toth") {
        typedef SEXP(*Ptr_soil)(SEXP,SEXP);
        static Ptr_soil p_soil = NULL;
        if (p_soil == NULL) {
            validateSignature("DataFrame(*soil)(DataFrame,String)");
            p_soil = (Ptr_soil)R_GetCCallable("medfate", "_medfate_soil");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(VG_PTF)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<DataFrame >(rcpp_result_gen);
    }

    inline void _modifySoilLayerParam(DataFrame soil, String paramName, int layer, double newValue, String VG_PTF = "Toth") {
        typedef SEXP(*Ptr__modifySoilLayerParam)(SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__modifySoilLayerParam p__modifySoilLayerParam = NULL;
        if (p__modifySoilLayerParam == NULL) {
            validateSignature("void(*_modifySoilLayerParam)(DataFrame,String,int,double,String)");
            p__modifySoilLayerParam = (Ptr__modifySoilLayerParam)R_GetCCallable("medfate", "_medfate__modifySoilLayerParam");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__modifySoilLayerParam(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(paramName)), Shield<SEXP>(Rcpp::wrap(layer)), Shield<SEXP>(Rcpp::wrap(newValue)), Shield<SEXP>(Rcpp::wrap(VG_PTF)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
    }

    inline NumericVector _testSoilDataFrameToStructure(DataFrame x, String model = "VG") {
        typedef SEXP(*Ptr__testSoilDataFrameToStructure)(SEXP,SEXP);
        static Ptr__testSoilDataFrameToStructure p__testSoilDataFrameToStructure = NULL;
        if (p__testSoilDataFrameToStructure == NULL) {
            validateSignature("NumericVector(*_testSoilDataFrameToStructure)(DataFrame,String)");
            p__testSoilDataFrameToStructure = (Ptr__testSoilDataFrameToStructure)R_GetCCallable("medfate", "_medfate__testSoilDataFrameToStructure");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__testSoilDataFrameToStructure(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_thermalCapacity(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_thermalCapacity)(SEXP,SEXP);
        static Ptr_soil_thermalCapacity p_soil_thermalCapacity = NULL;
        if (p_soil_thermalCapacity == NULL) {
            validateSignature("NumericVector(*soil_thermalCapacity)(DataFrame,String)");
            p_soil_thermalCapacity = (Ptr_soil_thermalCapacity)R_GetCCallable("medfate", "_medfate_soil_thermalCapacity");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_thermalCapacity(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_thermalConductivity(DataFrame soil, String model = "SX") {
        typedef SEXP(*Ptr_soil_thermalConductivity)(SEXP,SEXP);
        static Ptr_soil_thermalConductivity p_soil_thermalConductivity = NULL;
        if (p_soil_thermalConductivity == NULL) {
            validateSignature("NumericVector(*soil_thermalConductivity)(DataFrame,String)");
            p_soil_thermalConductivity = (Ptr_soil_thermalConductivity)R_GetCCallable("medfate", "_medfate_soil_thermalConductivity");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_thermalConductivity(Shield<SEXP>(Rcpp::wrap(soil)), Shield<SEXP>(Rcpp::wrap(model)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_temperatureGradient(NumericVector widths, NumericVector Temp) {
        typedef SEXP(*Ptr_soil_temperatureGradient)(SEXP,SEXP);
        static Ptr_soil_temperatureGradient p_soil_temperatureGradient = NULL;
        if (p_soil_temperatureGradient == NULL) {
            validateSignature("NumericVector(*soil_temperatureGradient)(NumericVector,NumericVector)");
            p_soil_temperatureGradient = (Ptr_soil_temperatureGradient)R_GetCCallable("medfate", "_medfate_soil_temperatureGradient");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_temperatureGradient(Shield<SEXP>(Rcpp::wrap(widths)), Shield<SEXP>(Rcpp::wrap(Temp)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline NumericVector soil_temperatureChange(NumericVector widths, NumericVector Temp, NumericVector sand, NumericVector clay, NumericVector W, NumericVector Theta_SAT, NumericVector Theta_FC, double Gdown, double tstep) {
        typedef SEXP(*Ptr_soil_temperatureChange)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_soil_temperatureChange p_soil_temperatureChange = NULL;
        if (p_soil_temperatureChange == NULL) {
            validateSignature("NumericVector(*soil_temperatureChange)(NumericVector,NumericVector,NumericVector,NumericVector,NumericVector,NumericVector,NumericVector,double,double)");
            p_soil_temperatureChange = (Ptr_soil_temperatureChange)R_GetCCallable("medfate", "_medfate_soil_temperatureChange");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_temperatureChange(Shield<SEXP>(Rcpp::wrap(widths)), Shield<SEXP>(Rcpp::wrap(Temp)), Shield<SEXP>(Rcpp::wrap(sand)), Shield<SEXP>(Rcpp::wrap(clay)), Shield<SEXP>(Rcpp::wrap(W)), Shield<SEXP>(Rcpp::wrap(Theta_SAT)), Shield<SEXP>(Rcpp::wrap(Theta_FC)), Shield<SEXP>(Rcpp::wrap(Gdown)), Shield<SEXP>(Rcpp::wrap(tstep)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<NumericVector >(rcpp_result_gen);
    }

    inline void soil_temperatureGradient(std::vector<double>& gradTemp, const std::vector<double>& widths, const std::vector<double>& Temp) {
        typedef SEXP(*Ptr_soil_temperatureGradient)(SEXP,SEXP,SEXP);
        static Ptr_soil_temperatureGradient p_soil_temperatureGradient = NULL;
        if (p_soil_temperatureGradient == NULL) {
            validateSignature("void(*soil_temperatureGradient)(std::vector<double>&,const std::vector<double>&,const std::vector<double>&)");
            p_soil_temperatureGradient = (Ptr_soil_temperatureGradient)R_GetCCallable("medfate", "_medfate_soil_temperatureGradient");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_soil_temperatureGradient(Shield<SEXP>(Rcpp::wrap(gradTemp)), Shield<SEXP>(Rcpp::wrap(widths)), Shield<SEXP>(Rcpp::wrap(Temp)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
    }

    inline CharacterVector _getWeatherDates(DataFrame meteo) {
        typedef SEXP(*Ptr__getWeatherDates)(SEXP);
        static Ptr__getWeatherDates p__getWeatherDates = NULL;
        if (p__getWeatherDates == NULL) {
            validateSignature("CharacterVector(*_getWeatherDates)(DataFrame)");
            p__getWeatherDates = (Ptr__getWeatherDates)R_GetCCallable("medfate", "_medfate__getWeatherDates");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__getWeatherDates(Shield<SEXP>(Rcpp::wrap(meteo)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<CharacterVector >(rcpp_result_gen);
    }

    inline List _defineSPWBDailyOutput(double latitude, double elevation, double slope, double aspect, CharacterVector dateStrings, List x) {
        typedef SEXP(*Ptr__defineSPWBDailyOutput)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr__defineSPWBDailyOutput p__defineSPWBDailyOutput = NULL;
        if (p__defineSPWBDailyOutput == NULL) {
            validateSignature("List(*_defineSPWBDailyOutput)(double,double,double,double,CharacterVector,List)");
            p__defineSPWBDailyOutput = (Ptr__defineSPWBDailyOutput)R_GetCCallable("medfate", "_medfate__defineSPWBDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__defineSPWBDailyOutput(Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(dateStrings)), Shield<SEXP>(Rcpp::wrap(x)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline void _fillSPWBDailyOutput(List l, List x, List sDay, int iday) {
        typedef SEXP(*Ptr__fillSPWBDailyOutput)(SEXP,SEXP,SEXP,SEXP);
        static Ptr__fillSPWBDailyOutput p__fillSPWBDailyOutput = NULL;
        if (p__fillSPWBDailyOutput == NULL) {
            validateSignature("void(*_fillSPWBDailyOutput)(List,List,List,int)");
            p__fillSPWBDailyOutput = (Ptr__fillSPWBDailyOutput)R_GetCCallable("medfate", "_medfate__fillSPWBDailyOutput");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p__fillSPWBDailyOutput(Shield<SEXP>(Rcpp::wrap(l)), Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(sDay)), Shield<SEXP>(Rcpp::wrap(iday)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
    }

    inline List spwb(List x, DataFrame meteo, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, NumericVector CO2ByYear = NumericVector(0), double waterTableDepth = NA_REAL) {
        typedef SEXP(*Ptr_spwb)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_spwb p_spwb = NULL;
        if (p_spwb == NULL) {
            validateSignature("List(*spwb)(List,DataFrame,double,double,double,double,NumericVector,double)");
            p_spwb = (Ptr_spwb)R_GetCCallable("medfate", "_medfate_spwb");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_spwb(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(meteo)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(CO2ByYear)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List pwb(List x, DataFrame meteo, NumericMatrix W, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, NumericVector canopyEvaporation = NumericVector(0), NumericVector snowMelt = NumericVector(0), NumericVector soilEvaporation = NumericVector(0), NumericVector herbTranspiration = NumericVector(0), NumericVector CO2ByYear = NumericVector(0)) {
        typedef SEXP(*Ptr_pwb)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_pwb p_pwb = NULL;
        if (p_pwb == NULL) {
            validateSignature("List(*pwb)(List,DataFrame,NumericMatrix,double,double,double,double,NumericVector,NumericVector,NumericVector,NumericVector,NumericVector)");
            p_pwb = (Ptr_pwb)R_GetCCallable("medfate", "_medfate_pwb");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_pwb(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(meteo)), Shield<SEXP>(Rcpp::wrap(W)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(canopyEvaporation)), Shield<SEXP>(Rcpp::wrap(snowMelt)), Shield<SEXP>(Rcpp::wrap(soilEvaporation)), Shield<SEXP>(Rcpp::wrap(herbTranspiration)), Shield<SEXP>(Rcpp::wrap(CO2ByYear)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List spwb_day(List x, CharacterVector date, NumericVector meteovec, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, double runon = 0.0, Nullable<NumericVector> lateralFlows = R_NilValue, double waterTableDepth = NA_REAL, bool modifyInput = true) {
        typedef SEXP(*Ptr_spwb_day)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_spwb_day p_spwb_day = NULL;
        if (p_spwb_day == NULL) {
            validateSignature("List(*spwb_day)(List,CharacterVector,NumericVector,double,double,double,double,double,Nullable<NumericVector>,double,bool)");
            p_spwb_day = (Ptr_spwb_day)R_GetCCallable("medfate", "_medfate_spwb_day");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_spwb_day(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(date)), Shield<SEXP>(Rcpp::wrap(meteovec)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(runon)), Shield<SEXP>(Rcpp::wrap(lateralFlows)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)), Shield<SEXP>(Rcpp::wrap(modifyInput)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

    inline List aspwb_day(List x, CharacterVector date, NumericVector meteovec, double latitude, double elevation, double slope = NA_REAL, double aspect = NA_REAL, double runon = 0.0, Nullable<NumericVector> lateralFlows = R_NilValue, double waterTableDepth = NA_REAL, bool modifyInput = true) {
        typedef SEXP(*Ptr_aspwb_day)(SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP,SEXP);
        static Ptr_aspwb_day p_aspwb_day = NULL;
        if (p_aspwb_day == NULL) {
            validateSignature("List(*aspwb_day)(List,CharacterVector,NumericVector,double,double,double,double,double,Nullable<NumericVector>,double,bool)");
            p_aspwb_day = (Ptr_aspwb_day)R_GetCCallable("medfate", "_medfate_aspwb_day");
        }
        RObject rcpp_result_gen;
        {
            RNGScope RCPP_rngScope_gen;
            rcpp_result_gen = p_aspwb_day(Shield<SEXP>(Rcpp::wrap(x)), Shield<SEXP>(Rcpp::wrap(date)), Shield<SEXP>(Rcpp::wrap(meteovec)), Shield<SEXP>(Rcpp::wrap(latitude)), Shield<SEXP>(Rcpp::wrap(elevation)), Shield<SEXP>(Rcpp::wrap(slope)), Shield<SEXP>(Rcpp::wrap(aspect)), Shield<SEXP>(Rcpp::wrap(runon)), Shield<SEXP>(Rcpp::wrap(lateralFlows)), Shield<SEXP>(Rcpp::wrap(waterTableDepth)), Shield<SEXP>(Rcpp::wrap(modifyInput)));
        }
        if (rcpp_result_gen.inherits("interrupted-error"))
            throw Rcpp::internal::InterruptedException();
        if (Rcpp::internal::isLongjumpSentinel(rcpp_result_gen))
            throw Rcpp::LongjumpException(rcpp_result_gen);
        if (rcpp_result_gen.inherits("try-error"))
            throw Rcpp::exception(Rcpp::as<std::string>(rcpp_result_gen).c_str());
        return Rcpp::as<List >(rcpp_result_gen);
    }

}

#endif // RCPP_medfate_RCPPEXPORTS_H_GEN_
