/* Generated by Cython 3.0a7 */

/* BEGIN: Cython Metadata
{
    "distutils": {
        "depends": [
            "src\\_cotton2k\\CottonPhenology.h",
            "src\\_cotton2k\\FruitAbscission.h",
            "src\\_cotton2k\\GettingInput_2.cpp",
            "src\\_cotton2k\\LeafAbscission.h",
            "src\\_cotton2k\\PlantGrowth.h",
            "src\\_cotton2k\\PlantNitrogen.h",
            "src\\_cotton2k\\RootGrowth.h",
            "src\\_cotton2k\\SoilNitrogen.h",
            "src\\_cotton2k\\SoilProcedures.h",
            "src\\_cotton2k\\SoilTemperature.h"
        ],
        "include_dirs": [
            "src/_cotton2k"
        ],
        "language": "c++",
        "name": "_cotton2k.simulation",
        "sources": [
            "src/_cotton2k\\simulation.pyx"
        ]
    },
    "module_name": "_cotton2k.simulation"
}
END: Cython Metadata */

#ifndef PY_SSIZE_T_CLEAN
#define PY_SSIZE_T_CLEAN
#endif /* PY_SSIZE_T_CLEAN */
#if defined(CYTHON_LIMITED_API) && 0
  #ifndef Py_LIMITED_API
    #if CYTHON_LIMITED_API+0 > 0x03030000
      #define Py_LIMITED_API CYTHON_LIMITED_API
    #else
      #define Py_LIMITED_API 0x03030000
    #endif
  #endif
#endif

#include "Python.h"
#ifndef Py_PYTHON_H
    #error Python headers needed to compile C extensions, please install development version of Python.
#elif PY_VERSION_HEX < 0x02070000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
    #error Cython requires Python 2.7+ or Python 3.3+.
#else
#define CYTHON_ABI "3_0a7"
#define __PYX_ABI_MODULE_NAME "_cython_" CYTHON_ABI
#define __PYX_TYPE_MODULE_PREFIX __PYX_ABI_MODULE_NAME "."
#define CYTHON_HEX_VERSION 0x030000A7
#define CYTHON_FUTURE_DIVISION 1
#include <stddef.h>
#ifndef offsetof
  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
#endif
#if !defined(_WIN32) && !defined(WIN32) && !defined(MS_WINDOWS)
  #ifndef __stdcall
    #define __stdcall
  #endif
  #ifndef __cdecl
    #define __cdecl
  #endif
  #ifndef __fastcall
    #define __fastcall
  #endif
#endif
#ifndef DL_IMPORT
  #define DL_IMPORT(t) t
#endif
#ifndef DL_EXPORT
  #define DL_EXPORT(t) t
#endif
#define __PYX_COMMA ,
#ifndef HAVE_LONG_LONG
  #define HAVE_LONG_LONG
#endif
#ifndef PY_LONG_LONG
  #define PY_LONG_LONG LONG_LONG
#endif
#ifndef Py_HUGE_VAL
  #define Py_HUGE_VAL HUGE_VAL
#endif
#ifdef PYPY_VERSION
  #define CYTHON_COMPILING_IN_PYPY 1
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #if PY_VERSION_HEX < 0x03050000
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #undef CYTHON_AVOID_BORROWED_REFS
  #define CYTHON_AVOID_BORROWED_REFS 1
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS (PY_MAJOR_VERSION >= 3)
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(PYSTON_VERSION)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 1
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #undef CYTHON_USE_UNICODE_WRITER
  #define CYTHON_USE_UNICODE_WRITER 0
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #undef CYTHON_PEP487_INIT_SUBCLASS
  #define CYTHON_PEP487_INIT_SUBCLASS 0
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #undef CYTHON_USE_TP_FINALIZE
  #define CYTHON_USE_TP_FINALIZE 0
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#elif defined(CYTHON_LIMITED_API)
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 0
  #define CYTHON_COMPILING_IN_LIMITED_API 1
  #undef CYTHON_USE_TYPE_SLOTS
  #define CYTHON_USE_TYPE_SLOTS 0
  #undef CYTHON_USE_PYTYPE_LOOKUP
  #define CYTHON_USE_PYTYPE_LOOKUP 0
  #undef CYTHON_USE_ASYNC_SLOTS
  #define CYTHON_USE_ASYNC_SLOTS 0
  #undef CYTHON_USE_PYLIST_INTERNALS
  #define CYTHON_USE_PYLIST_INTERNALS 0
  #undef CYTHON_USE_UNICODE_INTERNALS
  #define CYTHON_USE_UNICODE_INTERNALS 0
  #ifndef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #undef CYTHON_USE_PYLONG_INTERNALS
  #define CYTHON_USE_PYLONG_INTERNALS 0
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #undef CYTHON_ASSUME_SAFE_MACROS
  #define CYTHON_ASSUME_SAFE_MACROS 0
  #undef CYTHON_UNPACK_METHODS
  #define CYTHON_UNPACK_METHODS 0
  #undef CYTHON_FAST_THREAD_STATE
  #define CYTHON_FAST_THREAD_STATE 0
  #undef CYTHON_FAST_GIL
  #define CYTHON_FAST_GIL 0
  #undef CYTHON_METH_FASTCALL
  #define CYTHON_METH_FASTCALL 0
  #undef CYTHON_FAST_PYCALL
  #define CYTHON_FAST_PYCALL 0
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #undef CYTHON_PEP489_MULTI_PHASE_INIT
  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE 1
  #endif
  #undef CYTHON_USE_DICT_VERSIONS
  #define CYTHON_USE_DICT_VERSIONS 0
  #undef CYTHON_USE_EXC_INFO_STACK
  #define CYTHON_USE_EXC_INFO_STACK 0
#else
  #define CYTHON_COMPILING_IN_PYPY 0
  #define CYTHON_COMPILING_IN_PYSTON 0
  #define CYTHON_COMPILING_IN_CPYTHON 1
  #define CYTHON_COMPILING_IN_LIMITED_API 0
  #ifndef CYTHON_USE_TYPE_SLOTS
    #define CYTHON_USE_TYPE_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYTYPE_LOOKUP
    #define CYTHON_USE_PYTYPE_LOOKUP 1
  #endif
  #if PY_MAJOR_VERSION < 3
    #undef CYTHON_USE_ASYNC_SLOTS
    #define CYTHON_USE_ASYNC_SLOTS 0
  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
    #define CYTHON_USE_ASYNC_SLOTS 1
  #endif
  #ifndef CYTHON_USE_PYLONG_INTERNALS
    #define CYTHON_USE_PYLONG_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_PYLIST_INTERNALS
    #define CYTHON_USE_PYLIST_INTERNALS 1
  #endif
  #ifndef CYTHON_USE_UNICODE_INTERNALS
    #define CYTHON_USE_UNICODE_INTERNALS 1
  #endif
  #if PY_VERSION_HEX < 0x030300F0
    #undef CYTHON_USE_UNICODE_WRITER
    #define CYTHON_USE_UNICODE_WRITER 0
  #elif !defined(CYTHON_USE_UNICODE_WRITER)
    #define CYTHON_USE_UNICODE_WRITER 1
  #endif
  #ifndef CYTHON_AVOID_BORROWED_REFS
    #define CYTHON_AVOID_BORROWED_REFS 0
  #endif
  #ifndef CYTHON_ASSUME_SAFE_MACROS
    #define CYTHON_ASSUME_SAFE_MACROS 1
  #endif
  #ifndef CYTHON_UNPACK_METHODS
    #define CYTHON_UNPACK_METHODS 1
  #endif
  #ifndef CYTHON_FAST_THREAD_STATE
    #define CYTHON_FAST_THREAD_STATE 1
  #endif
  #ifndef CYTHON_FAST_GIL
    #define CYTHON_FAST_GIL (PY_MAJOR_VERSION < 3 || PY_VERSION_HEX >= 0x03060000)
  #endif
  #ifndef CYTHON_METH_FASTCALL
    #define CYTHON_METH_FASTCALL (PY_VERSION_HEX >= 0x030700A1)
  #endif
  #ifndef CYTHON_FAST_PYCALL
    #define CYTHON_FAST_PYCALL 1
  #endif
  #ifndef CYTHON_PEP487_INIT_SUBCLASS
    #define CYTHON_PEP487_INIT_SUBCLASS 1
  #endif
  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
    #define CYTHON_PEP489_MULTI_PHASE_INIT (PY_VERSION_HEX >= 0x03050000)
  #endif
  #ifndef CYTHON_USE_TP_FINALIZE
    #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
  #endif
  #ifndef CYTHON_USE_DICT_VERSIONS
    #define CYTHON_USE_DICT_VERSIONS (PY_VERSION_HEX >= 0x030600B1)
  #endif
  #ifndef CYTHON_USE_EXC_INFO_STACK
    #define CYTHON_USE_EXC_INFO_STACK (PY_VERSION_HEX >= 0x030700A3)
  #endif
#endif
#if !defined(CYTHON_FAST_PYCCALL)
#define CYTHON_FAST_PYCCALL  (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
#endif
#if !defined(CYTHON_VECTORCALL)
#define CYTHON_VECTORCALL  (CYTHON_FAST_PYCCALL && PY_VERSION_HEX >= 0x030800B1)
#endif
#define CYTHON_BACKPORT_VECTORCALL (CYTHON_METH_FASTCALL && PY_VERSION_HEX < 0x030800B1)
#if CYTHON_USE_PYLONG_INTERNALS
  #include "longintrepr.h"
  #undef SHIFT
  #undef BASE
  #undef MASK
  #ifdef SIZEOF_VOID_P
    enum { __pyx_check_sizeof_voidp = 1 / (int)(SIZEOF_VOID_P == sizeof(void*)) };
  #endif
#endif
#ifndef __has_attribute
  #define __has_attribute(x) 0
#endif
#ifndef __has_cpp_attribute
  #define __has_cpp_attribute(x) 0
#endif
#ifndef CYTHON_RESTRICT
  #if defined(__GNUC__)
    #define CYTHON_RESTRICT __restrict__
  #elif defined(_MSC_VER) && _MSC_VER >= 1400
    #define CYTHON_RESTRICT __restrict
  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define CYTHON_RESTRICT restrict
  #else
    #define CYTHON_RESTRICT
  #endif
#endif
#ifndef CYTHON_UNUSED
# if defined(__GNUC__)
#   if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
#     define CYTHON_UNUSED __attribute__ ((__unused__))
#   else
#     define CYTHON_UNUSED
#   endif
# elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
#   define CYTHON_UNUSED __attribute__ ((__unused__))
# else
#   define CYTHON_UNUSED
# endif
#endif
#ifndef CYTHON_UNUSED_VAR
#  if defined(__cplusplus)
     template<class T> void CYTHON_UNUSED_VAR( const T& ) { }
#  else
#    define CYTHON_UNUSED_VAR(x) (void)(x)
#  endif
#endif
#ifndef CYTHON_MAYBE_UNUSED_VAR
  #define CYTHON_MAYBE_UNUSED_VAR(x) CYTHON_UNUSED_VAR(x)
#endif
#ifndef CYTHON_NCP_UNUSED
# if CYTHON_COMPILING_IN_CPYTHON
#  define CYTHON_NCP_UNUSED
# else
#  define CYTHON_NCP_UNUSED CYTHON_UNUSED
# endif
#endif
#define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
#ifdef _MSC_VER
    #ifndef _MSC_STDINT_H_
        #if _MSC_VER < 1300
            typedef unsigned char     uint8_t;
            typedef unsigned short    uint16_t;
            typedef unsigned int      uint32_t;
        #else
            typedef unsigned __int8   uint8_t;
            typedef unsigned __int16  uint16_t;
            typedef unsigned __int32  uint32_t;
        #endif
    #endif
    #if _MSC_VER < 1300
        #ifdef _WIN64
            typedef unsigned long long  __pyx_uintptr_t;
        #else
            typedef unsigned int        __pyx_uintptr_t;
        #endif
    #else
        #ifdef _WIN64
            typedef unsigned __int64    __pyx_uintptr_t;
        #else
            typedef unsigned __int32    __pyx_uintptr_t;
        #endif
    #endif
#else
    #include <stdint.h>
    typedef uintptr_t  __pyx_uintptr_t;
#endif
#ifndef CYTHON_FALLTHROUGH
  #if defined(__cplusplus) && __cplusplus >= 201103L
    #if __has_cpp_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH [[fallthrough]]
    #elif __has_cpp_attribute(clang::fallthrough)
      #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
    #elif __has_cpp_attribute(gnu::fallthrough)
      #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
    #endif
  #endif
  #ifndef CYTHON_FALLTHROUGH
    #if __has_attribute(fallthrough)
      #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
    #else
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
  #if defined(__clang__ ) && defined(__apple_build_version__)
    #if __apple_build_version__ < 7000000
      #undef  CYTHON_FALLTHROUGH
      #define CYTHON_FALLTHROUGH
    #endif
  #endif
#endif

#ifndef __cplusplus
  #error "Cython files generated with the C++ option must be compiled with a C++ compiler."
#endif
#ifndef CYTHON_INLINE
  #if defined(__clang__)
    #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
  #else
    #define CYTHON_INLINE inline
  #endif
#endif
template<typename T>
void __Pyx_call_destructor(T& x) {
    x.~T();
}
template<typename T>
class __Pyx_FakeReference {
  public:
    __Pyx_FakeReference() : ptr(NULL) { }
    __Pyx_FakeReference(const T& ref) : ptr(const_cast<T*>(&ref)) { }
    T *operator->() { return ptr; }
    T *operator&() { return ptr; }
    operator T&() { return *ptr; }
    template<typename U> bool operator ==(U other) { return *ptr == other; }
    template<typename U> bool operator !=(U other) { return *ptr != other; }
  private:
    T *ptr;
};

#if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
  #define Py_OptimizeFlag 0
#endif
#define __PYX_BUILD_PY_SSIZE_T "n"
#define CYTHON_FORMAT_SSIZE_T "z"
#if PY_MAJOR_VERSION < 3
  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
  #define __Pyx_DefaultClassType PyClass_Type
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
  #define __Pyx_DefaultClassType PyType_Type
#if PY_VERSION_HEX >= 0x030800B2
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_NewWithPosOnlyArgs(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#elif PY_VERSION_HEX >= 0x030800A4
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else
  #define __Pyx_PyCode_New(a, p, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
          PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif
#endif
#if PY_VERSION_HEX >= 0x030900A4 || defined(Py_IS_TYPE)
  #define __Pyx_IS_TYPE(ob, type) Py_IS_TYPE(ob, type)
#else
  #define __Pyx_IS_TYPE(ob, type) (((const PyObject*)ob)->ob_type == (type))
#endif
#ifndef Py_TPFLAGS_CHECKTYPES
  #define Py_TPFLAGS_CHECKTYPES 0
#endif
#ifndef Py_TPFLAGS_HAVE_INDEX
  #define Py_TPFLAGS_HAVE_INDEX 0
#endif
#ifndef Py_TPFLAGS_HAVE_NEWBUFFER
  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
#endif
#ifndef Py_TPFLAGS_HAVE_FINALIZE
  #define Py_TPFLAGS_HAVE_FINALIZE 0
#endif
#ifndef METH_STACKLESS
  #define METH_STACKLESS 0
#endif
#if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
  #ifndef METH_FASTCALL
     #define METH_FASTCALL 0x80
  #endif
  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
                                                          Py_ssize_t nargs, PyObject *kwnames);
#else
  #define __Pyx_PyCFunctionFast _PyCFunctionFast
  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
#endif
#if CYTHON_METH_FASTCALL
  #define __Pyx_METH_FASTCALL METH_FASTCALL
  #define __Pyx_PyCFunction_FastCall __Pyx_PyCFunctionFast
  #define __Pyx_PyCFunction_FastCallWithKeywords __Pyx_PyCFunctionFastWithKeywords
#else
  #define __Pyx_METH_FASTCALL METH_VARARGS
  #define __Pyx_PyCFunction_FastCall PyCFunction
  #define __Pyx_PyCFunction_FastCallWithKeywords PyCFunctionWithKeywords
#endif
#if CYTHON_VECTORCALL
  #define __pyx_vectorcallfunc vectorcallfunc
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  PY_VECTORCALL_ARGUMENTS_OFFSET
  #define __Pyx_PyVectorcall_NARGS(n)  PyVectorcall_NARGS((size_t)(n))
#elif CYTHON_BACKPORT_VECTORCALL
  typedef PyObject *(*__pyx_vectorcallfunc)(PyObject *callable, PyObject *const *args,
                                            size_t nargsf, PyObject *kwnames);
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  ((size_t)1 << (8 * sizeof(size_t) - 1))
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(((size_t)(n)) & ~__Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET))
#else
  #define __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET  0
  #define __Pyx_PyVectorcall_NARGS(n)  ((Py_ssize_t)(n))
#endif
#if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
  #define PyObject_Malloc(s)   PyMem_Malloc(s)
  #define PyObject_Free(p)     PyMem_Free(p)
  #define PyObject_Realloc(p)  PyMem_Realloc(p)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX < 0x030400A1
  #define PyMem_RawMalloc(n)           PyMem_Malloc(n)
  #define PyMem_RawRealloc(p, n)       PyMem_Realloc(p, n)
  #define PyMem_RawFree(p)             PyMem_Free(p)
#endif
#if CYTHON_COMPILING_IN_PYSTON
  #define __Pyx_PyCode_HasFreeVars(co)  PyCode_HasFreeVars(co)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
#elif CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)
#else
  #define __Pyx_PyCode_HasFreeVars(co)  (PyCode_GetNumFree(co) > 0)
  #define __Pyx_PyFrame_SetLineNumber(frame, lineno)  (frame)->f_lineno = (lineno)
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyThreadState_Current PyThreadState_Get()
#elif !CYTHON_FAST_THREAD_STATE
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#elif PY_VERSION_HEX >= 0x03060000
  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
#elif PY_VERSION_HEX >= 0x03000000
  #define __Pyx_PyThreadState_Current PyThreadState_GET()
#else
  #define __Pyx_PyThreadState_Current _PyThreadState_Current
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static inline void *__Pyx_PyModule_GetState(PyObject *op)
{
    void *result;
    result = PyModule_GetState(op);
    if (!result)
        Py_FatalError("Couldn't find the module state");
    return result;
}
#endif
#if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
#include "pythread.h"
#define Py_tss_NEEDS_INIT 0
typedef int Py_tss_t;
static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
  *key = PyThread_create_key();
  return 0;
}
static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
  *key = Py_tss_NEEDS_INIT;
  return key;
}
static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
  PyObject_Free(key);
}
static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
  return *key != Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
  PyThread_delete_key(*key);
  *key = Py_tss_NEEDS_INIT;
}
static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
  return PyThread_set_key_value(*key, value);
}
static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
  return PyThread_get_key_value(*key);
}
#endif
#if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
#define __Pyx_PyDict_NewPresized(n)  ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
#else
#define __Pyx_PyDict_NewPresized(n)  PyDict_New()
#endif
#if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_TrueDivide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceTrueDivide(x,y)
#else
  #define __Pyx_PyNumber_Divide(x,y)         PyNumber_Divide(x,y)
  #define __Pyx_PyNumber_InPlaceDivide(x,y)  PyNumber_InPlaceDivide(x,y)
#endif
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX > 0x030600B4 && CYTHON_USE_UNICODE_INTERNALS
#define __Pyx_PyDict_GetItemStrWithError(dict, name)  _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStr(PyObject *dict, PyObject *name) {
    PyObject *res = __Pyx_PyDict_GetItemStrWithError(dict, name);
    if (res == NULL) PyErr_Clear();
    return res;
}
#elif PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
#define __Pyx_PyDict_GetItemStrWithError  PyDict_GetItemWithError
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#else
static CYTHON_INLINE PyObject * __Pyx_PyDict_GetItemStrWithError(PyObject *dict, PyObject *name) {
#if CYTHON_COMPILING_IN_PYPY
    return PyDict_GetItem(dict, name);
#else
    PyDictEntry *ep;
    PyDictObject *mp = (PyDictObject*) dict;
    long hash = ((PyStringObject *) name)->ob_shash;
    assert(hash != -1);
    ep = (mp->ma_lookup)(mp, name, hash);
    if (ep == NULL) {
        return NULL;
    }
    return ep->me_value;
#endif
}
#define __Pyx_PyDict_GetItemStr           PyDict_GetItem
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define __Pyx_PyType_GetFlags(tp)   (PyType_GetFlags((PyTypeObject *)tp))
#else
  #define __Pyx_PyType_GetFlags(tp)   (((PyTypeObject *)tp)->tp_flags)
#endif
#if CYTHON_USE_TYPE_SLOTS
  #define __Pyx_PyType_HasFeature(type, feature)  ((__Pyx_PyType_GetFlags(type) & (feature)) != 0)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  (Py_TYPE(obj)->tp_iternext)
#else
  #define __Pyx_PyType_HasFeature(type, feature)  PyType_HasFeature(type, feature)
  #define __Pyx_PyObject_GetIterNextFunc(obj)  PyIter_Next
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
  #define CYTHON_PEP393_ENABLED 1
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GetLength(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_ReadChar(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((void)u, 1114111)
  #define __Pyx_PyUnicode_KIND(u)         ((void)u, (0))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)u)
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)k, PyUnicode_ReadChar((PyObject*)(d), i))
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GetLength(u))
#elif PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
  #define CYTHON_PEP393_ENABLED 1
  #if defined(PyUnicode_IS_READY)
  #define __Pyx_PyUnicode_READY(op)       (likely(PyUnicode_IS_READY(op)) ?\
                                              0 : _PyUnicode_Ready((PyObject *)(op)))
  #else
  #define __Pyx_PyUnicode_READY(op)       (0)
  #endif
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_LENGTH(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   PyUnicode_MAX_CHAR_VALUE(u)
  #define __Pyx_PyUnicode_KIND(u)         ((int)PyUnicode_KIND(u))
  #define __Pyx_PyUnicode_DATA(u)         PyUnicode_DATA(u)
  #define __Pyx_PyUnicode_READ(k, d, i)   PyUnicode_READ(k, d, i)
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  PyUnicode_WRITE(k, d, i, ch)
  #if defined(PyUnicode_IS_READY) && defined(PyUnicode_GET_SIZE)
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x03090000
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : ((PyCompactUnicodeObject *)(u))->wstr_length))
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
  #endif
  #else
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_LENGTH(u))
  #endif
#else
  #define CYTHON_PEP393_ENABLED 0
  #define PyUnicode_1BYTE_KIND  1
  #define PyUnicode_2BYTE_KIND  2
  #define PyUnicode_4BYTE_KIND  4
  #define __Pyx_PyUnicode_READY(op)       (0)
  #define __Pyx_PyUnicode_GET_LENGTH(u)   PyUnicode_GET_SIZE(u)
  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u)   ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
  #define __Pyx_PyUnicode_KIND(u)         ((int)sizeof(Py_UNICODE))
  #define __Pyx_PyUnicode_DATA(u)         ((void*)PyUnicode_AS_UNICODE(u))
  #define __Pyx_PyUnicode_READ(k, d, i)   ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
  #define __Pyx_PyUnicode_WRITE(k, d, i, ch)  (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
  #define __Pyx_PyUnicode_IS_TRUE(u)      (0 != PyUnicode_GET_SIZE(u))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #define __Pyx_PyUnicode_Concat(a, b)      PyNumber_Add(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  PyNumber_Add(a, b)
#else
  #define __Pyx_PyUnicode_Concat(a, b)      PyUnicode_Concat(a, b)
  #define __Pyx_PyUnicode_ConcatSafe(a, b)  ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
      PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
#endif
#if CYTHON_COMPILING_IN_PYPY
  #if !defined(PyUnicode_DecodeUnicodeEscape)
    #define PyUnicode_DecodeUnicodeEscape(s, size, errors)  PyUnicode_Decode(s, size, "unicode_escape", errors)
  #endif
  #if !defined(PyUnicode_Contains) || (PY_MAJOR_VERSION == 2 && PYPY_VERSION_NUM < 0x07030500)
    #undef PyUnicode_Contains
    #define PyUnicode_Contains(u, s)  PySequence_Contains(u, s)
  #endif
  #if !defined(PyByteArray_Check)
    #define PyByteArray_Check(obj)  PyObject_TypeCheck(obj, &PyByteArray_Type)
  #endif
  #if !defined(PyObject_Format)
    #define PyObject_Format(obj, fmt)  PyObject_CallMethod(obj, "__format__", "O", fmt)
  #endif
#endif
#define __Pyx_PyString_FormatSafe(a, b)   ((unlikely((a) == Py_None || (PyString_Check(b) && !PyString_CheckExact(b)))) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
#define __Pyx_PyUnicode_FormatSafe(a, b)  ((unlikely((a) == Py_None || (PyUnicode_Check(b) && !PyUnicode_CheckExact(b)))) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyString_Format(a, b)  PyUnicode_Format(a, b)
#else
  #define __Pyx_PyString_Format(a, b)  PyString_Format(a, b)
#endif
#if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
  #define PyObject_ASCII(o)            PyObject_Repr(o)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBaseString_Type            PyUnicode_Type
  #define PyStringObject               PyUnicodeObject
  #define PyString_Type                PyUnicode_Type
  #define PyString_Check               PyUnicode_Check
  #define PyString_CheckExact          PyUnicode_CheckExact
#ifndef PyObject_Unicode
  #define PyObject_Unicode             PyObject_Str
#endif
#endif
#if PY_MAJOR_VERSION >= 3
  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
#else
  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
#endif
#if CYTHON_COMPILING_IN_CPYTHON
  #define __Pyx_PySequence_ListKeepNew(obj)\
    (likely(PyList_CheckExact(obj) && Py_REFCNT(obj) == 1) ? __Pyx_NewRef(obj) : PySequence_List(obj))
#else
  #define __Pyx_PySequence_ListKeepNew(obj)  PySequence_List(obj)
#endif
#ifndef PySet_CheckExact
  #define PySet_CheckExact(obj)        __Pyx_IS_TYPE(obj, &PySet_Type)
#endif
#if PY_VERSION_HEX >= 0x030900A4
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_SET_REFCNT(obj, refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SET_SIZE(obj, size)
#else
  #define __Pyx_SET_REFCNT(obj, refcnt) Py_REFCNT(obj) = (refcnt)
  #define __Pyx_SET_SIZE(obj, size) Py_SIZE(obj) = (size)
#endif
#if CYTHON_ASSUME_SAFE_MACROS
  #define __Pyx_PySequence_SIZE(seq)  Py_SIZE(seq)
#else
  #define __Pyx_PySequence_SIZE(seq)  PySequence_Size(seq)
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyIntObject                  PyLongObject
  #define PyInt_Type                   PyLong_Type
  #define PyInt_Check(op)              PyLong_Check(op)
  #define PyInt_CheckExact(op)         PyLong_CheckExact(op)
  #define PyInt_FromString             PyLong_FromString
  #define PyInt_FromUnicode            PyLong_FromUnicode
  #define PyInt_FromLong               PyLong_FromLong
  #define PyInt_FromSize_t             PyLong_FromSize_t
  #define PyInt_FromSsize_t            PyLong_FromSsize_t
  #define PyInt_AsLong                 PyLong_AsLong
  #define PyInt_AS_LONG                PyLong_AS_LONG
  #define PyInt_AsSsize_t              PyLong_AsSsize_t
  #define PyInt_AsUnsignedLongMask     PyLong_AsUnsignedLongMask
  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
  #define PyNumber_Int                 PyNumber_Long
#endif
#if PY_MAJOR_VERSION >= 3
  #define PyBoolObject                 PyLongObject
#endif
#if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
  #ifndef PyUnicode_InternFromString
    #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
  #endif
#endif
#if PY_VERSION_HEX < 0x030200A4
  typedef long Py_hash_t;
  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsHash_t
#else
  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
  #define __Pyx_PyInt_AsHash_t   __Pyx_PyIndex_AsSsize_t
#endif
#if CYTHON_USE_ASYNC_SLOTS
  #if PY_VERSION_HEX >= 0x030500B1
    #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
    #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
  #else
    #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
  #endif
#else
  #define __Pyx_PyType_AsAsync(obj) NULL
#endif
#ifndef __Pyx_PyAsyncMethodsStruct
    typedef struct {
        unaryfunc am_await;
        unaryfunc am_aiter;
        unaryfunc am_anext;
    } __Pyx_PyAsyncMethodsStruct;
#endif

#if defined(_WIN32) || defined(WIN32) || defined(MS_WINDOWS)
  #define _USE_MATH_DEFINES
#endif
#include <math.h>
#ifdef NAN
#define __PYX_NAN() ((float) NAN)
#else
static CYTHON_INLINE float __PYX_NAN() {
  float value;
  memset(&value, 0xFF, sizeof(value));
  return value;
}
#endif
#if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
#define __Pyx_truncl trunc
#else
#define __Pyx_truncl truncl
#endif

#define __PYX_MARK_ERR_POS(f_index, lineno) \
    { __pyx_filename = __pyx_f[f_index]; (void)__pyx_filename; __pyx_lineno = lineno; (void)__pyx_lineno; __pyx_clineno = __LINE__; (void)__pyx_clineno; }
#define __PYX_ERR(f_index, lineno, Ln_error) \
    { __PYX_MARK_ERR_POS(f_index, lineno) goto Ln_error; }

#ifndef __PYX_EXTERN_C
  #ifdef __cplusplus
    #define __PYX_EXTERN_C extern "C"
  #else
    #define __PYX_EXTERN_C extern
  #endif
#endif

#define __PYX_HAVE___cotton2k__simulation
#define __PYX_HAVE_API___cotton2k__simulation
/* Early includes */
#include <stdint.h>
#include "Climate.h"
#include "Irrigation.h"
#include "FruitingSite.h"
#include "Soil.h"
#include "State.hpp"
#include "PlantGrowth.h"
#include "Simulation.hpp"
#include "global.h"
#include "CottonPhenology.h"
#include "FruitAbscission.h"
#include "GettingInput_2.cpp"
#include "LeafAbscission.h"
#include "PlantNitrogen.h"
#include "RootGrowth.h"
#include "SoilNitrogen.h"
#include "SoilProcedures.h"
#include "SoilTemperature.h"
#include <math.h>
#include <string.h>
#include <stdlib.h>
#ifdef _OPENMP
#include <omp.h>
#endif /* _OPENMP */

#if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
#define CYTHON_WITHOUT_ASSERTIONS
#endif

typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
                const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;

#define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_UTF8 0
#define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT (PY_MAJOR_VERSION >= 3 && __PYX_DEFAULT_STRING_ENCODING_IS_UTF8)
#define __PYX_DEFAULT_STRING_ENCODING ""
#define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
#define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#define __Pyx_uchar_cast(c) ((unsigned char)c)
#define __Pyx_long_cast(x) ((long)x)
#define __Pyx_fits_Py_ssize_t(v, type, is_signed)  (\
    (sizeof(type) < sizeof(Py_ssize_t))  ||\
    (sizeof(type) > sizeof(Py_ssize_t) &&\
          likely(v < (type)PY_SSIZE_T_MAX ||\
                 v == (type)PY_SSIZE_T_MAX)  &&\
          (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
                                v == (type)PY_SSIZE_T_MIN)))  ||\
    (sizeof(type) == sizeof(Py_ssize_t) &&\
          (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
                               v == (type)PY_SSIZE_T_MAX)))  )
static CYTHON_INLINE int __Pyx_is_valid_index(Py_ssize_t i, Py_ssize_t limit) {
    return (size_t) i < (size_t) limit;
}
#if defined (__cplusplus) && __cplusplus >= 201103L
    #include <cstdlib>
    #define __Pyx_sst_abs(value) std::abs(value)
#elif SIZEOF_INT >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) abs(value)
#elif SIZEOF_LONG >= SIZEOF_SIZE_T
    #define __Pyx_sst_abs(value) labs(value)
#elif defined (_MSC_VER)
    #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
#elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
    #define __Pyx_sst_abs(value) llabs(value)
#elif defined (__GNUC__)
    #define __Pyx_sst_abs(value) __builtin_llabs(value)
#else
    #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
#define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
#define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
#define __Pyx_PyBytes_FromString        PyBytes_FromString
#define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
#if PY_MAJOR_VERSION < 3
    #define __Pyx_PyStr_FromString        __Pyx_PyBytes_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
#else
    #define __Pyx_PyStr_FromString        __Pyx_PyUnicode_FromString
    #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
#endif
#define __Pyx_PyBytes_AsWritableString(s)     ((char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableSString(s)    ((signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsWritableUString(s)    ((unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsString(s)     ((const char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsSString(s)    ((const signed char*) PyBytes_AS_STRING(s))
#define __Pyx_PyBytes_AsUString(s)    ((const unsigned char*) PyBytes_AS_STRING(s))
#define __Pyx_PyObject_AsWritableString(s)    ((char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableSString(s)    ((signed char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsWritableUString(s)    ((unsigned char*)(__pyx_uintptr_t) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsSString(s)    ((const signed char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_AsUString(s)    ((const unsigned char*) __Pyx_PyObject_AsString(s))
#define __Pyx_PyObject_FromCString(s)  __Pyx_PyObject_FromString((const char*)s)
#define __Pyx_PyBytes_FromCString(s)   __Pyx_PyBytes_FromString((const char*)s)
#define __Pyx_PyByteArray_FromCString(s)   __Pyx_PyByteArray_FromString((const char*)s)
#define __Pyx_PyStr_FromCString(s)     __Pyx_PyStr_FromString((const char*)s)
#define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const wchar_t *u)
{
    const wchar_t *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#else
static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u)
{
    const Py_UNICODE *u_end = u;
    while (*u_end++) ;
    return (size_t)(u_end - u - 1);
}
#endif
#define __Pyx_PyUnicode_FromUnicode(u)       PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
#define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
#define __Pyx_PyUnicode_AsUnicode            PyUnicode_AsUnicode
#define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
#define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject*);
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
#define __Pyx_PySequence_Tuple(obj)\
    (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject*);
#if CYTHON_ASSUME_SAFE_MACROS
#define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
#else
#define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
#endif
#define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
#if PY_MAJOR_VERSION >= 3
#define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
#else
#define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
#endif
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
static int __Pyx_sys_getdefaultencoding_not_ascii;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    PyObject* ascii_chars_u = NULL;
    PyObject* ascii_chars_b = NULL;
    const char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    if (strcmp(default_encoding_c, "ascii") == 0) {
        __Pyx_sys_getdefaultencoding_not_ascii = 0;
    } else {
        char ascii_chars[128];
        int c;
        for (c = 0; c < 128; c++) {
            ascii_chars[c] = c;
        }
        __Pyx_sys_getdefaultencoding_not_ascii = 1;
        ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
        if (!ascii_chars_u) goto bad;
        ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
        if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
            PyErr_Format(
                PyExc_ValueError,
                "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
                default_encoding_c);
            goto bad;
        }
        Py_DECREF(ascii_chars_u);
        Py_DECREF(ascii_chars_b);
    }
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    Py_XDECREF(ascii_chars_u);
    Py_XDECREF(ascii_chars_b);
    return -1;
}
#endif
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
#else
#define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
#if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
static char* __PYX_DEFAULT_STRING_ENCODING;
static int __Pyx_init_sys_getdefaultencoding_params(void) {
    PyObject* sys;
    PyObject* default_encoding = NULL;
    char* default_encoding_c;
    sys = PyImport_ImportModule("sys");
    if (!sys) goto bad;
    default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
    Py_DECREF(sys);
    if (!default_encoding) goto bad;
    default_encoding_c = PyBytes_AsString(default_encoding);
    if (!default_encoding_c) goto bad;
    __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c) + 1);
    if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
    strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
    Py_DECREF(default_encoding);
    return 0;
bad:
    Py_XDECREF(default_encoding);
    return -1;
}
#endif
#endif


/* Test for GCC > 2.95 */
#if defined(__GNUC__)     && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
  #define likely(x)   __builtin_expect(!!(x), 1)
  #define unlikely(x) __builtin_expect(!!(x), 0)
#else /* !__GNUC__ or GCC < 2.95 */
  #define likely(x)   (x)
  #define unlikely(x) (x)
#endif /* __GNUC__ */
static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }

#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__pyx_m = NULL;
static PyObject *__pyx_d;
static PyObject *__pyx_b;
static PyObject *__pyx_cython_runtime = NULL;
static PyObject *__pyx_empty_tuple;
static PyObject *__pyx_empty_bytes;
static PyObject *__pyx_empty_unicode;
#endif
static int __pyx_lineno;
static int __pyx_clineno = 0;
static const char * __pyx_cfilenm = __FILE__;
static const char *__pyx_filename;

/* #### Code section: filename_table ### */

static const char *__pyx_f[] = {
  "src\\\\_cotton2k\\\\simulation.pyx",
  "stringsource",
};
/* #### Code section: utility_code_proto_before_types ### */
/* #### Code section: numeric_typedefs ### */
/* #### Code section: complex_type_declarations ### */
/* #### Code section: type_declarations ### */

/*--- Type declarations ---*/
struct __pyx_obj_9_cotton2k_10simulation_SoilInit;
struct __pyx_obj_9_cotton2k_10simulation_Climate;
struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf;
struct __pyx_obj_9_cotton2k_10simulation_FruitingNode;
struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf;
struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch;
struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch;
struct __pyx_obj_9_cotton2k_10simulation_State;
struct __pyx_obj_9_cotton2k_10simulation_Simulation;

/* "_cotton2k/simulation.pyx":78
 *         sim.states[0].kday = 1
 * 
 * cdef class SoilInit:             # <<<<<<<<<<<<<<
 *     cdef unsigned int number_of_layers
 *     def __init__(self, initial, hydrology, layer_depth=None):
 */
struct __pyx_obj_9_cotton2k_10simulation_SoilInit {
  PyObject_HEAD
  unsigned int number_of_layers;
};


/* "_cotton2k/simulation.pyx":162
 *             psand[i] = layer["sand"]
 * 
 * cdef class Climate:             # <<<<<<<<<<<<<<
 *     cdef ClimateStruct *climate
 *     cdef unsigned int start_day
 */
struct __pyx_obj_9_cotton2k_10simulation_Climate {
  PyObject_HEAD
  ClimateStruct *climate;
  unsigned int start_day;
  unsigned int days;
  unsigned int current;
};


/* "_cotton2k/simulation.pyx":272
 * 
 * 
 * cdef class NodeLeaf:             # <<<<<<<<<<<<<<
 *     cdef Leaf *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_NodeLeaf *__pyx_vtab;
  Leaf *_;
};


/* "_cotton2k/simulation.pyx":298
 * 
 * 
 * cdef class FruitingNode:             # <<<<<<<<<<<<<<
 *     cdef FruitingSite *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_FruitingNode {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingNode *__pyx_vtab;
  FruitingSite *_;
};


/* "_cotton2k/simulation.pyx":340
 * 
 * 
 * cdef class MainStemLeaf:             # <<<<<<<<<<<<<<
 *     cdef cMainStemLeaf *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_MainStemLeaf *__pyx_vtab;
  MainStemLeaf *_;
};


/* "_cotton2k/simulation.pyx":373
 * 
 * 
 * cdef class FruitingBranch:             # <<<<<<<<<<<<<<
 *     cdef cFruitingBranch *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingBranch *__pyx_vtab;
  FruitingBranch *_;
};


/* "_cotton2k/simulation.pyx":415
 * 
 * 
 * cdef class VegetativeBranch:             # <<<<<<<<<<<<<<
 *     cdef cVegetativeBranch *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_VegetativeBranch *__pyx_vtab;
  VegetativeBranch *_;
};


/* "_cotton2k/simulation.pyx":453
 * 
 * 
 * cdef class State:             # <<<<<<<<<<<<<<
 *     cdef cState *_
 * 
 */
struct __pyx_obj_9_cotton2k_10simulation_State {
  PyObject_HEAD
  struct __pyx_vtabstruct_9_cotton2k_10simulation_State *__pyx_vtab;
  State *_;
};


/* "_cotton2k/simulation.pyx":567
 *         vegetative_branch.delay_for_new_fruiting_branch = 0
 * 
 * cdef class Simulation:             # <<<<<<<<<<<<<<
 *     cdef cSimulation _sim
 *     cdef public unsigned int version
 */
struct __pyx_obj_9_cotton2k_10simulation_Simulation {
  PyObject_HEAD
  Simulation _sim;
  unsigned int version;
  double relative_radiation_received_by_a_soil_column[20];
  double max_leaf_area_index;
  double ptsred;
  double avtemp;
  double sumstrs;
  double DaysTo1stSqare;
  double defkgh;
  double tdfkgh;
  bool idsw;
  double skip_row_width;
  double plants_per_meter;
};



/* "_cotton2k/simulation.pyx":272
 * 
 * 
 * cdef class NodeLeaf:             # <<<<<<<<<<<<<<
 *     cdef Leaf *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_NodeLeaf {
  struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *(*from_ptr)(Leaf *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_NodeLeaf *__pyx_vtabptr_9_cotton2k_10simulation_NodeLeaf;


/* "_cotton2k/simulation.pyx":298
 * 
 * 
 * cdef class FruitingNode:             # <<<<<<<<<<<<<<
 *     cdef FruitingSite *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingNode {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *(*from_ptr)(FruitingSite *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingNode *__pyx_vtabptr_9_cotton2k_10simulation_FruitingNode;


/* "_cotton2k/simulation.pyx":340
 * 
 * 
 * cdef class MainStemLeaf:             # <<<<<<<<<<<<<<
 *     cdef cMainStemLeaf *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_MainStemLeaf {
  struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *(*from_ptr)(MainStemLeaf *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_MainStemLeaf *__pyx_vtabptr_9_cotton2k_10simulation_MainStemLeaf;


/* "_cotton2k/simulation.pyx":373
 * 
 * 
 * cdef class FruitingBranch:             # <<<<<<<<<<<<<<
 *     cdef cFruitingBranch *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingBranch {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *(*from_ptr)(FruitingBranch *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingBranch *__pyx_vtabptr_9_cotton2k_10simulation_FruitingBranch;


/* "_cotton2k/simulation.pyx":415
 * 
 * 
 * cdef class VegetativeBranch:             # <<<<<<<<<<<<<<
 *     cdef cVegetativeBranch *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_VegetativeBranch {
  struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *(*from_ptr)(VegetativeBranch *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_VegetativeBranch *__pyx_vtabptr_9_cotton2k_10simulation_VegetativeBranch;


/* "_cotton2k/simulation.pyx":453
 * 
 * 
 * cdef class State:             # <<<<<<<<<<<<<<
 *     cdef cState *_
 * 
 */

struct __pyx_vtabstruct_9_cotton2k_10simulation_State {
  struct __pyx_obj_9_cotton2k_10simulation_State *(*from_ptr)(State *);
};
static struct __pyx_vtabstruct_9_cotton2k_10simulation_State *__pyx_vtabptr_9_cotton2k_10simulation_State;
/* #### Code section: utility_code_proto ### */

/* --- Runtime support code (head) --- */
/* Refnanny.proto */
#ifndef CYTHON_REFNANNY
  #define CYTHON_REFNANNY 0
#endif
#if CYTHON_REFNANNY
  typedef struct {
    void (*INCREF)(void*, PyObject*, Py_ssize_t);
    void (*DECREF)(void*, PyObject*, Py_ssize_t);
    void (*GOTREF)(void*, PyObject*, Py_ssize_t);
    void (*GIVEREF)(void*, PyObject*, Py_ssize_t);
    void* (*SetupContext)(const char*, Py_ssize_t, const char*);
    void (*FinishContext)(void**);
  } __Pyx_RefNannyAPIStruct;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
#ifdef WITH_THREAD
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          if (acquire_gil) {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
              PyGILState_Release(__pyx_gilstate_save);\
          } else {\
              __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__));\
          }
  #define __Pyx_RefNannyFinishContextNogil() {\
              PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
              __Pyx_RefNannyFinishContext();\
              PyGILState_Release(__pyx_gilstate_save);\
          }
#else
  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
          __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), (__LINE__), (__FILE__))
  #define __Pyx_RefNannyFinishContextNogil() __Pyx_RefNannyFinishContext()
#endif
  #define __Pyx_RefNannyFinishContext()\
          __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
  #define __Pyx_INCREF(r)  __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_DECREF(r)  __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GOTREF(r)  __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), (__LINE__))
  #define __Pyx_XINCREF(r)  do { if((r) == NULL); else {__Pyx_INCREF(r); }} while(0)
  #define __Pyx_XDECREF(r)  do { if((r) == NULL); else {__Pyx_DECREF(r); }} while(0)
  #define __Pyx_XGOTREF(r)  do { if((r) == NULL); else {__Pyx_GOTREF(r); }} while(0)
  #define __Pyx_XGIVEREF(r) do { if((r) == NULL); else {__Pyx_GIVEREF(r);}} while(0)
#else
  #define __Pyx_RefNannyDeclarations
  #define __Pyx_RefNannySetupContext(name, acquire_gil)
  #define __Pyx_RefNannyFinishContextNogil()
  #define __Pyx_RefNannyFinishContext()
  #define __Pyx_INCREF(r) Py_INCREF(r)
  #define __Pyx_DECREF(r) Py_DECREF(r)
  #define __Pyx_GOTREF(r)
  #define __Pyx_GIVEREF(r)
  #define __Pyx_XINCREF(r) Py_XINCREF(r)
  #define __Pyx_XDECREF(r) Py_XDECREF(r)
  #define __Pyx_XGOTREF(r)
  #define __Pyx_XGIVEREF(r)
#endif
#define __Pyx_Py_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; Py_XDECREF(tmp);\
    } while (0)
#define __Pyx_XDECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_XDECREF(tmp);\
    } while (0)
#define __Pyx_DECREF_SET(r, v) do {\
        PyObject *tmp = (PyObject *) r;\
        r = v; __Pyx_DECREF(tmp);\
    } while (0)
#define __Pyx_CLEAR(r)    do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
#define __Pyx_XCLEAR(r)   do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)

/* PyErrExceptionMatches.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
#else
#define __Pyx_PyErr_ExceptionMatches(err)  PyErr_ExceptionMatches(err)
#endif

/* PyThreadStateGet.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyThreadState_declare  PyThreadState *__pyx_tstate;
#define __Pyx_PyThreadState_assign  __pyx_tstate = __Pyx_PyThreadState_Current;
#define __Pyx_PyErr_Occurred()  __pyx_tstate->curexc_type
#else
#define __Pyx_PyThreadState_declare
#define __Pyx_PyThreadState_assign
#define __Pyx_PyErr_Occurred()  PyErr_Occurred()
#endif

/* PyErrFetchRestore.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
#define __Pyx_ErrRestoreWithState(type, value, tb)  __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)    __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)    __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
#else
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#endif
#else
#define __Pyx_PyErr_Clear() PyErr_Clear()
#define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
#define __Pyx_ErrRestoreWithState(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchWithState(type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestoreInState(tstate, type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetchInState(tstate, type, value, tb)  PyErr_Fetch(type, value, tb)
#define __Pyx_ErrRestore(type, value, tb)  PyErr_Restore(type, value, tb)
#define __Pyx_ErrFetch(type, value, tb)  PyErr_Fetch(type, value, tb)
#endif

/* PyObjectGetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
#endif

/* PyObjectGetAttrStrNoError.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name);

/* GetBuiltinName.proto */
static PyObject *__Pyx_GetBuiltinName(PyObject *name);

/* PyObjectCall.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
#else
#define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
#endif

/* RaiseException.proto */
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);

/* WriteUnraisableException.proto */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil);

/* TupleAndListFromArray.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n);
static CYTHON_INLINE PyObject* __Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n);
#endif

/* IncludeStringH.proto */
#include <string.h>

/* BytesEquals.proto */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);

/* UnicodeEquals.proto */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);

/* fastcall.proto */
#define __Pyx_Arg_VARARGS(args, i) PyTuple_GET_ITEM(args, i)
#define __Pyx_NumKwargs_VARARGS(kwds) PyDict_Size(kwds)
#define __Pyx_KwValues_VARARGS(args, nargs) NULL
#define __Pyx_GetKwValue_VARARGS(kw, kwvalues, s) __Pyx_PyDict_GetItemStrWithError(kw, s)
#define __Pyx_KwargsAsDict_VARARGS(kw, kwvalues) PyDict_Copy(kw)
#if CYTHON_METH_FASTCALL
    #define __Pyx_Arg_FASTCALL(args, i) args[i]
    #define __Pyx_NumKwargs_FASTCALL(kwds) PyTuple_GET_SIZE(kwds)
    #define __Pyx_KwValues_FASTCALL(args, nargs) (&args[nargs])
    static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s);
    #define __Pyx_KwargsAsDict_FASTCALL(kw, kwvalues) _PyStack_AsDict(kwvalues, kw)
#else
    #define __Pyx_Arg_FASTCALL __Pyx_Arg_VARARGS
    #define __Pyx_NumKwargs_FASTCALL __Pyx_NumKwargs_VARARGS
    #define __Pyx_KwValues_FASTCALL __Pyx_KwValues_VARARGS
    #define __Pyx_GetKwValue_FASTCALL __Pyx_GetKwValue_VARARGS
    #define __Pyx_KwargsAsDict_FASTCALL __Pyx_KwargsAsDict_VARARGS
#endif
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_VARARGS(args, start), stop - start)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) __Pyx_PyTuple_FromArray(&__Pyx_Arg_FASTCALL(args, start), stop - start)
#else
#define __Pyx_ArgsSlice_VARARGS(args, start, stop) PyTuple_GetSlice(args, start, stop)
#define __Pyx_ArgsSlice_FASTCALL(args, start, stop) PyTuple_GetSlice(args, start, stop)
#endif

/* RaiseArgTupleInvalid.proto */
static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
    Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);

/* RaiseDoubleKeywords.proto */
static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);

/* ParseKeywords.proto */
static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,
    const char* function_name);

/* PyObjectSetAttrStr.proto */
#if CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_DelAttrStr(o,n) __Pyx_PyObject_SetAttrStr(o, n, NULL)
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value);
#else
#define __Pyx_PyObject_DelAttrStr(o,n)   PyObject_DelAttr(o,n)
#define __Pyx_PyObject_SetAttrStr(o,n,v) PyObject_SetAttr(o,n,v)
#endif

/* DictGetItem.proto */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
#define __Pyx_PyObject_Dict_GetItem(obj, name)\
    (likely(PyDict_CheckExact(obj)) ?\
     __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
#else
#define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
#define __Pyx_PyObject_Dict_GetItem(obj, name)  PyObject_GetItem(obj, name)
#endif

/* ListCompAppend.proto */
#if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
    PyListObject* L = (PyListObject*) list;
    Py_ssize_t len = Py_SIZE(list);
    if (likely(L->allocated > len)) {
        Py_INCREF(x);
        PyList_SET_ITEM(list, len, x);
        __Pyx_SET_SIZE(list, len + 1);
        return 0;
    }
    return PyList_Append(list, x);
}
#else
#define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* KeywordStringCheck.proto */
static int __Pyx_CheckKeywordStrings(PyObject *kw, const char* function_name, int kw_allowed);

/* GetAttr3.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);

/* PyDictVersioning.proto */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
#define __PYX_DICT_VERSION_INIT  ((PY_UINT64_T) -1)
#define __PYX_GET_DICT_VERSION(dict)  (((PyDictObject*)(dict))->ma_version_tag)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)\
    (version_var) = __PYX_GET_DICT_VERSION(dict);\
    (cache_var) = (value);
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP) {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    if (likely(__PYX_GET_DICT_VERSION(DICT) == __pyx_dict_version)) {\
        (VAR) = __pyx_dict_cached_value;\
    } else {\
        (VAR) = __pyx_dict_cached_value = (LOOKUP);\
        __pyx_dict_version = __PYX_GET_DICT_VERSION(DICT);\
    }\
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj);
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj);
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version);
#else
#define __PYX_GET_DICT_VERSION(dict)  (0)
#define __PYX_UPDATE_DICT_CACHE(dict, value, cache_var, version_var)
#define __PYX_PY_DICT_LOOKUP_IF_MODIFIED(VAR, DICT, LOOKUP)  (VAR) = (LOOKUP);
#endif

/* GetModuleGlobalName.proto */
#if CYTHON_USE_DICT_VERSIONS
#define __Pyx_GetModuleGlobalName(var, name)  {\
    static PY_UINT64_T __pyx_dict_version = 0;\
    static PyObject *__pyx_dict_cached_value = NULL;\
    (var) = (likely(__pyx_dict_version == __PYX_GET_DICT_VERSION(__pyx_d))) ?\
        (likely(__pyx_dict_cached_value) ? __Pyx_NewRef(__pyx_dict_cached_value) : __Pyx_GetBuiltinName(name)) :\
        __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
#define __Pyx_GetModuleGlobalNameUncached(var, name)  {\
    PY_UINT64_T __pyx_dict_version;\
    PyObject *__pyx_dict_cached_value;\
    (var) = __Pyx__GetModuleGlobalName(name, &__pyx_dict_version, &__pyx_dict_cached_value);\
}
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value);
#else
#define __Pyx_GetModuleGlobalName(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
#define __Pyx_GetModuleGlobalNameUncached(var, name)  (var) = __Pyx__GetModuleGlobalName(name)
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name);
#endif

/* RaiseUnexpectedTypeError.proto */
static int __Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj);

/* PyFunctionFastCall.proto */
#if CYTHON_FAST_PYCALL
#if !CYTHON_VECTORCALL
#define __Pyx_PyFunction_FastCall(func, args, nargs)\
    __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs);
#endif
#define __Pyx_BUILD_ASSERT_EXPR(cond)\
    (sizeof(char [1 - 2*!(cond)]) - 1)
#ifndef Py_MEMBER_SIZE
#define Py_MEMBER_SIZE(type, member) sizeof(((type *)0)->member)
#endif
  static size_t __pyx_pyframe_localsplus_offset = 0;
  #include "frameobject.h"
  #define __Pxy_PyFrame_Initialize_Offsets()\
    ((void)__Pyx_BUILD_ASSERT_EXPR(sizeof(PyFrameObject) == offsetof(PyFrameObject, f_localsplus) + Py_MEMBER_SIZE(PyFrameObject, f_localsplus)),\
     (void)(__pyx_pyframe_localsplus_offset = ((size_t)PyFrame_Type.tp_basicsize) - Py_MEMBER_SIZE(PyFrameObject, f_localsplus)))
  #define __Pyx_PyFrame_GetLocalsplus(frame)\
    (assert(__pyx_pyframe_localsplus_offset), (PyObject **)(((char *)(frame)) + __pyx_pyframe_localsplus_offset))
#endif

/* PyObjectCallMethO.proto */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
#endif

/* PyObjectFastCall.proto */
#define __Pyx_PyObject_FastCall(func, args, nargs)  __Pyx_PyObject_FastCallDict(func, args, (size_t)(nargs), NULL)
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs);

/* GetItemInt.proto */
#define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
    (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
               __Pyx_GetItemInt_Generic(o, to_py_func(i))))
#define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
#define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
    (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
    __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
    (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              int wraparound, int boundscheck);
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
                                                     int is_list, int wraparound, int boundscheck);

/* PyIntCompare.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace);

/* py_dict_keys.proto */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d);

/* UnpackUnboundCMethod.proto */
typedef struct {
    PyObject *type;
    PyObject **method_name;
    PyCFunction func;
    PyObject *method;
    int flag;
} __Pyx_CachedCFunction;

/* CallUnboundCMethod0.proto */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self);
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_CallUnboundCMethod0(cfunc, self)\
    (likely((cfunc)->func) ?\
        (likely((cfunc)->flag == METH_NOARGS) ?  (*((cfunc)->func))(self, NULL) :\
         (PY_VERSION_HEX >= 0x030600B1 && likely((cfunc)->flag == METH_FASTCALL) ?\
            (PY_VERSION_HEX >= 0x030700A0 ?\
                (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0) :\
                (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL)) :\
          (PY_VERSION_HEX >= 0x030700A0 && (cfunc)->flag == (METH_FASTCALL | METH_KEYWORDS) ?\
            (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, &__pyx_empty_tuple, 0, NULL) :\
            (likely((cfunc)->flag == (METH_VARARGS | METH_KEYWORDS)) ?  ((*(PyCFunctionWithKeywords)(void*)(PyCFunction)(cfunc)->func)(self, __pyx_empty_tuple, NULL)) :\
               ((cfunc)->flag == METH_VARARGS ?  (*((cfunc)->func))(self, __pyx_empty_tuple) :\
               __Pyx__CallUnboundCMethod0(cfunc, self)))))) :\
        __Pyx__CallUnboundCMethod0(cfunc, self))
#else
#define __Pyx_CallUnboundCMethod0(cfunc, self)  __Pyx__CallUnboundCMethod0(cfunc, self)
#endif

/* PyObjectCallOneArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);

/* ObjectGetItem.proto */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key);
#else
#define __Pyx_PyObject_GetItem(obj, key)  PyObject_GetItem(obj, key)
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_AddCObj(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_SubtractObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceSubtract(op1, op2) : PyNumber_Subtract(op1, op2))
#endif

/* PyObjectFormatSimple.proto */
#if CYTHON_COMPILING_IN_PYPY
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#elif PY_MAJOR_VERSION < 3
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyString_CheckExact(s)) ? PyUnicode_FromEncodedObject(s, NULL, "strict") :\
        PyObject_Format(s, f))
#elif CYTHON_USE_TYPE_SLOTS
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        likely(PyLong_CheckExact(s)) ? PyLong_Type.tp_repr(s) :\
        likely(PyFloat_CheckExact(s)) ? PyFloat_Type.tp_repr(s) :\
        PyObject_Format(s, f))
#else
    #define __Pyx_PyObject_FormatSimple(s, f) (\
        likely(PyUnicode_CheckExact(s)) ? (Py_INCREF(s), s) :\
        PyObject_Format(s, f))
#endif

/* JoinPyUnicode.proto */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char);

/* GetTopmostException.proto */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem * __Pyx_PyErr_GetTopmostException(PyThreadState *tstate);
#endif

/* SaveResetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_ExceptionSave(type, value, tb)  __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#define __Pyx_ExceptionReset(type, value, tb)  __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
#else
#define __Pyx_ExceptionSave(type, value, tb)   PyErr_GetExcInfo(type, value, tb)
#define __Pyx_ExceptionReset(type, value, tb)  PyErr_SetExcInfo(type, value, tb)
#endif

/* GetException.proto */
#if CYTHON_FAST_THREAD_STATE
#define __Pyx_GetException(type, value, tb)  __Pyx__GetException(__pyx_tstate, type, value, tb)
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
#endif

/* IterFinish.proto */
static CYTHON_INLINE int __Pyx_IterFinish(void);

/* PyObjectCallNoArg.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);

/* PyObjectGetMethod.proto */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method);

/* PyObjectCallMethod0.proto */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name);

/* RaiseNeedMoreValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);

/* RaiseTooManyValuesToUnpack.proto */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);

/* UnpackItemEndCheck.proto */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected);

/* RaiseNoneIterError.proto */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);

/* UnpackTupleError.proto */
static void __Pyx_UnpackTupleError(PyObject *, Py_ssize_t index);

/* UnpackTuple2.proto */
#define __Pyx_unpack_tuple2(tuple, value1, value2, is_tuple, has_known_size, decref_tuple)\
    (likely(is_tuple || PyTuple_Check(tuple)) ?\
        (likely(has_known_size || PyTuple_GET_SIZE(tuple) == 2) ?\
            __Pyx_unpack_tuple2_exact(tuple, value1, value2, decref_tuple) :\
            (__Pyx_UnpackTupleError(tuple, 2), -1)) :\
        __Pyx_unpack_tuple2_generic(tuple, value1, value2, has_known_size, decref_tuple))
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
    PyObject* tuple, PyObject** value1, PyObject** value2, int decref_tuple);
static int __Pyx_unpack_tuple2_generic(
    PyObject* tuple, PyObject** value1, PyObject** value2, int has_known_size, int decref_tuple);

/* dict_iter.proto */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* dict, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_is_dict);
static CYTHON_INLINE int __Pyx_dict_iter_next(PyObject* dict_or_iter, Py_ssize_t orig_length, Py_ssize_t* ppos,
                                              PyObject** pkey, PyObject** pvalue, PyObject** pitem, int is_dict);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_TrueDivideObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceTrueDivide(op1, op2) : PyNumber_TrueDivide(op1, op2))
#endif

/* None.proto */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);

/* PyIntBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyInt_MultiplyObjC(op1, op2, intval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceMultiply(op1, op2) : PyNumber_Multiply(op1, op2))
#endif

/* PyFloatBinop.proto */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check);
#else
#define __Pyx_PyFloat_AddObjC(op1, op2, floatval, inplace, zerodivision_check)\
    (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
#endif

/* pow2.proto */
#define __Pyx_PyNumber_Power2(a, b) PyNumber_Power(a, b, Py_None)

/* dict_getitem_default.proto */
static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value);

/* CallUnboundCMethod1.proto */
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg);
#else
#define __Pyx_CallUnboundCMethod1(cfunc, self, arg)  __Pyx__CallUnboundCMethod1(cfunc, self, arg)
#endif

/* CallUnboundCMethod2.proto */
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2);
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2);
#else
#define __Pyx_CallUnboundCMethod2(cfunc, self, arg1, arg2)  __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2)
#endif

/* Import.proto */
static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);

/* ImportFrom.proto */
static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);

/* GetAttr.proto */
static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);

/* HasAttr.proto */
static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);

/* FastTypeChecks.proto */
#if CYTHON_COMPILING_IN_CPYTHON
#define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) __Pyx_IsAnySubtype2(Py_TYPE(obj), (PyTypeObject *)type1, (PyTypeObject *)type2)
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
#else
#define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
#define __Pyx_TypeCheck2(obj, type1, type2) (PyObject_TypeCheck(obj, (PyTypeObject *)type1) || PyObject_TypeCheck(obj, (PyTypeObject *)type2))
#define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
#define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
#endif
#define __Pyx_PyErr_ExceptionMatches2(err1, err2)  __Pyx_PyErr_GivenExceptionMatches2(__Pyx_PyErr_Occurred(), err1, err2)
#define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)

/* PyObject_GenericGetAttrNoDict.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
#endif

/* PyObject_GenericGetAttr.proto */
#if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
#else
#define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
#endif

/* PyType_Ready.proto */
#if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyType_Ready(PyTypeObject *t);
#else
#define __Pyx_PyType_Ready(t) PyType_Ready(t)
#endif

/* SetupReduce.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce(PyObject* type_obj);
#endif

/* SetVTable.proto */
static int __Pyx_SetVtable(PyObject *dict, void *vtable);

/* GetVTable.proto */
static void* __Pyx_GetVtable(PyTypeObject *type);

/* MergeVTables.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type);
#endif

/* Py3UpdateBases.proto */
static PyObject* __Pyx_PEP560_update_bases(PyObject *bases);

/* CalculateMetaclass.proto */
static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases);

/* PyObjectCall2Args.proto */
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2);

/* PyObjectLookupSpecial.proto */
#if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
#define __Pyx_PyObject_LookupSpecialNoError(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 0)
#define __Pyx_PyObject_LookupSpecial(obj, attr_name)  __Pyx__PyObject_LookupSpecial(obj, attr_name, 1)
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error);
#else
#define __Pyx_PyObject_LookupSpecialNoError(o,n) __Pyx_PyObject_GetAttrStrNoError(o,n)
#define __Pyx_PyObject_LookupSpecial(o,n) __Pyx_PyObject_GetAttrStr(o,n)
#endif

/* Py3ClassCreate.proto */
static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name, PyObject *qualname,
                                           PyObject *mkw, PyObject *modname, PyObject *doc);
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases, PyObject *dict,
                                      PyObject *mkw, int calculate_metaclass, int allow_py2_metaclass);

/* FetchCommonType.proto */
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
#if CYTHON_COMPILING_IN_LIMITED_API
static PyTypeObject* __Pyx_FetchCommonTypeFromSpec(PyType_Spec *spec, PyObject *bases);
#endif

/* PyMethodNew.proto */
#if PY_MAJOR_VERSION >= 3
static PyObject *__Pyx_PyMethod_New(PyObject *func, PyObject *self, PyObject *typ) {
    CYTHON_UNUSED_VAR(typ);
    if (!self)
        return __Pyx_NewRef(func);
    return PyMethod_New(func, self);
}
#else
    #define __Pyx_PyMethod_New PyMethod_New
#endif

/* PyVectorcallFastCallDict.proto */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw);
#endif

/* CythonFunctionShared.proto */
#define __Pyx_CyFunction_USED
#define __Pyx_CYFUNCTION_STATICMETHOD  0x01
#define __Pyx_CYFUNCTION_CLASSMETHOD   0x02
#define __Pyx_CYFUNCTION_CCLASS        0x04
#define __Pyx_CYFUNCTION_COROUTINE     0x08
#define __Pyx_CyFunction_GetClosure(f)\
    (((__pyx_CyFunctionObject *) (f))->func_closure)
#define __Pyx_CyFunction_GetClassObj(f)\
    (((__pyx_CyFunctionObject *) (f))->func_classobj)
#define __Pyx_CyFunction_Defaults(type, f)\
    ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
#define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
    ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
typedef struct {
    PyCFunctionObject func;
#if CYTHON_BACKPORT_VECTORCALL
    __pyx_vectorcallfunc func_vectorcall;
#endif
#if PY_VERSION_HEX < 0x030500A0
    PyObject *func_weakreflist;
#endif
    PyObject *func_dict;
    PyObject *func_name;
    PyObject *func_qualname;
    PyObject *func_doc;
    PyObject *func_globals;
    PyObject *func_code;
    PyObject *func_closure;
    PyObject *func_classobj;
    void *defaults;
    int defaults_pyobjects;
    size_t defaults_size;  // used by FusedFunction for copying defaults
    int flags;
    PyObject *defaults_tuple;
    PyObject *defaults_kwdict;
    PyObject *(*defaults_getter)(PyObject *);
    PyObject *func_annotations;
    PyObject *func_is_coroutine;
} __pyx_CyFunctionObject;
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyTypeObject *__pyx_CyFunctionType = 0;
#endif
#define __Pyx_CyFunction_Check(obj)  __Pyx_TypeCheck(obj, __pyx_CyFunctionType)
#define __Pyx_IsCyOrPyCFunction(obj)  __Pyx_TypeCheck2(obj, __pyx_CyFunctionType, &PyCFunction_Type)
#define __Pyx_CyFunction_CheckExact(obj)  __Pyx_IS_TYPE(obj, __pyx_CyFunctionType)
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject* op, PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
                                                         size_t size,
                                                         int pyobjects);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
                                                            PyObject *tuple);
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
                                                             PyObject *dict);
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
                                                              PyObject *dict);
static int __pyx_CyFunction_init(void);
#if CYTHON_METH_FASTCALL
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames);
#if CYTHON_BACKPORT_VECTORCALL
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func_vectorcall)
#else
#define __Pyx_CyFunction_func_vectorcall(f) (((__pyx_CyFunctionObject*)f)->func.vectorcall)
#endif
#endif

/* CythonFunction.proto */
static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml,
                                      int flags, PyObject* qualname,
                                      PyObject *closure,
                                      PyObject *module, PyObject *globals,
                                      PyObject* code);

/* CLineInTraceback.proto */
#ifdef CYTHON_CLINE_IN_TRACEBACK
#define __Pyx_CLineForTraceback(tstate, c_line)  (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
#else
static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
#endif

/* CodeObjectCache.proto */
#if !CYTHON_COMPILING_IN_LIMITED_API
typedef struct {
    PyCodeObject* code_object;
    int code_line;
} __Pyx_CodeObjectCacheEntry;
struct __Pyx_CodeObjectCache {
    int count;
    int max_count;
    __Pyx_CodeObjectCacheEntry* entries;
};
static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
static PyCodeObject *__pyx_find_code_object(int code_line);
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
#endif

/* AddTraceback.proto */
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename);

/* None.proto */
#include <new>

/* GCCDiagnostics.proto */
#if defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6))
#define __Pyx_HAS_GCC_DIAGNOSTIC
#endif

static PyObject* __pyx_convert__to_py_ClimateStruct(ClimateStruct s);
static PyObject* __pyx_convert__to_py_MainStemLeaf(MainStemLeaf s);
static PyObject* __pyx_convert__to_py_Leaf(Leaf s);
static PyObject* __pyx_convert__to_py_struct__SquareStruct(struct SquareStruct s);
static PyObject* __pyx_convert__to_py_Boll(Boll s);
static PyObject* __pyx_convert__to_py_Burr(Burr s);
static PyObject* __pyx_convert__to_py_Petiole(Petiole s);
static PyObject* __pyx_convert__to_py_FruitingSite(FruitingSite s);
static PyObject* __pyx_convert__to_py_FruitingBranch(FruitingBranch s);
static PyObject* __pyx_convert__to_py_VegetativeBranch(VegetativeBranch s);
static PyObject* __pyx_convert__to_py_Hour(Hour s);
static PyObject* __pyx_convert__to_py_SoilLayer(SoilLayer s);
static PyObject* __pyx_convert__to_py_Root(Root s);
static PyObject* __pyx_convert__to_py_SoilCell(SoilCell s);
static PyObject* __pyx_convert__to_py_Soil(Soil s);
static PyObject* __pyx_convert__to_py_State(State s);
/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value);

/* CIntFromPy.proto */
static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);

/* CIntFromPy.proto */
static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Stage(enum Stage value);

/* CIntFromPy.proto */
static CYTHON_INLINE enum Stage __Pyx_PyInt_As_enum__Stage(PyObject *);

/* CIntToPy.proto */
static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);

/* CIntFromPy.proto */
static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *);

/* CIntFromPy.proto */
static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *);

/* FormatTypeName.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef PyObject *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%U"
static __Pyx_TypeName __Pyx_PyType_GetName(PyTypeObject* tp);
#define __Pyx_DECREF_TypeName(obj) Py_XDECREF(obj)
#else
typedef const char *__Pyx_TypeName;
#define __Pyx_FMT_TYPENAME "%.200s"
#define __Pyx_PyType_GetName(tp) ((tp)->tp_name)
#define __Pyx_DECREF_TypeName(obj)
#endif

/* CheckBinaryVersion.proto */
static int __Pyx_check_binary_version(void);

/* InitStrings.proto */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str);
#else
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
#endif

/* #### Code section: module_declarations ### */
static struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_f_9_cotton2k_10simulation_8NodeLeaf_from_ptr(Leaf *__pyx_v__ptr); /* proto*/
static struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_f_9_cotton2k_10simulation_12FruitingNode_from_ptr(FruitingSite *__pyx_v__ptr); /* proto*/
static struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_f_9_cotton2k_10simulation_12MainStemLeaf_from_ptr(MainStemLeaf *__pyx_v__ptr); /* proto*/
static struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_f_9_cotton2k_10simulation_14FruitingBranch_from_ptr(FruitingBranch *__pyx_v__ptr); /* proto*/
static struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_f_9_cotton2k_10simulation_16VegetativeBranch_from_ptr(VegetativeBranch *__pyx_v__ptr); /* proto*/
static struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_f_9_cotton2k_10simulation_5State_from_ptr(State *__pyx_v__ptr); /* proto*/

/* Module declarations from "libc.stdint" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.climate" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.irrigation" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "libcpp" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.fruiting_site" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.soil" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.state" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.cxx" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "libc.math" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "libc.string" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "libc.stdlib" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif

/* Module declarations from "_cotton2k.rs" */
#if !CYTHON_COMPILING_IN_LIMITED_API
#endif
__PYX_EXTERN_C DL_IMPORT(double) wk(unsigned int, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) tdewest(double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(int) SlabLoc(int, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) dayrad(double, double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) dayrh(double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) daywnd(double, double, double, double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) PotentialStemGrowth(double, int, enum Stage, double, double, double, double, double, double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) AddPlantHeight(double, double, uint32_t, enum Stage, double, double, double, double, double, double, double, double, double, double, double, double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) TemperatureOnFruitGrowthRate(double); /*proto*/

/* Module declarations from "_cotton2k.simulation" */
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_SoilInit = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_Climate = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_NodeLeaf = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_FruitingNode = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_FruitingBranch = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_State = 0;
static PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_Simulation = 0;
#endif
__PYX_EXTERN_C DL_IMPORT(double) daytmp(Simulation &, uint32_t, double, double, uint32_t, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(void) AverageAirTemperatures(Hour *, double &, double &, double &); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) tdewhour(Simulation &, uint32_t, uint32_t, double, double, double, double, double, double, double, double); /*proto*/
__PYX_EXTERN_C DL_IMPORT(double) SimulateRunoff(Simulation &, uint32_t, double, double, uint32_t); /*proto*/
__PYX_EXTERN_C DL_IMPORT(void) EvapoTranspiration(State &, double, double, double, double, double); /*proto*/
static PyObject *__pyx_f_9_cotton2k_10simulation_CopyState(Simulation &, uint32_t); /*proto*/
static void __pyx_f_9_cotton2k_10simulation_initialize_switch(Simulation &); /*proto*/
static PyObject *__pyx_f_9_cotton2k_10simulation_read_agricultural_input(Simulation &, PyObject *); /*proto*/
static PyObject *__pyx_f_9_cotton2k_10simulation___pyx_unpickle_SoilInit__set_state(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *, PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_double(double *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_double(double *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_FruitingSite(FruitingSite *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_FruitingSite(FruitingSite *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_FruitingBranch(FruitingBranch *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_FruitingBranch(FruitingBranch *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_VegetativeBranch(VegetativeBranch *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_VegetativeBranch(VegetativeBranch *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_Hour(Hour *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_Hour(Hour *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilLayer(SoilLayer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilLayer(SoilLayer *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilCell(SoilCell *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilCell(SoilCell *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilCell___5b_20_5d_(SoilCell (*)[20], Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilCell___5b_20_5d_(SoilCell (*)[20], Py_ssize_t); /*proto*/
static int __Pyx_carray_from_py_double(PyObject *, double *, Py_ssize_t); /*proto*/
static MainStemLeaf __pyx_convert__from_py_MainStemLeaf(PyObject *); /*proto*/
static Leaf __pyx_convert__from_py_Leaf(PyObject *); /*proto*/
static struct SquareStruct __pyx_convert__from_py_struct__SquareStruct(PyObject *); /*proto*/
static Boll __pyx_convert__from_py_Boll(PyObject *); /*proto*/
static Burr __pyx_convert__from_py_Burr(PyObject *); /*proto*/
static Petiole __pyx_convert__from_py_Petiole(PyObject *); /*proto*/
static FruitingSite __pyx_convert__from_py_FruitingSite(PyObject *); /*proto*/
static int __Pyx_carray_from_py_FruitingSite(PyObject *, FruitingSite *, Py_ssize_t); /*proto*/
static FruitingBranch __pyx_convert__from_py_FruitingBranch(PyObject *); /*proto*/
static int __Pyx_carray_from_py_FruitingBranch(PyObject *, FruitingBranch *, Py_ssize_t); /*proto*/
static VegetativeBranch __pyx_convert__from_py_VegetativeBranch(PyObject *); /*proto*/
static int __Pyx_carray_from_py_VegetativeBranch(PyObject *, VegetativeBranch *, Py_ssize_t); /*proto*/
static Hour __pyx_convert__from_py_Hour(PyObject *); /*proto*/
static int __Pyx_carray_from_py_Hour(PyObject *, Hour *, Py_ssize_t); /*proto*/
static SoilLayer __pyx_convert__from_py_SoilLayer(PyObject *); /*proto*/
static int __Pyx_carray_from_py_SoilLayer(PyObject *, SoilLayer *, Py_ssize_t); /*proto*/
static Root __pyx_convert__from_py_Root(PyObject *); /*proto*/
static SoilCell __pyx_convert__from_py_SoilCell(PyObject *); /*proto*/
static int __Pyx_carray_from_py_SoilCell(PyObject *, SoilCell *, Py_ssize_t); /*proto*/
static int __Pyx_carray_from_py_SoilCell___5b_20_5d_(PyObject *, SoilCell (*)[20], Py_ssize_t); /*proto*/
static Soil __pyx_convert__from_py_Soil(PyObject *); /*proto*/
static State __pyx_convert__from_py_State(PyObject *); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_py_ClimateStruct(ClimateStruct *, Py_ssize_t); /*proto*/
static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_ClimateStruct(ClimateStruct *, Py_ssize_t); /*proto*/
static ClimateStruct __pyx_convert__from_py_ClimateStruct(PyObject *); /*proto*/
/* #### Code section: typeinfo ### */
/* #### Code section: before_global_var ### */
#define __Pyx_MODULE_NAME "_cotton2k.simulation"
extern int __pyx_module_is_main__cotton2k__simulation;
int __pyx_module_is_main__cotton2k__simulation = 0;

/* Implementation of "_cotton2k.simulation" */
/* #### Code section: global_var ### */
static PyObject *__pyx_builtin_RuntimeError;
static PyObject *__pyx_builtin_range;
static PyObject *__pyx_builtin_enumerate;
static PyObject *__pyx_builtin_StopIteration;
static PyObject *__pyx_builtin_TypeError;
static PyObject *__pyx_builtin_OverflowError;
static PyObject *__pyx_builtin_IndexError;
static PyObject *__pyx_builtin_KeyError;
static PyObject *__pyx_builtin_ValueError;
/* #### Code section: string_decls ### */
static const char __pyx_k_c[] = "c";
static const char __pyx_k_i[] = "i";
static const char __pyx_k_j[] = "j";
static const char __pyx_k_k[] = "k";
static const char __pyx_k_l[] = "l";
static const char __pyx_k_m[] = "m";
static const char __pyx_k_p[] = "p";
static const char __pyx_k_u[] = "u";
static const char __pyx_k__8[] = " ";
static const char __pyx_k_cc[] = "cc";
static const char __pyx_k_cd[] = "cd";
static const char __pyx_k_gc[] = "gc";
static const char __pyx_k_k0[] = "k0";
static const char __pyx_k_l1[] = "l1";
static const char __pyx_k_l2[] = "l2";
static const char __pyx_k_p1[] = "p1";
static const char __pyx_k_p2[] = "p2";
static const char __pyx_k_p3[] = "p3";
static const char __pyx_k_p4[] = "p4";
static const char __pyx_k_p5[] = "p5";
static const char __pyx_k_p6[] = "p6";
static const char __pyx_k_p7[] = "p7";
static const char __pyx_k_pi[] = "pi";
static const char __pyx_k_sd[] = "sd";
static const char __pyx_k_sw[] = "sw";
static const char __pyx_k_t1[] = "t1";
static const char __pyx_k_t2[] = "t2";
static const char __pyx_k_t3[] = "t3";
static const char __pyx_k_ti[] = "ti";
static const char __pyx_k_z1[] = "z1";
static const char __pyx_k_Rad[] = "Rad";
static const char __pyx_k_Y_j[] = "%Y %j";
static const char __pyx_k_age[] = "age";
static const char __pyx_k_c11[] = "c11";
static const char __pyx_k_cos[] = "cos";
static const char __pyx_k_doc[] = "__doc__";
static const char __pyx_k_dum[] = "dum";
static const char __pyx_k_et1[] = "et1";
static const char __pyx_k_et2[] = "et2";
static const char __pyx_k_get[] = "get";
static const char __pyx_k_ihr[] = "ihr";
static const char __pyx_k_jp1[] = "jp1";
static const char __pyx_k_lp1[] = "lp1";
static const char __pyx_k_max[] = "max";
static const char __pyx_k_min[] = "min";
static const char __pyx_k_mp1[] = "mp1";
static const char __pyx_k_new[] = "__new__";
static const char __pyx_k_pex[] = "pex";
static const char __pyx_k_pts[] = "pts";
static const char __pyx_k_run[] = "run";
static const char __pyx_k_sin[] = "sin";
static const char __pyx_k_sw0[] = "sw0";
static const char __pyx_k_sw1[] = "sw1";
static const char __pyx_k_tav[] = "tav";
static const char __pyx_k_Rain[] = "Rain";
static const char __pyx_k_Tdew[] = "Tdew";
static const char __pyx_k_Tmax[] = "Tmax";
static const char __pyx_k_Tmin[] = "Tmin";
static const char __pyx_k_Wind[] = "Wind";
static const char __pyx_k__213[] = "?";
static const char __pyx_k_acos[] = "acos";
static const char __pyx_k_area[] = "area";
static const char __pyx_k_beta[] = "beta";
static const char __pyx_k_boll[] = "boll";
static const char __pyx_k_burr[] = "burr";
static const char __pyx_k_clay[] = "clay";
static const char __pyx_k_date[] = "date";
static const char __pyx_k_dict[] = "__dict__";
static const char __pyx_k_dsbe[] = "dsbe";
static const char __pyx_k_hour[] = "hour";
static const char __pyx_k_kday[] = "kday";
static const char __pyx_k_keys[] = "keys";
static const char __pyx_k_leaf[] = "leaf";
static const char __pyx_k_main[] = "__main__";
static const char __pyx_k_math[] = "math";
static const char __pyx_k_name[] = "__name__";
static const char __pyx_k_nwfl[] = "nwfl";
static const char __pyx_k_rain[] = "rain";
static const char __pyx_k_rate[] = "rate";
static const char __pyx_k_root[] = "root";
static const char __pyx_k_sand[] = "sand";
static const char __pyx_k_self[] = "self";
static const char __pyx_k_sinb[] = "sinb";
static const char __pyx_k_smax[] = "smax";
static const char __pyx_k_soil[] = "soil";
static const char __pyx_k_sqrt[] = "sqrt";
static const char __pyx_k_step[] = "step";
static const char __pyx_k_stop[] = "stop";
static const char __pyx_k_sunr[] = "sunr";
static const char __pyx_k_suns[] = "suns";
static const char __pyx_k_test[] = "__test__";
static const char __pyx_k_tfrt[] = "tfrt";
static const char __pyx_k_type[] = "type";
static const char __pyx_k_urea[] = "urea";
static const char __pyx_k_wfdb[] = "wfdb";
static const char __pyx_k_wind[] = "wind";
static const char __pyx_k_xlat[] = "xlat";
static const char __pyx_k_year[] = "year";
static const char __pyx_k_zero[] = "zero";
static const char __pyx_k_zint[] = "zint";
static const char __pyx_k_State[] = "State";
static const char __pyx_k_alpha[] = "alpha";
static const char __pyx_k_bmain[] = "bmain";
static const char __pyx_k_cdpet[] = "cdpet";
static const char __pyx_k_cells[] = "cells";
static const char __pyx_k_denf2[] = "denf2";
static const char __pyx_k_depth[] = "depth";
static const char __pyx_k_gsubr[] = "gsubr";
static const char __pyx_k_hours[] = "hours";
static const char __pyx_k_items[] = "items";
static const char __pyx_k_kkday[] = "kkday";
static const char __pyx_k_lfint[] = "lfint";
static const char __pyx_k_newbr[] = "newbr";
static const char __pyx_k_nodes[] = "nodes";
static const char __pyx_k_range[] = "range";
static const char __pyx_k_rbmax[] = "rbmax";
static const char __pyx_k_rsubl[] = "rsubl";
static const char __pyx_k_rsubo[] = "rsubo";
static const char __pyx_k_shade[] = "shade";
static const char __pyx_k_smaxx[] = "smaxx";
static const char __pyx_k_stage[] = "stage";
static const char __pyx_k_start[] = "start";
static const char __pyx_k_state[] = "state";
static const char __pyx_k_sumwk[] = "sumwk";
static const char __pyx_k_super[] = "super";
static const char __pyx_k_tdday[] = "tdday";
static const char __pyx_k_theta[] = "theta";
static const char __pyx_k_vpnet[] = "vpnet";
static const char __pyx_k_vstrs[] = "vstrs";
static const char __pyx_k_water[] = "water";
static const char __pyx_k_wbmax[] = "wbmax";
static const char __pyx_k_wnytf[] = "wnytf";
static const char __pyx_k_addlfn[] = "addlfn";
static const char __pyx_k_agemax[] = "agemax";
static const char __pyx_k_agetop[] = "agetop";
static const char __pyx_k_albedo[] = "albedo";
static const char __pyx_k_amount[] = "amount";
static const char __pyx_k_cdleaf[] = "cdleaf";
static const char __pyx_k_cdroot[] = "cdroot";
static const char __pyx_k_cdstem[] = "cdstem";
static const char __pyx_k_daynum[] = "daynum";
static const char __pyx_k_denfac[] = "denfac";
static const char __pyx_k_dict_2[] = "_dict";
static const char __pyx_k_enable[] = "enable";
static const char __pyx_k_growth[] = "_growth";
static const char __pyx_k_htdenf[] = "htdenf";
static const char __pyx_k_import[] = "__import__";
static const char __pyx_k_kwargs[] = "kwargs";
static const char __pyx_k_layers[] = "layers";
static const char __pyx_k_lyrsol[] = "lyrsol";
static const char __pyx_k_lytres[] = "lytres";
static const char __pyx_k_method[] = "method";
static const char __pyx_k_minute[] = "minute";
static const char __pyx_k_module[] = "__module__";
static const char __pyx_k_nidmax[] = "nidmax";
static const char __pyx_k_pickle[] = "pickle";
static const char __pyx_k_pplant[] = "pplant";
static const char __pyx_k_psilim[] = "psilim";
static const char __pyx_k_pstand[] = "pstand";
static const char __pyx_k_ptnfac[] = "ptnfac";
static const char __pyx_k_radsum[] = "radsum";
static const char __pyx_k_reduce[] = "__reduce__";
static const char __pyx_k_ref_et[] = "ref_et";
static const char __pyx_k_result[] = "result";
static const char __pyx_k_runoff[] = "runoff";
static const char __pyx_k_second[] = "second";
static const char __pyx_k_square[] = "square";
static const char __pyx_k_state0[] = "state0";
static const char __pyx_k_stress[] = "_stress";
static const char __pyx_k_sumpdr[] = "sumpdr";
static const char __pyx_k_tmpisr[] = "tmpisr";
static const char __pyx_k_update[] = "update";
static const char __pyx_k_vfrtbr[] = "vfrtbr";
static const char __pyx_k_vpheno[] = "vpheno";
static const char __pyx_k_vpotlf[] = "vpotlf";
static const char __pyx_k_vpvegb[] = "vpvegb";
static const char __pyx_k_wattsm[] = "wattsm";
static const char __pyx_k_weight[] = "weight";
static const char __pyx_k_wstrlf[] = "wstrlf";
static const char __pyx_k_Climate[] = "Climate";
static const char __pyx_k_air_dry[] = "air_dry";
static const char __pyx_k_climate[] = "climate";
static const char __pyx_k_cotylwt[] = "cotylwt";
static const char __pyx_k_day_inc[] = "day_inc";
static const char __pyx_k_disable[] = "disable";
static const char __pyx_k_getattr[] = "__getattr__";
static const char __pyx_k_initial[] = "initial";
static const char __pyx_k_maxrtgr[] = "maxrtgr";
static const char __pyx_k_nitrate[] = "nitrate";
static const char __pyx_k_perdmax[] = "perdmax";
static const char __pyx_k_petiole[] = "petiole";
static const char __pyx_k_pnetcor[] = "pnetcor";
static const char __pyx_k_prepare[] = "__prepare__";
static const char __pyx_k_ratebol[] = "ratebol";
static const char __pyx_k_ratebur[] = "ratebur";
static const char __pyx_k_ratesqr[] = "ratesqr";
static const char __pyx_k_replace[] = "replace";
static const char __pyx_k_stemnew[] = "stemnew";
static const char __pyx_k_version[] = "version";
static const char __pyx_k_voldstm[] = "voldstm";
static const char __pyx_k_vpotfrt[] = "vpotfrt";
static const char __pyx_k_wtfstrs[] = "wtfstrs";
static const char __pyx_k_KeyError[] = "KeyError";
static const char __pyx_k_NodeLeaf[] = "NodeLeaf";
static const char __pyx_k_SoilInit[] = "SoilInit";
static const char __pyx_k_ammonium[] = "ammonium";
static const char __pyx_k_date2doy[] = "date2doy";
static const char __pyx_k_datetime[] = "datetime";
static const char __pyx_k_dewpoint[] = "dewpoint";
static const char __pyx_k_doy2date[] = "_doy2date";
static const char __pyx_k_fraction[] = "fraction";
static const char __pyx_k_getstate[] = "__getstate__";
static const char __pyx_k_humidity[] = "humidity";
static const char __pyx_k_latitude[] = "latitude";
static const char __pyx_k_maxstmgr[] = "maxstmgr";
static const char __pyx_k_new_node[] = "new_node";
static const char __pyx_k_oldstmwt[] = "oldstmwt";
static const char __pyx_k_pyx_type[] = "__pyx_type";
static const char __pyx_k_qualname[] = "__qualname__";
static const char __pyx_k_set_name[] = "__set_name__";
static const char __pyx_k_setstate[] = "__setstate__";
static const char __pyx_k_simulate[] = "_simulate";
static const char __pyx_k_strptime[] = "strptime";
static const char __pyx_k_OpenRatio[] = "OpenRatio";
static const char __pyx_k_TypeError[] = "TypeError";
static const char __pyx_k_cloud_cor[] = "cloud_cor";
static const char __pyx_k_cloud_cov[] = "cloud_cov";
static const char __pyx_k_defoliate[] = "_defoliate";
static const char __pyx_k_dew_point[] = "dew_point";
static const char __pyx_k_elevation[] = "elevation";
static const char __pyx_k_enumerate[] = "enumerate";
static const char __pyx_k_hydrology[] = "hydrology";
static const char __pyx_k_init_grid[] = "_init_grid";
static const char __pyx_k_isenabled[] = "isenabled";
static const char __pyx_k_leaf_area[] = "leaf_area";
static const char __pyx_k_longitude[] = "longitude";
static const char __pyx_k_metaclass[] = "__metaclass__";
static const char __pyx_k_phenology[] = "_phenology";
static const char __pyx_k_pyx_state[] = "__pyx_state";
static const char __pyx_k_radiation[] = "radiation";
static const char __pyx_k_rainToday[] = "rainToday";
static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
static const char __pyx_k_row_space[] = "row_space";
static const char __pyx_k_timedelta[] = "timedelta";
static const char __pyx_k_IndexError[] = "IndexError";
static const char __pyx_k_Simulation[] = "Simulation";
static const char __pyx_k_State_keys[] = "State.keys";
static const char __pyx_k_ValueError[] = "ValueError";
static const char __pyx_k_day_length[] = "day_length";
static const char __pyx_k_drip_depth[] = "drip_depth";
static const char __pyx_k_first_node[] = "first_node";
static const char __pyx_k_init_state[] = "_init_state";
static const char __pyx_k_irrigation[] = "irrigation";
static const char __pyx_k_lint_yield[] = "lint_yield";
static const char __pyx_k_new_branch[] = "new_branch";
static const char __pyx_k_pyx_result[] = "__pyx_result";
static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
static const char __pyx_k_read_input[] = "read_input";
static const char __pyx_k_solar_noon[] = "solar_noon";
static const char __pyx_k_start_date[] = "start_date";
static const char __pyx_k_stemNRatio[] = "stemNRatio";
static const char __pyx_k_wind_speed[] = "wind_speed";
static const char __pyx_k_PickleError[] = "PickleError";
static const char __pyx_k_WaterStress[] = "WaterStress";
static const char __pyx_k_declination[] = "declination";
static const char __pyx_k_layer_depth[] = "layer_depth";
static const char __pyx_k_leaf_weight[] = "leaf_weight";
static const char __pyx_k_microsecond[] = "microsecond";
static const char __pyx_k_mro_entries[] = "__mro_entries__";
static const char __pyx_k_runoffToday[] = "runoffToday";
static const char __pyx_k_stem_weight[] = "stem_weight";
static const char __pyx_k_temperature[] = "temperature";
static const char __pyx_k_FruitingNode[] = "FruitingNode";
static const char __pyx_k_MainStemLeaf[] = "MainStemLeaf";
static const char __pyx_k_RuntimeError[] = "RuntimeError";
static const char __pyx_k_bulk_density[] = "bulk_density";
static const char __pyx_k_extra_carbon[] = "extra_carbon";
static const char __pyx_k_is_coroutine[] = "_is_coroutine";
static const char __pyx_k_plant_height[] = "plant_height";
static const char __pyx_k_plant_weight[] = "plant_weight";
static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
static const char __pyx_k_stringsource[] = "stringsource";
static const char __pyx_k_use_setstate[] = "use_setstate";
static const char __pyx_k_water_stress[] = "water_stress";
static const char __pyx_k_OverflowError[] = "OverflowError";
static const char __pyx_k_SimulationEnd[] = "SimulationEnd";
static const char __pyx_k_StopIteration[] = "StopIteration";
static const char __pyx_k_actual_growth[] = "actual_growth";
static const char __pyx_k_applied_water[] = "applied_water";
static const char __pyx_k_burr_nitrogen[] = "burr_nitrogen";
static const char __pyx_k_carbon_stress[] = "carbon_stress";
static const char __pyx_k_class_getitem[] = "__class_getitem__";
static const char __pyx_k_cotton2k_leaf[] = "_cotton2k.leaf";
static const char __pyx_k_daily_climate[] = "_daily_climate";
static const char __pyx_k_fertilization[] = "fertilization";
static const char __pyx_k_growth_factor[] = "growth_factor";
static const char __pyx_k_init_subclass[] = "__init_subclass__";
static const char __pyx_k_leaf_nitrogen[] = "leaf_nitrogen";
static const char __pyx_k_net_radiation[] = "net_radiation";
static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
static const char __pyx_k_seed_nitrogen[] = "seed_nitrogen";
static const char __pyx_k_square_weight[] = "square_weight";
static const char __pyx_k_stem_nitrogen[] = "stem_nitrogen";
static const char __pyx_k_DaysTo1stSqare[] = "DaysTo1stSqare";
static const char __pyx_k_FruitingBranch[] = "FruitingBranch";
static const char __pyx_k_Simulation_run[] = "Simulation.run";
static const char __pyx_k_column_shading[] = "_column_shading";
static const char __pyx_k_cotton2k_utils[] = "_cotton2k.utils";
static const char __pyx_k_density_factor[] = "density_factor";
static const char __pyx_k_main_stem_leaf[] = "main_stem_leaf";
static const char __pyx_k_organic_matter[] = "organic_matter";
static const char __pyx_k_petiole_weight[] = "petiole_weight";
static const char __pyx_k_ratio_implicit[] = "ratio_implicit";
static const char __pyx_k_ginning_percent[] = "ginning_percent";
static const char __pyx_k_leaf_area_index[] = "leaf_area_index";
static const char __pyx_k_nitrogen_stress[] = "nitrogen_stress";
static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
static const char __pyx_k_square_nitrogen[] = "square_nitrogen";
static const char __pyx_k_Simulation_state[] = "Simulation.state";
static const char __pyx_k_VegetativeBranch[] = "VegetativeBranch";
static const char __pyx_k_cotton2k_climate[] = "_cotton2k.climate";
static const char __pyx_k_max_conductivity[] = "max_conductivity";
static const char __pyx_k_nitrate_nitrogen[] = "nitrate_nitrogen";
static const char __pyx_k_potential_growth[] = "potential_growth";
static const char __pyx_k_ammonium_nitrogen[] = "ammonium_nitrogen";
static const char __pyx_k_bloom_weight_loss[] = "bloom_weight_loss";
static const char __pyx_k_delayFrtByCStress[] = "delayFrtByCStress";
static const char __pyx_k_delayVegByCStress[] = "delayVegByCStress";
static const char __pyx_k_fruiting_branches[] = "fruiting_branches";
static const char __pyx_k_number_of_squares[] = "number_of_squares";
static const char __pyx_k_open_bolls_weight[] = "open_bolls_weight";
static const char __pyx_k_simulate_this_day[] = "_simulate_this_day";
static const char __pyx_k_vegetative_branch[] = "vegetative_branch";
static const char __pyx_k_water_stress_stem[] = "water_stress_stem";
static const char __pyx_k_PhenDelayByNStress[] = "PhenDelayByNStress";
static const char __pyx_k_Simulation__growth[] = "Simulation._growth";
static const char __pyx_k_Simulation__stress[] = "Simulation._stress";
static const char __pyx_k_ambient_co2_factor[] = "ambient_co2_factor";
static const char __pyx_k_asyncio_coroutines[] = "asyncio.coroutines";
static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
static const char __pyx_k_compute_day_length[] = "compute_day_length";
static const char __pyx_k_delay_for_new_node[] = "delay_for_new_node";
static const char __pyx_k_evapotranspiration[] = "evapotranspiration";
static const char __pyx_k_fruit_growth_ratio[] = "fruit_growth_ratio";
static const char __pyx_k_green_bolls_weight[] = "green_bolls_weight";
static const char __pyx_k_light_interception[] = "light_interception";
static const char __pyx_k_pollination_switch[] = "pollination_switch";
static const char __pyx_k_TimeToNextFruBranch[] = "TimeToNextFruBranch";
static const char __pyx_k_TimeToNextVegBranch[] = "TimeToNextVegBranch";
static const char __pyx_k_add_fruiting_branch[] = "add_fruiting_branch";
static const char __pyx_k_agricultural_inputs[] = "agricultural_inputs";
static const char __pyx_k_average_temperature[] = "average_temperature";
static const char __pyx_k_cotton2k_simulation[] = "_cotton2k.simulation";
static const char __pyx_k_create_first_square[] = "create_first_square";
static const char __pyx_k_cultivar_parameters[] = "cultivar_parameters";
static const char __pyx_k_vegetative_branches[] = "vegetative_branches";
static const char __pyx_k_Simulation__doy2date[] = "Simulation._doy2date";
static const char __pyx_k_Simulation__simulate[] = "Simulation._simulate";
static const char __pyx_k_abscised_fruit_sites[] = "abscised_fruit_sites";
static const char __pyx_k_abscised_leaf_weight[] = "abscised_leaf_weight";
static const char __pyx_k_actual_transpiration[] = "actual_transpiration";
static const char __pyx_k_days_to_first_square[] = "_days_to_first_square";
static const char __pyx_k_delay_for_new_branch[] = "delay_for_new_branch";
static const char __pyx_k_fresh_organic_matter[] = "fresh_organic_matter";
static const char __pyx_k_last_fruiting_branch[] = "last_fruiting_branch";
static const char __pyx_k_nitrogen_stress_root[] = "nitrogen_stress_root";
static const char __pyx_k_number_of_open_bolls[] = "number_of_open_bolls";
static const char __pyx_k_Simulation__defoliate[] = "Simulation._defoliate";
static const char __pyx_k_Simulation__init_grid[] = "Simulation._init_grid";
static const char __pyx_k_Simulation__phenology[] = "Simulation._phenology";
static const char __pyx_k_Simulation_read_input[] = "Simulation.read_input";
static const char __pyx_k_State___reduce_cython[] = "State.__reduce_cython__";
static const char __pyx_k_add_vegetative_branch[] = "_add_vegetative_branch";
static const char __pyx_k_drip_horizontal_place[] = "drip_horizontal_place";
static const char __pyx_k_number_of_green_bolls[] = "number_of_green_bolls";
static const char __pyx_k_potential_leaf_growth[] = "_potential_leaf_growth";
static const char __pyx_k_pyx_unpickle_SoilInit[] = "__pyx_unpickle_SoilInit";
static const char __pyx_k_weight_capable_uptake[] = "weight_capable_uptake";
static const char __pyx_k_Simulation__init_state[] = "Simulation._init_state";
static const char __pyx_k_cumulative_evaporation[] = "cumulative_evaporation";
static const char __pyx_k_defoliation_prediction[] = "defoliation prediction";
static const char __pyx_k_first_square_leaf_area[] = "first_square_leaf_area";
static const char __pyx_k_get_net_photosynthesis[] = "_get_net_photosynthesis";
static const char __pyx_k_leaf_area_pre_fruiting[] = "leaf_area_pre_fruiting";
static const char __pyx_k_leaf_weight_area_ratio[] = "leaf_weight_area_ratio";
static const char __pyx_k_open_bolls_burr_weight[] = "open_bolls_burr_weight";
static const char __pyx_k_potential_fruit_growth[] = "_potential_fruit_growth";
static const char __pyx_k_Climate___reduce_cython[] = "Climate.__reduce_cython__";
static const char __pyx_k_State___setstate_cython[] = "State.__setstate_cython__";
static const char __pyx_k_actual_soil_evaporation[] = "actual_soil_evaporation";
static const char __pyx_k_calc_light_interception[] = "_calc_light_interception";
static const char __pyx_k_cotton2k_photosynthesis[] = "_cotton2k.photosynthesis";
static const char __pyx_k_green_bolls_burr_weight[] = "green_bolls_burr_weight";
static const char __pyx_k_total_required_nitrogen[] = "total_required_nitrogen";
static const char __pyx_k_NodeLeaf___reduce_cython[] = "NodeLeaf.__reduce_cython__";
static const char __pyx_k_SoilInit___reduce_cython[] = "SoilInit.__reduce_cython__";
static const char __pyx_k_cumulative_nitrogen_loss[] = "cumulative_nitrogen_loss";
static const char __pyx_k_cumulative_transpiration[] = "cumulative_transpiration";
static const char __pyx_k_leaf_weight_pre_fruiting[] = "leaf_weight_pre_fruiting";
static const char __pyx_k_nitrate_nitrogen_content[] = "nitrate_nitrogen_content";
static const char __pyx_k_nitrogen_stress_fruiting[] = "nitrogen_stress_fruiting";
static const char __pyx_k_number_of_fruiting_nodes[] = "number_of_fruiting_nodes";
static const char __pyx_k_number_of_fruiting_sites[] = "number_of_fruiting_sites";
static const char __pyx_k_Climate___setstate_cython[] = "Climate.__setstate_cython__";
static const char __pyx_k_Simulation__daily_climate[] = "Simulation._daily_climate";
static const char __pyx_k_State_add_fruiting_branch[] = "State.add_fruiting_branch";
static const char __pyx_k_State_create_first_square[] = "State.create_first_square";
static const char __pyx_k_age_of_pre_fruiting_nodes[] = "age_of_pre_fruiting_nodes";
static const char __pyx_k_NodeLeaf___setstate_cython[] = "NodeLeaf.__setstate_cython__";
static const char __pyx_k_Simulation___reduce_cython[] = "Simulation.__reduce_cython__";
static const char __pyx_k_Simulation__column_shading[] = "Simulation._column_shading";
static const char __pyx_k_SoilInit___setstate_cython[] = "SoilInit.__setstate_cython__";
static const char __pyx_k_new_node_initial_leaf_area[] = "new_node_initial_leaf_area";
static const char __pyx_k_nitrogen_stress_vegetative[] = "nitrogen_stress_vegetative";
static const char __pyx_k_number_of_layers_with_root[] = "number_of_layers_with_root";
static const char __pyx_k_leaf_nitrogen_concentration[] = "leaf_nitrogen_concentration";
static const char __pyx_k_number_of_fruiting_branches[] = "number_of_fruiting_branches";
static const char __pyx_k_root_nitrogen_concentration[] = "root_nitrogen_concentration";
static const char __pyx_k_seed_nitrogen_concentration[] = "seed_nitrogen_concentration";
static const char __pyx_k_time_to_new_fruiting_branch[] = "time_to_new_fruiting_branch";
static const char __pyx_k_FruitingNode___reduce_cython[] = "FruitingNode.__reduce_cython__";
static const char __pyx_k_MainStemLeaf___reduce_cython[] = "MainStemLeaf.__reduce_cython__";
static const char __pyx_k_Simulation___setstate_cython[] = "Simulation.__setstate_cython__";
static const char __pyx_k_number_of_pre_fruiting_nodes[] = "number_of_pre_fruiting_nodes";
static const char __pyx_k_src__cotton2k_simulation_pyx[] = "src\\_cotton2k\\simulation.pyx";
static const char __pyx_k_Simulation__simulate_this_day[] = "Simulation._simulate_this_day";
static const char __pyx_k_delay_for_new_fruiting_branch[] = "delay_for_new_fruiting_branch";
static const char __pyx_k_number_of_vegetative_branches[] = "number_of_vegetative_branches";
static const char __pyx_k_square_nitrogen_concentration[] = "square_nitrogen_concentration";
static const char __pyx_k_FruitingBranch___reduce_cython[] = "FruitingBranch.__reduce_cython__";
static const char __pyx_k_FruitingNode___setstate_cython[] = "FruitingNode.__setstate_cython__";
static const char __pyx_k_MainStemLeaf___setstate_cython[] = "MainStemLeaf.__setstate_cython__";
static const char __pyx_k_field_capacity_water_potential[] = "field_capacity_water_potential";
static const char __pyx_k_petiole_nitrogen_concentration[] = "petiole_nitrogen_concentration";
static const char __pyx_k_potential_growth_for_leaf_area[] = "potential_growth_for_leaf_area";
static const char __pyx_k_Pickling_of_struct_members_such[] = "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)";
static const char __pyx_k_planting_date_or_emergence_date[] = " planting date or emergence date must be given in the profile file !!";
static const char __pyx_k_self___cannot_be_converted_to_a[] = "self._ cannot be converted to a Python object for pickling";
static const char __pyx_k_temperature_on_leaf_growth_rate[] = "temperature_on_leaf_growth_rate";
static const char __pyx_k_FruitingBranch___setstate_cython[] = "FruitingBranch.__setstate_cython__";
static const char __pyx_k_Incompatible_checksums_s_vs_0x84[] = "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))";
static const char __pyx_k_No_value_specified_for_struct_at[] = "No value specified for struct attribute 'leaf_area'";
static const char __pyx_k_Simulation__add_vegetative_branc[] = "Simulation._add_vegetative_branch";
static const char __pyx_k_Simulation__calc_light_intercept[] = "Simulation._calc_light_interception";
static const char __pyx_k_Simulation__days_to_first_square[] = "Simulation._days_to_first_square";
static const char __pyx_k_Simulation__get_net_photosynthes[] = "Simulation._get_net_photosynthesis";
static const char __pyx_k_Simulation__potential_fruit_grow[] = "Simulation._potential_fruit_growth";
static const char __pyx_k_Simulation__potential_leaf_growt[] = "Simulation._potential_leaf_growth";
static const char __pyx_k_VegetativeBranch___reduce_cython[] = "VegetativeBranch.__reduce_cython__";
static const char __pyx_k_VegetativeBranch___setstate_cyth[] = "VegetativeBranch.__setstate_cython__";
static const char __pyx_k_field_capacity_hydraulic_conduct[] = "field_capacity_hydraulic_conductivity";
static const char __pyx_k_immediate_drainage_water_potenti[] = "immediate_drainage_water_potential";
static const char __pyx_k_number_of_left_columns_with_root[] = "number_of_left_columns_with_root";
static const char __pyx_k_number_of_right_columns_with_roo[] = "number_of_right_columns_with_root";
static const char __pyx_k_potential_growth_for_leaf_weight[] = "potential_growth_for_leaf_weight";
static const char __pyx_k_potential_growth_for_petiole_wei[] = "potential_growth_for_petiole_weight";
static const char __pyx_k_saturated_hydraulic_conductivity[] = "saturated_hydraulic_conductivity";
static const char __pyx_k_self_climate_cannot_be_converted[] = "self.climate cannot be converted to a Python object for pickling";
static const char __pyx_k_No_value_specified_for_struct_at_2[] = "No value specified for struct attribute 'leaf_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_3[] = "No value specified for struct attribute 'petiole_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_4[] = "No value specified for struct attribute 'potential_growth_for_leaf_area'";
static const char __pyx_k_No_value_specified_for_struct_at_5[] = "No value specified for struct attribute 'potential_growth_for_leaf_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_6[] = "No value specified for struct attribute 'potential_growth_for_petiole_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_7[] = "No value specified for struct attribute 'age'";
static const char __pyx_k_No_value_specified_for_struct_at_8[] = "No value specified for struct attribute 'potential_growth'";
static const char __pyx_k_No_value_specified_for_struct_at_9[] = "No value specified for struct attribute 'area'";
static const char __pyx_k_No_value_specified_for_struct_at_10[] = "No value specified for struct attribute 'weight'";
static const char __pyx_k_No_value_specified_for_struct_at_11[] = "No value specified for struct attribute 'fraction'";
static const char __pyx_k_No_value_specified_for_struct_at_12[] = "No value specified for struct attribute 'average_temperature'";
static const char __pyx_k_No_value_specified_for_struct_at_13[] = "No value specified for struct attribute 'ginning_percent'";
static const char __pyx_k_No_value_specified_for_struct_at_14[] = "No value specified for struct attribute 'stage'";
static const char __pyx_k_No_value_specified_for_struct_at_15[] = "No value specified for struct attribute 'leaf'";
static const char __pyx_k_No_value_specified_for_struct_at_16[] = "No value specified for struct attribute 'square'";
static const char __pyx_k_No_value_specified_for_struct_at_17[] = "No value specified for struct attribute 'boll'";
static const char __pyx_k_No_value_specified_for_struct_at_18[] = "No value specified for struct attribute 'burr'";
static const char __pyx_k_No_value_specified_for_struct_at_19[] = "No value specified for struct attribute 'petiole'";
static const char __pyx_k_No_value_specified_for_struct_at_20[] = "No value specified for struct attribute 'number_of_fruiting_nodes'";
static const char __pyx_k_No_value_specified_for_struct_at_21[] = "No value specified for struct attribute 'delay_for_new_node'";
static const char __pyx_k_No_value_specified_for_struct_at_22[] = "No value specified for struct attribute 'main_stem_leaf'";
static const char __pyx_k_No_value_specified_for_struct_at_23[] = "No value specified for struct attribute 'nodes'";
static const char __pyx_k_No_value_specified_for_struct_at_24[] = "No value specified for struct attribute 'number_of_fruiting_branches'";
static const char __pyx_k_No_value_specified_for_struct_at_25[] = "No value specified for struct attribute 'delay_for_new_fruiting_branch'";
static const char __pyx_k_No_value_specified_for_struct_at_26[] = "No value specified for struct attribute 'fruiting_branches'";
static const char __pyx_k_No_value_specified_for_struct_at_27[] = "No value specified for struct attribute 'temperature'";
static const char __pyx_k_No_value_specified_for_struct_at_28[] = "No value specified for struct attribute 'radiation'";
static const char __pyx_k_No_value_specified_for_struct_at_29[] = "No value specified for struct attribute 'cloud_cov'";
static const char __pyx_k_No_value_specified_for_struct_at_30[] = "No value specified for struct attribute 'cloud_cor'";
static const char __pyx_k_No_value_specified_for_struct_at_31[] = "No value specified for struct attribute 'et1'";
static const char __pyx_k_No_value_specified_for_struct_at_32[] = "No value specified for struct attribute 'et2'";
static const char __pyx_k_No_value_specified_for_struct_at_33[] = "No value specified for struct attribute 'ref_et'";
static const char __pyx_k_No_value_specified_for_struct_at_34[] = "No value specified for struct attribute 'wind_speed'";
static const char __pyx_k_No_value_specified_for_struct_at_35[] = "No value specified for struct attribute 'dew_point'";
static const char __pyx_k_No_value_specified_for_struct_at_36[] = "No value specified for struct attribute 'humidity'";
static const char __pyx_k_No_value_specified_for_struct_at_37[] = "No value specified for struct attribute 'albedo'";
static const char __pyx_k_No_value_specified_for_struct_at_38[] = "No value specified for struct attribute 'number_of_left_columns_with_root'";
static const char __pyx_k_No_value_specified_for_struct_at_39[] = "No value specified for struct attribute 'number_of_right_columns_with_root'";
static const char __pyx_k_No_value_specified_for_struct_at_40[] = "No value specified for struct attribute 'growth_factor'";
static const char __pyx_k_No_value_specified_for_struct_at_41[] = "No value specified for struct attribute 'actual_growth'";
static const char __pyx_k_No_value_specified_for_struct_at_42[] = "No value specified for struct attribute 'weight_capable_uptake'";
static const char __pyx_k_No_value_specified_for_struct_at_43[] = "No value specified for struct attribute 'nitrate_nitrogen_content'";
static const char __pyx_k_No_value_specified_for_struct_at_44[] = "No value specified for struct attribute 'fresh_organic_matter'";
static const char __pyx_k_No_value_specified_for_struct_at_45[] = "No value specified for struct attribute 'root'";
static const char __pyx_k_No_value_specified_for_struct_at_46[] = "No value specified for struct attribute 'number_of_layers_with_root'";
static const char __pyx_k_No_value_specified_for_struct_at_47[] = "No value specified for struct attribute 'layers'";
static const char __pyx_k_No_value_specified_for_struct_at_48[] = "No value specified for struct attribute 'cells'";
static const char __pyx_k_No_value_specified_for_struct_at_49[] = "No value specified for struct attribute 'daynum'";
static const char __pyx_k_No_value_specified_for_struct_at_50[] = "No value specified for struct attribute 'kday'";
static const char __pyx_k_No_value_specified_for_struct_at_51[] = "No value specified for struct attribute 'day_inc'";
static const char __pyx_k_No_value_specified_for_struct_at_52[] = "No value specified for struct attribute 'lint_yield'";
static const char __pyx_k_No_value_specified_for_struct_at_53[] = "No value specified for struct attribute 'bloom_weight_loss'";
static const char __pyx_k_No_value_specified_for_struct_at_54[] = "No value specified for struct attribute 'abscised_fruit_sites'";
static const char __pyx_k_No_value_specified_for_struct_at_55[] = "No value specified for struct attribute 'abscised_leaf_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_56[] = "No value specified for struct attribute 'cumulative_nitrogen_loss'";
static const char __pyx_k_No_value_specified_for_struct_at_57[] = "No value specified for struct attribute 'applied_water'";
static const char __pyx_k_No_value_specified_for_struct_at_58[] = "No value specified for struct attribute 'water_stress'";
static const char __pyx_k_No_value_specified_for_struct_at_59[] = "No value specified for struct attribute 'water_stress_stem'";
static const char __pyx_k_No_value_specified_for_struct_at_60[] = "No value specified for struct attribute 'carbon_stress'";
static const char __pyx_k_No_value_specified_for_struct_at_61[] = "No value specified for struct attribute 'extra_carbon'";
static const char __pyx_k_No_value_specified_for_struct_at_62[] = "No value specified for struct attribute 'day_length'";
static const char __pyx_k_No_value_specified_for_struct_at_63[] = "No value specified for struct attribute 'plant_height'";
static const char __pyx_k_No_value_specified_for_struct_at_64[] = "No value specified for struct attribute 'plant_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_65[] = "No value specified for struct attribute 'stem_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_66[] = "No value specified for struct attribute 'square_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_67[] = "No value specified for struct attribute 'green_bolls_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_68[] = "No value specified for struct attribute 'green_bolls_burr_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_69[] = "No value specified for struct attribute 'open_bolls_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_70[] = "No value specified for struct attribute 'open_bolls_burr_weight'";
static const char __pyx_k_No_value_specified_for_struct_at_71[] = "No value specified for struct attribute 'runoff'";
static const char __pyx_k_No_value_specified_for_struct_at_72[] = "No value specified for struct attribute 'solar_noon'";
static const char __pyx_k_No_value_specified_for_struct_at_73[] = "No value specified for struct attribute 'net_radiation'";
static const char __pyx_k_No_value_specified_for_struct_at_74[] = "No value specified for struct attribute 'evapotranspiration'";
static const char __pyx_k_No_value_specified_for_struct_at_75[] = "No value specified for struct attribute 'actual_transpiration'";
static const char __pyx_k_No_value_specified_for_struct_at_76[] = "No value specified for struct attribute 'cumulative_transpiration'";
static const char __pyx_k_No_value_specified_for_struct_at_77[] = "No value specified for struct attribute 'actual_soil_evaporation'";
static const char __pyx_k_No_value_specified_for_struct_at_78[] = "No value specified for struct attribute 'cumulative_evaporation'";
static const char __pyx_k_No_value_specified_for_struct_at_79[] = "No value specified for struct attribute 'light_interception'";
static const char __pyx_k_No_value_specified_for_struct_at_80[] = "No value specified for struct attribute 'number_of_vegetative_branches'";
static const char __pyx_k_No_value_specified_for_struct_at_81[] = "No value specified for struct attribute 'number_of_fruiting_sites'";
static const char __pyx_k_No_value_specified_for_struct_at_82[] = "No value specified for struct attribute 'number_of_squares'";
static const char __pyx_k_No_value_specified_for_struct_at_83[] = "No value specified for struct attribute 'number_of_green_bolls'";
static const char __pyx_k_No_value_specified_for_struct_at_84[] = "No value specified for struct attribute 'number_of_open_bolls'";
static const char __pyx_k_No_value_specified_for_struct_at_85[] = "No value specified for struct attribute 'nitrogen_stress'";
static const char __pyx_k_No_value_specified_for_struct_at_86[] = "No value specified for struct attribute 'nitrogen_stress_vegetative'";
static const char __pyx_k_No_value_specified_for_struct_at_87[] = "No value specified for struct attribute 'nitrogen_stress_fruiting'";
static const char __pyx_k_No_value_specified_for_struct_at_88[] = "No value specified for struct attribute 'nitrogen_stress_root'";
static const char __pyx_k_No_value_specified_for_struct_at_89[] = "No value specified for struct attribute 'total_required_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_90[] = "No value specified for struct attribute 'leaf_area_index'";
static const char __pyx_k_No_value_specified_for_struct_at_91[] = "No value specified for struct attribute 'leaf_weight_pre_fruiting'";
static const char __pyx_k_No_value_specified_for_struct_at_92[] = "No value specified for struct attribute 'leaf_weight_area_ratio'";
static const char __pyx_k_No_value_specified_for_struct_at_93[] = "No value specified for struct attribute 'leaf_nitrogen_concentration'";
static const char __pyx_k_No_value_specified_for_struct_at_94[] = "No value specified for struct attribute 'leaf_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_95[] = "No value specified for struct attribute 'petiole_nitrogen_concentration'";
static const char __pyx_k_No_value_specified_for_struct_at_96[] = "No value specified for struct attribute 'seed_nitrogen_concentration'";
static const char __pyx_k_No_value_specified_for_struct_at_97[] = "No value specified for struct attribute 'seed_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_98[] = "No value specified for struct attribute 'root_nitrogen_concentration'";
static const char __pyx_k_No_value_specified_for_struct_at_99[] = "No value specified for struct attribute 'square_nitrogen_concentration'";
static const char __pyx_k_No_value_specified_for_struct_at_100[] = "No value specified for struct attribute 'burr_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_101[] = "No value specified for struct attribute 'square_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_102[] = "No value specified for struct attribute 'stem_nitrogen'";
static const char __pyx_k_No_value_specified_for_struct_at_103[] = "No value specified for struct attribute 'fruit_growth_ratio'";
static const char __pyx_k_No_value_specified_for_struct_at_104[] = "No value specified for struct attribute 'pollination_switch'";
static const char __pyx_k_No_value_specified_for_struct_at_105[] = "No value specified for struct attribute 'age_of_pre_fruiting_nodes'";
static const char __pyx_k_No_value_specified_for_struct_at_106[] = "No value specified for struct attribute 'number_of_pre_fruiting_nodes'";
static const char __pyx_k_No_value_specified_for_struct_at_107[] = "No value specified for struct attribute 'leaf_area_pre_fruiting'";
static const char __pyx_k_No_value_specified_for_struct_at_108[] = "No value specified for struct attribute 'delay_for_new_branch'";
static const char __pyx_k_No_value_specified_for_struct_at_109[] = "No value specified for struct attribute 'vegetative_branches'";
static const char __pyx_k_No_value_specified_for_struct_at_110[] = "No value specified for struct attribute 'hours'";
static const char __pyx_k_No_value_specified_for_struct_at_111[] = "No value specified for struct attribute 'soil'";
static const char __pyx_k_No_value_specified_for_struct_at_112[] = "No value specified for struct attribute 'Rad'";
static const char __pyx_k_No_value_specified_for_struct_at_113[] = "No value specified for struct attribute 'Tmax'";
static const char __pyx_k_No_value_specified_for_struct_at_114[] = "No value specified for struct attribute 'Tmin'";
static const char __pyx_k_No_value_specified_for_struct_at_115[] = "No value specified for struct attribute 'Rain'";
static const char __pyx_k_No_value_specified_for_struct_at_116[] = "No value specified for struct attribute 'Wind'";
static const char __pyx_k_No_value_specified_for_struct_at_117[] = "No value specified for struct attribute 'Tdew'";
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__pyx_n_s_Climate;
static PyObject *__pyx_n_s_Climate___reduce_cython;
static PyObject *__pyx_n_s_Climate___setstate_cython;
static PyObject *__pyx_n_s_DaysTo1stSqare;
static PyObject *__pyx_n_s_FruitingBranch;
static PyObject *__pyx_n_s_FruitingBranch___reduce_cython;
static PyObject *__pyx_n_s_FruitingBranch___setstate_cython;
static PyObject *__pyx_n_s_FruitingNode;
static PyObject *__pyx_n_s_FruitingNode___reduce_cython;
static PyObject *__pyx_n_s_FruitingNode___setstate_cython;
static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x84;
static PyObject *__pyx_n_s_IndexError;
static PyObject *__pyx_n_s_KeyError;
static PyObject *__pyx_n_s_MainStemLeaf;
static PyObject *__pyx_n_s_MainStemLeaf___reduce_cython;
static PyObject *__pyx_n_s_MainStemLeaf___setstate_cython;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_10;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_100;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_101;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_102;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_103;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_104;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_105;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_106;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_107;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_108;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_109;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_11;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_110;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_111;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_112;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_113;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_114;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_115;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_116;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_117;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_12;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_13;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_14;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_15;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_16;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_17;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_18;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_19;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_20;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_21;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_22;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_23;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_24;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_25;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_26;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_27;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_28;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_29;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_30;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_31;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_32;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_33;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_34;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_35;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_36;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_37;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_38;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_39;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_40;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_41;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_42;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_43;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_44;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_45;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_46;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_47;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_48;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_49;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_50;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_51;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_52;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_53;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_54;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_55;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_56;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_57;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_58;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_59;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_60;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_61;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_62;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_63;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_64;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_65;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_66;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_67;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_68;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_69;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_7;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_70;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_71;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_72;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_73;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_74;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_75;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_76;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_77;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_78;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_79;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_8;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_80;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_81;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_82;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_83;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_84;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_85;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_86;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_87;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_88;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_89;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_9;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_90;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_91;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_92;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_93;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_94;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_95;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_96;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_97;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_98;
static PyObject *__pyx_kp_s_No_value_specified_for_struct_at_99;
static PyObject *__pyx_n_s_NodeLeaf;
static PyObject *__pyx_n_s_NodeLeaf___reduce_cython;
static PyObject *__pyx_n_s_NodeLeaf___setstate_cython;
static PyObject *__pyx_n_s_OpenRatio;
static PyObject *__pyx_n_s_OverflowError;
static PyObject *__pyx_n_s_PhenDelayByNStress;
static PyObject *__pyx_n_s_PickleError;
static PyObject *__pyx_kp_s_Pickling_of_struct_members_such;
static PyObject *__pyx_n_s_Rad;
static PyObject *__pyx_n_u_Rad;
static PyObject *__pyx_n_s_Rain;
static PyObject *__pyx_n_u_Rain;
static PyObject *__pyx_n_s_RuntimeError;
static PyObject *__pyx_n_s_Simulation;
static PyObject *__pyx_n_s_SimulationEnd;
static PyObject *__pyx_n_s_Simulation___reduce_cython;
static PyObject *__pyx_n_s_Simulation___setstate_cython;
static PyObject *__pyx_n_s_Simulation__add_vegetative_branc;
static PyObject *__pyx_n_s_Simulation__calc_light_intercept;
static PyObject *__pyx_n_s_Simulation__column_shading;
static PyObject *__pyx_n_s_Simulation__daily_climate;
static PyObject *__pyx_n_s_Simulation__days_to_first_square;
static PyObject *__pyx_n_s_Simulation__defoliate;
static PyObject *__pyx_n_s_Simulation__doy2date;
static PyObject *__pyx_n_s_Simulation__get_net_photosynthes;
static PyObject *__pyx_n_s_Simulation__growth;
static PyObject *__pyx_n_s_Simulation__init_grid;
static PyObject *__pyx_n_s_Simulation__init_state;
static PyObject *__pyx_n_s_Simulation__phenology;
static PyObject *__pyx_n_s_Simulation__potential_fruit_grow;
static PyObject *__pyx_n_s_Simulation__potential_leaf_growt;
static PyObject *__pyx_n_s_Simulation__simulate;
static PyObject *__pyx_n_s_Simulation__simulate_this_day;
static PyObject *__pyx_n_s_Simulation__stress;
static PyObject *__pyx_n_s_Simulation_read_input;
static PyObject *__pyx_n_s_Simulation_run;
static PyObject *__pyx_n_s_Simulation_state;
static PyObject *__pyx_n_s_SoilInit;
static PyObject *__pyx_n_s_SoilInit___reduce_cython;
static PyObject *__pyx_n_s_SoilInit___setstate_cython;
static PyObject *__pyx_n_s_State;
static PyObject *__pyx_n_s_State___reduce_cython;
static PyObject *__pyx_n_s_State___setstate_cython;
static PyObject *__pyx_n_s_State_add_fruiting_branch;
static PyObject *__pyx_n_s_State_create_first_square;
static PyObject *__pyx_n_s_State_keys;
static PyObject *__pyx_n_s_StopIteration;
static PyObject *__pyx_n_s_Tdew;
static PyObject *__pyx_n_u_Tdew;
static PyObject *__pyx_n_s_TimeToNextFruBranch;
static PyObject *__pyx_n_s_TimeToNextVegBranch;
static PyObject *__pyx_n_s_Tmax;
static PyObject *__pyx_n_u_Tmax;
static PyObject *__pyx_n_s_Tmin;
static PyObject *__pyx_n_u_Tmin;
static PyObject *__pyx_n_s_TypeError;
static PyObject *__pyx_n_s_ValueError;
static PyObject *__pyx_n_s_VegetativeBranch;
static PyObject *__pyx_n_s_VegetativeBranch___reduce_cython;
static PyObject *__pyx_n_s_VegetativeBranch___setstate_cyth;
static PyObject *__pyx_n_s_WaterStress;
static PyObject *__pyx_n_s_Wind;
static PyObject *__pyx_n_u_Wind;
static PyObject *__pyx_kp_u_Y_j;
static PyObject *__pyx_n_s__213;
static PyObject *__pyx_kp_u__8;
static PyObject *__pyx_n_s_abscised_fruit_sites;
static PyObject *__pyx_n_s_abscised_leaf_weight;
static PyObject *__pyx_n_s_acos;
static PyObject *__pyx_n_s_actual_growth;
static PyObject *__pyx_n_s_actual_soil_evaporation;
static PyObject *__pyx_n_s_actual_transpiration;
static PyObject *__pyx_n_s_add_fruiting_branch;
static PyObject *__pyx_n_s_add_vegetative_branch;
static PyObject *__pyx_n_s_addlfn;
static PyObject *__pyx_n_s_age;
static PyObject *__pyx_n_s_age_of_pre_fruiting_nodes;
static PyObject *__pyx_n_s_agemax;
static PyObject *__pyx_n_s_agetop;
static PyObject *__pyx_n_u_agricultural_inputs;
static PyObject *__pyx_n_u_air_dry;
static PyObject *__pyx_n_s_albedo;
static PyObject *__pyx_n_u_alpha;
static PyObject *__pyx_n_s_ambient_co2_factor;
static PyObject *__pyx_n_u_ammonium;
static PyObject *__pyx_n_u_ammonium_nitrogen;
static PyObject *__pyx_n_u_amount;
static PyObject *__pyx_n_s_applied_water;
static PyObject *__pyx_n_s_area;
static PyObject *__pyx_n_s_asyncio_coroutines;
static PyObject *__pyx_n_s_average_temperature;
static PyObject *__pyx_n_u_beta;
static PyObject *__pyx_n_s_bloom_weight_loss;
static PyObject *__pyx_n_s_bmain;
static PyObject *__pyx_n_s_boll;
static PyObject *__pyx_n_u_bulk_density;
static PyObject *__pyx_n_s_burr;
static PyObject *__pyx_n_s_burr_nitrogen;
static PyObject *__pyx_n_s_c;
static PyObject *__pyx_n_s_c11;
static PyObject *__pyx_n_s_calc_light_interception;
static PyObject *__pyx_n_s_carbon_stress;
static PyObject *__pyx_n_s_cc;
static PyObject *__pyx_n_s_cd;
static PyObject *__pyx_n_s_cdleaf;
static PyObject *__pyx_n_s_cdpet;
static PyObject *__pyx_n_s_cdroot;
static PyObject *__pyx_n_s_cdstem;
static PyObject *__pyx_n_s_cells;
static PyObject *__pyx_n_s_class_getitem;
static PyObject *__pyx_n_u_clay;
static PyObject *__pyx_n_s_climate;
static PyObject *__pyx_n_s_cline_in_traceback;
static PyObject *__pyx_n_s_cloud_cor;
static PyObject *__pyx_n_s_cloud_cov;
static PyObject *__pyx_n_s_column_shading;
static PyObject *__pyx_n_s_compute_day_length;
static PyObject *__pyx_n_s_cos;
static PyObject *__pyx_n_s_cotton2k_climate;
static PyObject *__pyx_n_s_cotton2k_leaf;
static PyObject *__pyx_n_s_cotton2k_photosynthesis;
static PyObject *__pyx_n_s_cotton2k_simulation;
static PyObject *__pyx_n_s_cotton2k_utils;
static PyObject *__pyx_n_s_cotylwt;
static PyObject *__pyx_n_s_create_first_square;
static PyObject *__pyx_n_s_cultivar_parameters;
static PyObject *__pyx_n_s_cumulative_evaporation;
static PyObject *__pyx_n_s_cumulative_nitrogen_loss;
static PyObject *__pyx_n_s_cumulative_transpiration;
static PyObject *__pyx_n_s_daily_climate;
static PyObject *__pyx_n_s_date;
static PyObject *__pyx_n_u_date;
static PyObject *__pyx_n_s_date2doy;
static PyObject *__pyx_n_s_datetime;
static PyObject *__pyx_n_s_day_inc;
static PyObject *__pyx_n_s_day_length;
static PyObject *__pyx_n_u_day_length;
static PyObject *__pyx_n_s_daynum;
static PyObject *__pyx_n_s_days_to_first_square;
static PyObject *__pyx_n_s_declination;
static PyObject *__pyx_n_u_declination;
static PyObject *__pyx_n_s_defoliate;
static PyObject *__pyx_kp_u_defoliation_prediction;
static PyObject *__pyx_n_s_delayFrtByCStress;
static PyObject *__pyx_n_s_delayVegByCStress;
static PyObject *__pyx_n_s_delay_for_new_branch;
static PyObject *__pyx_n_s_delay_for_new_fruiting_branch;
static PyObject *__pyx_n_s_delay_for_new_node;
static PyObject *__pyx_n_s_denf2;
static PyObject *__pyx_n_s_denfac;
static PyObject *__pyx_n_s_density_factor;
static PyObject *__pyx_n_u_depth;
static PyObject *__pyx_n_s_dew_point;
static PyObject *__pyx_n_u_dewpoint;
static PyObject *__pyx_n_s_dict;
static PyObject *__pyx_n_s_dict_2;
static PyObject *__pyx_kp_u_disable;
static PyObject *__pyx_n_s_doc;
static PyObject *__pyx_n_s_doy2date;
static PyObject *__pyx_n_u_drip_depth;
static PyObject *__pyx_n_u_drip_horizontal_place;
static PyObject *__pyx_n_s_dsbe;
static PyObject *__pyx_n_s_dum;
static PyObject *__pyx_n_s_elevation;
static PyObject *__pyx_kp_u_enable;
static PyObject *__pyx_n_s_enumerate;
static PyObject *__pyx_n_s_et1;
static PyObject *__pyx_n_s_et2;
static PyObject *__pyx_n_s_evapotranspiration;
static PyObject *__pyx_n_s_extra_carbon;
static PyObject *__pyx_n_u_fertilization;
static PyObject *__pyx_n_u_field_capacity_hydraulic_conduct;
static PyObject *__pyx_n_u_field_capacity_water_potential;
static PyObject *__pyx_n_s_first_node;
static PyObject *__pyx_n_s_first_square_leaf_area;
static PyObject *__pyx_n_s_fraction;
static PyObject *__pyx_n_s_fresh_organic_matter;
static PyObject *__pyx_n_s_fruit_growth_ratio;
static PyObject *__pyx_n_s_fruiting_branches;
static PyObject *__pyx_kp_u_gc;
static PyObject *__pyx_n_s_get;
static PyObject *__pyx_n_s_get_net_photosynthesis;
static PyObject *__pyx_n_s_getattr;
static PyObject *__pyx_n_s_getstate;
static PyObject *__pyx_n_s_ginning_percent;
static PyObject *__pyx_n_s_green_bolls_burr_weight;
static PyObject *__pyx_n_s_green_bolls_weight;
static PyObject *__pyx_n_s_growth;
static PyObject *__pyx_n_s_growth_factor;
static PyObject *__pyx_n_s_gsubr;
static PyObject *__pyx_n_s_hour;
static PyObject *__pyx_n_s_hours;
static PyObject *__pyx_n_s_htdenf;
static PyObject *__pyx_n_s_humidity;
static PyObject *__pyx_n_s_hydrology;
static PyObject *__pyx_n_s_i;
static PyObject *__pyx_n_s_ihr;
static PyObject *__pyx_n_u_immediate_drainage_water_potenti;
static PyObject *__pyx_n_s_import;
static PyObject *__pyx_n_s_init_grid;
static PyObject *__pyx_n_s_init_state;
static PyObject *__pyx_n_s_init_subclass;
static PyObject *__pyx_n_s_initial;
static PyObject *__pyx_n_u_irrigation;
static PyObject *__pyx_n_s_is_coroutine;
static PyObject *__pyx_kp_u_isenabled;
static PyObject *__pyx_n_s_items;
static PyObject *__pyx_n_s_j;
static PyObject *__pyx_n_s_jp1;
static PyObject *__pyx_n_s_k;
static PyObject *__pyx_n_s_k0;
static PyObject *__pyx_n_s_kday;
static PyObject *__pyx_n_s_keys;
static PyObject *__pyx_n_s_kkday;
static PyObject *__pyx_n_s_kwargs;
static PyObject *__pyx_n_s_l;
static PyObject *__pyx_n_s_l1;
static PyObject *__pyx_n_s_l2;
static PyObject *__pyx_n_s_last_fruiting_branch;
static PyObject *__pyx_n_s_latitude;
static PyObject *__pyx_n_s_layer_depth;
static PyObject *__pyx_n_s_layers;
static PyObject *__pyx_n_u_layers;
static PyObject *__pyx_n_s_leaf;
static PyObject *__pyx_n_s_leaf_area;
static PyObject *__pyx_n_s_leaf_area_index;
static PyObject *__pyx_n_s_leaf_area_pre_fruiting;
static PyObject *__pyx_n_s_leaf_nitrogen;
static PyObject *__pyx_n_s_leaf_nitrogen_concentration;
static PyObject *__pyx_n_s_leaf_weight;
static PyObject *__pyx_n_s_leaf_weight_area_ratio;
static PyObject *__pyx_n_s_leaf_weight_pre_fruiting;
static PyObject *__pyx_n_s_lfint;
static PyObject *__pyx_n_s_light_interception;
static PyObject *__pyx_n_s_lint_yield;
static PyObject *__pyx_n_s_longitude;
static PyObject *__pyx_n_s_lp1;
static PyObject *__pyx_n_s_lyrsol;
static PyObject *__pyx_n_s_lytres;
static PyObject *__pyx_n_s_m;
static PyObject *__pyx_n_s_main;
static PyObject *__pyx_n_s_main_stem_leaf;
static PyObject *__pyx_n_s_math;
static PyObject *__pyx_n_u_max;
static PyObject *__pyx_n_u_max_conductivity;
static PyObject *__pyx_n_s_maxrtgr;
static PyObject *__pyx_n_s_maxstmgr;
static PyObject *__pyx_n_s_metaclass;
static PyObject *__pyx_n_u_method;
static PyObject *__pyx_n_s_microsecond;
static PyObject *__pyx_n_u_min;
static PyObject *__pyx_n_s_minute;
static PyObject *__pyx_n_s_module;
static PyObject *__pyx_n_s_mp1;
static PyObject *__pyx_n_s_mro_entries;
static PyObject *__pyx_n_s_name;
static PyObject *__pyx_n_s_net_radiation;
static PyObject *__pyx_n_s_new;
static PyObject *__pyx_n_s_new_branch;
static PyObject *__pyx_n_s_new_node;
static PyObject *__pyx_n_s_new_node_initial_leaf_area;
static PyObject *__pyx_n_s_newbr;
static PyObject *__pyx_n_s_nidmax;
static PyObject *__pyx_n_u_nitrate;
static PyObject *__pyx_n_u_nitrate_nitrogen;
static PyObject *__pyx_n_s_nitrate_nitrogen_content;
static PyObject *__pyx_n_s_nitrogen_stress;
static PyObject *__pyx_n_s_nitrogen_stress_fruiting;
static PyObject *__pyx_n_s_nitrogen_stress_root;
static PyObject *__pyx_n_s_nitrogen_stress_vegetative;
static PyObject *__pyx_n_s_nodes;
static PyObject *__pyx_n_s_number_of_fruiting_branches;
static PyObject *__pyx_n_s_number_of_fruiting_nodes;
static PyObject *__pyx_n_s_number_of_fruiting_sites;
static PyObject *__pyx_n_s_number_of_green_bolls;
static PyObject *__pyx_n_s_number_of_layers_with_root;
static PyObject *__pyx_n_s_number_of_left_columns_with_root;
static PyObject *__pyx_n_s_number_of_open_bolls;
static PyObject *__pyx_n_s_number_of_pre_fruiting_nodes;
static PyObject *__pyx_n_s_number_of_right_columns_with_roo;
static PyObject *__pyx_n_s_number_of_squares;
static PyObject *__pyx_n_s_number_of_vegetative_branches;
static PyObject *__pyx_n_s_nwfl;
static PyObject *__pyx_n_s_oldstmwt;
static PyObject *__pyx_n_s_open_bolls_burr_weight;
static PyObject *__pyx_n_s_open_bolls_weight;
static PyObject *__pyx_n_u_organic_matter;
static PyObject *__pyx_n_s_p;
static PyObject *__pyx_n_s_p1;
static PyObject *__pyx_n_s_p2;
static PyObject *__pyx_n_s_p3;
static PyObject *__pyx_n_s_p4;
static PyObject *__pyx_n_s_p5;
static PyObject *__pyx_n_s_p6;
static PyObject *__pyx_n_s_p7;
static PyObject *__pyx_n_s_perdmax;
static PyObject *__pyx_n_s_petiole;
static PyObject *__pyx_n_s_petiole_nitrogen_concentration;
static PyObject *__pyx_n_s_petiole_weight;
static PyObject *__pyx_n_s_pex;
static PyObject *__pyx_n_s_phenology;
static PyObject *__pyx_n_s_pi;
static PyObject *__pyx_n_s_pickle;
static PyObject *__pyx_n_s_plant_height;
static PyObject *__pyx_n_s_plant_weight;
static PyObject *__pyx_kp_u_planting_date_or_emergence_date;
static PyObject *__pyx_n_s_pnetcor;
static PyObject *__pyx_n_s_pollination_switch;
static PyObject *__pyx_n_s_potential_fruit_growth;
static PyObject *__pyx_n_s_potential_growth;
static PyObject *__pyx_n_s_potential_growth_for_leaf_area;
static PyObject *__pyx_n_s_potential_growth_for_leaf_weight;
static PyObject *__pyx_n_s_potential_growth_for_petiole_wei;
static PyObject *__pyx_n_s_potential_leaf_growth;
static PyObject *__pyx_n_s_pplant;
static PyObject *__pyx_n_s_prepare;
static PyObject *__pyx_n_s_psilim;
static PyObject *__pyx_n_s_pstand;
static PyObject *__pyx_n_s_ptnfac;
static PyObject *__pyx_n_s_pts;
static PyObject *__pyx_n_s_pyx_PickleError;
static PyObject *__pyx_n_s_pyx_checksum;
static PyObject *__pyx_n_s_pyx_result;
static PyObject *__pyx_n_s_pyx_state;
static PyObject *__pyx_n_s_pyx_type;
static PyObject *__pyx_n_s_pyx_unpickle_SoilInit;
static PyObject *__pyx_n_s_pyx_vtable;
static PyObject *__pyx_n_s_qualname;
static PyObject *__pyx_n_s_radiation;
static PyObject *__pyx_n_u_radiation;
static PyObject *__pyx_n_s_radsum;
static PyObject *__pyx_n_u_rain;
static PyObject *__pyx_n_s_rainToday;
static PyObject *__pyx_n_s_range;
static PyObject *__pyx_n_s_rate;
static PyObject *__pyx_n_s_ratebol;
static PyObject *__pyx_n_s_ratebur;
static PyObject *__pyx_n_s_ratesqr;
static PyObject *__pyx_n_u_ratio_implicit;
static PyObject *__pyx_n_s_rbmax;
static PyObject *__pyx_n_s_read_input;
static PyObject *__pyx_n_s_reduce;
static PyObject *__pyx_n_s_reduce_cython;
static PyObject *__pyx_n_s_reduce_ex;
static PyObject *__pyx_n_s_ref_et;
static PyObject *__pyx_n_s_replace;
static PyObject *__pyx_n_s_result;
static PyObject *__pyx_n_s_root;
static PyObject *__pyx_n_s_root_nitrogen_concentration;
static PyObject *__pyx_n_s_row_space;
static PyObject *__pyx_n_s_rsubl;
static PyObject *__pyx_n_s_rsubo;
static PyObject *__pyx_n_s_run;
static PyObject *__pyx_n_s_runoff;
static PyObject *__pyx_n_s_runoffToday;
static PyObject *__pyx_n_u_sand;
static PyObject *__pyx_n_u_saturated_hydraulic_conductivity;
static PyObject *__pyx_n_s_sd;
static PyObject *__pyx_n_s_second;
static PyObject *__pyx_n_s_seed_nitrogen;
static PyObject *__pyx_n_s_seed_nitrogen_concentration;
static PyObject *__pyx_n_s_self;
static PyObject *__pyx_kp_s_self___cannot_be_converted_to_a;
static PyObject *__pyx_kp_s_self_climate_cannot_be_converted;
static PyObject *__pyx_n_s_set_name;
static PyObject *__pyx_n_s_setstate;
static PyObject *__pyx_n_s_setstate_cython;
static PyObject *__pyx_n_s_shade;
static PyObject *__pyx_n_s_simulate;
static PyObject *__pyx_n_s_simulate_this_day;
static PyObject *__pyx_n_s_sin;
static PyObject *__pyx_n_s_sinb;
static PyObject *__pyx_n_s_smax;
static PyObject *__pyx_n_s_smaxx;
static PyObject *__pyx_n_s_soil;
static PyObject *__pyx_n_s_solar_noon;
static PyObject *__pyx_n_u_solar_noon;
static PyObject *__pyx_n_s_sqrt;
static PyObject *__pyx_n_s_square;
static PyObject *__pyx_n_s_square_nitrogen;
static PyObject *__pyx_n_s_square_nitrogen_concentration;
static PyObject *__pyx_n_s_square_weight;
static PyObject *__pyx_kp_s_src__cotton2k_simulation_pyx;
static PyObject *__pyx_n_s_stage;
static PyObject *__pyx_n_s_start;
static PyObject *__pyx_n_s_start_date;
static PyObject *__pyx_n_s_state;
static PyObject *__pyx_n_s_state0;
static PyObject *__pyx_n_s_stemNRatio;
static PyObject *__pyx_n_s_stem_nitrogen;
static PyObject *__pyx_n_s_stem_weight;
static PyObject *__pyx_n_s_stemnew;
static PyObject *__pyx_n_s_step;
static PyObject *__pyx_n_s_stop;
static PyObject *__pyx_n_s_stress;
static PyObject *__pyx_kp_s_stringsource;
static PyObject *__pyx_n_s_strptime;
static PyObject *__pyx_n_s_sumpdr;
static PyObject *__pyx_n_s_sumwk;
static PyObject *__pyx_n_s_sunr;
static PyObject *__pyx_n_u_sunr;
static PyObject *__pyx_n_s_suns;
static PyObject *__pyx_n_u_suns;
static PyObject *__pyx_n_s_super;
static PyObject *__pyx_n_s_sw;
static PyObject *__pyx_n_s_sw0;
static PyObject *__pyx_n_s_sw1;
static PyObject *__pyx_n_s_t1;
static PyObject *__pyx_n_s_t2;
static PyObject *__pyx_n_s_t3;
static PyObject *__pyx_n_s_tav;
static PyObject *__pyx_n_s_tdday;
static PyObject *__pyx_n_s_temperature;
static PyObject *__pyx_n_s_temperature_on_leaf_growth_rate;
static PyObject *__pyx_n_s_test;
static PyObject *__pyx_n_s_tfrt;
static PyObject *__pyx_n_u_theta;
static PyObject *__pyx_n_s_ti;
static PyObject *__pyx_n_s_time_to_new_fruiting_branch;
static PyObject *__pyx_n_s_timedelta;
static PyObject *__pyx_n_s_tmpisr;
static PyObject *__pyx_n_u_tmpisr;
static PyObject *__pyx_n_s_total_required_nitrogen;
static PyObject *__pyx_n_u_type;
static PyObject *__pyx_n_s_u;
static PyObject *__pyx_n_s_update;
static PyObject *__pyx_n_u_urea;
static PyObject *__pyx_n_s_use_setstate;
static PyObject *__pyx_n_s_vegetative_branch;
static PyObject *__pyx_n_s_vegetative_branches;
static PyObject *__pyx_n_s_version;
static PyObject *__pyx_n_s_vfrtbr;
static PyObject *__pyx_n_s_voldstm;
static PyObject *__pyx_n_s_vpheno;
static PyObject *__pyx_n_s_vpnet;
static PyObject *__pyx_n_s_vpotfrt;
static PyObject *__pyx_n_s_vpotlf;
static PyObject *__pyx_n_s_vpvegb;
static PyObject *__pyx_n_s_vstrs;
static PyObject *__pyx_n_u_water;
static PyObject *__pyx_n_s_water_stress;
static PyObject *__pyx_n_s_water_stress_stem;
static PyObject *__pyx_n_s_wattsm;
static PyObject *__pyx_n_s_wbmax;
static PyObject *__pyx_n_s_weight;
static PyObject *__pyx_n_s_weight_capable_uptake;
static PyObject *__pyx_n_s_wfdb;
static PyObject *__pyx_n_u_wind;
static PyObject *__pyx_n_s_wind_speed;
static PyObject *__pyx_n_s_wnytf;
static PyObject *__pyx_n_s_wstrlf;
static PyObject *__pyx_n_s_wtfstrs;
static PyObject *__pyx_n_s_xlat;
static PyObject *__pyx_n_s_year;
static PyObject *__pyx_n_s_z1;
static PyObject *__pyx_n_s_zero;
static PyObject *__pyx_n_s_zint;
#endif
/* #### Code section: decls ### */
static int __pyx_pf_9_cotton2k_10simulation_8SoilInit___init__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_initial, PyObject *__pyx_v_hydrology, PyObject *__pyx_v_layer_depth); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_6lyrsol___get__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_init_soil); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology___get__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_soil_hydrology); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_2__reduce_cython__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_4__setstate_cython__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_7Climate___init__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, PyObject *__pyx_v_start_date, PyObject *__pyx_v_climate); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_2__getitem__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, PyObject *__pyx_v_key); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_4__iter__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_6__next__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area___get__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area_2__set__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight___get__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight_2__set__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_3age___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_4leaf___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area___get__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area_2__set__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight___get__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight_2__set__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_5nodes___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_2__set__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_2__set__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_keys(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_2__getattr__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_5State_4__setattr__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_6__getitem__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_19vegetative_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_8create_first_square(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_first_square_leaf_area); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_10add_fruiting_branch(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_k, PyObject *__pyx_v_density_factor, PyObject *__pyx_v_delayVegByCStress, CYTHON_UNUSED PyObject *__pyx_v_delayFrtByCStress, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_PhenDelayByNStress, PyObject *__pyx_v_time_to_new_fruiting_branch, PyObject *__pyx_v_new_node_initial_leaf_area); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation__doy2date(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_j); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_2__init__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_version); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_4year___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_4year_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_year); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_parameters); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_parameters); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_6states___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_4state(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_i); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_7climate___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_7climate_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_climate); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_6run(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_8_init_state(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10_simulate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_12_calc_light_interception(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_14_column_shading(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_16_daily_climate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_18_stress(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_26_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_28_days_to_first_square(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u, PyObject *__pyx_v_delayVegByCStress, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_DaysTo1stSqare, PyObject *__pyx_v_PhenDelayByNStress); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_32_phenology(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_34_defoliate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_36_simulate_this_day(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_38_init_grid(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_40read_input(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_lyrsol, PyObject *__pyx_v_kwargs); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_7version___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_7version_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static int __pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_pf_9_cotton2k_10simulation___pyx_unpickle_SoilInit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_SoilInit(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_Climate(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_NodeLeaf(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_FruitingNode(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_MainStemLeaf(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_FruitingBranch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_VegetativeBranch(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_State(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static PyObject *__pyx_tp_new_9_cotton2k_10simulation_Simulation(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_get = {0, 0, 0, 0, 0};
static __Pyx_CachedCFunction __pyx_umethod_PyDict_Type_keys = {0, 0, 0, 0, 0};
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__pyx_float_0_3;
static PyObject *__pyx_float_0_5;
static PyObject *__pyx_float_0_08;
static PyObject *__pyx_float_0_0002;
static PyObject *__pyx_int_0;
static PyObject *__pyx_int_1;
static PyObject *__pyx_int_2;
static PyObject *__pyx_int_4;
static PyObject *__pyx_int_10;
static PyObject *__pyx_int_12;
static PyObject *__pyx_int_24;
static PyObject *__pyx_int_30;
static PyObject *__pyx_int_180;
static PyObject *__pyx_int_1024;
static PyObject *__pyx_int_1000000;
static PyObject *__pyx_int_139140702;
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static PyObject *__pyx_tuple_;
static PyObject *__pyx_tuple__2;
static PyObject *__pyx_tuple__3;
static PyObject *__pyx_tuple__4;
static PyObject *__pyx_tuple__5;
static PyObject *__pyx_tuple__6;
static PyObject *__pyx_tuple__7;
static PyObject *__pyx_tuple__9;
static PyObject *__pyx_tuple__10;
static PyObject *__pyx_tuple__11;
static PyObject *__pyx_tuple__12;
static PyObject *__pyx_tuple__13;
static PyObject *__pyx_tuple__14;
static PyObject *__pyx_tuple__15;
static PyObject *__pyx_tuple__16;
static PyObject *__pyx_tuple__17;
static PyObject *__pyx_tuple__18;
static PyObject *__pyx_tuple__19;
static PyObject *__pyx_tuple__20;
static PyObject *__pyx_tuple__21;
static PyObject *__pyx_tuple__22;
static PyObject *__pyx_tuple__23;
static PyObject *__pyx_tuple__24;
static PyObject *__pyx_tuple__25;
static PyObject *__pyx_tuple__26;
static PyObject *__pyx_tuple__27;
static PyObject *__pyx_tuple__28;
static PyObject *__pyx_tuple__29;
static PyObject *__pyx_tuple__30;
static PyObject *__pyx_tuple__31;
static PyObject *__pyx_tuple__32;
static PyObject *__pyx_tuple__33;
static PyObject *__pyx_tuple__34;
static PyObject *__pyx_tuple__35;
static PyObject *__pyx_tuple__36;
static PyObject *__pyx_tuple__37;
static PyObject *__pyx_tuple__38;
static PyObject *__pyx_tuple__39;
static PyObject *__pyx_tuple__40;
static PyObject *__pyx_tuple__41;
static PyObject *__pyx_tuple__42;
static PyObject *__pyx_tuple__43;
static PyObject *__pyx_tuple__44;
static PyObject *__pyx_tuple__45;
static PyObject *__pyx_tuple__46;
static PyObject *__pyx_tuple__47;
static PyObject *__pyx_tuple__48;
static PyObject *__pyx_tuple__49;
static PyObject *__pyx_tuple__50;
static PyObject *__pyx_tuple__51;
static PyObject *__pyx_tuple__52;
static PyObject *__pyx_tuple__53;
static PyObject *__pyx_tuple__54;
static PyObject *__pyx_tuple__55;
static PyObject *__pyx_tuple__56;
static PyObject *__pyx_tuple__57;
static PyObject *__pyx_tuple__58;
static PyObject *__pyx_tuple__59;
static PyObject *__pyx_tuple__60;
static PyObject *__pyx_tuple__61;
static PyObject *__pyx_tuple__62;
static PyObject *__pyx_tuple__63;
static PyObject *__pyx_tuple__64;
static PyObject *__pyx_tuple__65;
static PyObject *__pyx_tuple__66;
static PyObject *__pyx_tuple__67;
static PyObject *__pyx_tuple__68;
static PyObject *__pyx_tuple__69;
static PyObject *__pyx_tuple__70;
static PyObject *__pyx_tuple__71;
static PyObject *__pyx_tuple__72;
static PyObject *__pyx_tuple__73;
static PyObject *__pyx_tuple__74;
static PyObject *__pyx_tuple__75;
static PyObject *__pyx_tuple__76;
static PyObject *__pyx_tuple__77;
static PyObject *__pyx_tuple__78;
static PyObject *__pyx_tuple__79;
static PyObject *__pyx_tuple__80;
static PyObject *__pyx_tuple__81;
static PyObject *__pyx_tuple__82;
static PyObject *__pyx_tuple__83;
static PyObject *__pyx_tuple__84;
static PyObject *__pyx_tuple__85;
static PyObject *__pyx_tuple__86;
static PyObject *__pyx_tuple__87;
static PyObject *__pyx_tuple__88;
static PyObject *__pyx_tuple__89;
static PyObject *__pyx_tuple__90;
static PyObject *__pyx_tuple__91;
static PyObject *__pyx_tuple__92;
static PyObject *__pyx_tuple__93;
static PyObject *__pyx_tuple__94;
static PyObject *__pyx_tuple__95;
static PyObject *__pyx_tuple__96;
static PyObject *__pyx_tuple__97;
static PyObject *__pyx_tuple__98;
static PyObject *__pyx_tuple__99;
static PyObject *__pyx_tuple__100;
static PyObject *__pyx_tuple__101;
static PyObject *__pyx_tuple__102;
static PyObject *__pyx_tuple__103;
static PyObject *__pyx_tuple__104;
static PyObject *__pyx_tuple__105;
static PyObject *__pyx_tuple__106;
static PyObject *__pyx_tuple__107;
static PyObject *__pyx_tuple__108;
static PyObject *__pyx_tuple__109;
static PyObject *__pyx_tuple__110;
static PyObject *__pyx_tuple__111;
static PyObject *__pyx_tuple__112;
static PyObject *__pyx_tuple__113;
static PyObject *__pyx_tuple__114;
static PyObject *__pyx_tuple__115;
static PyObject *__pyx_tuple__116;
static PyObject *__pyx_tuple__117;
static PyObject *__pyx_tuple__118;
static PyObject *__pyx_tuple__119;
static PyObject *__pyx_tuple__120;
static PyObject *__pyx_tuple__121;
static PyObject *__pyx_tuple__122;
static PyObject *__pyx_tuple__123;
static PyObject *__pyx_tuple__124;
static PyObject *__pyx_tuple__125;
static PyObject *__pyx_tuple__126;
static PyObject *__pyx_tuple__127;
static PyObject *__pyx_tuple__128;
static PyObject *__pyx_tuple__129;
static PyObject *__pyx_tuple__131;
static PyObject *__pyx_tuple__133;
static PyObject *__pyx_tuple__135;
static PyObject *__pyx_tuple__137;
static PyObject *__pyx_tuple__139;
static PyObject *__pyx_tuple__141;
static PyObject *__pyx_tuple__143;
static PyObject *__pyx_tuple__145;
static PyObject *__pyx_tuple__147;
static PyObject *__pyx_tuple__149;
static PyObject *__pyx_tuple__151;
static PyObject *__pyx_tuple__153;
static PyObject *__pyx_tuple__155;
static PyObject *__pyx_tuple__157;
static PyObject *__pyx_tuple__159;
static PyObject *__pyx_tuple__161;
static PyObject *__pyx_tuple__163;
static PyObject *__pyx_tuple__165;
static PyObject *__pyx_tuple__167;
static PyObject *__pyx_tuple__169;
static PyObject *__pyx_tuple__171;
static PyObject *__pyx_tuple__173;
static PyObject *__pyx_tuple__175;
static PyObject *__pyx_tuple__177;
static PyObject *__pyx_tuple__179;
static PyObject *__pyx_tuple__181;
static PyObject *__pyx_tuple__183;
static PyObject *__pyx_tuple__185;
static PyObject *__pyx_tuple__187;
static PyObject *__pyx_tuple__189;
static PyObject *__pyx_tuple__191;
static PyObject *__pyx_tuple__193;
static PyObject *__pyx_tuple__195;
static PyObject *__pyx_tuple__197;
static PyObject *__pyx_tuple__199;
static PyObject *__pyx_tuple__201;
static PyObject *__pyx_tuple__203;
static PyObject *__pyx_tuple__205;
static PyObject *__pyx_tuple__207;
static PyObject *__pyx_tuple__209;
static PyObject *__pyx_tuple__211;
static PyObject *__pyx_codeobj__130;
static PyObject *__pyx_codeobj__132;
static PyObject *__pyx_codeobj__134;
static PyObject *__pyx_codeobj__136;
static PyObject *__pyx_codeobj__138;
static PyObject *__pyx_codeobj__140;
static PyObject *__pyx_codeobj__142;
static PyObject *__pyx_codeobj__144;
static PyObject *__pyx_codeobj__146;
static PyObject *__pyx_codeobj__148;
static PyObject *__pyx_codeobj__150;
static PyObject *__pyx_codeobj__152;
static PyObject *__pyx_codeobj__154;
static PyObject *__pyx_codeobj__156;
static PyObject *__pyx_codeobj__158;
static PyObject *__pyx_codeobj__160;
static PyObject *__pyx_codeobj__162;
static PyObject *__pyx_codeobj__164;
static PyObject *__pyx_codeobj__166;
static PyObject *__pyx_codeobj__168;
static PyObject *__pyx_codeobj__170;
static PyObject *__pyx_codeobj__172;
static PyObject *__pyx_codeobj__174;
static PyObject *__pyx_codeobj__176;
static PyObject *__pyx_codeobj__178;
static PyObject *__pyx_codeobj__180;
static PyObject *__pyx_codeobj__182;
static PyObject *__pyx_codeobj__184;
static PyObject *__pyx_codeobj__186;
static PyObject *__pyx_codeobj__188;
static PyObject *__pyx_codeobj__190;
static PyObject *__pyx_codeobj__192;
static PyObject *__pyx_codeobj__194;
static PyObject *__pyx_codeobj__196;
static PyObject *__pyx_codeobj__198;
static PyObject *__pyx_codeobj__200;
static PyObject *__pyx_codeobj__202;
static PyObject *__pyx_codeobj__204;
static PyObject *__pyx_codeobj__206;
static PyObject *__pyx_codeobj__208;
static PyObject *__pyx_codeobj__210;
static PyObject *__pyx_codeobj__212;
#endif
/* #### Code section: late_includes ### */
/* #### Code section: module_state ### */
#if CYTHON_COMPILING_IN_LIMITED_API
typedef struct {
  PyObject *__pyx_d;
  PyObject *__pyx_b;
  PyObject *__pyx_cython_runtime;
  PyObject *__pyx_empty_tuple;
  PyObject *__pyx_empty_bytes;
  PyObject *__pyx_empty_unicode;
  #ifdef __Pyx_CyFunction_USED
  PyTypeObject *__pyx_CyFunctionType;
  #endif
  #ifdef __Pyx_FusedFunction_USED
  PyTypeObject *__pyx_FusedFunctionType;
  #endif
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_SoilInit;
  PyObject *__pyx_type_9_cotton2k_10simulation_SoilInit;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_Climate;
  PyObject *__pyx_type_9_cotton2k_10simulation_Climate;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_NodeLeaf;
  PyObject *__pyx_type_9_cotton2k_10simulation_NodeLeaf;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_FruitingNode;
  PyObject *__pyx_type_9_cotton2k_10simulation_FruitingNode;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf;
  PyObject *__pyx_type_9_cotton2k_10simulation_MainStemLeaf;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_FruitingBranch;
  PyObject *__pyx_type_9_cotton2k_10simulation_FruitingBranch;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch;
  PyObject *__pyx_type_9_cotton2k_10simulation_VegetativeBranch;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_State;
  PyObject *__pyx_type_9_cotton2k_10simulation_State;
  PyTypeObject *__pyx_ptype_9_cotton2k_10simulation_Simulation;
  PyObject *__pyx_type_9_cotton2k_10simulation_Simulation;
  PyObject *__pyx_n_s_Climate;
  PyObject *__pyx_n_s_Climate___reduce_cython;
  PyObject *__pyx_n_s_Climate___setstate_cython;
  PyObject *__pyx_n_s_DaysTo1stSqare;
  PyObject *__pyx_n_s_FruitingBranch;
  PyObject *__pyx_n_s_FruitingBranch___reduce_cython;
  PyObject *__pyx_n_s_FruitingBranch___setstate_cython;
  PyObject *__pyx_n_s_FruitingNode;
  PyObject *__pyx_n_s_FruitingNode___reduce_cython;
  PyObject *__pyx_n_s_FruitingNode___setstate_cython;
  PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x84;
  PyObject *__pyx_n_s_IndexError;
  PyObject *__pyx_n_s_KeyError;
  PyObject *__pyx_n_s_MainStemLeaf;
  PyObject *__pyx_n_s_MainStemLeaf___reduce_cython;
  PyObject *__pyx_n_s_MainStemLeaf___setstate_cython;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_10;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_100;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_101;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_102;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_103;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_104;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_105;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_106;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_107;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_108;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_109;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_11;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_110;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_111;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_112;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_113;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_114;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_115;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_116;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_117;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_12;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_13;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_14;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_15;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_16;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_17;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_18;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_19;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_2;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_20;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_21;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_22;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_23;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_24;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_25;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_26;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_27;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_28;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_29;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_3;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_30;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_31;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_32;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_33;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_34;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_35;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_36;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_37;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_38;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_39;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_4;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_40;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_41;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_42;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_43;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_44;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_45;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_46;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_47;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_48;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_49;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_5;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_50;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_51;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_52;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_53;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_54;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_55;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_56;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_57;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_58;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_59;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_6;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_60;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_61;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_62;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_63;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_64;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_65;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_66;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_67;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_68;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_69;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_7;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_70;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_71;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_72;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_73;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_74;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_75;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_76;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_77;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_78;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_79;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_8;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_80;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_81;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_82;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_83;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_84;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_85;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_86;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_87;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_88;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_89;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_9;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_90;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_91;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_92;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_93;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_94;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_95;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_96;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_97;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_98;
  PyObject *__pyx_kp_s_No_value_specified_for_struct_at_99;
  PyObject *__pyx_n_s_NodeLeaf;
  PyObject *__pyx_n_s_NodeLeaf___reduce_cython;
  PyObject *__pyx_n_s_NodeLeaf___setstate_cython;
  PyObject *__pyx_n_s_OpenRatio;
  PyObject *__pyx_n_s_OverflowError;
  PyObject *__pyx_n_s_PhenDelayByNStress;
  PyObject *__pyx_n_s_PickleError;
  PyObject *__pyx_kp_s_Pickling_of_struct_members_such;
  PyObject *__pyx_n_s_Rad;
  PyObject *__pyx_n_u_Rad;
  PyObject *__pyx_n_s_Rain;
  PyObject *__pyx_n_u_Rain;
  PyObject *__pyx_n_s_RuntimeError;
  PyObject *__pyx_n_s_Simulation;
  PyObject *__pyx_n_s_SimulationEnd;
  PyObject *__pyx_n_s_Simulation___reduce_cython;
  PyObject *__pyx_n_s_Simulation___setstate_cython;
  PyObject *__pyx_n_s_Simulation__add_vegetative_branc;
  PyObject *__pyx_n_s_Simulation__calc_light_intercept;
  PyObject *__pyx_n_s_Simulation__column_shading;
  PyObject *__pyx_n_s_Simulation__daily_climate;
  PyObject *__pyx_n_s_Simulation__days_to_first_square;
  PyObject *__pyx_n_s_Simulation__defoliate;
  PyObject *__pyx_n_s_Simulation__doy2date;
  PyObject *__pyx_n_s_Simulation__get_net_photosynthes;
  PyObject *__pyx_n_s_Simulation__growth;
  PyObject *__pyx_n_s_Simulation__init_grid;
  PyObject *__pyx_n_s_Simulation__init_state;
  PyObject *__pyx_n_s_Simulation__phenology;
  PyObject *__pyx_n_s_Simulation__potential_fruit_grow;
  PyObject *__pyx_n_s_Simulation__potential_leaf_growt;
  PyObject *__pyx_n_s_Simulation__simulate;
  PyObject *__pyx_n_s_Simulation__simulate_this_day;
  PyObject *__pyx_n_s_Simulation__stress;
  PyObject *__pyx_n_s_Simulation_read_input;
  PyObject *__pyx_n_s_Simulation_run;
  PyObject *__pyx_n_s_Simulation_state;
  PyObject *__pyx_n_s_SoilInit;
  PyObject *__pyx_n_s_SoilInit___reduce_cython;
  PyObject *__pyx_n_s_SoilInit___setstate_cython;
  PyObject *__pyx_n_s_State;
  PyObject *__pyx_n_s_State___reduce_cython;
  PyObject *__pyx_n_s_State___setstate_cython;
  PyObject *__pyx_n_s_State_add_fruiting_branch;
  PyObject *__pyx_n_s_State_create_first_square;
  PyObject *__pyx_n_s_State_keys;
  PyObject *__pyx_n_s_StopIteration;
  PyObject *__pyx_n_s_Tdew;
  PyObject *__pyx_n_u_Tdew;
  PyObject *__pyx_n_s_TimeToNextFruBranch;
  PyObject *__pyx_n_s_TimeToNextVegBranch;
  PyObject *__pyx_n_s_Tmax;
  PyObject *__pyx_n_u_Tmax;
  PyObject *__pyx_n_s_Tmin;
  PyObject *__pyx_n_u_Tmin;
  PyObject *__pyx_n_s_TypeError;
  PyObject *__pyx_n_s_ValueError;
  PyObject *__pyx_n_s_VegetativeBranch;
  PyObject *__pyx_n_s_VegetativeBranch___reduce_cython;
  PyObject *__pyx_n_s_VegetativeBranch___setstate_cyth;
  PyObject *__pyx_n_s_WaterStress;
  PyObject *__pyx_n_s_Wind;
  PyObject *__pyx_n_u_Wind;
  PyObject *__pyx_kp_u_Y_j;
  PyObject *__pyx_n_s__213;
  PyObject *__pyx_kp_u__8;
  PyObject *__pyx_n_s_abscised_fruit_sites;
  PyObject *__pyx_n_s_abscised_leaf_weight;
  PyObject *__pyx_n_s_acos;
  PyObject *__pyx_n_s_actual_growth;
  PyObject *__pyx_n_s_actual_soil_evaporation;
  PyObject *__pyx_n_s_actual_transpiration;
  PyObject *__pyx_n_s_add_fruiting_branch;
  PyObject *__pyx_n_s_add_vegetative_branch;
  PyObject *__pyx_n_s_addlfn;
  PyObject *__pyx_n_s_age;
  PyObject *__pyx_n_s_age_of_pre_fruiting_nodes;
  PyObject *__pyx_n_s_agemax;
  PyObject *__pyx_n_s_agetop;
  PyObject *__pyx_n_u_agricultural_inputs;
  PyObject *__pyx_n_u_air_dry;
  PyObject *__pyx_n_s_albedo;
  PyObject *__pyx_n_u_alpha;
  PyObject *__pyx_n_s_ambient_co2_factor;
  PyObject *__pyx_n_u_ammonium;
  PyObject *__pyx_n_u_ammonium_nitrogen;
  PyObject *__pyx_n_u_amount;
  PyObject *__pyx_n_s_applied_water;
  PyObject *__pyx_n_s_area;
  PyObject *__pyx_n_s_asyncio_coroutines;
  PyObject *__pyx_n_s_average_temperature;
  PyObject *__pyx_n_u_beta;
  PyObject *__pyx_n_s_bloom_weight_loss;
  PyObject *__pyx_n_s_bmain;
  PyObject *__pyx_n_s_boll;
  PyObject *__pyx_n_u_bulk_density;
  PyObject *__pyx_n_s_burr;
  PyObject *__pyx_n_s_burr_nitrogen;
  PyObject *__pyx_n_s_c;
  PyObject *__pyx_n_s_c11;
  PyObject *__pyx_n_s_calc_light_interception;
  PyObject *__pyx_n_s_carbon_stress;
  PyObject *__pyx_n_s_cc;
  PyObject *__pyx_n_s_cd;
  PyObject *__pyx_n_s_cdleaf;
  PyObject *__pyx_n_s_cdpet;
  PyObject *__pyx_n_s_cdroot;
  PyObject *__pyx_n_s_cdstem;
  PyObject *__pyx_n_s_cells;
  PyObject *__pyx_n_s_class_getitem;
  PyObject *__pyx_n_u_clay;
  PyObject *__pyx_n_s_climate;
  PyObject *__pyx_n_s_cline_in_traceback;
  PyObject *__pyx_n_s_cloud_cor;
  PyObject *__pyx_n_s_cloud_cov;
  PyObject *__pyx_n_s_column_shading;
  PyObject *__pyx_n_s_compute_day_length;
  PyObject *__pyx_n_s_cos;
  PyObject *__pyx_n_s_cotton2k_climate;
  PyObject *__pyx_n_s_cotton2k_leaf;
  PyObject *__pyx_n_s_cotton2k_photosynthesis;
  PyObject *__pyx_n_s_cotton2k_simulation;
  PyObject *__pyx_n_s_cotton2k_utils;
  PyObject *__pyx_n_s_cotylwt;
  PyObject *__pyx_n_s_create_first_square;
  PyObject *__pyx_n_s_cultivar_parameters;
  PyObject *__pyx_n_s_cumulative_evaporation;
  PyObject *__pyx_n_s_cumulative_nitrogen_loss;
  PyObject *__pyx_n_s_cumulative_transpiration;
  PyObject *__pyx_n_s_daily_climate;
  PyObject *__pyx_n_s_date;
  PyObject *__pyx_n_u_date;
  PyObject *__pyx_n_s_date2doy;
  PyObject *__pyx_n_s_datetime;
  PyObject *__pyx_n_s_day_inc;
  PyObject *__pyx_n_s_day_length;
  PyObject *__pyx_n_u_day_length;
  PyObject *__pyx_n_s_daynum;
  PyObject *__pyx_n_s_days_to_first_square;
  PyObject *__pyx_n_s_declination;
  PyObject *__pyx_n_u_declination;
  PyObject *__pyx_n_s_defoliate;
  PyObject *__pyx_kp_u_defoliation_prediction;
  PyObject *__pyx_n_s_delayFrtByCStress;
  PyObject *__pyx_n_s_delayVegByCStress;
  PyObject *__pyx_n_s_delay_for_new_branch;
  PyObject *__pyx_n_s_delay_for_new_fruiting_branch;
  PyObject *__pyx_n_s_delay_for_new_node;
  PyObject *__pyx_n_s_denf2;
  PyObject *__pyx_n_s_denfac;
  PyObject *__pyx_n_s_density_factor;
  PyObject *__pyx_n_u_depth;
  PyObject *__pyx_n_s_dew_point;
  PyObject *__pyx_n_u_dewpoint;
  PyObject *__pyx_n_s_dict;
  PyObject *__pyx_n_s_dict_2;
  PyObject *__pyx_kp_u_disable;
  PyObject *__pyx_n_s_doc;
  PyObject *__pyx_n_s_doy2date;
  PyObject *__pyx_n_u_drip_depth;
  PyObject *__pyx_n_u_drip_horizontal_place;
  PyObject *__pyx_n_s_dsbe;
  PyObject *__pyx_n_s_dum;
  PyObject *__pyx_n_s_elevation;
  PyObject *__pyx_kp_u_enable;
  PyObject *__pyx_n_s_enumerate;
  PyObject *__pyx_n_s_et1;
  PyObject *__pyx_n_s_et2;
  PyObject *__pyx_n_s_evapotranspiration;
  PyObject *__pyx_n_s_extra_carbon;
  PyObject *__pyx_n_u_fertilization;
  PyObject *__pyx_n_u_field_capacity_hydraulic_conduct;
  PyObject *__pyx_n_u_field_capacity_water_potential;
  PyObject *__pyx_n_s_first_node;
  PyObject *__pyx_n_s_first_square_leaf_area;
  PyObject *__pyx_n_s_fraction;
  PyObject *__pyx_n_s_fresh_organic_matter;
  PyObject *__pyx_n_s_fruit_growth_ratio;
  PyObject *__pyx_n_s_fruiting_branches;
  PyObject *__pyx_kp_u_gc;
  PyObject *__pyx_n_s_get;
  PyObject *__pyx_n_s_get_net_photosynthesis;
  PyObject *__pyx_n_s_getattr;
  PyObject *__pyx_n_s_getstate;
  PyObject *__pyx_n_s_ginning_percent;
  PyObject *__pyx_n_s_green_bolls_burr_weight;
  PyObject *__pyx_n_s_green_bolls_weight;
  PyObject *__pyx_n_s_growth;
  PyObject *__pyx_n_s_growth_factor;
  PyObject *__pyx_n_s_gsubr;
  PyObject *__pyx_n_s_hour;
  PyObject *__pyx_n_s_hours;
  PyObject *__pyx_n_s_htdenf;
  PyObject *__pyx_n_s_humidity;
  PyObject *__pyx_n_s_hydrology;
  PyObject *__pyx_n_s_i;
  PyObject *__pyx_n_s_ihr;
  PyObject *__pyx_n_u_immediate_drainage_water_potenti;
  PyObject *__pyx_n_s_import;
  PyObject *__pyx_n_s_init_grid;
  PyObject *__pyx_n_s_init_state;
  PyObject *__pyx_n_s_init_subclass;
  PyObject *__pyx_n_s_initial;
  PyObject *__pyx_n_u_irrigation;
  PyObject *__pyx_n_s_is_coroutine;
  PyObject *__pyx_kp_u_isenabled;
  PyObject *__pyx_n_s_items;
  PyObject *__pyx_n_s_j;
  PyObject *__pyx_n_s_jp1;
  PyObject *__pyx_n_s_k;
  PyObject *__pyx_n_s_k0;
  PyObject *__pyx_n_s_kday;
  PyObject *__pyx_n_s_keys;
  PyObject *__pyx_n_s_kkday;
  PyObject *__pyx_n_s_kwargs;
  PyObject *__pyx_n_s_l;
  PyObject *__pyx_n_s_l1;
  PyObject *__pyx_n_s_l2;
  PyObject *__pyx_n_s_last_fruiting_branch;
  PyObject *__pyx_n_s_latitude;
  PyObject *__pyx_n_s_layer_depth;
  PyObject *__pyx_n_s_layers;
  PyObject *__pyx_n_u_layers;
  PyObject *__pyx_n_s_leaf;
  PyObject *__pyx_n_s_leaf_area;
  PyObject *__pyx_n_s_leaf_area_index;
  PyObject *__pyx_n_s_leaf_area_pre_fruiting;
  PyObject *__pyx_n_s_leaf_nitrogen;
  PyObject *__pyx_n_s_leaf_nitrogen_concentration;
  PyObject *__pyx_n_s_leaf_weight;
  PyObject *__pyx_n_s_leaf_weight_area_ratio;
  PyObject *__pyx_n_s_leaf_weight_pre_fruiting;
  PyObject *__pyx_n_s_lfint;
  PyObject *__pyx_n_s_light_interception;
  PyObject *__pyx_n_s_lint_yield;
  PyObject *__pyx_n_s_longitude;
  PyObject *__pyx_n_s_lp1;
  PyObject *__pyx_n_s_lyrsol;
  PyObject *__pyx_n_s_lytres;
  PyObject *__pyx_n_s_m;
  PyObject *__pyx_n_s_main;
  PyObject *__pyx_n_s_main_stem_leaf;
  PyObject *__pyx_n_s_math;
  PyObject *__pyx_n_u_max;
  PyObject *__pyx_n_u_max_conductivity;
  PyObject *__pyx_n_s_maxrtgr;
  PyObject *__pyx_n_s_maxstmgr;
  PyObject *__pyx_n_s_metaclass;
  PyObject *__pyx_n_u_method;
  PyObject *__pyx_n_s_microsecond;
  PyObject *__pyx_n_u_min;
  PyObject *__pyx_n_s_minute;
  PyObject *__pyx_n_s_module;
  PyObject *__pyx_n_s_mp1;
  PyObject *__pyx_n_s_mro_entries;
  PyObject *__pyx_n_s_name;
  PyObject *__pyx_n_s_net_radiation;
  PyObject *__pyx_n_s_new;
  PyObject *__pyx_n_s_new_branch;
  PyObject *__pyx_n_s_new_node;
  PyObject *__pyx_n_s_new_node_initial_leaf_area;
  PyObject *__pyx_n_s_newbr;
  PyObject *__pyx_n_s_nidmax;
  PyObject *__pyx_n_u_nitrate;
  PyObject *__pyx_n_u_nitrate_nitrogen;
  PyObject *__pyx_n_s_nitrate_nitrogen_content;
  PyObject *__pyx_n_s_nitrogen_stress;
  PyObject *__pyx_n_s_nitrogen_stress_fruiting;
  PyObject *__pyx_n_s_nitrogen_stress_root;
  PyObject *__pyx_n_s_nitrogen_stress_vegetative;
  PyObject *__pyx_n_s_nodes;
  PyObject *__pyx_n_s_number_of_fruiting_branches;
  PyObject *__pyx_n_s_number_of_fruiting_nodes;
  PyObject *__pyx_n_s_number_of_fruiting_sites;
  PyObject *__pyx_n_s_number_of_green_bolls;
  PyObject *__pyx_n_s_number_of_layers_with_root;
  PyObject *__pyx_n_s_number_of_left_columns_with_root;
  PyObject *__pyx_n_s_number_of_open_bolls;
  PyObject *__pyx_n_s_number_of_pre_fruiting_nodes;
  PyObject *__pyx_n_s_number_of_right_columns_with_roo;
  PyObject *__pyx_n_s_number_of_squares;
  PyObject *__pyx_n_s_number_of_vegetative_branches;
  PyObject *__pyx_n_s_nwfl;
  PyObject *__pyx_n_s_oldstmwt;
  PyObject *__pyx_n_s_open_bolls_burr_weight;
  PyObject *__pyx_n_s_open_bolls_weight;
  PyObject *__pyx_n_u_organic_matter;
  PyObject *__pyx_n_s_p;
  PyObject *__pyx_n_s_p1;
  PyObject *__pyx_n_s_p2;
  PyObject *__pyx_n_s_p3;
  PyObject *__pyx_n_s_p4;
  PyObject *__pyx_n_s_p5;
  PyObject *__pyx_n_s_p6;
  PyObject *__pyx_n_s_p7;
  PyObject *__pyx_n_s_perdmax;
  PyObject *__pyx_n_s_petiole;
  PyObject *__pyx_n_s_petiole_nitrogen_concentration;
  PyObject *__pyx_n_s_petiole_weight;
  PyObject *__pyx_n_s_pex;
  PyObject *__pyx_n_s_phenology;
  PyObject *__pyx_n_s_pi;
  PyObject *__pyx_n_s_pickle;
  PyObject *__pyx_n_s_plant_height;
  PyObject *__pyx_n_s_plant_weight;
  PyObject *__pyx_kp_u_planting_date_or_emergence_date;
  PyObject *__pyx_n_s_pnetcor;
  PyObject *__pyx_n_s_pollination_switch;
  PyObject *__pyx_n_s_potential_fruit_growth;
  PyObject *__pyx_n_s_potential_growth;
  PyObject *__pyx_n_s_potential_growth_for_leaf_area;
  PyObject *__pyx_n_s_potential_growth_for_leaf_weight;
  PyObject *__pyx_n_s_potential_growth_for_petiole_wei;
  PyObject *__pyx_n_s_potential_leaf_growth;
  PyObject *__pyx_n_s_pplant;
  PyObject *__pyx_n_s_prepare;
  PyObject *__pyx_n_s_psilim;
  PyObject *__pyx_n_s_pstand;
  PyObject *__pyx_n_s_ptnfac;
  PyObject *__pyx_n_s_pts;
  PyObject *__pyx_n_s_pyx_PickleError;
  PyObject *__pyx_n_s_pyx_checksum;
  PyObject *__pyx_n_s_pyx_result;
  PyObject *__pyx_n_s_pyx_state;
  PyObject *__pyx_n_s_pyx_type;
  PyObject *__pyx_n_s_pyx_unpickle_SoilInit;
  PyObject *__pyx_n_s_pyx_vtable;
  PyObject *__pyx_n_s_qualname;
  PyObject *__pyx_n_s_radiation;
  PyObject *__pyx_n_u_radiation;
  PyObject *__pyx_n_s_radsum;
  PyObject *__pyx_n_u_rain;
  PyObject *__pyx_n_s_rainToday;
  PyObject *__pyx_n_s_range;
  PyObject *__pyx_n_s_rate;
  PyObject *__pyx_n_s_ratebol;
  PyObject *__pyx_n_s_ratebur;
  PyObject *__pyx_n_s_ratesqr;
  PyObject *__pyx_n_u_ratio_implicit;
  PyObject *__pyx_n_s_rbmax;
  PyObject *__pyx_n_s_read_input;
  PyObject *__pyx_n_s_reduce;
  PyObject *__pyx_n_s_reduce_cython;
  PyObject *__pyx_n_s_reduce_ex;
  PyObject *__pyx_n_s_ref_et;
  PyObject *__pyx_n_s_replace;
  PyObject *__pyx_n_s_result;
  PyObject *__pyx_n_s_root;
  PyObject *__pyx_n_s_root_nitrogen_concentration;
  PyObject *__pyx_n_s_row_space;
  PyObject *__pyx_n_s_rsubl;
  PyObject *__pyx_n_s_rsubo;
  PyObject *__pyx_n_s_run;
  PyObject *__pyx_n_s_runoff;
  PyObject *__pyx_n_s_runoffToday;
  PyObject *__pyx_n_u_sand;
  PyObject *__pyx_n_u_saturated_hydraulic_conductivity;
  PyObject *__pyx_n_s_sd;
  PyObject *__pyx_n_s_second;
  PyObject *__pyx_n_s_seed_nitrogen;
  PyObject *__pyx_n_s_seed_nitrogen_concentration;
  PyObject *__pyx_n_s_self;
  PyObject *__pyx_kp_s_self___cannot_be_converted_to_a;
  PyObject *__pyx_kp_s_self_climate_cannot_be_converted;
  PyObject *__pyx_n_s_set_name;
  PyObject *__pyx_n_s_setstate;
  PyObject *__pyx_n_s_setstate_cython;
  PyObject *__pyx_n_s_shade;
  PyObject *__pyx_n_s_simulate;
  PyObject *__pyx_n_s_simulate_this_day;
  PyObject *__pyx_n_s_sin;
  PyObject *__pyx_n_s_sinb;
  PyObject *__pyx_n_s_smax;
  PyObject *__pyx_n_s_smaxx;
  PyObject *__pyx_n_s_soil;
  PyObject *__pyx_n_s_solar_noon;
  PyObject *__pyx_n_u_solar_noon;
  PyObject *__pyx_n_s_sqrt;
  PyObject *__pyx_n_s_square;
  PyObject *__pyx_n_s_square_nitrogen;
  PyObject *__pyx_n_s_square_nitrogen_concentration;
  PyObject *__pyx_n_s_square_weight;
  PyObject *__pyx_kp_s_src__cotton2k_simulation_pyx;
  PyObject *__pyx_n_s_stage;
  PyObject *__pyx_n_s_start;
  PyObject *__pyx_n_s_start_date;
  PyObject *__pyx_n_s_state;
  PyObject *__pyx_n_s_state0;
  PyObject *__pyx_n_s_stemNRatio;
  PyObject *__pyx_n_s_stem_nitrogen;
  PyObject *__pyx_n_s_stem_weight;
  PyObject *__pyx_n_s_stemnew;
  PyObject *__pyx_n_s_step;
  PyObject *__pyx_n_s_stop;
  PyObject *__pyx_n_s_stress;
  PyObject *__pyx_kp_s_stringsource;
  PyObject *__pyx_n_s_strptime;
  PyObject *__pyx_n_s_sumpdr;
  PyObject *__pyx_n_s_sumwk;
  PyObject *__pyx_n_s_sunr;
  PyObject *__pyx_n_u_sunr;
  PyObject *__pyx_n_s_suns;
  PyObject *__pyx_n_u_suns;
  PyObject *__pyx_n_s_super;
  PyObject *__pyx_n_s_sw;
  PyObject *__pyx_n_s_sw0;
  PyObject *__pyx_n_s_sw1;
  PyObject *__pyx_n_s_t1;
  PyObject *__pyx_n_s_t2;
  PyObject *__pyx_n_s_t3;
  PyObject *__pyx_n_s_tav;
  PyObject *__pyx_n_s_tdday;
  PyObject *__pyx_n_s_temperature;
  PyObject *__pyx_n_s_temperature_on_leaf_growth_rate;
  PyObject *__pyx_n_s_test;
  PyObject *__pyx_n_s_tfrt;
  PyObject *__pyx_n_u_theta;
  PyObject *__pyx_n_s_ti;
  PyObject *__pyx_n_s_time_to_new_fruiting_branch;
  PyObject *__pyx_n_s_timedelta;
  PyObject *__pyx_n_s_tmpisr;
  PyObject *__pyx_n_u_tmpisr;
  PyObject *__pyx_n_s_total_required_nitrogen;
  PyObject *__pyx_n_u_type;
  PyObject *__pyx_n_s_u;
  PyObject *__pyx_n_s_update;
  PyObject *__pyx_n_u_urea;
  PyObject *__pyx_n_s_use_setstate;
  PyObject *__pyx_n_s_vegetative_branch;
  PyObject *__pyx_n_s_vegetative_branches;
  PyObject *__pyx_n_s_version;
  PyObject *__pyx_n_s_vfrtbr;
  PyObject *__pyx_n_s_voldstm;
  PyObject *__pyx_n_s_vpheno;
  PyObject *__pyx_n_s_vpnet;
  PyObject *__pyx_n_s_vpotfrt;
  PyObject *__pyx_n_s_vpotlf;
  PyObject *__pyx_n_s_vpvegb;
  PyObject *__pyx_n_s_vstrs;
  PyObject *__pyx_n_u_water;
  PyObject *__pyx_n_s_water_stress;
  PyObject *__pyx_n_s_water_stress_stem;
  PyObject *__pyx_n_s_wattsm;
  PyObject *__pyx_n_s_wbmax;
  PyObject *__pyx_n_s_weight;
  PyObject *__pyx_n_s_weight_capable_uptake;
  PyObject *__pyx_n_s_wfdb;
  PyObject *__pyx_n_u_wind;
  PyObject *__pyx_n_s_wind_speed;
  PyObject *__pyx_n_s_wnytf;
  PyObject *__pyx_n_s_wstrlf;
  PyObject *__pyx_n_s_wtfstrs;
  PyObject *__pyx_n_s_xlat;
  PyObject *__pyx_n_s_year;
  PyObject *__pyx_n_s_z1;
  PyObject *__pyx_n_s_zero;
  PyObject *__pyx_n_s_zint;
  PyObject *__pyx_float_0_3;
  PyObject *__pyx_float_0_5;
  PyObject *__pyx_float_0_08;
  PyObject *__pyx_float_0_0002;
  PyObject *__pyx_int_0;
  PyObject *__pyx_int_1;
  PyObject *__pyx_int_2;
  PyObject *__pyx_int_4;
  PyObject *__pyx_int_10;
  PyObject *__pyx_int_12;
  PyObject *__pyx_int_24;
  PyObject *__pyx_int_30;
  PyObject *__pyx_int_180;
  PyObject *__pyx_int_1024;
  PyObject *__pyx_int_1000000;
  PyObject *__pyx_int_139140702;
  PyObject *__pyx_tuple_;
  PyObject *__pyx_tuple__2;
  PyObject *__pyx_tuple__3;
  PyObject *__pyx_tuple__4;
  PyObject *__pyx_tuple__5;
  PyObject *__pyx_tuple__6;
  PyObject *__pyx_tuple__7;
  PyObject *__pyx_tuple__9;
  PyObject *__pyx_tuple__10;
  PyObject *__pyx_tuple__11;
  PyObject *__pyx_tuple__12;
  PyObject *__pyx_tuple__13;
  PyObject *__pyx_tuple__14;
  PyObject *__pyx_tuple__15;
  PyObject *__pyx_tuple__16;
  PyObject *__pyx_tuple__17;
  PyObject *__pyx_tuple__18;
  PyObject *__pyx_tuple__19;
  PyObject *__pyx_tuple__20;
  PyObject *__pyx_tuple__21;
  PyObject *__pyx_tuple__22;
  PyObject *__pyx_tuple__23;
  PyObject *__pyx_tuple__24;
  PyObject *__pyx_tuple__25;
  PyObject *__pyx_tuple__26;
  PyObject *__pyx_tuple__27;
  PyObject *__pyx_tuple__28;
  PyObject *__pyx_tuple__29;
  PyObject *__pyx_tuple__30;
  PyObject *__pyx_tuple__31;
  PyObject *__pyx_tuple__32;
  PyObject *__pyx_tuple__33;
  PyObject *__pyx_tuple__34;
  PyObject *__pyx_tuple__35;
  PyObject *__pyx_tuple__36;
  PyObject *__pyx_tuple__37;
  PyObject *__pyx_tuple__38;
  PyObject *__pyx_tuple__39;
  PyObject *__pyx_tuple__40;
  PyObject *__pyx_tuple__41;
  PyObject *__pyx_tuple__42;
  PyObject *__pyx_tuple__43;
  PyObject *__pyx_tuple__44;
  PyObject *__pyx_tuple__45;
  PyObject *__pyx_tuple__46;
  PyObject *__pyx_tuple__47;
  PyObject *__pyx_tuple__48;
  PyObject *__pyx_tuple__49;
  PyObject *__pyx_tuple__50;
  PyObject *__pyx_tuple__51;
  PyObject *__pyx_tuple__52;
  PyObject *__pyx_tuple__53;
  PyObject *__pyx_tuple__54;
  PyObject *__pyx_tuple__55;
  PyObject *__pyx_tuple__56;
  PyObject *__pyx_tuple__57;
  PyObject *__pyx_tuple__58;
  PyObject *__pyx_tuple__59;
  PyObject *__pyx_tuple__60;
  PyObject *__pyx_tuple__61;
  PyObject *__pyx_tuple__62;
  PyObject *__pyx_tuple__63;
  PyObject *__pyx_tuple__64;
  PyObject *__pyx_tuple__65;
  PyObject *__pyx_tuple__66;
  PyObject *__pyx_tuple__67;
  PyObject *__pyx_tuple__68;
  PyObject *__pyx_tuple__69;
  PyObject *__pyx_tuple__70;
  PyObject *__pyx_tuple__71;
  PyObject *__pyx_tuple__72;
  PyObject *__pyx_tuple__73;
  PyObject *__pyx_tuple__74;
  PyObject *__pyx_tuple__75;
  PyObject *__pyx_tuple__76;
  PyObject *__pyx_tuple__77;
  PyObject *__pyx_tuple__78;
  PyObject *__pyx_tuple__79;
  PyObject *__pyx_tuple__80;
  PyObject *__pyx_tuple__81;
  PyObject *__pyx_tuple__82;
  PyObject *__pyx_tuple__83;
  PyObject *__pyx_tuple__84;
  PyObject *__pyx_tuple__85;
  PyObject *__pyx_tuple__86;
  PyObject *__pyx_tuple__87;
  PyObject *__pyx_tuple__88;
  PyObject *__pyx_tuple__89;
  PyObject *__pyx_tuple__90;
  PyObject *__pyx_tuple__91;
  PyObject *__pyx_tuple__92;
  PyObject *__pyx_tuple__93;
  PyObject *__pyx_tuple__94;
  PyObject *__pyx_tuple__95;
  PyObject *__pyx_tuple__96;
  PyObject *__pyx_tuple__97;
  PyObject *__pyx_tuple__98;
  PyObject *__pyx_tuple__99;
  PyObject *__pyx_tuple__100;
  PyObject *__pyx_tuple__101;
  PyObject *__pyx_tuple__102;
  PyObject *__pyx_tuple__103;
  PyObject *__pyx_tuple__104;
  PyObject *__pyx_tuple__105;
  PyObject *__pyx_tuple__106;
  PyObject *__pyx_tuple__107;
  PyObject *__pyx_tuple__108;
  PyObject *__pyx_tuple__109;
  PyObject *__pyx_tuple__110;
  PyObject *__pyx_tuple__111;
  PyObject *__pyx_tuple__112;
  PyObject *__pyx_tuple__113;
  PyObject *__pyx_tuple__114;
  PyObject *__pyx_tuple__115;
  PyObject *__pyx_tuple__116;
  PyObject *__pyx_tuple__117;
  PyObject *__pyx_tuple__118;
  PyObject *__pyx_tuple__119;
  PyObject *__pyx_tuple__120;
  PyObject *__pyx_tuple__121;
  PyObject *__pyx_tuple__122;
  PyObject *__pyx_tuple__123;
  PyObject *__pyx_tuple__124;
  PyObject *__pyx_tuple__125;
  PyObject *__pyx_tuple__126;
  PyObject *__pyx_tuple__127;
  PyObject *__pyx_tuple__128;
  PyObject *__pyx_tuple__129;
  PyObject *__pyx_tuple__131;
  PyObject *__pyx_tuple__133;
  PyObject *__pyx_tuple__135;
  PyObject *__pyx_tuple__137;
  PyObject *__pyx_tuple__139;
  PyObject *__pyx_tuple__141;
  PyObject *__pyx_tuple__143;
  PyObject *__pyx_tuple__145;
  PyObject *__pyx_tuple__147;
  PyObject *__pyx_tuple__149;
  PyObject *__pyx_tuple__151;
  PyObject *__pyx_tuple__153;
  PyObject *__pyx_tuple__155;
  PyObject *__pyx_tuple__157;
  PyObject *__pyx_tuple__159;
  PyObject *__pyx_tuple__161;
  PyObject *__pyx_tuple__163;
  PyObject *__pyx_tuple__165;
  PyObject *__pyx_tuple__167;
  PyObject *__pyx_tuple__169;
  PyObject *__pyx_tuple__171;
  PyObject *__pyx_tuple__173;
  PyObject *__pyx_tuple__175;
  PyObject *__pyx_tuple__177;
  PyObject *__pyx_tuple__179;
  PyObject *__pyx_tuple__181;
  PyObject *__pyx_tuple__183;
  PyObject *__pyx_tuple__185;
  PyObject *__pyx_tuple__187;
  PyObject *__pyx_tuple__189;
  PyObject *__pyx_tuple__191;
  PyObject *__pyx_tuple__193;
  PyObject *__pyx_tuple__195;
  PyObject *__pyx_tuple__197;
  PyObject *__pyx_tuple__199;
  PyObject *__pyx_tuple__201;
  PyObject *__pyx_tuple__203;
  PyObject *__pyx_tuple__205;
  PyObject *__pyx_tuple__207;
  PyObject *__pyx_tuple__209;
  PyObject *__pyx_tuple__211;
  PyObject *__pyx_codeobj__130;
  PyObject *__pyx_codeobj__132;
  PyObject *__pyx_codeobj__134;
  PyObject *__pyx_codeobj__136;
  PyObject *__pyx_codeobj__138;
  PyObject *__pyx_codeobj__140;
  PyObject *__pyx_codeobj__142;
  PyObject *__pyx_codeobj__144;
  PyObject *__pyx_codeobj__146;
  PyObject *__pyx_codeobj__148;
  PyObject *__pyx_codeobj__150;
  PyObject *__pyx_codeobj__152;
  PyObject *__pyx_codeobj__154;
  PyObject *__pyx_codeobj__156;
  PyObject *__pyx_codeobj__158;
  PyObject *__pyx_codeobj__160;
  PyObject *__pyx_codeobj__162;
  PyObject *__pyx_codeobj__164;
  PyObject *__pyx_codeobj__166;
  PyObject *__pyx_codeobj__168;
  PyObject *__pyx_codeobj__170;
  PyObject *__pyx_codeobj__172;
  PyObject *__pyx_codeobj__174;
  PyObject *__pyx_codeobj__176;
  PyObject *__pyx_codeobj__178;
  PyObject *__pyx_codeobj__180;
  PyObject *__pyx_codeobj__182;
  PyObject *__pyx_codeobj__184;
  PyObject *__pyx_codeobj__186;
  PyObject *__pyx_codeobj__188;
  PyObject *__pyx_codeobj__190;
  PyObject *__pyx_codeobj__192;
  PyObject *__pyx_codeobj__194;
  PyObject *__pyx_codeobj__196;
  PyObject *__pyx_codeobj__198;
  PyObject *__pyx_codeobj__200;
  PyObject *__pyx_codeobj__202;
  PyObject *__pyx_codeobj__204;
  PyObject *__pyx_codeobj__206;
  PyObject *__pyx_codeobj__208;
  PyObject *__pyx_codeobj__210;
  PyObject *__pyx_codeobj__212;
} __pyx_mstate;

#ifdef __cplusplus
namespace {
  extern struct PyModuleDef __pyx_moduledef;
} /* anonymous namespace */
#else
static struct PyModuleDef __pyx_moduledef;
#endif

#define __pyx_mstate(o) ((__pyx_mstate *)__Pyx_PyModule_GetState(o))

#define __pyx_mstate_global (__pyx_mstate(PyState_FindModule(&__pyx_moduledef)))

#define __pyx_m (PyState_FindModule(&__pyx_moduledef))
#endif
/* #### Code section: module_state_clear ### */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_m_clear(PyObject *m) {
  __pyx_mstate *clear_module_state = __pyx_mstate(m);
  if (!clear_module_state) return 0;
  Py_CLEAR(clear_module_state->__pyx_d);
  Py_CLEAR(clear_module_state->__pyx_b);
  Py_CLEAR(clear_module_state->__pyx_cython_runtime);
  Py_CLEAR(clear_module_state->__pyx_empty_tuple);
  Py_CLEAR(clear_module_state->__pyx_empty_bytes);
  Py_CLEAR(clear_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_CLEAR(clear_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_CLEAR(clear_module_state->__pyx_FusedFunctionType);
  #endif
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_SoilInit);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_SoilInit);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_Climate);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_Climate);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_NodeLeaf);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_NodeLeaf);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_FruitingNode);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_FruitingNode);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_MainStemLeaf);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_FruitingBranch);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_FruitingBranch);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_VegetativeBranch);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_State);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_State);
  Py_CLEAR(clear_module_state->__pyx_ptype_9_cotton2k_10simulation_Simulation);
  Py_CLEAR(clear_module_state->__pyx_type_9_cotton2k_10simulation_Simulation);
  Py_CLEAR(clear_module_state->__pyx_n_s_Climate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Climate___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Climate___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_DaysTo1stSqare);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingBranch);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingBranch___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingBranch___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingNode);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingNode___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_FruitingNode___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Incompatible_checksums_s_vs_0x84);
  Py_CLEAR(clear_module_state->__pyx_n_s_IndexError);
  Py_CLEAR(clear_module_state->__pyx_n_s_KeyError);
  Py_CLEAR(clear_module_state->__pyx_n_s_MainStemLeaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_MainStemLeaf___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_MainStemLeaf___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_10);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_100);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_101);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_102);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_103);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_104);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_105);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_106);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_107);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_108);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_109);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_11);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_110);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_111);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_112);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_113);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_114);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_115);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_116);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_117);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_12);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_13);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_14);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_15);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_16);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_17);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_18);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_19);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_2);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_20);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_21);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_22);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_23);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_24);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_25);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_26);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_27);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_28);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_29);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_3);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_30);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_31);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_32);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_33);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_34);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_35);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_36);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_37);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_38);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_39);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_4);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_40);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_41);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_42);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_43);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_44);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_45);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_46);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_47);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_48);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_49);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_5);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_50);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_51);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_52);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_53);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_54);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_55);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_56);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_57);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_58);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_59);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_6);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_60);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_61);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_62);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_63);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_64);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_65);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_66);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_67);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_68);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_69);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_7);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_70);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_71);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_72);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_73);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_74);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_75);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_76);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_77);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_78);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_79);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_8);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_80);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_81);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_82);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_83);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_84);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_85);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_86);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_87);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_88);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_89);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_9);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_90);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_91);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_92);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_93);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_94);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_95);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_96);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_97);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_98);
  Py_CLEAR(clear_module_state->__pyx_kp_s_No_value_specified_for_struct_at_99);
  Py_CLEAR(clear_module_state->__pyx_n_s_NodeLeaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_NodeLeaf___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_NodeLeaf___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_OpenRatio);
  Py_CLEAR(clear_module_state->__pyx_n_s_OverflowError);
  Py_CLEAR(clear_module_state->__pyx_n_s_PhenDelayByNStress);
  Py_CLEAR(clear_module_state->__pyx_n_s_PickleError);
  Py_CLEAR(clear_module_state->__pyx_kp_s_Pickling_of_struct_members_such);
  Py_CLEAR(clear_module_state->__pyx_n_s_Rad);
  Py_CLEAR(clear_module_state->__pyx_n_u_Rad);
  Py_CLEAR(clear_module_state->__pyx_n_s_Rain);
  Py_CLEAR(clear_module_state->__pyx_n_u_Rain);
  Py_CLEAR(clear_module_state->__pyx_n_s_RuntimeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation);
  Py_CLEAR(clear_module_state->__pyx_n_s_SimulationEnd);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__add_vegetative_branc);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__calc_light_intercept);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__column_shading);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__daily_climate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__days_to_first_square);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__defoliate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__doy2date);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__get_net_photosynthes);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__init_grid);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__init_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__phenology);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__potential_fruit_grow);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__potential_leaf_growt);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__simulate);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__simulate_this_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation__stress);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation_read_input);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation_run);
  Py_CLEAR(clear_module_state->__pyx_n_s_Simulation_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_SoilInit);
  Py_CLEAR(clear_module_state->__pyx_n_s_SoilInit___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_SoilInit___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_State);
  Py_CLEAR(clear_module_state->__pyx_n_s_State___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_State___setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_State_add_fruiting_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_State_create_first_square);
  Py_CLEAR(clear_module_state->__pyx_n_s_State_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_StopIteration);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tdew);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tdew);
  Py_CLEAR(clear_module_state->__pyx_n_s_TimeToNextFruBranch);
  Py_CLEAR(clear_module_state->__pyx_n_s_TimeToNextVegBranch);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tmax);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_Tmin);
  Py_CLEAR(clear_module_state->__pyx_n_u_Tmin);
  Py_CLEAR(clear_module_state->__pyx_n_s_TypeError);
  Py_CLEAR(clear_module_state->__pyx_n_s_ValueError);
  Py_CLEAR(clear_module_state->__pyx_n_s_VegetativeBranch);
  Py_CLEAR(clear_module_state->__pyx_n_s_VegetativeBranch___reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_VegetativeBranch___setstate_cyth);
  Py_CLEAR(clear_module_state->__pyx_n_s_WaterStress);
  Py_CLEAR(clear_module_state->__pyx_n_s_Wind);
  Py_CLEAR(clear_module_state->__pyx_n_u_Wind);
  Py_CLEAR(clear_module_state->__pyx_kp_u_Y_j);
  Py_CLEAR(clear_module_state->__pyx_n_s__213);
  Py_CLEAR(clear_module_state->__pyx_kp_u__8);
  Py_CLEAR(clear_module_state->__pyx_n_s_abscised_fruit_sites);
  Py_CLEAR(clear_module_state->__pyx_n_s_abscised_leaf_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_acos);
  Py_CLEAR(clear_module_state->__pyx_n_s_actual_growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_actual_soil_evaporation);
  Py_CLEAR(clear_module_state->__pyx_n_s_actual_transpiration);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_fruiting_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_add_vegetative_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_addlfn);
  Py_CLEAR(clear_module_state->__pyx_n_s_age);
  Py_CLEAR(clear_module_state->__pyx_n_s_age_of_pre_fruiting_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_agemax);
  Py_CLEAR(clear_module_state->__pyx_n_s_agetop);
  Py_CLEAR(clear_module_state->__pyx_n_u_agricultural_inputs);
  Py_CLEAR(clear_module_state->__pyx_n_u_air_dry);
  Py_CLEAR(clear_module_state->__pyx_n_s_albedo);
  Py_CLEAR(clear_module_state->__pyx_n_u_alpha);
  Py_CLEAR(clear_module_state->__pyx_n_s_ambient_co2_factor);
  Py_CLEAR(clear_module_state->__pyx_n_u_ammonium);
  Py_CLEAR(clear_module_state->__pyx_n_u_ammonium_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_u_amount);
  Py_CLEAR(clear_module_state->__pyx_n_s_applied_water);
  Py_CLEAR(clear_module_state->__pyx_n_s_area);
  Py_CLEAR(clear_module_state->__pyx_n_s_asyncio_coroutines);
  Py_CLEAR(clear_module_state->__pyx_n_s_average_temperature);
  Py_CLEAR(clear_module_state->__pyx_n_u_beta);
  Py_CLEAR(clear_module_state->__pyx_n_s_bloom_weight_loss);
  Py_CLEAR(clear_module_state->__pyx_n_s_bmain);
  Py_CLEAR(clear_module_state->__pyx_n_s_boll);
  Py_CLEAR(clear_module_state->__pyx_n_u_bulk_density);
  Py_CLEAR(clear_module_state->__pyx_n_s_burr);
  Py_CLEAR(clear_module_state->__pyx_n_s_burr_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_c);
  Py_CLEAR(clear_module_state->__pyx_n_s_c11);
  Py_CLEAR(clear_module_state->__pyx_n_s_calc_light_interception);
  Py_CLEAR(clear_module_state->__pyx_n_s_carbon_stress);
  Py_CLEAR(clear_module_state->__pyx_n_s_cc);
  Py_CLEAR(clear_module_state->__pyx_n_s_cd);
  Py_CLEAR(clear_module_state->__pyx_n_s_cdleaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_cdpet);
  Py_CLEAR(clear_module_state->__pyx_n_s_cdroot);
  Py_CLEAR(clear_module_state->__pyx_n_s_cdstem);
  Py_CLEAR(clear_module_state->__pyx_n_s_cells);
  Py_CLEAR(clear_module_state->__pyx_n_s_class_getitem);
  Py_CLEAR(clear_module_state->__pyx_n_u_clay);
  Py_CLEAR(clear_module_state->__pyx_n_s_climate);
  Py_CLEAR(clear_module_state->__pyx_n_s_cline_in_traceback);
  Py_CLEAR(clear_module_state->__pyx_n_s_cloud_cor);
  Py_CLEAR(clear_module_state->__pyx_n_s_cloud_cov);
  Py_CLEAR(clear_module_state->__pyx_n_s_column_shading);
  Py_CLEAR(clear_module_state->__pyx_n_s_compute_day_length);
  Py_CLEAR(clear_module_state->__pyx_n_s_cos);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotton2k_climate);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotton2k_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotton2k_photosynthesis);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotton2k_simulation);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotton2k_utils);
  Py_CLEAR(clear_module_state->__pyx_n_s_cotylwt);
  Py_CLEAR(clear_module_state->__pyx_n_s_create_first_square);
  Py_CLEAR(clear_module_state->__pyx_n_s_cultivar_parameters);
  Py_CLEAR(clear_module_state->__pyx_n_s_cumulative_evaporation);
  Py_CLEAR(clear_module_state->__pyx_n_s_cumulative_nitrogen_loss);
  Py_CLEAR(clear_module_state->__pyx_n_s_cumulative_transpiration);
  Py_CLEAR(clear_module_state->__pyx_n_s_daily_climate);
  Py_CLEAR(clear_module_state->__pyx_n_s_date);
  Py_CLEAR(clear_module_state->__pyx_n_u_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_date2doy);
  Py_CLEAR(clear_module_state->__pyx_n_s_datetime);
  Py_CLEAR(clear_module_state->__pyx_n_s_day_inc);
  Py_CLEAR(clear_module_state->__pyx_n_s_day_length);
  Py_CLEAR(clear_module_state->__pyx_n_u_day_length);
  Py_CLEAR(clear_module_state->__pyx_n_s_daynum);
  Py_CLEAR(clear_module_state->__pyx_n_s_days_to_first_square);
  Py_CLEAR(clear_module_state->__pyx_n_s_declination);
  Py_CLEAR(clear_module_state->__pyx_n_u_declination);
  Py_CLEAR(clear_module_state->__pyx_n_s_defoliate);
  Py_CLEAR(clear_module_state->__pyx_kp_u_defoliation_prediction);
  Py_CLEAR(clear_module_state->__pyx_n_s_delayFrtByCStress);
  Py_CLEAR(clear_module_state->__pyx_n_s_delayVegByCStress);
  Py_CLEAR(clear_module_state->__pyx_n_s_delay_for_new_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_delay_for_new_fruiting_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_delay_for_new_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_denf2);
  Py_CLEAR(clear_module_state->__pyx_n_s_denfac);
  Py_CLEAR(clear_module_state->__pyx_n_s_density_factor);
  Py_CLEAR(clear_module_state->__pyx_n_u_depth);
  Py_CLEAR(clear_module_state->__pyx_n_s_dew_point);
  Py_CLEAR(clear_module_state->__pyx_n_u_dewpoint);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict);
  Py_CLEAR(clear_module_state->__pyx_n_s_dict_2);
  Py_CLEAR(clear_module_state->__pyx_kp_u_disable);
  Py_CLEAR(clear_module_state->__pyx_n_s_doc);
  Py_CLEAR(clear_module_state->__pyx_n_s_doy2date);
  Py_CLEAR(clear_module_state->__pyx_n_u_drip_depth);
  Py_CLEAR(clear_module_state->__pyx_n_u_drip_horizontal_place);
  Py_CLEAR(clear_module_state->__pyx_n_s_dsbe);
  Py_CLEAR(clear_module_state->__pyx_n_s_dum);
  Py_CLEAR(clear_module_state->__pyx_n_s_elevation);
  Py_CLEAR(clear_module_state->__pyx_kp_u_enable);
  Py_CLEAR(clear_module_state->__pyx_n_s_enumerate);
  Py_CLEAR(clear_module_state->__pyx_n_s_et1);
  Py_CLEAR(clear_module_state->__pyx_n_s_et2);
  Py_CLEAR(clear_module_state->__pyx_n_s_evapotranspiration);
  Py_CLEAR(clear_module_state->__pyx_n_s_extra_carbon);
  Py_CLEAR(clear_module_state->__pyx_n_u_fertilization);
  Py_CLEAR(clear_module_state->__pyx_n_u_field_capacity_hydraulic_conduct);
  Py_CLEAR(clear_module_state->__pyx_n_u_field_capacity_water_potential);
  Py_CLEAR(clear_module_state->__pyx_n_s_first_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_first_square_leaf_area);
  Py_CLEAR(clear_module_state->__pyx_n_s_fraction);
  Py_CLEAR(clear_module_state->__pyx_n_s_fresh_organic_matter);
  Py_CLEAR(clear_module_state->__pyx_n_s_fruit_growth_ratio);
  Py_CLEAR(clear_module_state->__pyx_n_s_fruiting_branches);
  Py_CLEAR(clear_module_state->__pyx_kp_u_gc);
  Py_CLEAR(clear_module_state->__pyx_n_s_get);
  Py_CLEAR(clear_module_state->__pyx_n_s_get_net_photosynthesis);
  Py_CLEAR(clear_module_state->__pyx_n_s_getattr);
  Py_CLEAR(clear_module_state->__pyx_n_s_getstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_ginning_percent);
  Py_CLEAR(clear_module_state->__pyx_n_s_green_bolls_burr_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_green_bolls_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_growth_factor);
  Py_CLEAR(clear_module_state->__pyx_n_s_gsubr);
  Py_CLEAR(clear_module_state->__pyx_n_s_hour);
  Py_CLEAR(clear_module_state->__pyx_n_s_hours);
  Py_CLEAR(clear_module_state->__pyx_n_s_htdenf);
  Py_CLEAR(clear_module_state->__pyx_n_s_humidity);
  Py_CLEAR(clear_module_state->__pyx_n_s_hydrology);
  Py_CLEAR(clear_module_state->__pyx_n_s_i);
  Py_CLEAR(clear_module_state->__pyx_n_s_ihr);
  Py_CLEAR(clear_module_state->__pyx_n_u_immediate_drainage_water_potenti);
  Py_CLEAR(clear_module_state->__pyx_n_s_import);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_grid);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_init_subclass);
  Py_CLEAR(clear_module_state->__pyx_n_s_initial);
  Py_CLEAR(clear_module_state->__pyx_n_u_irrigation);
  Py_CLEAR(clear_module_state->__pyx_n_s_is_coroutine);
  Py_CLEAR(clear_module_state->__pyx_kp_u_isenabled);
  Py_CLEAR(clear_module_state->__pyx_n_s_items);
  Py_CLEAR(clear_module_state->__pyx_n_s_j);
  Py_CLEAR(clear_module_state->__pyx_n_s_jp1);
  Py_CLEAR(clear_module_state->__pyx_n_s_k);
  Py_CLEAR(clear_module_state->__pyx_n_s_k0);
  Py_CLEAR(clear_module_state->__pyx_n_s_kday);
  Py_CLEAR(clear_module_state->__pyx_n_s_keys);
  Py_CLEAR(clear_module_state->__pyx_n_s_kkday);
  Py_CLEAR(clear_module_state->__pyx_n_s_kwargs);
  Py_CLEAR(clear_module_state->__pyx_n_s_l);
  Py_CLEAR(clear_module_state->__pyx_n_s_l1);
  Py_CLEAR(clear_module_state->__pyx_n_s_l2);
  Py_CLEAR(clear_module_state->__pyx_n_s_last_fruiting_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_latitude);
  Py_CLEAR(clear_module_state->__pyx_n_s_layer_depth);
  Py_CLEAR(clear_module_state->__pyx_n_s_layers);
  Py_CLEAR(clear_module_state->__pyx_n_u_layers);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_area);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_area_index);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_area_pre_fruiting);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_nitrogen_concentration);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_weight_area_ratio);
  Py_CLEAR(clear_module_state->__pyx_n_s_leaf_weight_pre_fruiting);
  Py_CLEAR(clear_module_state->__pyx_n_s_lfint);
  Py_CLEAR(clear_module_state->__pyx_n_s_light_interception);
  Py_CLEAR(clear_module_state->__pyx_n_s_lint_yield);
  Py_CLEAR(clear_module_state->__pyx_n_s_longitude);
  Py_CLEAR(clear_module_state->__pyx_n_s_lp1);
  Py_CLEAR(clear_module_state->__pyx_n_s_lyrsol);
  Py_CLEAR(clear_module_state->__pyx_n_s_lytres);
  Py_CLEAR(clear_module_state->__pyx_n_s_m);
  Py_CLEAR(clear_module_state->__pyx_n_s_main);
  Py_CLEAR(clear_module_state->__pyx_n_s_main_stem_leaf);
  Py_CLEAR(clear_module_state->__pyx_n_s_math);
  Py_CLEAR(clear_module_state->__pyx_n_u_max);
  Py_CLEAR(clear_module_state->__pyx_n_u_max_conductivity);
  Py_CLEAR(clear_module_state->__pyx_n_s_maxrtgr);
  Py_CLEAR(clear_module_state->__pyx_n_s_maxstmgr);
  Py_CLEAR(clear_module_state->__pyx_n_s_metaclass);
  Py_CLEAR(clear_module_state->__pyx_n_u_method);
  Py_CLEAR(clear_module_state->__pyx_n_s_microsecond);
  Py_CLEAR(clear_module_state->__pyx_n_u_min);
  Py_CLEAR(clear_module_state->__pyx_n_s_minute);
  Py_CLEAR(clear_module_state->__pyx_n_s_module);
  Py_CLEAR(clear_module_state->__pyx_n_s_mp1);
  Py_CLEAR(clear_module_state->__pyx_n_s_mro_entries);
  Py_CLEAR(clear_module_state->__pyx_n_s_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_net_radiation);
  Py_CLEAR(clear_module_state->__pyx_n_s_new);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_node);
  Py_CLEAR(clear_module_state->__pyx_n_s_new_node_initial_leaf_area);
  Py_CLEAR(clear_module_state->__pyx_n_s_newbr);
  Py_CLEAR(clear_module_state->__pyx_n_s_nidmax);
  Py_CLEAR(clear_module_state->__pyx_n_u_nitrate);
  Py_CLEAR(clear_module_state->__pyx_n_u_nitrate_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_nitrate_nitrogen_content);
  Py_CLEAR(clear_module_state->__pyx_n_s_nitrogen_stress);
  Py_CLEAR(clear_module_state->__pyx_n_s_nitrogen_stress_fruiting);
  Py_CLEAR(clear_module_state->__pyx_n_s_nitrogen_stress_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_nitrogen_stress_vegetative);
  Py_CLEAR(clear_module_state->__pyx_n_s_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_fruiting_branches);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_fruiting_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_fruiting_sites);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_green_bolls);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_layers_with_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_left_columns_with_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_open_bolls);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_pre_fruiting_nodes);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_right_columns_with_roo);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_squares);
  Py_CLEAR(clear_module_state->__pyx_n_s_number_of_vegetative_branches);
  Py_CLEAR(clear_module_state->__pyx_n_s_nwfl);
  Py_CLEAR(clear_module_state->__pyx_n_s_oldstmwt);
  Py_CLEAR(clear_module_state->__pyx_n_s_open_bolls_burr_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_open_bolls_weight);
  Py_CLEAR(clear_module_state->__pyx_n_u_organic_matter);
  Py_CLEAR(clear_module_state->__pyx_n_s_p);
  Py_CLEAR(clear_module_state->__pyx_n_s_p1);
  Py_CLEAR(clear_module_state->__pyx_n_s_p2);
  Py_CLEAR(clear_module_state->__pyx_n_s_p3);
  Py_CLEAR(clear_module_state->__pyx_n_s_p4);
  Py_CLEAR(clear_module_state->__pyx_n_s_p5);
  Py_CLEAR(clear_module_state->__pyx_n_s_p6);
  Py_CLEAR(clear_module_state->__pyx_n_s_p7);
  Py_CLEAR(clear_module_state->__pyx_n_s_perdmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_petiole);
  Py_CLEAR(clear_module_state->__pyx_n_s_petiole_nitrogen_concentration);
  Py_CLEAR(clear_module_state->__pyx_n_s_petiole_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_pex);
  Py_CLEAR(clear_module_state->__pyx_n_s_phenology);
  Py_CLEAR(clear_module_state->__pyx_n_s_pi);
  Py_CLEAR(clear_module_state->__pyx_n_s_pickle);
  Py_CLEAR(clear_module_state->__pyx_n_s_plant_height);
  Py_CLEAR(clear_module_state->__pyx_n_s_plant_weight);
  Py_CLEAR(clear_module_state->__pyx_kp_u_planting_date_or_emergence_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_pnetcor);
  Py_CLEAR(clear_module_state->__pyx_n_s_pollination_switch);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_fruit_growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_growth_for_leaf_area);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_growth_for_leaf_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_growth_for_petiole_wei);
  Py_CLEAR(clear_module_state->__pyx_n_s_potential_leaf_growth);
  Py_CLEAR(clear_module_state->__pyx_n_s_pplant);
  Py_CLEAR(clear_module_state->__pyx_n_s_prepare);
  Py_CLEAR(clear_module_state->__pyx_n_s_psilim);
  Py_CLEAR(clear_module_state->__pyx_n_s_pstand);
  Py_CLEAR(clear_module_state->__pyx_n_s_ptnfac);
  Py_CLEAR(clear_module_state->__pyx_n_s_pts);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_PickleError);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_checksum);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_unpickle_SoilInit);
  Py_CLEAR(clear_module_state->__pyx_n_s_pyx_vtable);
  Py_CLEAR(clear_module_state->__pyx_n_s_qualname);
  Py_CLEAR(clear_module_state->__pyx_n_s_radiation);
  Py_CLEAR(clear_module_state->__pyx_n_u_radiation);
  Py_CLEAR(clear_module_state->__pyx_n_s_radsum);
  Py_CLEAR(clear_module_state->__pyx_n_u_rain);
  Py_CLEAR(clear_module_state->__pyx_n_s_rainToday);
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
  Py_CLEAR(clear_module_state->__pyx_n_s_rate);
  Py_CLEAR(clear_module_state->__pyx_n_s_ratebol);
  Py_CLEAR(clear_module_state->__pyx_n_s_ratebur);
  Py_CLEAR(clear_module_state->__pyx_n_s_ratesqr);
  Py_CLEAR(clear_module_state->__pyx_n_u_ratio_implicit);
  Py_CLEAR(clear_module_state->__pyx_n_s_rbmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_read_input);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_reduce_ex);
  Py_CLEAR(clear_module_state->__pyx_n_s_ref_et);
  Py_CLEAR(clear_module_state->__pyx_n_s_replace);
  Py_CLEAR(clear_module_state->__pyx_n_s_result);
  Py_CLEAR(clear_module_state->__pyx_n_s_root);
  Py_CLEAR(clear_module_state->__pyx_n_s_root_nitrogen_concentration);
  Py_CLEAR(clear_module_state->__pyx_n_s_row_space);
  Py_CLEAR(clear_module_state->__pyx_n_s_rsubl);
  Py_CLEAR(clear_module_state->__pyx_n_s_rsubo);
  Py_CLEAR(clear_module_state->__pyx_n_s_run);
  Py_CLEAR(clear_module_state->__pyx_n_s_runoff);
  Py_CLEAR(clear_module_state->__pyx_n_s_runoffToday);
  Py_CLEAR(clear_module_state->__pyx_n_u_sand);
  Py_CLEAR(clear_module_state->__pyx_n_u_saturated_hydraulic_conductivity);
  Py_CLEAR(clear_module_state->__pyx_n_s_sd);
  Py_CLEAR(clear_module_state->__pyx_n_s_second);
  Py_CLEAR(clear_module_state->__pyx_n_s_seed_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_seed_nitrogen_concentration);
  Py_CLEAR(clear_module_state->__pyx_n_s_self);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self___cannot_be_converted_to_a);
  Py_CLEAR(clear_module_state->__pyx_kp_s_self_climate_cannot_be_converted);
  Py_CLEAR(clear_module_state->__pyx_n_s_set_name);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_setstate_cython);
  Py_CLEAR(clear_module_state->__pyx_n_s_shade);
  Py_CLEAR(clear_module_state->__pyx_n_s_simulate);
  Py_CLEAR(clear_module_state->__pyx_n_s_simulate_this_day);
  Py_CLEAR(clear_module_state->__pyx_n_s_sin);
  Py_CLEAR(clear_module_state->__pyx_n_s_sinb);
  Py_CLEAR(clear_module_state->__pyx_n_s_smax);
  Py_CLEAR(clear_module_state->__pyx_n_s_smaxx);
  Py_CLEAR(clear_module_state->__pyx_n_s_soil);
  Py_CLEAR(clear_module_state->__pyx_n_s_solar_noon);
  Py_CLEAR(clear_module_state->__pyx_n_u_solar_noon);
  Py_CLEAR(clear_module_state->__pyx_n_s_sqrt);
  Py_CLEAR(clear_module_state->__pyx_n_s_square);
  Py_CLEAR(clear_module_state->__pyx_n_s_square_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_square_nitrogen_concentration);
  Py_CLEAR(clear_module_state->__pyx_n_s_square_weight);
  Py_CLEAR(clear_module_state->__pyx_kp_s_src__cotton2k_simulation_pyx);
  Py_CLEAR(clear_module_state->__pyx_n_s_stage);
  Py_CLEAR(clear_module_state->__pyx_n_s_start);
  Py_CLEAR(clear_module_state->__pyx_n_s_start_date);
  Py_CLEAR(clear_module_state->__pyx_n_s_state);
  Py_CLEAR(clear_module_state->__pyx_n_s_state0);
  Py_CLEAR(clear_module_state->__pyx_n_s_stemNRatio);
  Py_CLEAR(clear_module_state->__pyx_n_s_stem_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_s_stem_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_stemnew);
  Py_CLEAR(clear_module_state->__pyx_n_s_step);
  Py_CLEAR(clear_module_state->__pyx_n_s_stop);
  Py_CLEAR(clear_module_state->__pyx_n_s_stress);
  Py_CLEAR(clear_module_state->__pyx_kp_s_stringsource);
  Py_CLEAR(clear_module_state->__pyx_n_s_strptime);
  Py_CLEAR(clear_module_state->__pyx_n_s_sumpdr);
  Py_CLEAR(clear_module_state->__pyx_n_s_sumwk);
  Py_CLEAR(clear_module_state->__pyx_n_s_sunr);
  Py_CLEAR(clear_module_state->__pyx_n_u_sunr);
  Py_CLEAR(clear_module_state->__pyx_n_s_suns);
  Py_CLEAR(clear_module_state->__pyx_n_u_suns);
  Py_CLEAR(clear_module_state->__pyx_n_s_super);
  Py_CLEAR(clear_module_state->__pyx_n_s_sw);
  Py_CLEAR(clear_module_state->__pyx_n_s_sw0);
  Py_CLEAR(clear_module_state->__pyx_n_s_sw1);
  Py_CLEAR(clear_module_state->__pyx_n_s_t1);
  Py_CLEAR(clear_module_state->__pyx_n_s_t2);
  Py_CLEAR(clear_module_state->__pyx_n_s_t3);
  Py_CLEAR(clear_module_state->__pyx_n_s_tav);
  Py_CLEAR(clear_module_state->__pyx_n_s_tdday);
  Py_CLEAR(clear_module_state->__pyx_n_s_temperature);
  Py_CLEAR(clear_module_state->__pyx_n_s_temperature_on_leaf_growth_rate);
  Py_CLEAR(clear_module_state->__pyx_n_s_test);
  Py_CLEAR(clear_module_state->__pyx_n_s_tfrt);
  Py_CLEAR(clear_module_state->__pyx_n_u_theta);
  Py_CLEAR(clear_module_state->__pyx_n_s_ti);
  Py_CLEAR(clear_module_state->__pyx_n_s_time_to_new_fruiting_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_timedelta);
  Py_CLEAR(clear_module_state->__pyx_n_s_tmpisr);
  Py_CLEAR(clear_module_state->__pyx_n_u_tmpisr);
  Py_CLEAR(clear_module_state->__pyx_n_s_total_required_nitrogen);
  Py_CLEAR(clear_module_state->__pyx_n_u_type);
  Py_CLEAR(clear_module_state->__pyx_n_s_u);
  Py_CLEAR(clear_module_state->__pyx_n_s_update);
  Py_CLEAR(clear_module_state->__pyx_n_u_urea);
  Py_CLEAR(clear_module_state->__pyx_n_s_use_setstate);
  Py_CLEAR(clear_module_state->__pyx_n_s_vegetative_branch);
  Py_CLEAR(clear_module_state->__pyx_n_s_vegetative_branches);
  Py_CLEAR(clear_module_state->__pyx_n_s_version);
  Py_CLEAR(clear_module_state->__pyx_n_s_vfrtbr);
  Py_CLEAR(clear_module_state->__pyx_n_s_voldstm);
  Py_CLEAR(clear_module_state->__pyx_n_s_vpheno);
  Py_CLEAR(clear_module_state->__pyx_n_s_vpnet);
  Py_CLEAR(clear_module_state->__pyx_n_s_vpotfrt);
  Py_CLEAR(clear_module_state->__pyx_n_s_vpotlf);
  Py_CLEAR(clear_module_state->__pyx_n_s_vpvegb);
  Py_CLEAR(clear_module_state->__pyx_n_s_vstrs);
  Py_CLEAR(clear_module_state->__pyx_n_u_water);
  Py_CLEAR(clear_module_state->__pyx_n_s_water_stress);
  Py_CLEAR(clear_module_state->__pyx_n_s_water_stress_stem);
  Py_CLEAR(clear_module_state->__pyx_n_s_wattsm);
  Py_CLEAR(clear_module_state->__pyx_n_s_wbmax);
  Py_CLEAR(clear_module_state->__pyx_n_s_weight);
  Py_CLEAR(clear_module_state->__pyx_n_s_weight_capable_uptake);
  Py_CLEAR(clear_module_state->__pyx_n_s_wfdb);
  Py_CLEAR(clear_module_state->__pyx_n_u_wind);
  Py_CLEAR(clear_module_state->__pyx_n_s_wind_speed);
  Py_CLEAR(clear_module_state->__pyx_n_s_wnytf);
  Py_CLEAR(clear_module_state->__pyx_n_s_wstrlf);
  Py_CLEAR(clear_module_state->__pyx_n_s_wtfstrs);
  Py_CLEAR(clear_module_state->__pyx_n_s_xlat);
  Py_CLEAR(clear_module_state->__pyx_n_s_year);
  Py_CLEAR(clear_module_state->__pyx_n_s_z1);
  Py_CLEAR(clear_module_state->__pyx_n_s_zero);
  Py_CLEAR(clear_module_state->__pyx_n_s_zint);
  Py_CLEAR(clear_module_state->__pyx_float_0_3);
  Py_CLEAR(clear_module_state->__pyx_float_0_5);
  Py_CLEAR(clear_module_state->__pyx_float_0_08);
  Py_CLEAR(clear_module_state->__pyx_float_0_0002);
  Py_CLEAR(clear_module_state->__pyx_int_0);
  Py_CLEAR(clear_module_state->__pyx_int_1);
  Py_CLEAR(clear_module_state->__pyx_int_2);
  Py_CLEAR(clear_module_state->__pyx_int_4);
  Py_CLEAR(clear_module_state->__pyx_int_10);
  Py_CLEAR(clear_module_state->__pyx_int_12);
  Py_CLEAR(clear_module_state->__pyx_int_24);
  Py_CLEAR(clear_module_state->__pyx_int_30);
  Py_CLEAR(clear_module_state->__pyx_int_180);
  Py_CLEAR(clear_module_state->__pyx_int_1024);
  Py_CLEAR(clear_module_state->__pyx_int_1000000);
  Py_CLEAR(clear_module_state->__pyx_int_139140702);
  Py_CLEAR(clear_module_state->__pyx_tuple_);
  Py_CLEAR(clear_module_state->__pyx_tuple__2);
  Py_CLEAR(clear_module_state->__pyx_tuple__3);
  Py_CLEAR(clear_module_state->__pyx_tuple__4);
  Py_CLEAR(clear_module_state->__pyx_tuple__5);
  Py_CLEAR(clear_module_state->__pyx_tuple__6);
  Py_CLEAR(clear_module_state->__pyx_tuple__7);
  Py_CLEAR(clear_module_state->__pyx_tuple__9);
  Py_CLEAR(clear_module_state->__pyx_tuple__10);
  Py_CLEAR(clear_module_state->__pyx_tuple__11);
  Py_CLEAR(clear_module_state->__pyx_tuple__12);
  Py_CLEAR(clear_module_state->__pyx_tuple__13);
  Py_CLEAR(clear_module_state->__pyx_tuple__14);
  Py_CLEAR(clear_module_state->__pyx_tuple__15);
  Py_CLEAR(clear_module_state->__pyx_tuple__16);
  Py_CLEAR(clear_module_state->__pyx_tuple__17);
  Py_CLEAR(clear_module_state->__pyx_tuple__18);
  Py_CLEAR(clear_module_state->__pyx_tuple__19);
  Py_CLEAR(clear_module_state->__pyx_tuple__20);
  Py_CLEAR(clear_module_state->__pyx_tuple__21);
  Py_CLEAR(clear_module_state->__pyx_tuple__22);
  Py_CLEAR(clear_module_state->__pyx_tuple__23);
  Py_CLEAR(clear_module_state->__pyx_tuple__24);
  Py_CLEAR(clear_module_state->__pyx_tuple__25);
  Py_CLEAR(clear_module_state->__pyx_tuple__26);
  Py_CLEAR(clear_module_state->__pyx_tuple__27);
  Py_CLEAR(clear_module_state->__pyx_tuple__28);
  Py_CLEAR(clear_module_state->__pyx_tuple__29);
  Py_CLEAR(clear_module_state->__pyx_tuple__30);
  Py_CLEAR(clear_module_state->__pyx_tuple__31);
  Py_CLEAR(clear_module_state->__pyx_tuple__32);
  Py_CLEAR(clear_module_state->__pyx_tuple__33);
  Py_CLEAR(clear_module_state->__pyx_tuple__34);
  Py_CLEAR(clear_module_state->__pyx_tuple__35);
  Py_CLEAR(clear_module_state->__pyx_tuple__36);
  Py_CLEAR(clear_module_state->__pyx_tuple__37);
  Py_CLEAR(clear_module_state->__pyx_tuple__38);
  Py_CLEAR(clear_module_state->__pyx_tuple__39);
  Py_CLEAR(clear_module_state->__pyx_tuple__40);
  Py_CLEAR(clear_module_state->__pyx_tuple__41);
  Py_CLEAR(clear_module_state->__pyx_tuple__42);
  Py_CLEAR(clear_module_state->__pyx_tuple__43);
  Py_CLEAR(clear_module_state->__pyx_tuple__44);
  Py_CLEAR(clear_module_state->__pyx_tuple__45);
  Py_CLEAR(clear_module_state->__pyx_tuple__46);
  Py_CLEAR(clear_module_state->__pyx_tuple__47);
  Py_CLEAR(clear_module_state->__pyx_tuple__48);
  Py_CLEAR(clear_module_state->__pyx_tuple__49);
  Py_CLEAR(clear_module_state->__pyx_tuple__50);
  Py_CLEAR(clear_module_state->__pyx_tuple__51);
  Py_CLEAR(clear_module_state->__pyx_tuple__52);
  Py_CLEAR(clear_module_state->__pyx_tuple__53);
  Py_CLEAR(clear_module_state->__pyx_tuple__54);
  Py_CLEAR(clear_module_state->__pyx_tuple__55);
  Py_CLEAR(clear_module_state->__pyx_tuple__56);
  Py_CLEAR(clear_module_state->__pyx_tuple__57);
  Py_CLEAR(clear_module_state->__pyx_tuple__58);
  Py_CLEAR(clear_module_state->__pyx_tuple__59);
  Py_CLEAR(clear_module_state->__pyx_tuple__60);
  Py_CLEAR(clear_module_state->__pyx_tuple__61);
  Py_CLEAR(clear_module_state->__pyx_tuple__62);
  Py_CLEAR(clear_module_state->__pyx_tuple__63);
  Py_CLEAR(clear_module_state->__pyx_tuple__64);
  Py_CLEAR(clear_module_state->__pyx_tuple__65);
  Py_CLEAR(clear_module_state->__pyx_tuple__66);
  Py_CLEAR(clear_module_state->__pyx_tuple__67);
  Py_CLEAR(clear_module_state->__pyx_tuple__68);
  Py_CLEAR(clear_module_state->__pyx_tuple__69);
  Py_CLEAR(clear_module_state->__pyx_tuple__70);
  Py_CLEAR(clear_module_state->__pyx_tuple__71);
  Py_CLEAR(clear_module_state->__pyx_tuple__72);
  Py_CLEAR(clear_module_state->__pyx_tuple__73);
  Py_CLEAR(clear_module_state->__pyx_tuple__74);
  Py_CLEAR(clear_module_state->__pyx_tuple__75);
  Py_CLEAR(clear_module_state->__pyx_tuple__76);
  Py_CLEAR(clear_module_state->__pyx_tuple__77);
  Py_CLEAR(clear_module_state->__pyx_tuple__78);
  Py_CLEAR(clear_module_state->__pyx_tuple__79);
  Py_CLEAR(clear_module_state->__pyx_tuple__80);
  Py_CLEAR(clear_module_state->__pyx_tuple__81);
  Py_CLEAR(clear_module_state->__pyx_tuple__82);
  Py_CLEAR(clear_module_state->__pyx_tuple__83);
  Py_CLEAR(clear_module_state->__pyx_tuple__84);
  Py_CLEAR(clear_module_state->__pyx_tuple__85);
  Py_CLEAR(clear_module_state->__pyx_tuple__86);
  Py_CLEAR(clear_module_state->__pyx_tuple__87);
  Py_CLEAR(clear_module_state->__pyx_tuple__88);
  Py_CLEAR(clear_module_state->__pyx_tuple__89);
  Py_CLEAR(clear_module_state->__pyx_tuple__90);
  Py_CLEAR(clear_module_state->__pyx_tuple__91);
  Py_CLEAR(clear_module_state->__pyx_tuple__92);
  Py_CLEAR(clear_module_state->__pyx_tuple__93);
  Py_CLEAR(clear_module_state->__pyx_tuple__94);
  Py_CLEAR(clear_module_state->__pyx_tuple__95);
  Py_CLEAR(clear_module_state->__pyx_tuple__96);
  Py_CLEAR(clear_module_state->__pyx_tuple__97);
  Py_CLEAR(clear_module_state->__pyx_tuple__98);
  Py_CLEAR(clear_module_state->__pyx_tuple__99);
  Py_CLEAR(clear_module_state->__pyx_tuple__100);
  Py_CLEAR(clear_module_state->__pyx_tuple__101);
  Py_CLEAR(clear_module_state->__pyx_tuple__102);
  Py_CLEAR(clear_module_state->__pyx_tuple__103);
  Py_CLEAR(clear_module_state->__pyx_tuple__104);
  Py_CLEAR(clear_module_state->__pyx_tuple__105);
  Py_CLEAR(clear_module_state->__pyx_tuple__106);
  Py_CLEAR(clear_module_state->__pyx_tuple__107);
  Py_CLEAR(clear_module_state->__pyx_tuple__108);
  Py_CLEAR(clear_module_state->__pyx_tuple__109);
  Py_CLEAR(clear_module_state->__pyx_tuple__110);
  Py_CLEAR(clear_module_state->__pyx_tuple__111);
  Py_CLEAR(clear_module_state->__pyx_tuple__112);
  Py_CLEAR(clear_module_state->__pyx_tuple__113);
  Py_CLEAR(clear_module_state->__pyx_tuple__114);
  Py_CLEAR(clear_module_state->__pyx_tuple__115);
  Py_CLEAR(clear_module_state->__pyx_tuple__116);
  Py_CLEAR(clear_module_state->__pyx_tuple__117);
  Py_CLEAR(clear_module_state->__pyx_tuple__118);
  Py_CLEAR(clear_module_state->__pyx_tuple__119);
  Py_CLEAR(clear_module_state->__pyx_tuple__120);
  Py_CLEAR(clear_module_state->__pyx_tuple__121);
  Py_CLEAR(clear_module_state->__pyx_tuple__122);
  Py_CLEAR(clear_module_state->__pyx_tuple__123);
  Py_CLEAR(clear_module_state->__pyx_tuple__124);
  Py_CLEAR(clear_module_state->__pyx_tuple__125);
  Py_CLEAR(clear_module_state->__pyx_tuple__126);
  Py_CLEAR(clear_module_state->__pyx_tuple__127);
  Py_CLEAR(clear_module_state->__pyx_tuple__128);
  Py_CLEAR(clear_module_state->__pyx_tuple__129);
  Py_CLEAR(clear_module_state->__pyx_tuple__131);
  Py_CLEAR(clear_module_state->__pyx_tuple__133);
  Py_CLEAR(clear_module_state->__pyx_tuple__135);
  Py_CLEAR(clear_module_state->__pyx_tuple__137);
  Py_CLEAR(clear_module_state->__pyx_tuple__139);
  Py_CLEAR(clear_module_state->__pyx_tuple__141);
  Py_CLEAR(clear_module_state->__pyx_tuple__143);
  Py_CLEAR(clear_module_state->__pyx_tuple__145);
  Py_CLEAR(clear_module_state->__pyx_tuple__147);
  Py_CLEAR(clear_module_state->__pyx_tuple__149);
  Py_CLEAR(clear_module_state->__pyx_tuple__151);
  Py_CLEAR(clear_module_state->__pyx_tuple__153);
  Py_CLEAR(clear_module_state->__pyx_tuple__155);
  Py_CLEAR(clear_module_state->__pyx_tuple__157);
  Py_CLEAR(clear_module_state->__pyx_tuple__159);
  Py_CLEAR(clear_module_state->__pyx_tuple__161);
  Py_CLEAR(clear_module_state->__pyx_tuple__163);
  Py_CLEAR(clear_module_state->__pyx_tuple__165);
  Py_CLEAR(clear_module_state->__pyx_tuple__167);
  Py_CLEAR(clear_module_state->__pyx_tuple__169);
  Py_CLEAR(clear_module_state->__pyx_tuple__171);
  Py_CLEAR(clear_module_state->__pyx_tuple__173);
  Py_CLEAR(clear_module_state->__pyx_tuple__175);
  Py_CLEAR(clear_module_state->__pyx_tuple__177);
  Py_CLEAR(clear_module_state->__pyx_tuple__179);
  Py_CLEAR(clear_module_state->__pyx_tuple__181);
  Py_CLEAR(clear_module_state->__pyx_tuple__183);
  Py_CLEAR(clear_module_state->__pyx_tuple__185);
  Py_CLEAR(clear_module_state->__pyx_tuple__187);
  Py_CLEAR(clear_module_state->__pyx_tuple__189);
  Py_CLEAR(clear_module_state->__pyx_tuple__191);
  Py_CLEAR(clear_module_state->__pyx_tuple__193);
  Py_CLEAR(clear_module_state->__pyx_tuple__195);
  Py_CLEAR(clear_module_state->__pyx_tuple__197);
  Py_CLEAR(clear_module_state->__pyx_tuple__199);
  Py_CLEAR(clear_module_state->__pyx_tuple__201);
  Py_CLEAR(clear_module_state->__pyx_tuple__203);
  Py_CLEAR(clear_module_state->__pyx_tuple__205);
  Py_CLEAR(clear_module_state->__pyx_tuple__207);
  Py_CLEAR(clear_module_state->__pyx_tuple__209);
  Py_CLEAR(clear_module_state->__pyx_tuple__211);
  Py_CLEAR(clear_module_state->__pyx_codeobj__130);
  Py_CLEAR(clear_module_state->__pyx_codeobj__132);
  Py_CLEAR(clear_module_state->__pyx_codeobj__134);
  Py_CLEAR(clear_module_state->__pyx_codeobj__136);
  Py_CLEAR(clear_module_state->__pyx_codeobj__138);
  Py_CLEAR(clear_module_state->__pyx_codeobj__140);
  Py_CLEAR(clear_module_state->__pyx_codeobj__142);
  Py_CLEAR(clear_module_state->__pyx_codeobj__144);
  Py_CLEAR(clear_module_state->__pyx_codeobj__146);
  Py_CLEAR(clear_module_state->__pyx_codeobj__148);
  Py_CLEAR(clear_module_state->__pyx_codeobj__150);
  Py_CLEAR(clear_module_state->__pyx_codeobj__152);
  Py_CLEAR(clear_module_state->__pyx_codeobj__154);
  Py_CLEAR(clear_module_state->__pyx_codeobj__156);
  Py_CLEAR(clear_module_state->__pyx_codeobj__158);
  Py_CLEAR(clear_module_state->__pyx_codeobj__160);
  Py_CLEAR(clear_module_state->__pyx_codeobj__162);
  Py_CLEAR(clear_module_state->__pyx_codeobj__164);
  Py_CLEAR(clear_module_state->__pyx_codeobj__166);
  Py_CLEAR(clear_module_state->__pyx_codeobj__168);
  Py_CLEAR(clear_module_state->__pyx_codeobj__170);
  Py_CLEAR(clear_module_state->__pyx_codeobj__172);
  Py_CLEAR(clear_module_state->__pyx_codeobj__174);
  Py_CLEAR(clear_module_state->__pyx_codeobj__176);
  Py_CLEAR(clear_module_state->__pyx_codeobj__178);
  Py_CLEAR(clear_module_state->__pyx_codeobj__180);
  Py_CLEAR(clear_module_state->__pyx_codeobj__182);
  Py_CLEAR(clear_module_state->__pyx_codeobj__184);
  Py_CLEAR(clear_module_state->__pyx_codeobj__186);
  Py_CLEAR(clear_module_state->__pyx_codeobj__188);
  Py_CLEAR(clear_module_state->__pyx_codeobj__190);
  Py_CLEAR(clear_module_state->__pyx_codeobj__192);
  Py_CLEAR(clear_module_state->__pyx_codeobj__194);
  Py_CLEAR(clear_module_state->__pyx_codeobj__196);
  Py_CLEAR(clear_module_state->__pyx_codeobj__198);
  Py_CLEAR(clear_module_state->__pyx_codeobj__200);
  Py_CLEAR(clear_module_state->__pyx_codeobj__202);
  Py_CLEAR(clear_module_state->__pyx_codeobj__204);
  Py_CLEAR(clear_module_state->__pyx_codeobj__206);
  Py_CLEAR(clear_module_state->__pyx_codeobj__208);
  Py_CLEAR(clear_module_state->__pyx_codeobj__210);
  Py_CLEAR(clear_module_state->__pyx_codeobj__212);
  return 0;
}
#endif
/* #### Code section: module_state_traverse ### */
#if CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
  __pyx_mstate *traverse_module_state = __pyx_mstate(m);
  if (!traverse_module_state) return 0;
  Py_VISIT(traverse_module_state->__pyx_d);
  Py_VISIT(traverse_module_state->__pyx_b);
  Py_VISIT(traverse_module_state->__pyx_cython_runtime);
  Py_VISIT(traverse_module_state->__pyx_empty_tuple);
  Py_VISIT(traverse_module_state->__pyx_empty_bytes);
  Py_VISIT(traverse_module_state->__pyx_empty_unicode);
  #ifdef __Pyx_CyFunction_USED
  Py_VISIT(traverse_module_state->__pyx_CyFunctionType);
  #endif
  #ifdef __Pyx_FusedFunction_USED
  Py_VISIT(traverse_module_state->__pyx_FusedFunctionType);
  #endif
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_SoilInit);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_SoilInit);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_Climate);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_Climate);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_NodeLeaf);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_NodeLeaf);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_FruitingNode);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_FruitingNode);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_MainStemLeaf);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_FruitingBranch);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_FruitingBranch);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_VegetativeBranch);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_State);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_State);
  Py_VISIT(traverse_module_state->__pyx_ptype_9_cotton2k_10simulation_Simulation);
  Py_VISIT(traverse_module_state->__pyx_type_9_cotton2k_10simulation_Simulation);
  Py_VISIT(traverse_module_state->__pyx_n_s_Climate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Climate___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Climate___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_DaysTo1stSqare);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingBranch);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingBranch___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingBranch___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingNode);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingNode___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_FruitingNode___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Incompatible_checksums_s_vs_0x84);
  Py_VISIT(traverse_module_state->__pyx_n_s_IndexError);
  Py_VISIT(traverse_module_state->__pyx_n_s_KeyError);
  Py_VISIT(traverse_module_state->__pyx_n_s_MainStemLeaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_MainStemLeaf___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_MainStemLeaf___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_10);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_100);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_101);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_102);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_103);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_104);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_105);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_106);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_107);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_108);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_109);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_11);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_110);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_111);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_112);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_113);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_114);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_115);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_116);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_117);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_12);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_13);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_14);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_15);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_16);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_17);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_18);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_19);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_2);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_20);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_21);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_22);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_23);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_24);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_25);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_26);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_27);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_28);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_29);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_3);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_30);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_31);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_32);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_33);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_34);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_35);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_36);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_37);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_38);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_39);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_4);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_40);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_41);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_42);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_43);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_44);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_45);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_46);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_47);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_48);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_49);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_5);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_50);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_51);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_52);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_53);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_54);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_55);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_56);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_57);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_58);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_59);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_6);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_60);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_61);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_62);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_63);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_64);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_65);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_66);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_67);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_68);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_69);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_7);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_70);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_71);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_72);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_73);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_74);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_75);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_76);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_77);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_78);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_79);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_8);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_80);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_81);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_82);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_83);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_84);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_85);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_86);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_87);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_88);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_89);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_9);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_90);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_91);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_92);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_93);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_94);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_95);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_96);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_97);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_98);
  Py_VISIT(traverse_module_state->__pyx_kp_s_No_value_specified_for_struct_at_99);
  Py_VISIT(traverse_module_state->__pyx_n_s_NodeLeaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_NodeLeaf___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_NodeLeaf___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_OpenRatio);
  Py_VISIT(traverse_module_state->__pyx_n_s_OverflowError);
  Py_VISIT(traverse_module_state->__pyx_n_s_PhenDelayByNStress);
  Py_VISIT(traverse_module_state->__pyx_n_s_PickleError);
  Py_VISIT(traverse_module_state->__pyx_kp_s_Pickling_of_struct_members_such);
  Py_VISIT(traverse_module_state->__pyx_n_s_Rad);
  Py_VISIT(traverse_module_state->__pyx_n_u_Rad);
  Py_VISIT(traverse_module_state->__pyx_n_s_Rain);
  Py_VISIT(traverse_module_state->__pyx_n_u_Rain);
  Py_VISIT(traverse_module_state->__pyx_n_s_RuntimeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation);
  Py_VISIT(traverse_module_state->__pyx_n_s_SimulationEnd);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__add_vegetative_branc);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__calc_light_intercept);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__column_shading);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__daily_climate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__days_to_first_square);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__defoliate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__doy2date);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__get_net_photosynthes);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__init_grid);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__init_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__phenology);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__potential_fruit_grow);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__potential_leaf_growt);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__simulate);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__simulate_this_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation__stress);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation_read_input);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation_run);
  Py_VISIT(traverse_module_state->__pyx_n_s_Simulation_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_SoilInit);
  Py_VISIT(traverse_module_state->__pyx_n_s_SoilInit___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_SoilInit___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_State);
  Py_VISIT(traverse_module_state->__pyx_n_s_State___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_State___setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_State_add_fruiting_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_State_create_first_square);
  Py_VISIT(traverse_module_state->__pyx_n_s_State_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_StopIteration);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tdew);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tdew);
  Py_VISIT(traverse_module_state->__pyx_n_s_TimeToNextFruBranch);
  Py_VISIT(traverse_module_state->__pyx_n_s_TimeToNextVegBranch);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tmax);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_Tmin);
  Py_VISIT(traverse_module_state->__pyx_n_u_Tmin);
  Py_VISIT(traverse_module_state->__pyx_n_s_TypeError);
  Py_VISIT(traverse_module_state->__pyx_n_s_ValueError);
  Py_VISIT(traverse_module_state->__pyx_n_s_VegetativeBranch);
  Py_VISIT(traverse_module_state->__pyx_n_s_VegetativeBranch___reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_VegetativeBranch___setstate_cyth);
  Py_VISIT(traverse_module_state->__pyx_n_s_WaterStress);
  Py_VISIT(traverse_module_state->__pyx_n_s_Wind);
  Py_VISIT(traverse_module_state->__pyx_n_u_Wind);
  Py_VISIT(traverse_module_state->__pyx_kp_u_Y_j);
  Py_VISIT(traverse_module_state->__pyx_n_s__213);
  Py_VISIT(traverse_module_state->__pyx_kp_u__8);
  Py_VISIT(traverse_module_state->__pyx_n_s_abscised_fruit_sites);
  Py_VISIT(traverse_module_state->__pyx_n_s_abscised_leaf_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_acos);
  Py_VISIT(traverse_module_state->__pyx_n_s_actual_growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_actual_soil_evaporation);
  Py_VISIT(traverse_module_state->__pyx_n_s_actual_transpiration);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_fruiting_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_add_vegetative_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_addlfn);
  Py_VISIT(traverse_module_state->__pyx_n_s_age);
  Py_VISIT(traverse_module_state->__pyx_n_s_age_of_pre_fruiting_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_agemax);
  Py_VISIT(traverse_module_state->__pyx_n_s_agetop);
  Py_VISIT(traverse_module_state->__pyx_n_u_agricultural_inputs);
  Py_VISIT(traverse_module_state->__pyx_n_u_air_dry);
  Py_VISIT(traverse_module_state->__pyx_n_s_albedo);
  Py_VISIT(traverse_module_state->__pyx_n_u_alpha);
  Py_VISIT(traverse_module_state->__pyx_n_s_ambient_co2_factor);
  Py_VISIT(traverse_module_state->__pyx_n_u_ammonium);
  Py_VISIT(traverse_module_state->__pyx_n_u_ammonium_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_u_amount);
  Py_VISIT(traverse_module_state->__pyx_n_s_applied_water);
  Py_VISIT(traverse_module_state->__pyx_n_s_area);
  Py_VISIT(traverse_module_state->__pyx_n_s_asyncio_coroutines);
  Py_VISIT(traverse_module_state->__pyx_n_s_average_temperature);
  Py_VISIT(traverse_module_state->__pyx_n_u_beta);
  Py_VISIT(traverse_module_state->__pyx_n_s_bloom_weight_loss);
  Py_VISIT(traverse_module_state->__pyx_n_s_bmain);
  Py_VISIT(traverse_module_state->__pyx_n_s_boll);
  Py_VISIT(traverse_module_state->__pyx_n_u_bulk_density);
  Py_VISIT(traverse_module_state->__pyx_n_s_burr);
  Py_VISIT(traverse_module_state->__pyx_n_s_burr_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_c);
  Py_VISIT(traverse_module_state->__pyx_n_s_c11);
  Py_VISIT(traverse_module_state->__pyx_n_s_calc_light_interception);
  Py_VISIT(traverse_module_state->__pyx_n_s_carbon_stress);
  Py_VISIT(traverse_module_state->__pyx_n_s_cc);
  Py_VISIT(traverse_module_state->__pyx_n_s_cd);
  Py_VISIT(traverse_module_state->__pyx_n_s_cdleaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_cdpet);
  Py_VISIT(traverse_module_state->__pyx_n_s_cdroot);
  Py_VISIT(traverse_module_state->__pyx_n_s_cdstem);
  Py_VISIT(traverse_module_state->__pyx_n_s_cells);
  Py_VISIT(traverse_module_state->__pyx_n_s_class_getitem);
  Py_VISIT(traverse_module_state->__pyx_n_u_clay);
  Py_VISIT(traverse_module_state->__pyx_n_s_climate);
  Py_VISIT(traverse_module_state->__pyx_n_s_cline_in_traceback);
  Py_VISIT(traverse_module_state->__pyx_n_s_cloud_cor);
  Py_VISIT(traverse_module_state->__pyx_n_s_cloud_cov);
  Py_VISIT(traverse_module_state->__pyx_n_s_column_shading);
  Py_VISIT(traverse_module_state->__pyx_n_s_compute_day_length);
  Py_VISIT(traverse_module_state->__pyx_n_s_cos);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotton2k_climate);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotton2k_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotton2k_photosynthesis);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotton2k_simulation);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotton2k_utils);
  Py_VISIT(traverse_module_state->__pyx_n_s_cotylwt);
  Py_VISIT(traverse_module_state->__pyx_n_s_create_first_square);
  Py_VISIT(traverse_module_state->__pyx_n_s_cultivar_parameters);
  Py_VISIT(traverse_module_state->__pyx_n_s_cumulative_evaporation);
  Py_VISIT(traverse_module_state->__pyx_n_s_cumulative_nitrogen_loss);
  Py_VISIT(traverse_module_state->__pyx_n_s_cumulative_transpiration);
  Py_VISIT(traverse_module_state->__pyx_n_s_daily_climate);
  Py_VISIT(traverse_module_state->__pyx_n_s_date);
  Py_VISIT(traverse_module_state->__pyx_n_u_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_date2doy);
  Py_VISIT(traverse_module_state->__pyx_n_s_datetime);
  Py_VISIT(traverse_module_state->__pyx_n_s_day_inc);
  Py_VISIT(traverse_module_state->__pyx_n_s_day_length);
  Py_VISIT(traverse_module_state->__pyx_n_u_day_length);
  Py_VISIT(traverse_module_state->__pyx_n_s_daynum);
  Py_VISIT(traverse_module_state->__pyx_n_s_days_to_first_square);
  Py_VISIT(traverse_module_state->__pyx_n_s_declination);
  Py_VISIT(traverse_module_state->__pyx_n_u_declination);
  Py_VISIT(traverse_module_state->__pyx_n_s_defoliate);
  Py_VISIT(traverse_module_state->__pyx_kp_u_defoliation_prediction);
  Py_VISIT(traverse_module_state->__pyx_n_s_delayFrtByCStress);
  Py_VISIT(traverse_module_state->__pyx_n_s_delayVegByCStress);
  Py_VISIT(traverse_module_state->__pyx_n_s_delay_for_new_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_delay_for_new_fruiting_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_delay_for_new_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_denf2);
  Py_VISIT(traverse_module_state->__pyx_n_s_denfac);
  Py_VISIT(traverse_module_state->__pyx_n_s_density_factor);
  Py_VISIT(traverse_module_state->__pyx_n_u_depth);
  Py_VISIT(traverse_module_state->__pyx_n_s_dew_point);
  Py_VISIT(traverse_module_state->__pyx_n_u_dewpoint);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict);
  Py_VISIT(traverse_module_state->__pyx_n_s_dict_2);
  Py_VISIT(traverse_module_state->__pyx_kp_u_disable);
  Py_VISIT(traverse_module_state->__pyx_n_s_doc);
  Py_VISIT(traverse_module_state->__pyx_n_s_doy2date);
  Py_VISIT(traverse_module_state->__pyx_n_u_drip_depth);
  Py_VISIT(traverse_module_state->__pyx_n_u_drip_horizontal_place);
  Py_VISIT(traverse_module_state->__pyx_n_s_dsbe);
  Py_VISIT(traverse_module_state->__pyx_n_s_dum);
  Py_VISIT(traverse_module_state->__pyx_n_s_elevation);
  Py_VISIT(traverse_module_state->__pyx_kp_u_enable);
  Py_VISIT(traverse_module_state->__pyx_n_s_enumerate);
  Py_VISIT(traverse_module_state->__pyx_n_s_et1);
  Py_VISIT(traverse_module_state->__pyx_n_s_et2);
  Py_VISIT(traverse_module_state->__pyx_n_s_evapotranspiration);
  Py_VISIT(traverse_module_state->__pyx_n_s_extra_carbon);
  Py_VISIT(traverse_module_state->__pyx_n_u_fertilization);
  Py_VISIT(traverse_module_state->__pyx_n_u_field_capacity_hydraulic_conduct);
  Py_VISIT(traverse_module_state->__pyx_n_u_field_capacity_water_potential);
  Py_VISIT(traverse_module_state->__pyx_n_s_first_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_first_square_leaf_area);
  Py_VISIT(traverse_module_state->__pyx_n_s_fraction);
  Py_VISIT(traverse_module_state->__pyx_n_s_fresh_organic_matter);
  Py_VISIT(traverse_module_state->__pyx_n_s_fruit_growth_ratio);
  Py_VISIT(traverse_module_state->__pyx_n_s_fruiting_branches);
  Py_VISIT(traverse_module_state->__pyx_kp_u_gc);
  Py_VISIT(traverse_module_state->__pyx_n_s_get);
  Py_VISIT(traverse_module_state->__pyx_n_s_get_net_photosynthesis);
  Py_VISIT(traverse_module_state->__pyx_n_s_getattr);
  Py_VISIT(traverse_module_state->__pyx_n_s_getstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_ginning_percent);
  Py_VISIT(traverse_module_state->__pyx_n_s_green_bolls_burr_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_green_bolls_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_growth_factor);
  Py_VISIT(traverse_module_state->__pyx_n_s_gsubr);
  Py_VISIT(traverse_module_state->__pyx_n_s_hour);
  Py_VISIT(traverse_module_state->__pyx_n_s_hours);
  Py_VISIT(traverse_module_state->__pyx_n_s_htdenf);
  Py_VISIT(traverse_module_state->__pyx_n_s_humidity);
  Py_VISIT(traverse_module_state->__pyx_n_s_hydrology);
  Py_VISIT(traverse_module_state->__pyx_n_s_i);
  Py_VISIT(traverse_module_state->__pyx_n_s_ihr);
  Py_VISIT(traverse_module_state->__pyx_n_u_immediate_drainage_water_potenti);
  Py_VISIT(traverse_module_state->__pyx_n_s_import);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_grid);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_init_subclass);
  Py_VISIT(traverse_module_state->__pyx_n_s_initial);
  Py_VISIT(traverse_module_state->__pyx_n_u_irrigation);
  Py_VISIT(traverse_module_state->__pyx_n_s_is_coroutine);
  Py_VISIT(traverse_module_state->__pyx_kp_u_isenabled);
  Py_VISIT(traverse_module_state->__pyx_n_s_items);
  Py_VISIT(traverse_module_state->__pyx_n_s_j);
  Py_VISIT(traverse_module_state->__pyx_n_s_jp1);
  Py_VISIT(traverse_module_state->__pyx_n_s_k);
  Py_VISIT(traverse_module_state->__pyx_n_s_k0);
  Py_VISIT(traverse_module_state->__pyx_n_s_kday);
  Py_VISIT(traverse_module_state->__pyx_n_s_keys);
  Py_VISIT(traverse_module_state->__pyx_n_s_kkday);
  Py_VISIT(traverse_module_state->__pyx_n_s_kwargs);
  Py_VISIT(traverse_module_state->__pyx_n_s_l);
  Py_VISIT(traverse_module_state->__pyx_n_s_l1);
  Py_VISIT(traverse_module_state->__pyx_n_s_l2);
  Py_VISIT(traverse_module_state->__pyx_n_s_last_fruiting_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_latitude);
  Py_VISIT(traverse_module_state->__pyx_n_s_layer_depth);
  Py_VISIT(traverse_module_state->__pyx_n_s_layers);
  Py_VISIT(traverse_module_state->__pyx_n_u_layers);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_area);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_area_index);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_area_pre_fruiting);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_nitrogen_concentration);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_weight_area_ratio);
  Py_VISIT(traverse_module_state->__pyx_n_s_leaf_weight_pre_fruiting);
  Py_VISIT(traverse_module_state->__pyx_n_s_lfint);
  Py_VISIT(traverse_module_state->__pyx_n_s_light_interception);
  Py_VISIT(traverse_module_state->__pyx_n_s_lint_yield);
  Py_VISIT(traverse_module_state->__pyx_n_s_longitude);
  Py_VISIT(traverse_module_state->__pyx_n_s_lp1);
  Py_VISIT(traverse_module_state->__pyx_n_s_lyrsol);
  Py_VISIT(traverse_module_state->__pyx_n_s_lytres);
  Py_VISIT(traverse_module_state->__pyx_n_s_m);
  Py_VISIT(traverse_module_state->__pyx_n_s_main);
  Py_VISIT(traverse_module_state->__pyx_n_s_main_stem_leaf);
  Py_VISIT(traverse_module_state->__pyx_n_s_math);
  Py_VISIT(traverse_module_state->__pyx_n_u_max);
  Py_VISIT(traverse_module_state->__pyx_n_u_max_conductivity);
  Py_VISIT(traverse_module_state->__pyx_n_s_maxrtgr);
  Py_VISIT(traverse_module_state->__pyx_n_s_maxstmgr);
  Py_VISIT(traverse_module_state->__pyx_n_s_metaclass);
  Py_VISIT(traverse_module_state->__pyx_n_u_method);
  Py_VISIT(traverse_module_state->__pyx_n_s_microsecond);
  Py_VISIT(traverse_module_state->__pyx_n_u_min);
  Py_VISIT(traverse_module_state->__pyx_n_s_minute);
  Py_VISIT(traverse_module_state->__pyx_n_s_module);
  Py_VISIT(traverse_module_state->__pyx_n_s_mp1);
  Py_VISIT(traverse_module_state->__pyx_n_s_mro_entries);
  Py_VISIT(traverse_module_state->__pyx_n_s_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_net_radiation);
  Py_VISIT(traverse_module_state->__pyx_n_s_new);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_node);
  Py_VISIT(traverse_module_state->__pyx_n_s_new_node_initial_leaf_area);
  Py_VISIT(traverse_module_state->__pyx_n_s_newbr);
  Py_VISIT(traverse_module_state->__pyx_n_s_nidmax);
  Py_VISIT(traverse_module_state->__pyx_n_u_nitrate);
  Py_VISIT(traverse_module_state->__pyx_n_u_nitrate_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_nitrate_nitrogen_content);
  Py_VISIT(traverse_module_state->__pyx_n_s_nitrogen_stress);
  Py_VISIT(traverse_module_state->__pyx_n_s_nitrogen_stress_fruiting);
  Py_VISIT(traverse_module_state->__pyx_n_s_nitrogen_stress_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_nitrogen_stress_vegetative);
  Py_VISIT(traverse_module_state->__pyx_n_s_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_fruiting_branches);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_fruiting_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_fruiting_sites);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_green_bolls);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_layers_with_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_left_columns_with_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_open_bolls);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_pre_fruiting_nodes);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_right_columns_with_roo);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_squares);
  Py_VISIT(traverse_module_state->__pyx_n_s_number_of_vegetative_branches);
  Py_VISIT(traverse_module_state->__pyx_n_s_nwfl);
  Py_VISIT(traverse_module_state->__pyx_n_s_oldstmwt);
  Py_VISIT(traverse_module_state->__pyx_n_s_open_bolls_burr_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_open_bolls_weight);
  Py_VISIT(traverse_module_state->__pyx_n_u_organic_matter);
  Py_VISIT(traverse_module_state->__pyx_n_s_p);
  Py_VISIT(traverse_module_state->__pyx_n_s_p1);
  Py_VISIT(traverse_module_state->__pyx_n_s_p2);
  Py_VISIT(traverse_module_state->__pyx_n_s_p3);
  Py_VISIT(traverse_module_state->__pyx_n_s_p4);
  Py_VISIT(traverse_module_state->__pyx_n_s_p5);
  Py_VISIT(traverse_module_state->__pyx_n_s_p6);
  Py_VISIT(traverse_module_state->__pyx_n_s_p7);
  Py_VISIT(traverse_module_state->__pyx_n_s_perdmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_petiole);
  Py_VISIT(traverse_module_state->__pyx_n_s_petiole_nitrogen_concentration);
  Py_VISIT(traverse_module_state->__pyx_n_s_petiole_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_pex);
  Py_VISIT(traverse_module_state->__pyx_n_s_phenology);
  Py_VISIT(traverse_module_state->__pyx_n_s_pi);
  Py_VISIT(traverse_module_state->__pyx_n_s_pickle);
  Py_VISIT(traverse_module_state->__pyx_n_s_plant_height);
  Py_VISIT(traverse_module_state->__pyx_n_s_plant_weight);
  Py_VISIT(traverse_module_state->__pyx_kp_u_planting_date_or_emergence_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_pnetcor);
  Py_VISIT(traverse_module_state->__pyx_n_s_pollination_switch);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_fruit_growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_growth_for_leaf_area);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_growth_for_leaf_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_growth_for_petiole_wei);
  Py_VISIT(traverse_module_state->__pyx_n_s_potential_leaf_growth);
  Py_VISIT(traverse_module_state->__pyx_n_s_pplant);
  Py_VISIT(traverse_module_state->__pyx_n_s_prepare);
  Py_VISIT(traverse_module_state->__pyx_n_s_psilim);
  Py_VISIT(traverse_module_state->__pyx_n_s_pstand);
  Py_VISIT(traverse_module_state->__pyx_n_s_ptnfac);
  Py_VISIT(traverse_module_state->__pyx_n_s_pts);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_PickleError);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_checksum);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_unpickle_SoilInit);
  Py_VISIT(traverse_module_state->__pyx_n_s_pyx_vtable);
  Py_VISIT(traverse_module_state->__pyx_n_s_qualname);
  Py_VISIT(traverse_module_state->__pyx_n_s_radiation);
  Py_VISIT(traverse_module_state->__pyx_n_u_radiation);
  Py_VISIT(traverse_module_state->__pyx_n_s_radsum);
  Py_VISIT(traverse_module_state->__pyx_n_u_rain);
  Py_VISIT(traverse_module_state->__pyx_n_s_rainToday);
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
  Py_VISIT(traverse_module_state->__pyx_n_s_rate);
  Py_VISIT(traverse_module_state->__pyx_n_s_ratebol);
  Py_VISIT(traverse_module_state->__pyx_n_s_ratebur);
  Py_VISIT(traverse_module_state->__pyx_n_s_ratesqr);
  Py_VISIT(traverse_module_state->__pyx_n_u_ratio_implicit);
  Py_VISIT(traverse_module_state->__pyx_n_s_rbmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_read_input);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_reduce_ex);
  Py_VISIT(traverse_module_state->__pyx_n_s_ref_et);
  Py_VISIT(traverse_module_state->__pyx_n_s_replace);
  Py_VISIT(traverse_module_state->__pyx_n_s_result);
  Py_VISIT(traverse_module_state->__pyx_n_s_root);
  Py_VISIT(traverse_module_state->__pyx_n_s_root_nitrogen_concentration);
  Py_VISIT(traverse_module_state->__pyx_n_s_row_space);
  Py_VISIT(traverse_module_state->__pyx_n_s_rsubl);
  Py_VISIT(traverse_module_state->__pyx_n_s_rsubo);
  Py_VISIT(traverse_module_state->__pyx_n_s_run);
  Py_VISIT(traverse_module_state->__pyx_n_s_runoff);
  Py_VISIT(traverse_module_state->__pyx_n_s_runoffToday);
  Py_VISIT(traverse_module_state->__pyx_n_u_sand);
  Py_VISIT(traverse_module_state->__pyx_n_u_saturated_hydraulic_conductivity);
  Py_VISIT(traverse_module_state->__pyx_n_s_sd);
  Py_VISIT(traverse_module_state->__pyx_n_s_second);
  Py_VISIT(traverse_module_state->__pyx_n_s_seed_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_seed_nitrogen_concentration);
  Py_VISIT(traverse_module_state->__pyx_n_s_self);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self___cannot_be_converted_to_a);
  Py_VISIT(traverse_module_state->__pyx_kp_s_self_climate_cannot_be_converted);
  Py_VISIT(traverse_module_state->__pyx_n_s_set_name);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_setstate_cython);
  Py_VISIT(traverse_module_state->__pyx_n_s_shade);
  Py_VISIT(traverse_module_state->__pyx_n_s_simulate);
  Py_VISIT(traverse_module_state->__pyx_n_s_simulate_this_day);
  Py_VISIT(traverse_module_state->__pyx_n_s_sin);
  Py_VISIT(traverse_module_state->__pyx_n_s_sinb);
  Py_VISIT(traverse_module_state->__pyx_n_s_smax);
  Py_VISIT(traverse_module_state->__pyx_n_s_smaxx);
  Py_VISIT(traverse_module_state->__pyx_n_s_soil);
  Py_VISIT(traverse_module_state->__pyx_n_s_solar_noon);
  Py_VISIT(traverse_module_state->__pyx_n_u_solar_noon);
  Py_VISIT(traverse_module_state->__pyx_n_s_sqrt);
  Py_VISIT(traverse_module_state->__pyx_n_s_square);
  Py_VISIT(traverse_module_state->__pyx_n_s_square_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_square_nitrogen_concentration);
  Py_VISIT(traverse_module_state->__pyx_n_s_square_weight);
  Py_VISIT(traverse_module_state->__pyx_kp_s_src__cotton2k_simulation_pyx);
  Py_VISIT(traverse_module_state->__pyx_n_s_stage);
  Py_VISIT(traverse_module_state->__pyx_n_s_start);
  Py_VISIT(traverse_module_state->__pyx_n_s_start_date);
  Py_VISIT(traverse_module_state->__pyx_n_s_state);
  Py_VISIT(traverse_module_state->__pyx_n_s_state0);
  Py_VISIT(traverse_module_state->__pyx_n_s_stemNRatio);
  Py_VISIT(traverse_module_state->__pyx_n_s_stem_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_s_stem_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_stemnew);
  Py_VISIT(traverse_module_state->__pyx_n_s_step);
  Py_VISIT(traverse_module_state->__pyx_n_s_stop);
  Py_VISIT(traverse_module_state->__pyx_n_s_stress);
  Py_VISIT(traverse_module_state->__pyx_kp_s_stringsource);
  Py_VISIT(traverse_module_state->__pyx_n_s_strptime);
  Py_VISIT(traverse_module_state->__pyx_n_s_sumpdr);
  Py_VISIT(traverse_module_state->__pyx_n_s_sumwk);
  Py_VISIT(traverse_module_state->__pyx_n_s_sunr);
  Py_VISIT(traverse_module_state->__pyx_n_u_sunr);
  Py_VISIT(traverse_module_state->__pyx_n_s_suns);
  Py_VISIT(traverse_module_state->__pyx_n_u_suns);
  Py_VISIT(traverse_module_state->__pyx_n_s_super);
  Py_VISIT(traverse_module_state->__pyx_n_s_sw);
  Py_VISIT(traverse_module_state->__pyx_n_s_sw0);
  Py_VISIT(traverse_module_state->__pyx_n_s_sw1);
  Py_VISIT(traverse_module_state->__pyx_n_s_t1);
  Py_VISIT(traverse_module_state->__pyx_n_s_t2);
  Py_VISIT(traverse_module_state->__pyx_n_s_t3);
  Py_VISIT(traverse_module_state->__pyx_n_s_tav);
  Py_VISIT(traverse_module_state->__pyx_n_s_tdday);
  Py_VISIT(traverse_module_state->__pyx_n_s_temperature);
  Py_VISIT(traverse_module_state->__pyx_n_s_temperature_on_leaf_growth_rate);
  Py_VISIT(traverse_module_state->__pyx_n_s_test);
  Py_VISIT(traverse_module_state->__pyx_n_s_tfrt);
  Py_VISIT(traverse_module_state->__pyx_n_u_theta);
  Py_VISIT(traverse_module_state->__pyx_n_s_ti);
  Py_VISIT(traverse_module_state->__pyx_n_s_time_to_new_fruiting_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_timedelta);
  Py_VISIT(traverse_module_state->__pyx_n_s_tmpisr);
  Py_VISIT(traverse_module_state->__pyx_n_u_tmpisr);
  Py_VISIT(traverse_module_state->__pyx_n_s_total_required_nitrogen);
  Py_VISIT(traverse_module_state->__pyx_n_u_type);
  Py_VISIT(traverse_module_state->__pyx_n_s_u);
  Py_VISIT(traverse_module_state->__pyx_n_s_update);
  Py_VISIT(traverse_module_state->__pyx_n_u_urea);
  Py_VISIT(traverse_module_state->__pyx_n_s_use_setstate);
  Py_VISIT(traverse_module_state->__pyx_n_s_vegetative_branch);
  Py_VISIT(traverse_module_state->__pyx_n_s_vegetative_branches);
  Py_VISIT(traverse_module_state->__pyx_n_s_version);
  Py_VISIT(traverse_module_state->__pyx_n_s_vfrtbr);
  Py_VISIT(traverse_module_state->__pyx_n_s_voldstm);
  Py_VISIT(traverse_module_state->__pyx_n_s_vpheno);
  Py_VISIT(traverse_module_state->__pyx_n_s_vpnet);
  Py_VISIT(traverse_module_state->__pyx_n_s_vpotfrt);
  Py_VISIT(traverse_module_state->__pyx_n_s_vpotlf);
  Py_VISIT(traverse_module_state->__pyx_n_s_vpvegb);
  Py_VISIT(traverse_module_state->__pyx_n_s_vstrs);
  Py_VISIT(traverse_module_state->__pyx_n_u_water);
  Py_VISIT(traverse_module_state->__pyx_n_s_water_stress);
  Py_VISIT(traverse_module_state->__pyx_n_s_water_stress_stem);
  Py_VISIT(traverse_module_state->__pyx_n_s_wattsm);
  Py_VISIT(traverse_module_state->__pyx_n_s_wbmax);
  Py_VISIT(traverse_module_state->__pyx_n_s_weight);
  Py_VISIT(traverse_module_state->__pyx_n_s_weight_capable_uptake);
  Py_VISIT(traverse_module_state->__pyx_n_s_wfdb);
  Py_VISIT(traverse_module_state->__pyx_n_u_wind);
  Py_VISIT(traverse_module_state->__pyx_n_s_wind_speed);
  Py_VISIT(traverse_module_state->__pyx_n_s_wnytf);
  Py_VISIT(traverse_module_state->__pyx_n_s_wstrlf);
  Py_VISIT(traverse_module_state->__pyx_n_s_wtfstrs);
  Py_VISIT(traverse_module_state->__pyx_n_s_xlat);
  Py_VISIT(traverse_module_state->__pyx_n_s_year);
  Py_VISIT(traverse_module_state->__pyx_n_s_z1);
  Py_VISIT(traverse_module_state->__pyx_n_s_zero);
  Py_VISIT(traverse_module_state->__pyx_n_s_zint);
  Py_VISIT(traverse_module_state->__pyx_float_0_3);
  Py_VISIT(traverse_module_state->__pyx_float_0_5);
  Py_VISIT(traverse_module_state->__pyx_float_0_08);
  Py_VISIT(traverse_module_state->__pyx_float_0_0002);
  Py_VISIT(traverse_module_state->__pyx_int_0);
  Py_VISIT(traverse_module_state->__pyx_int_1);
  Py_VISIT(traverse_module_state->__pyx_int_2);
  Py_VISIT(traverse_module_state->__pyx_int_4);
  Py_VISIT(traverse_module_state->__pyx_int_10);
  Py_VISIT(traverse_module_state->__pyx_int_12);
  Py_VISIT(traverse_module_state->__pyx_int_24);
  Py_VISIT(traverse_module_state->__pyx_int_30);
  Py_VISIT(traverse_module_state->__pyx_int_180);
  Py_VISIT(traverse_module_state->__pyx_int_1024);
  Py_VISIT(traverse_module_state->__pyx_int_1000000);
  Py_VISIT(traverse_module_state->__pyx_int_139140702);
  Py_VISIT(traverse_module_state->__pyx_tuple_);
  Py_VISIT(traverse_module_state->__pyx_tuple__2);
  Py_VISIT(traverse_module_state->__pyx_tuple__3);
  Py_VISIT(traverse_module_state->__pyx_tuple__4);
  Py_VISIT(traverse_module_state->__pyx_tuple__5);
  Py_VISIT(traverse_module_state->__pyx_tuple__6);
  Py_VISIT(traverse_module_state->__pyx_tuple__7);
  Py_VISIT(traverse_module_state->__pyx_tuple__9);
  Py_VISIT(traverse_module_state->__pyx_tuple__10);
  Py_VISIT(traverse_module_state->__pyx_tuple__11);
  Py_VISIT(traverse_module_state->__pyx_tuple__12);
  Py_VISIT(traverse_module_state->__pyx_tuple__13);
  Py_VISIT(traverse_module_state->__pyx_tuple__14);
  Py_VISIT(traverse_module_state->__pyx_tuple__15);
  Py_VISIT(traverse_module_state->__pyx_tuple__16);
  Py_VISIT(traverse_module_state->__pyx_tuple__17);
  Py_VISIT(traverse_module_state->__pyx_tuple__18);
  Py_VISIT(traverse_module_state->__pyx_tuple__19);
  Py_VISIT(traverse_module_state->__pyx_tuple__20);
  Py_VISIT(traverse_module_state->__pyx_tuple__21);
  Py_VISIT(traverse_module_state->__pyx_tuple__22);
  Py_VISIT(traverse_module_state->__pyx_tuple__23);
  Py_VISIT(traverse_module_state->__pyx_tuple__24);
  Py_VISIT(traverse_module_state->__pyx_tuple__25);
  Py_VISIT(traverse_module_state->__pyx_tuple__26);
  Py_VISIT(traverse_module_state->__pyx_tuple__27);
  Py_VISIT(traverse_module_state->__pyx_tuple__28);
  Py_VISIT(traverse_module_state->__pyx_tuple__29);
  Py_VISIT(traverse_module_state->__pyx_tuple__30);
  Py_VISIT(traverse_module_state->__pyx_tuple__31);
  Py_VISIT(traverse_module_state->__pyx_tuple__32);
  Py_VISIT(traverse_module_state->__pyx_tuple__33);
  Py_VISIT(traverse_module_state->__pyx_tuple__34);
  Py_VISIT(traverse_module_state->__pyx_tuple__35);
  Py_VISIT(traverse_module_state->__pyx_tuple__36);
  Py_VISIT(traverse_module_state->__pyx_tuple__37);
  Py_VISIT(traverse_module_state->__pyx_tuple__38);
  Py_VISIT(traverse_module_state->__pyx_tuple__39);
  Py_VISIT(traverse_module_state->__pyx_tuple__40);
  Py_VISIT(traverse_module_state->__pyx_tuple__41);
  Py_VISIT(traverse_module_state->__pyx_tuple__42);
  Py_VISIT(traverse_module_state->__pyx_tuple__43);
  Py_VISIT(traverse_module_state->__pyx_tuple__44);
  Py_VISIT(traverse_module_state->__pyx_tuple__45);
  Py_VISIT(traverse_module_state->__pyx_tuple__46);
  Py_VISIT(traverse_module_state->__pyx_tuple__47);
  Py_VISIT(traverse_module_state->__pyx_tuple__48);
  Py_VISIT(traverse_module_state->__pyx_tuple__49);
  Py_VISIT(traverse_module_state->__pyx_tuple__50);
  Py_VISIT(traverse_module_state->__pyx_tuple__51);
  Py_VISIT(traverse_module_state->__pyx_tuple__52);
  Py_VISIT(traverse_module_state->__pyx_tuple__53);
  Py_VISIT(traverse_module_state->__pyx_tuple__54);
  Py_VISIT(traverse_module_state->__pyx_tuple__55);
  Py_VISIT(traverse_module_state->__pyx_tuple__56);
  Py_VISIT(traverse_module_state->__pyx_tuple__57);
  Py_VISIT(traverse_module_state->__pyx_tuple__58);
  Py_VISIT(traverse_module_state->__pyx_tuple__59);
  Py_VISIT(traverse_module_state->__pyx_tuple__60);
  Py_VISIT(traverse_module_state->__pyx_tuple__61);
  Py_VISIT(traverse_module_state->__pyx_tuple__62);
  Py_VISIT(traverse_module_state->__pyx_tuple__63);
  Py_VISIT(traverse_module_state->__pyx_tuple__64);
  Py_VISIT(traverse_module_state->__pyx_tuple__65);
  Py_VISIT(traverse_module_state->__pyx_tuple__66);
  Py_VISIT(traverse_module_state->__pyx_tuple__67);
  Py_VISIT(traverse_module_state->__pyx_tuple__68);
  Py_VISIT(traverse_module_state->__pyx_tuple__69);
  Py_VISIT(traverse_module_state->__pyx_tuple__70);
  Py_VISIT(traverse_module_state->__pyx_tuple__71);
  Py_VISIT(traverse_module_state->__pyx_tuple__72);
  Py_VISIT(traverse_module_state->__pyx_tuple__73);
  Py_VISIT(traverse_module_state->__pyx_tuple__74);
  Py_VISIT(traverse_module_state->__pyx_tuple__75);
  Py_VISIT(traverse_module_state->__pyx_tuple__76);
  Py_VISIT(traverse_module_state->__pyx_tuple__77);
  Py_VISIT(traverse_module_state->__pyx_tuple__78);
  Py_VISIT(traverse_module_state->__pyx_tuple__79);
  Py_VISIT(traverse_module_state->__pyx_tuple__80);
  Py_VISIT(traverse_module_state->__pyx_tuple__81);
  Py_VISIT(traverse_module_state->__pyx_tuple__82);
  Py_VISIT(traverse_module_state->__pyx_tuple__83);
  Py_VISIT(traverse_module_state->__pyx_tuple__84);
  Py_VISIT(traverse_module_state->__pyx_tuple__85);
  Py_VISIT(traverse_module_state->__pyx_tuple__86);
  Py_VISIT(traverse_module_state->__pyx_tuple__87);
  Py_VISIT(traverse_module_state->__pyx_tuple__88);
  Py_VISIT(traverse_module_state->__pyx_tuple__89);
  Py_VISIT(traverse_module_state->__pyx_tuple__90);
  Py_VISIT(traverse_module_state->__pyx_tuple__91);
  Py_VISIT(traverse_module_state->__pyx_tuple__92);
  Py_VISIT(traverse_module_state->__pyx_tuple__93);
  Py_VISIT(traverse_module_state->__pyx_tuple__94);
  Py_VISIT(traverse_module_state->__pyx_tuple__95);
  Py_VISIT(traverse_module_state->__pyx_tuple__96);
  Py_VISIT(traverse_module_state->__pyx_tuple__97);
  Py_VISIT(traverse_module_state->__pyx_tuple__98);
  Py_VISIT(traverse_module_state->__pyx_tuple__99);
  Py_VISIT(traverse_module_state->__pyx_tuple__100);
  Py_VISIT(traverse_module_state->__pyx_tuple__101);
  Py_VISIT(traverse_module_state->__pyx_tuple__102);
  Py_VISIT(traverse_module_state->__pyx_tuple__103);
  Py_VISIT(traverse_module_state->__pyx_tuple__104);
  Py_VISIT(traverse_module_state->__pyx_tuple__105);
  Py_VISIT(traverse_module_state->__pyx_tuple__106);
  Py_VISIT(traverse_module_state->__pyx_tuple__107);
  Py_VISIT(traverse_module_state->__pyx_tuple__108);
  Py_VISIT(traverse_module_state->__pyx_tuple__109);
  Py_VISIT(traverse_module_state->__pyx_tuple__110);
  Py_VISIT(traverse_module_state->__pyx_tuple__111);
  Py_VISIT(traverse_module_state->__pyx_tuple__112);
  Py_VISIT(traverse_module_state->__pyx_tuple__113);
  Py_VISIT(traverse_module_state->__pyx_tuple__114);
  Py_VISIT(traverse_module_state->__pyx_tuple__115);
  Py_VISIT(traverse_module_state->__pyx_tuple__116);
  Py_VISIT(traverse_module_state->__pyx_tuple__117);
  Py_VISIT(traverse_module_state->__pyx_tuple__118);
  Py_VISIT(traverse_module_state->__pyx_tuple__119);
  Py_VISIT(traverse_module_state->__pyx_tuple__120);
  Py_VISIT(traverse_module_state->__pyx_tuple__121);
  Py_VISIT(traverse_module_state->__pyx_tuple__122);
  Py_VISIT(traverse_module_state->__pyx_tuple__123);
  Py_VISIT(traverse_module_state->__pyx_tuple__124);
  Py_VISIT(traverse_module_state->__pyx_tuple__125);
  Py_VISIT(traverse_module_state->__pyx_tuple__126);
  Py_VISIT(traverse_module_state->__pyx_tuple__127);
  Py_VISIT(traverse_module_state->__pyx_tuple__128);
  Py_VISIT(traverse_module_state->__pyx_tuple__129);
  Py_VISIT(traverse_module_state->__pyx_tuple__131);
  Py_VISIT(traverse_module_state->__pyx_tuple__133);
  Py_VISIT(traverse_module_state->__pyx_tuple__135);
  Py_VISIT(traverse_module_state->__pyx_tuple__137);
  Py_VISIT(traverse_module_state->__pyx_tuple__139);
  Py_VISIT(traverse_module_state->__pyx_tuple__141);
  Py_VISIT(traverse_module_state->__pyx_tuple__143);
  Py_VISIT(traverse_module_state->__pyx_tuple__145);
  Py_VISIT(traverse_module_state->__pyx_tuple__147);
  Py_VISIT(traverse_module_state->__pyx_tuple__149);
  Py_VISIT(traverse_module_state->__pyx_tuple__151);
  Py_VISIT(traverse_module_state->__pyx_tuple__153);
  Py_VISIT(traverse_module_state->__pyx_tuple__155);
  Py_VISIT(traverse_module_state->__pyx_tuple__157);
  Py_VISIT(traverse_module_state->__pyx_tuple__159);
  Py_VISIT(traverse_module_state->__pyx_tuple__161);
  Py_VISIT(traverse_module_state->__pyx_tuple__163);
  Py_VISIT(traverse_module_state->__pyx_tuple__165);
  Py_VISIT(traverse_module_state->__pyx_tuple__167);
  Py_VISIT(traverse_module_state->__pyx_tuple__169);
  Py_VISIT(traverse_module_state->__pyx_tuple__171);
  Py_VISIT(traverse_module_state->__pyx_tuple__173);
  Py_VISIT(traverse_module_state->__pyx_tuple__175);
  Py_VISIT(traverse_module_state->__pyx_tuple__177);
  Py_VISIT(traverse_module_state->__pyx_tuple__179);
  Py_VISIT(traverse_module_state->__pyx_tuple__181);
  Py_VISIT(traverse_module_state->__pyx_tuple__183);
  Py_VISIT(traverse_module_state->__pyx_tuple__185);
  Py_VISIT(traverse_module_state->__pyx_tuple__187);
  Py_VISIT(traverse_module_state->__pyx_tuple__189);
  Py_VISIT(traverse_module_state->__pyx_tuple__191);
  Py_VISIT(traverse_module_state->__pyx_tuple__193);
  Py_VISIT(traverse_module_state->__pyx_tuple__195);
  Py_VISIT(traverse_module_state->__pyx_tuple__197);
  Py_VISIT(traverse_module_state->__pyx_tuple__199);
  Py_VISIT(traverse_module_state->__pyx_tuple__201);
  Py_VISIT(traverse_module_state->__pyx_tuple__203);
  Py_VISIT(traverse_module_state->__pyx_tuple__205);
  Py_VISIT(traverse_module_state->__pyx_tuple__207);
  Py_VISIT(traverse_module_state->__pyx_tuple__209);
  Py_VISIT(traverse_module_state->__pyx_tuple__211);
  Py_VISIT(traverse_module_state->__pyx_codeobj__130);
  Py_VISIT(traverse_module_state->__pyx_codeobj__132);
  Py_VISIT(traverse_module_state->__pyx_codeobj__134);
  Py_VISIT(traverse_module_state->__pyx_codeobj__136);
  Py_VISIT(traverse_module_state->__pyx_codeobj__138);
  Py_VISIT(traverse_module_state->__pyx_codeobj__140);
  Py_VISIT(traverse_module_state->__pyx_codeobj__142);
  Py_VISIT(traverse_module_state->__pyx_codeobj__144);
  Py_VISIT(traverse_module_state->__pyx_codeobj__146);
  Py_VISIT(traverse_module_state->__pyx_codeobj__148);
  Py_VISIT(traverse_module_state->__pyx_codeobj__150);
  Py_VISIT(traverse_module_state->__pyx_codeobj__152);
  Py_VISIT(traverse_module_state->__pyx_codeobj__154);
  Py_VISIT(traverse_module_state->__pyx_codeobj__156);
  Py_VISIT(traverse_module_state->__pyx_codeobj__158);
  Py_VISIT(traverse_module_state->__pyx_codeobj__160);
  Py_VISIT(traverse_module_state->__pyx_codeobj__162);
  Py_VISIT(traverse_module_state->__pyx_codeobj__164);
  Py_VISIT(traverse_module_state->__pyx_codeobj__166);
  Py_VISIT(traverse_module_state->__pyx_codeobj__168);
  Py_VISIT(traverse_module_state->__pyx_codeobj__170);
  Py_VISIT(traverse_module_state->__pyx_codeobj__172);
  Py_VISIT(traverse_module_state->__pyx_codeobj__174);
  Py_VISIT(traverse_module_state->__pyx_codeobj__176);
  Py_VISIT(traverse_module_state->__pyx_codeobj__178);
  Py_VISIT(traverse_module_state->__pyx_codeobj__180);
  Py_VISIT(traverse_module_state->__pyx_codeobj__182);
  Py_VISIT(traverse_module_state->__pyx_codeobj__184);
  Py_VISIT(traverse_module_state->__pyx_codeobj__186);
  Py_VISIT(traverse_module_state->__pyx_codeobj__188);
  Py_VISIT(traverse_module_state->__pyx_codeobj__190);
  Py_VISIT(traverse_module_state->__pyx_codeobj__192);
  Py_VISIT(traverse_module_state->__pyx_codeobj__194);
  Py_VISIT(traverse_module_state->__pyx_codeobj__196);
  Py_VISIT(traverse_module_state->__pyx_codeobj__198);
  Py_VISIT(traverse_module_state->__pyx_codeobj__200);
  Py_VISIT(traverse_module_state->__pyx_codeobj__202);
  Py_VISIT(traverse_module_state->__pyx_codeobj__204);
  Py_VISIT(traverse_module_state->__pyx_codeobj__206);
  Py_VISIT(traverse_module_state->__pyx_codeobj__208);
  Py_VISIT(traverse_module_state->__pyx_codeobj__210);
  Py_VISIT(traverse_module_state->__pyx_codeobj__212);
  return 0;
}
#endif
/* #### Code section: module_state_defines ### */
#if CYTHON_COMPILING_IN_LIMITED_API
#define __pyx_d __pyx_mstate_global->__pyx_d
#define __pyx_b __pyx_mstate_global->__pyx_b
#define __pyx_cython_runtime __pyx_mstate_global->__pyx_cython_runtime
#define __pyx_empty_tuple __pyx_mstate_global->__pyx_empty_tuple
#define __pyx_empty_bytes __pyx_mstate_global->__pyx_empty_bytes
#define __pyx_empty_unicode __pyx_mstate_global->__pyx_empty_unicode
#ifdef __Pyx_CyFunction_USED
#define __pyx_CyFunctionType __pyx_mstate_global->__pyx_CyFunctionType
#endif
#ifdef __Pyx_FusedFunction_USED
#define __pyx_FusedFunctionType __pyx_mstate_global->__pyx_FusedFunctionType
#endif
#define __pyx_ptype_9_cotton2k_10simulation_SoilInit __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_SoilInit
#define __pyx_type_9_cotton2k_10simulation_SoilInit __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_SoilInit
#define __pyx_ptype_9_cotton2k_10simulation_Climate __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_Climate
#define __pyx_type_9_cotton2k_10simulation_Climate __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_Climate
#define __pyx_ptype_9_cotton2k_10simulation_NodeLeaf __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_NodeLeaf
#define __pyx_type_9_cotton2k_10simulation_NodeLeaf __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_NodeLeaf
#define __pyx_ptype_9_cotton2k_10simulation_FruitingNode __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_FruitingNode
#define __pyx_type_9_cotton2k_10simulation_FruitingNode __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_FruitingNode
#define __pyx_ptype_9_cotton2k_10simulation_MainStemLeaf __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf
#define __pyx_type_9_cotton2k_10simulation_MainStemLeaf __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_MainStemLeaf
#define __pyx_ptype_9_cotton2k_10simulation_FruitingBranch __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_FruitingBranch
#define __pyx_type_9_cotton2k_10simulation_FruitingBranch __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_FruitingBranch
#define __pyx_ptype_9_cotton2k_10simulation_VegetativeBranch __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch
#define __pyx_type_9_cotton2k_10simulation_VegetativeBranch __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_VegetativeBranch
#define __pyx_ptype_9_cotton2k_10simulation_State __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_State
#define __pyx_type_9_cotton2k_10simulation_State __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_State
#define __pyx_ptype_9_cotton2k_10simulation_Simulation __pyx_mstate_global->__pyx_ptype_9_cotton2k_10simulation_Simulation
#define __pyx_type_9_cotton2k_10simulation_Simulation __pyx_mstate_global->__pyx_type_9_cotton2k_10simulation_Simulation
#define __pyx_n_s_Climate __pyx_mstate_global->__pyx_n_s_Climate
#define __pyx_n_s_Climate___reduce_cython __pyx_mstate_global->__pyx_n_s_Climate___reduce_cython
#define __pyx_n_s_Climate___setstate_cython __pyx_mstate_global->__pyx_n_s_Climate___setstate_cython
#define __pyx_n_s_DaysTo1stSqare __pyx_mstate_global->__pyx_n_s_DaysTo1stSqare
#define __pyx_n_s_FruitingBranch __pyx_mstate_global->__pyx_n_s_FruitingBranch
#define __pyx_n_s_FruitingBranch___reduce_cython __pyx_mstate_global->__pyx_n_s_FruitingBranch___reduce_cython
#define __pyx_n_s_FruitingBranch___setstate_cython __pyx_mstate_global->__pyx_n_s_FruitingBranch___setstate_cython
#define __pyx_n_s_FruitingNode __pyx_mstate_global->__pyx_n_s_FruitingNode
#define __pyx_n_s_FruitingNode___reduce_cython __pyx_mstate_global->__pyx_n_s_FruitingNode___reduce_cython
#define __pyx_n_s_FruitingNode___setstate_cython __pyx_mstate_global->__pyx_n_s_FruitingNode___setstate_cython
#define __pyx_kp_s_Incompatible_checksums_s_vs_0x84 __pyx_mstate_global->__pyx_kp_s_Incompatible_checksums_s_vs_0x84
#define __pyx_n_s_IndexError __pyx_mstate_global->__pyx_n_s_IndexError
#define __pyx_n_s_KeyError __pyx_mstate_global->__pyx_n_s_KeyError
#define __pyx_n_s_MainStemLeaf __pyx_mstate_global->__pyx_n_s_MainStemLeaf
#define __pyx_n_s_MainStemLeaf___reduce_cython __pyx_mstate_global->__pyx_n_s_MainStemLeaf___reduce_cython
#define __pyx_n_s_MainStemLeaf___setstate_cython __pyx_mstate_global->__pyx_n_s_MainStemLeaf___setstate_cython
#define __pyx_kp_s_No_value_specified_for_struct_at __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at
#define __pyx_kp_s_No_value_specified_for_struct_at_10 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_10
#define __pyx_kp_s_No_value_specified_for_struct_at_100 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_100
#define __pyx_kp_s_No_value_specified_for_struct_at_101 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_101
#define __pyx_kp_s_No_value_specified_for_struct_at_102 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_102
#define __pyx_kp_s_No_value_specified_for_struct_at_103 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_103
#define __pyx_kp_s_No_value_specified_for_struct_at_104 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_104
#define __pyx_kp_s_No_value_specified_for_struct_at_105 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_105
#define __pyx_kp_s_No_value_specified_for_struct_at_106 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_106
#define __pyx_kp_s_No_value_specified_for_struct_at_107 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_107
#define __pyx_kp_s_No_value_specified_for_struct_at_108 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_108
#define __pyx_kp_s_No_value_specified_for_struct_at_109 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_109
#define __pyx_kp_s_No_value_specified_for_struct_at_11 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_11
#define __pyx_kp_s_No_value_specified_for_struct_at_110 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_110
#define __pyx_kp_s_No_value_specified_for_struct_at_111 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_111
#define __pyx_kp_s_No_value_specified_for_struct_at_112 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_112
#define __pyx_kp_s_No_value_specified_for_struct_at_113 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_113
#define __pyx_kp_s_No_value_specified_for_struct_at_114 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_114
#define __pyx_kp_s_No_value_specified_for_struct_at_115 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_115
#define __pyx_kp_s_No_value_specified_for_struct_at_116 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_116
#define __pyx_kp_s_No_value_specified_for_struct_at_117 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_117
#define __pyx_kp_s_No_value_specified_for_struct_at_12 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_12
#define __pyx_kp_s_No_value_specified_for_struct_at_13 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_13
#define __pyx_kp_s_No_value_specified_for_struct_at_14 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_14
#define __pyx_kp_s_No_value_specified_for_struct_at_15 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_15
#define __pyx_kp_s_No_value_specified_for_struct_at_16 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_16
#define __pyx_kp_s_No_value_specified_for_struct_at_17 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_17
#define __pyx_kp_s_No_value_specified_for_struct_at_18 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_18
#define __pyx_kp_s_No_value_specified_for_struct_at_19 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_19
#define __pyx_kp_s_No_value_specified_for_struct_at_2 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_2
#define __pyx_kp_s_No_value_specified_for_struct_at_20 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_20
#define __pyx_kp_s_No_value_specified_for_struct_at_21 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_21
#define __pyx_kp_s_No_value_specified_for_struct_at_22 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_22
#define __pyx_kp_s_No_value_specified_for_struct_at_23 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_23
#define __pyx_kp_s_No_value_specified_for_struct_at_24 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_24
#define __pyx_kp_s_No_value_specified_for_struct_at_25 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_25
#define __pyx_kp_s_No_value_specified_for_struct_at_26 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_26
#define __pyx_kp_s_No_value_specified_for_struct_at_27 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_27
#define __pyx_kp_s_No_value_specified_for_struct_at_28 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_28
#define __pyx_kp_s_No_value_specified_for_struct_at_29 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_29
#define __pyx_kp_s_No_value_specified_for_struct_at_3 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_3
#define __pyx_kp_s_No_value_specified_for_struct_at_30 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_30
#define __pyx_kp_s_No_value_specified_for_struct_at_31 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_31
#define __pyx_kp_s_No_value_specified_for_struct_at_32 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_32
#define __pyx_kp_s_No_value_specified_for_struct_at_33 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_33
#define __pyx_kp_s_No_value_specified_for_struct_at_34 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_34
#define __pyx_kp_s_No_value_specified_for_struct_at_35 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_35
#define __pyx_kp_s_No_value_specified_for_struct_at_36 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_36
#define __pyx_kp_s_No_value_specified_for_struct_at_37 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_37
#define __pyx_kp_s_No_value_specified_for_struct_at_38 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_38
#define __pyx_kp_s_No_value_specified_for_struct_at_39 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_39
#define __pyx_kp_s_No_value_specified_for_struct_at_4 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_4
#define __pyx_kp_s_No_value_specified_for_struct_at_40 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_40
#define __pyx_kp_s_No_value_specified_for_struct_at_41 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_41
#define __pyx_kp_s_No_value_specified_for_struct_at_42 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_42
#define __pyx_kp_s_No_value_specified_for_struct_at_43 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_43
#define __pyx_kp_s_No_value_specified_for_struct_at_44 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_44
#define __pyx_kp_s_No_value_specified_for_struct_at_45 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_45
#define __pyx_kp_s_No_value_specified_for_struct_at_46 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_46
#define __pyx_kp_s_No_value_specified_for_struct_at_47 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_47
#define __pyx_kp_s_No_value_specified_for_struct_at_48 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_48
#define __pyx_kp_s_No_value_specified_for_struct_at_49 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_49
#define __pyx_kp_s_No_value_specified_for_struct_at_5 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_5
#define __pyx_kp_s_No_value_specified_for_struct_at_50 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_50
#define __pyx_kp_s_No_value_specified_for_struct_at_51 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_51
#define __pyx_kp_s_No_value_specified_for_struct_at_52 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_52
#define __pyx_kp_s_No_value_specified_for_struct_at_53 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_53
#define __pyx_kp_s_No_value_specified_for_struct_at_54 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_54
#define __pyx_kp_s_No_value_specified_for_struct_at_55 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_55
#define __pyx_kp_s_No_value_specified_for_struct_at_56 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_56
#define __pyx_kp_s_No_value_specified_for_struct_at_57 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_57
#define __pyx_kp_s_No_value_specified_for_struct_at_58 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_58
#define __pyx_kp_s_No_value_specified_for_struct_at_59 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_59
#define __pyx_kp_s_No_value_specified_for_struct_at_6 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_6
#define __pyx_kp_s_No_value_specified_for_struct_at_60 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_60
#define __pyx_kp_s_No_value_specified_for_struct_at_61 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_61
#define __pyx_kp_s_No_value_specified_for_struct_at_62 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_62
#define __pyx_kp_s_No_value_specified_for_struct_at_63 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_63
#define __pyx_kp_s_No_value_specified_for_struct_at_64 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_64
#define __pyx_kp_s_No_value_specified_for_struct_at_65 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_65
#define __pyx_kp_s_No_value_specified_for_struct_at_66 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_66
#define __pyx_kp_s_No_value_specified_for_struct_at_67 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_67
#define __pyx_kp_s_No_value_specified_for_struct_at_68 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_68
#define __pyx_kp_s_No_value_specified_for_struct_at_69 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_69
#define __pyx_kp_s_No_value_specified_for_struct_at_7 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_7
#define __pyx_kp_s_No_value_specified_for_struct_at_70 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_70
#define __pyx_kp_s_No_value_specified_for_struct_at_71 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_71
#define __pyx_kp_s_No_value_specified_for_struct_at_72 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_72
#define __pyx_kp_s_No_value_specified_for_struct_at_73 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_73
#define __pyx_kp_s_No_value_specified_for_struct_at_74 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_74
#define __pyx_kp_s_No_value_specified_for_struct_at_75 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_75
#define __pyx_kp_s_No_value_specified_for_struct_at_76 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_76
#define __pyx_kp_s_No_value_specified_for_struct_at_77 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_77
#define __pyx_kp_s_No_value_specified_for_struct_at_78 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_78
#define __pyx_kp_s_No_value_specified_for_struct_at_79 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_79
#define __pyx_kp_s_No_value_specified_for_struct_at_8 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_8
#define __pyx_kp_s_No_value_specified_for_struct_at_80 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_80
#define __pyx_kp_s_No_value_specified_for_struct_at_81 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_81
#define __pyx_kp_s_No_value_specified_for_struct_at_82 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_82
#define __pyx_kp_s_No_value_specified_for_struct_at_83 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_83
#define __pyx_kp_s_No_value_specified_for_struct_at_84 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_84
#define __pyx_kp_s_No_value_specified_for_struct_at_85 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_85
#define __pyx_kp_s_No_value_specified_for_struct_at_86 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_86
#define __pyx_kp_s_No_value_specified_for_struct_at_87 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_87
#define __pyx_kp_s_No_value_specified_for_struct_at_88 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_88
#define __pyx_kp_s_No_value_specified_for_struct_at_89 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_89
#define __pyx_kp_s_No_value_specified_for_struct_at_9 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_9
#define __pyx_kp_s_No_value_specified_for_struct_at_90 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_90
#define __pyx_kp_s_No_value_specified_for_struct_at_91 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_91
#define __pyx_kp_s_No_value_specified_for_struct_at_92 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_92
#define __pyx_kp_s_No_value_specified_for_struct_at_93 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_93
#define __pyx_kp_s_No_value_specified_for_struct_at_94 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_94
#define __pyx_kp_s_No_value_specified_for_struct_at_95 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_95
#define __pyx_kp_s_No_value_specified_for_struct_at_96 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_96
#define __pyx_kp_s_No_value_specified_for_struct_at_97 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_97
#define __pyx_kp_s_No_value_specified_for_struct_at_98 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_98
#define __pyx_kp_s_No_value_specified_for_struct_at_99 __pyx_mstate_global->__pyx_kp_s_No_value_specified_for_struct_at_99
#define __pyx_n_s_NodeLeaf __pyx_mstate_global->__pyx_n_s_NodeLeaf
#define __pyx_n_s_NodeLeaf___reduce_cython __pyx_mstate_global->__pyx_n_s_NodeLeaf___reduce_cython
#define __pyx_n_s_NodeLeaf___setstate_cython __pyx_mstate_global->__pyx_n_s_NodeLeaf___setstate_cython
#define __pyx_n_s_OpenRatio __pyx_mstate_global->__pyx_n_s_OpenRatio
#define __pyx_n_s_OverflowError __pyx_mstate_global->__pyx_n_s_OverflowError
#define __pyx_n_s_PhenDelayByNStress __pyx_mstate_global->__pyx_n_s_PhenDelayByNStress
#define __pyx_n_s_PickleError __pyx_mstate_global->__pyx_n_s_PickleError
#define __pyx_kp_s_Pickling_of_struct_members_such __pyx_mstate_global->__pyx_kp_s_Pickling_of_struct_members_such
#define __pyx_n_s_Rad __pyx_mstate_global->__pyx_n_s_Rad
#define __pyx_n_u_Rad __pyx_mstate_global->__pyx_n_u_Rad
#define __pyx_n_s_Rain __pyx_mstate_global->__pyx_n_s_Rain
#define __pyx_n_u_Rain __pyx_mstate_global->__pyx_n_u_Rain
#define __pyx_n_s_RuntimeError __pyx_mstate_global->__pyx_n_s_RuntimeError
#define __pyx_n_s_Simulation __pyx_mstate_global->__pyx_n_s_Simulation
#define __pyx_n_s_SimulationEnd __pyx_mstate_global->__pyx_n_s_SimulationEnd
#define __pyx_n_s_Simulation___reduce_cython __pyx_mstate_global->__pyx_n_s_Simulation___reduce_cython
#define __pyx_n_s_Simulation___setstate_cython __pyx_mstate_global->__pyx_n_s_Simulation___setstate_cython
#define __pyx_n_s_Simulation__add_vegetative_branc __pyx_mstate_global->__pyx_n_s_Simulation__add_vegetative_branc
#define __pyx_n_s_Simulation__calc_light_intercept __pyx_mstate_global->__pyx_n_s_Simulation__calc_light_intercept
#define __pyx_n_s_Simulation__column_shading __pyx_mstate_global->__pyx_n_s_Simulation__column_shading
#define __pyx_n_s_Simulation__daily_climate __pyx_mstate_global->__pyx_n_s_Simulation__daily_climate
#define __pyx_n_s_Simulation__days_to_first_square __pyx_mstate_global->__pyx_n_s_Simulation__days_to_first_square
#define __pyx_n_s_Simulation__defoliate __pyx_mstate_global->__pyx_n_s_Simulation__defoliate
#define __pyx_n_s_Simulation__doy2date __pyx_mstate_global->__pyx_n_s_Simulation__doy2date
#define __pyx_n_s_Simulation__get_net_photosynthes __pyx_mstate_global->__pyx_n_s_Simulation__get_net_photosynthes
#define __pyx_n_s_Simulation__growth __pyx_mstate_global->__pyx_n_s_Simulation__growth
#define __pyx_n_s_Simulation__init_grid __pyx_mstate_global->__pyx_n_s_Simulation__init_grid
#define __pyx_n_s_Simulation__init_state __pyx_mstate_global->__pyx_n_s_Simulation__init_state
#define __pyx_n_s_Simulation__phenology __pyx_mstate_global->__pyx_n_s_Simulation__phenology
#define __pyx_n_s_Simulation__potential_fruit_grow __pyx_mstate_global->__pyx_n_s_Simulation__potential_fruit_grow
#define __pyx_n_s_Simulation__potential_leaf_growt __pyx_mstate_global->__pyx_n_s_Simulation__potential_leaf_growt
#define __pyx_n_s_Simulation__simulate __pyx_mstate_global->__pyx_n_s_Simulation__simulate
#define __pyx_n_s_Simulation__simulate_this_day __pyx_mstate_global->__pyx_n_s_Simulation__simulate_this_day
#define __pyx_n_s_Simulation__stress __pyx_mstate_global->__pyx_n_s_Simulation__stress
#define __pyx_n_s_Simulation_read_input __pyx_mstate_global->__pyx_n_s_Simulation_read_input
#define __pyx_n_s_Simulation_run __pyx_mstate_global->__pyx_n_s_Simulation_run
#define __pyx_n_s_Simulation_state __pyx_mstate_global->__pyx_n_s_Simulation_state
#define __pyx_n_s_SoilInit __pyx_mstate_global->__pyx_n_s_SoilInit
#define __pyx_n_s_SoilInit___reduce_cython __pyx_mstate_global->__pyx_n_s_SoilInit___reduce_cython
#define __pyx_n_s_SoilInit___setstate_cython __pyx_mstate_global->__pyx_n_s_SoilInit___setstate_cython
#define __pyx_n_s_State __pyx_mstate_global->__pyx_n_s_State
#define __pyx_n_s_State___reduce_cython __pyx_mstate_global->__pyx_n_s_State___reduce_cython
#define __pyx_n_s_State___setstate_cython __pyx_mstate_global->__pyx_n_s_State___setstate_cython
#define __pyx_n_s_State_add_fruiting_branch __pyx_mstate_global->__pyx_n_s_State_add_fruiting_branch
#define __pyx_n_s_State_create_first_square __pyx_mstate_global->__pyx_n_s_State_create_first_square
#define __pyx_n_s_State_keys __pyx_mstate_global->__pyx_n_s_State_keys
#define __pyx_n_s_StopIteration __pyx_mstate_global->__pyx_n_s_StopIteration
#define __pyx_n_s_Tdew __pyx_mstate_global->__pyx_n_s_Tdew
#define __pyx_n_u_Tdew __pyx_mstate_global->__pyx_n_u_Tdew
#define __pyx_n_s_TimeToNextFruBranch __pyx_mstate_global->__pyx_n_s_TimeToNextFruBranch
#define __pyx_n_s_TimeToNextVegBranch __pyx_mstate_global->__pyx_n_s_TimeToNextVegBranch
#define __pyx_n_s_Tmax __pyx_mstate_global->__pyx_n_s_Tmax
#define __pyx_n_u_Tmax __pyx_mstate_global->__pyx_n_u_Tmax
#define __pyx_n_s_Tmin __pyx_mstate_global->__pyx_n_s_Tmin
#define __pyx_n_u_Tmin __pyx_mstate_global->__pyx_n_u_Tmin
#define __pyx_n_s_TypeError __pyx_mstate_global->__pyx_n_s_TypeError
#define __pyx_n_s_ValueError __pyx_mstate_global->__pyx_n_s_ValueError
#define __pyx_n_s_VegetativeBranch __pyx_mstate_global->__pyx_n_s_VegetativeBranch
#define __pyx_n_s_VegetativeBranch___reduce_cython __pyx_mstate_global->__pyx_n_s_VegetativeBranch___reduce_cython
#define __pyx_n_s_VegetativeBranch___setstate_cyth __pyx_mstate_global->__pyx_n_s_VegetativeBranch___setstate_cyth
#define __pyx_n_s_WaterStress __pyx_mstate_global->__pyx_n_s_WaterStress
#define __pyx_n_s_Wind __pyx_mstate_global->__pyx_n_s_Wind
#define __pyx_n_u_Wind __pyx_mstate_global->__pyx_n_u_Wind
#define __pyx_kp_u_Y_j __pyx_mstate_global->__pyx_kp_u_Y_j
#define __pyx_n_s__213 __pyx_mstate_global->__pyx_n_s__213
#define __pyx_kp_u__8 __pyx_mstate_global->__pyx_kp_u__8
#define __pyx_n_s_abscised_fruit_sites __pyx_mstate_global->__pyx_n_s_abscised_fruit_sites
#define __pyx_n_s_abscised_leaf_weight __pyx_mstate_global->__pyx_n_s_abscised_leaf_weight
#define __pyx_n_s_acos __pyx_mstate_global->__pyx_n_s_acos
#define __pyx_n_s_actual_growth __pyx_mstate_global->__pyx_n_s_actual_growth
#define __pyx_n_s_actual_soil_evaporation __pyx_mstate_global->__pyx_n_s_actual_soil_evaporation
#define __pyx_n_s_actual_transpiration __pyx_mstate_global->__pyx_n_s_actual_transpiration
#define __pyx_n_s_add_fruiting_branch __pyx_mstate_global->__pyx_n_s_add_fruiting_branch
#define __pyx_n_s_add_vegetative_branch __pyx_mstate_global->__pyx_n_s_add_vegetative_branch
#define __pyx_n_s_addlfn __pyx_mstate_global->__pyx_n_s_addlfn
#define __pyx_n_s_age __pyx_mstate_global->__pyx_n_s_age
#define __pyx_n_s_age_of_pre_fruiting_nodes __pyx_mstate_global->__pyx_n_s_age_of_pre_fruiting_nodes
#define __pyx_n_s_agemax __pyx_mstate_global->__pyx_n_s_agemax
#define __pyx_n_s_agetop __pyx_mstate_global->__pyx_n_s_agetop
#define __pyx_n_u_agricultural_inputs __pyx_mstate_global->__pyx_n_u_agricultural_inputs
#define __pyx_n_u_air_dry __pyx_mstate_global->__pyx_n_u_air_dry
#define __pyx_n_s_albedo __pyx_mstate_global->__pyx_n_s_albedo
#define __pyx_n_u_alpha __pyx_mstate_global->__pyx_n_u_alpha
#define __pyx_n_s_ambient_co2_factor __pyx_mstate_global->__pyx_n_s_ambient_co2_factor
#define __pyx_n_u_ammonium __pyx_mstate_global->__pyx_n_u_ammonium
#define __pyx_n_u_ammonium_nitrogen __pyx_mstate_global->__pyx_n_u_ammonium_nitrogen
#define __pyx_n_u_amount __pyx_mstate_global->__pyx_n_u_amount
#define __pyx_n_s_applied_water __pyx_mstate_global->__pyx_n_s_applied_water
#define __pyx_n_s_area __pyx_mstate_global->__pyx_n_s_area
#define __pyx_n_s_asyncio_coroutines __pyx_mstate_global->__pyx_n_s_asyncio_coroutines
#define __pyx_n_s_average_temperature __pyx_mstate_global->__pyx_n_s_average_temperature
#define __pyx_n_u_beta __pyx_mstate_global->__pyx_n_u_beta
#define __pyx_n_s_bloom_weight_loss __pyx_mstate_global->__pyx_n_s_bloom_weight_loss
#define __pyx_n_s_bmain __pyx_mstate_global->__pyx_n_s_bmain
#define __pyx_n_s_boll __pyx_mstate_global->__pyx_n_s_boll
#define __pyx_n_u_bulk_density __pyx_mstate_global->__pyx_n_u_bulk_density
#define __pyx_n_s_burr __pyx_mstate_global->__pyx_n_s_burr
#define __pyx_n_s_burr_nitrogen __pyx_mstate_global->__pyx_n_s_burr_nitrogen
#define __pyx_n_s_c __pyx_mstate_global->__pyx_n_s_c
#define __pyx_n_s_c11 __pyx_mstate_global->__pyx_n_s_c11
#define __pyx_n_s_calc_light_interception __pyx_mstate_global->__pyx_n_s_calc_light_interception
#define __pyx_n_s_carbon_stress __pyx_mstate_global->__pyx_n_s_carbon_stress
#define __pyx_n_s_cc __pyx_mstate_global->__pyx_n_s_cc
#define __pyx_n_s_cd __pyx_mstate_global->__pyx_n_s_cd
#define __pyx_n_s_cdleaf __pyx_mstate_global->__pyx_n_s_cdleaf
#define __pyx_n_s_cdpet __pyx_mstate_global->__pyx_n_s_cdpet
#define __pyx_n_s_cdroot __pyx_mstate_global->__pyx_n_s_cdroot
#define __pyx_n_s_cdstem __pyx_mstate_global->__pyx_n_s_cdstem
#define __pyx_n_s_cells __pyx_mstate_global->__pyx_n_s_cells
#define __pyx_n_s_class_getitem __pyx_mstate_global->__pyx_n_s_class_getitem
#define __pyx_n_u_clay __pyx_mstate_global->__pyx_n_u_clay
#define __pyx_n_s_climate __pyx_mstate_global->__pyx_n_s_climate
#define __pyx_n_s_cline_in_traceback __pyx_mstate_global->__pyx_n_s_cline_in_traceback
#define __pyx_n_s_cloud_cor __pyx_mstate_global->__pyx_n_s_cloud_cor
#define __pyx_n_s_cloud_cov __pyx_mstate_global->__pyx_n_s_cloud_cov
#define __pyx_n_s_column_shading __pyx_mstate_global->__pyx_n_s_column_shading
#define __pyx_n_s_compute_day_length __pyx_mstate_global->__pyx_n_s_compute_day_length
#define __pyx_n_s_cos __pyx_mstate_global->__pyx_n_s_cos
#define __pyx_n_s_cotton2k_climate __pyx_mstate_global->__pyx_n_s_cotton2k_climate
#define __pyx_n_s_cotton2k_leaf __pyx_mstate_global->__pyx_n_s_cotton2k_leaf
#define __pyx_n_s_cotton2k_photosynthesis __pyx_mstate_global->__pyx_n_s_cotton2k_photosynthesis
#define __pyx_n_s_cotton2k_simulation __pyx_mstate_global->__pyx_n_s_cotton2k_simulation
#define __pyx_n_s_cotton2k_utils __pyx_mstate_global->__pyx_n_s_cotton2k_utils
#define __pyx_n_s_cotylwt __pyx_mstate_global->__pyx_n_s_cotylwt
#define __pyx_n_s_create_first_square __pyx_mstate_global->__pyx_n_s_create_first_square
#define __pyx_n_s_cultivar_parameters __pyx_mstate_global->__pyx_n_s_cultivar_parameters
#define __pyx_n_s_cumulative_evaporation __pyx_mstate_global->__pyx_n_s_cumulative_evaporation
#define __pyx_n_s_cumulative_nitrogen_loss __pyx_mstate_global->__pyx_n_s_cumulative_nitrogen_loss
#define __pyx_n_s_cumulative_transpiration __pyx_mstate_global->__pyx_n_s_cumulative_transpiration
#define __pyx_n_s_daily_climate __pyx_mstate_global->__pyx_n_s_daily_climate
#define __pyx_n_s_date __pyx_mstate_global->__pyx_n_s_date
#define __pyx_n_u_date __pyx_mstate_global->__pyx_n_u_date
#define __pyx_n_s_date2doy __pyx_mstate_global->__pyx_n_s_date2doy
#define __pyx_n_s_datetime __pyx_mstate_global->__pyx_n_s_datetime
#define __pyx_n_s_day_inc __pyx_mstate_global->__pyx_n_s_day_inc
#define __pyx_n_s_day_length __pyx_mstate_global->__pyx_n_s_day_length
#define __pyx_n_u_day_length __pyx_mstate_global->__pyx_n_u_day_length
#define __pyx_n_s_daynum __pyx_mstate_global->__pyx_n_s_daynum
#define __pyx_n_s_days_to_first_square __pyx_mstate_global->__pyx_n_s_days_to_first_square
#define __pyx_n_s_declination __pyx_mstate_global->__pyx_n_s_declination
#define __pyx_n_u_declination __pyx_mstate_global->__pyx_n_u_declination
#define __pyx_n_s_defoliate __pyx_mstate_global->__pyx_n_s_defoliate
#define __pyx_kp_u_defoliation_prediction __pyx_mstate_global->__pyx_kp_u_defoliation_prediction
#define __pyx_n_s_delayFrtByCStress __pyx_mstate_global->__pyx_n_s_delayFrtByCStress
#define __pyx_n_s_delayVegByCStress __pyx_mstate_global->__pyx_n_s_delayVegByCStress
#define __pyx_n_s_delay_for_new_branch __pyx_mstate_global->__pyx_n_s_delay_for_new_branch
#define __pyx_n_s_delay_for_new_fruiting_branch __pyx_mstate_global->__pyx_n_s_delay_for_new_fruiting_branch
#define __pyx_n_s_delay_for_new_node __pyx_mstate_global->__pyx_n_s_delay_for_new_node
#define __pyx_n_s_denf2 __pyx_mstate_global->__pyx_n_s_denf2
#define __pyx_n_s_denfac __pyx_mstate_global->__pyx_n_s_denfac
#define __pyx_n_s_density_factor __pyx_mstate_global->__pyx_n_s_density_factor
#define __pyx_n_u_depth __pyx_mstate_global->__pyx_n_u_depth
#define __pyx_n_s_dew_point __pyx_mstate_global->__pyx_n_s_dew_point
#define __pyx_n_u_dewpoint __pyx_mstate_global->__pyx_n_u_dewpoint
#define __pyx_n_s_dict __pyx_mstate_global->__pyx_n_s_dict
#define __pyx_n_s_dict_2 __pyx_mstate_global->__pyx_n_s_dict_2
#define __pyx_kp_u_disable __pyx_mstate_global->__pyx_kp_u_disable
#define __pyx_n_s_doc __pyx_mstate_global->__pyx_n_s_doc
#define __pyx_n_s_doy2date __pyx_mstate_global->__pyx_n_s_doy2date
#define __pyx_n_u_drip_depth __pyx_mstate_global->__pyx_n_u_drip_depth
#define __pyx_n_u_drip_horizontal_place __pyx_mstate_global->__pyx_n_u_drip_horizontal_place
#define __pyx_n_s_dsbe __pyx_mstate_global->__pyx_n_s_dsbe
#define __pyx_n_s_dum __pyx_mstate_global->__pyx_n_s_dum
#define __pyx_n_s_elevation __pyx_mstate_global->__pyx_n_s_elevation
#define __pyx_kp_u_enable __pyx_mstate_global->__pyx_kp_u_enable
#define __pyx_n_s_enumerate __pyx_mstate_global->__pyx_n_s_enumerate
#define __pyx_n_s_et1 __pyx_mstate_global->__pyx_n_s_et1
#define __pyx_n_s_et2 __pyx_mstate_global->__pyx_n_s_et2
#define __pyx_n_s_evapotranspiration __pyx_mstate_global->__pyx_n_s_evapotranspiration
#define __pyx_n_s_extra_carbon __pyx_mstate_global->__pyx_n_s_extra_carbon
#define __pyx_n_u_fertilization __pyx_mstate_global->__pyx_n_u_fertilization
#define __pyx_n_u_field_capacity_hydraulic_conduct __pyx_mstate_global->__pyx_n_u_field_capacity_hydraulic_conduct
#define __pyx_n_u_field_capacity_water_potential __pyx_mstate_global->__pyx_n_u_field_capacity_water_potential
#define __pyx_n_s_first_node __pyx_mstate_global->__pyx_n_s_first_node
#define __pyx_n_s_first_square_leaf_area __pyx_mstate_global->__pyx_n_s_first_square_leaf_area
#define __pyx_n_s_fraction __pyx_mstate_global->__pyx_n_s_fraction
#define __pyx_n_s_fresh_organic_matter __pyx_mstate_global->__pyx_n_s_fresh_organic_matter
#define __pyx_n_s_fruit_growth_ratio __pyx_mstate_global->__pyx_n_s_fruit_growth_ratio
#define __pyx_n_s_fruiting_branches __pyx_mstate_global->__pyx_n_s_fruiting_branches
#define __pyx_kp_u_gc __pyx_mstate_global->__pyx_kp_u_gc
#define __pyx_n_s_get __pyx_mstate_global->__pyx_n_s_get
#define __pyx_n_s_get_net_photosynthesis __pyx_mstate_global->__pyx_n_s_get_net_photosynthesis
#define __pyx_n_s_getattr __pyx_mstate_global->__pyx_n_s_getattr
#define __pyx_n_s_getstate __pyx_mstate_global->__pyx_n_s_getstate
#define __pyx_n_s_ginning_percent __pyx_mstate_global->__pyx_n_s_ginning_percent
#define __pyx_n_s_green_bolls_burr_weight __pyx_mstate_global->__pyx_n_s_green_bolls_burr_weight
#define __pyx_n_s_green_bolls_weight __pyx_mstate_global->__pyx_n_s_green_bolls_weight
#define __pyx_n_s_growth __pyx_mstate_global->__pyx_n_s_growth
#define __pyx_n_s_growth_factor __pyx_mstate_global->__pyx_n_s_growth_factor
#define __pyx_n_s_gsubr __pyx_mstate_global->__pyx_n_s_gsubr
#define __pyx_n_s_hour __pyx_mstate_global->__pyx_n_s_hour
#define __pyx_n_s_hours __pyx_mstate_global->__pyx_n_s_hours
#define __pyx_n_s_htdenf __pyx_mstate_global->__pyx_n_s_htdenf
#define __pyx_n_s_humidity __pyx_mstate_global->__pyx_n_s_humidity
#define __pyx_n_s_hydrology __pyx_mstate_global->__pyx_n_s_hydrology
#define __pyx_n_s_i __pyx_mstate_global->__pyx_n_s_i
#define __pyx_n_s_ihr __pyx_mstate_global->__pyx_n_s_ihr
#define __pyx_n_u_immediate_drainage_water_potenti __pyx_mstate_global->__pyx_n_u_immediate_drainage_water_potenti
#define __pyx_n_s_import __pyx_mstate_global->__pyx_n_s_import
#define __pyx_n_s_init_grid __pyx_mstate_global->__pyx_n_s_init_grid
#define __pyx_n_s_init_state __pyx_mstate_global->__pyx_n_s_init_state
#define __pyx_n_s_init_subclass __pyx_mstate_global->__pyx_n_s_init_subclass
#define __pyx_n_s_initial __pyx_mstate_global->__pyx_n_s_initial
#define __pyx_n_u_irrigation __pyx_mstate_global->__pyx_n_u_irrigation
#define __pyx_n_s_is_coroutine __pyx_mstate_global->__pyx_n_s_is_coroutine
#define __pyx_kp_u_isenabled __pyx_mstate_global->__pyx_kp_u_isenabled
#define __pyx_n_s_items __pyx_mstate_global->__pyx_n_s_items
#define __pyx_n_s_j __pyx_mstate_global->__pyx_n_s_j
#define __pyx_n_s_jp1 __pyx_mstate_global->__pyx_n_s_jp1
#define __pyx_n_s_k __pyx_mstate_global->__pyx_n_s_k
#define __pyx_n_s_k0 __pyx_mstate_global->__pyx_n_s_k0
#define __pyx_n_s_kday __pyx_mstate_global->__pyx_n_s_kday
#define __pyx_n_s_keys __pyx_mstate_global->__pyx_n_s_keys
#define __pyx_n_s_kkday __pyx_mstate_global->__pyx_n_s_kkday
#define __pyx_n_s_kwargs __pyx_mstate_global->__pyx_n_s_kwargs
#define __pyx_n_s_l __pyx_mstate_global->__pyx_n_s_l
#define __pyx_n_s_l1 __pyx_mstate_global->__pyx_n_s_l1
#define __pyx_n_s_l2 __pyx_mstate_global->__pyx_n_s_l2
#define __pyx_n_s_last_fruiting_branch __pyx_mstate_global->__pyx_n_s_last_fruiting_branch
#define __pyx_n_s_latitude __pyx_mstate_global->__pyx_n_s_latitude
#define __pyx_n_s_layer_depth __pyx_mstate_global->__pyx_n_s_layer_depth
#define __pyx_n_s_layers __pyx_mstate_global->__pyx_n_s_layers
#define __pyx_n_u_layers __pyx_mstate_global->__pyx_n_u_layers
#define __pyx_n_s_leaf __pyx_mstate_global->__pyx_n_s_leaf
#define __pyx_n_s_leaf_area __pyx_mstate_global->__pyx_n_s_leaf_area
#define __pyx_n_s_leaf_area_index __pyx_mstate_global->__pyx_n_s_leaf_area_index
#define __pyx_n_s_leaf_area_pre_fruiting __pyx_mstate_global->__pyx_n_s_leaf_area_pre_fruiting
#define __pyx_n_s_leaf_nitrogen __pyx_mstate_global->__pyx_n_s_leaf_nitrogen
#define __pyx_n_s_leaf_nitrogen_concentration __pyx_mstate_global->__pyx_n_s_leaf_nitrogen_concentration
#define __pyx_n_s_leaf_weight __pyx_mstate_global->__pyx_n_s_leaf_weight
#define __pyx_n_s_leaf_weight_area_ratio __pyx_mstate_global->__pyx_n_s_leaf_weight_area_ratio
#define __pyx_n_s_leaf_weight_pre_fruiting __pyx_mstate_global->__pyx_n_s_leaf_weight_pre_fruiting
#define __pyx_n_s_lfint __pyx_mstate_global->__pyx_n_s_lfint
#define __pyx_n_s_light_interception __pyx_mstate_global->__pyx_n_s_light_interception
#define __pyx_n_s_lint_yield __pyx_mstate_global->__pyx_n_s_lint_yield
#define __pyx_n_s_longitude __pyx_mstate_global->__pyx_n_s_longitude
#define __pyx_n_s_lp1 __pyx_mstate_global->__pyx_n_s_lp1
#define __pyx_n_s_lyrsol __pyx_mstate_global->__pyx_n_s_lyrsol
#define __pyx_n_s_lytres __pyx_mstate_global->__pyx_n_s_lytres
#define __pyx_n_s_m __pyx_mstate_global->__pyx_n_s_m
#define __pyx_n_s_main __pyx_mstate_global->__pyx_n_s_main
#define __pyx_n_s_main_stem_leaf __pyx_mstate_global->__pyx_n_s_main_stem_leaf
#define __pyx_n_s_math __pyx_mstate_global->__pyx_n_s_math
#define __pyx_n_u_max __pyx_mstate_global->__pyx_n_u_max
#define __pyx_n_u_max_conductivity __pyx_mstate_global->__pyx_n_u_max_conductivity
#define __pyx_n_s_maxrtgr __pyx_mstate_global->__pyx_n_s_maxrtgr
#define __pyx_n_s_maxstmgr __pyx_mstate_global->__pyx_n_s_maxstmgr
#define __pyx_n_s_metaclass __pyx_mstate_global->__pyx_n_s_metaclass
#define __pyx_n_u_method __pyx_mstate_global->__pyx_n_u_method
#define __pyx_n_s_microsecond __pyx_mstate_global->__pyx_n_s_microsecond
#define __pyx_n_u_min __pyx_mstate_global->__pyx_n_u_min
#define __pyx_n_s_minute __pyx_mstate_global->__pyx_n_s_minute
#define __pyx_n_s_module __pyx_mstate_global->__pyx_n_s_module
#define __pyx_n_s_mp1 __pyx_mstate_global->__pyx_n_s_mp1
#define __pyx_n_s_mro_entries __pyx_mstate_global->__pyx_n_s_mro_entries
#define __pyx_n_s_name __pyx_mstate_global->__pyx_n_s_name
#define __pyx_n_s_net_radiation __pyx_mstate_global->__pyx_n_s_net_radiation
#define __pyx_n_s_new __pyx_mstate_global->__pyx_n_s_new
#define __pyx_n_s_new_branch __pyx_mstate_global->__pyx_n_s_new_branch
#define __pyx_n_s_new_node __pyx_mstate_global->__pyx_n_s_new_node
#define __pyx_n_s_new_node_initial_leaf_area __pyx_mstate_global->__pyx_n_s_new_node_initial_leaf_area
#define __pyx_n_s_newbr __pyx_mstate_global->__pyx_n_s_newbr
#define __pyx_n_s_nidmax __pyx_mstate_global->__pyx_n_s_nidmax
#define __pyx_n_u_nitrate __pyx_mstate_global->__pyx_n_u_nitrate
#define __pyx_n_u_nitrate_nitrogen __pyx_mstate_global->__pyx_n_u_nitrate_nitrogen
#define __pyx_n_s_nitrate_nitrogen_content __pyx_mstate_global->__pyx_n_s_nitrate_nitrogen_content
#define __pyx_n_s_nitrogen_stress __pyx_mstate_global->__pyx_n_s_nitrogen_stress
#define __pyx_n_s_nitrogen_stress_fruiting __pyx_mstate_global->__pyx_n_s_nitrogen_stress_fruiting
#define __pyx_n_s_nitrogen_stress_root __pyx_mstate_global->__pyx_n_s_nitrogen_stress_root
#define __pyx_n_s_nitrogen_stress_vegetative __pyx_mstate_global->__pyx_n_s_nitrogen_stress_vegetative
#define __pyx_n_s_nodes __pyx_mstate_global->__pyx_n_s_nodes
#define __pyx_n_s_number_of_fruiting_branches __pyx_mstate_global->__pyx_n_s_number_of_fruiting_branches
#define __pyx_n_s_number_of_fruiting_nodes __pyx_mstate_global->__pyx_n_s_number_of_fruiting_nodes
#define __pyx_n_s_number_of_fruiting_sites __pyx_mstate_global->__pyx_n_s_number_of_fruiting_sites
#define __pyx_n_s_number_of_green_bolls __pyx_mstate_global->__pyx_n_s_number_of_green_bolls
#define __pyx_n_s_number_of_layers_with_root __pyx_mstate_global->__pyx_n_s_number_of_layers_with_root
#define __pyx_n_s_number_of_left_columns_with_root __pyx_mstate_global->__pyx_n_s_number_of_left_columns_with_root
#define __pyx_n_s_number_of_open_bolls __pyx_mstate_global->__pyx_n_s_number_of_open_bolls
#define __pyx_n_s_number_of_pre_fruiting_nodes __pyx_mstate_global->__pyx_n_s_number_of_pre_fruiting_nodes
#define __pyx_n_s_number_of_right_columns_with_roo __pyx_mstate_global->__pyx_n_s_number_of_right_columns_with_roo
#define __pyx_n_s_number_of_squares __pyx_mstate_global->__pyx_n_s_number_of_squares
#define __pyx_n_s_number_of_vegetative_branches __pyx_mstate_global->__pyx_n_s_number_of_vegetative_branches
#define __pyx_n_s_nwfl __pyx_mstate_global->__pyx_n_s_nwfl
#define __pyx_n_s_oldstmwt __pyx_mstate_global->__pyx_n_s_oldstmwt
#define __pyx_n_s_open_bolls_burr_weight __pyx_mstate_global->__pyx_n_s_open_bolls_burr_weight
#define __pyx_n_s_open_bolls_weight __pyx_mstate_global->__pyx_n_s_open_bolls_weight
#define __pyx_n_u_organic_matter __pyx_mstate_global->__pyx_n_u_organic_matter
#define __pyx_n_s_p __pyx_mstate_global->__pyx_n_s_p
#define __pyx_n_s_p1 __pyx_mstate_global->__pyx_n_s_p1
#define __pyx_n_s_p2 __pyx_mstate_global->__pyx_n_s_p2
#define __pyx_n_s_p3 __pyx_mstate_global->__pyx_n_s_p3
#define __pyx_n_s_p4 __pyx_mstate_global->__pyx_n_s_p4
#define __pyx_n_s_p5 __pyx_mstate_global->__pyx_n_s_p5
#define __pyx_n_s_p6 __pyx_mstate_global->__pyx_n_s_p6
#define __pyx_n_s_p7 __pyx_mstate_global->__pyx_n_s_p7
#define __pyx_n_s_perdmax __pyx_mstate_global->__pyx_n_s_perdmax
#define __pyx_n_s_petiole __pyx_mstate_global->__pyx_n_s_petiole
#define __pyx_n_s_petiole_nitrogen_concentration __pyx_mstate_global->__pyx_n_s_petiole_nitrogen_concentration
#define __pyx_n_s_petiole_weight __pyx_mstate_global->__pyx_n_s_petiole_weight
#define __pyx_n_s_pex __pyx_mstate_global->__pyx_n_s_pex
#define __pyx_n_s_phenology __pyx_mstate_global->__pyx_n_s_phenology
#define __pyx_n_s_pi __pyx_mstate_global->__pyx_n_s_pi
#define __pyx_n_s_pickle __pyx_mstate_global->__pyx_n_s_pickle
#define __pyx_n_s_plant_height __pyx_mstate_global->__pyx_n_s_plant_height
#define __pyx_n_s_plant_weight __pyx_mstate_global->__pyx_n_s_plant_weight
#define __pyx_kp_u_planting_date_or_emergence_date __pyx_mstate_global->__pyx_kp_u_planting_date_or_emergence_date
#define __pyx_n_s_pnetcor __pyx_mstate_global->__pyx_n_s_pnetcor
#define __pyx_n_s_pollination_switch __pyx_mstate_global->__pyx_n_s_pollination_switch
#define __pyx_n_s_potential_fruit_growth __pyx_mstate_global->__pyx_n_s_potential_fruit_growth
#define __pyx_n_s_potential_growth __pyx_mstate_global->__pyx_n_s_potential_growth
#define __pyx_n_s_potential_growth_for_leaf_area __pyx_mstate_global->__pyx_n_s_potential_growth_for_leaf_area
#define __pyx_n_s_potential_growth_for_leaf_weight __pyx_mstate_global->__pyx_n_s_potential_growth_for_leaf_weight
#define __pyx_n_s_potential_growth_for_petiole_wei __pyx_mstate_global->__pyx_n_s_potential_growth_for_petiole_wei
#define __pyx_n_s_potential_leaf_growth __pyx_mstate_global->__pyx_n_s_potential_leaf_growth
#define __pyx_n_s_pplant __pyx_mstate_global->__pyx_n_s_pplant
#define __pyx_n_s_prepare __pyx_mstate_global->__pyx_n_s_prepare
#define __pyx_n_s_psilim __pyx_mstate_global->__pyx_n_s_psilim
#define __pyx_n_s_pstand __pyx_mstate_global->__pyx_n_s_pstand
#define __pyx_n_s_ptnfac __pyx_mstate_global->__pyx_n_s_ptnfac
#define __pyx_n_s_pts __pyx_mstate_global->__pyx_n_s_pts
#define __pyx_n_s_pyx_PickleError __pyx_mstate_global->__pyx_n_s_pyx_PickleError
#define __pyx_n_s_pyx_checksum __pyx_mstate_global->__pyx_n_s_pyx_checksum
#define __pyx_n_s_pyx_result __pyx_mstate_global->__pyx_n_s_pyx_result
#define __pyx_n_s_pyx_state __pyx_mstate_global->__pyx_n_s_pyx_state
#define __pyx_n_s_pyx_type __pyx_mstate_global->__pyx_n_s_pyx_type
#define __pyx_n_s_pyx_unpickle_SoilInit __pyx_mstate_global->__pyx_n_s_pyx_unpickle_SoilInit
#define __pyx_n_s_pyx_vtable __pyx_mstate_global->__pyx_n_s_pyx_vtable
#define __pyx_n_s_qualname __pyx_mstate_global->__pyx_n_s_qualname
#define __pyx_n_s_radiation __pyx_mstate_global->__pyx_n_s_radiation
#define __pyx_n_u_radiation __pyx_mstate_global->__pyx_n_u_radiation
#define __pyx_n_s_radsum __pyx_mstate_global->__pyx_n_s_radsum
#define __pyx_n_u_rain __pyx_mstate_global->__pyx_n_u_rain
#define __pyx_n_s_rainToday __pyx_mstate_global->__pyx_n_s_rainToday
#define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
#define __pyx_n_s_rate __pyx_mstate_global->__pyx_n_s_rate
#define __pyx_n_s_ratebol __pyx_mstate_global->__pyx_n_s_ratebol
#define __pyx_n_s_ratebur __pyx_mstate_global->__pyx_n_s_ratebur
#define __pyx_n_s_ratesqr __pyx_mstate_global->__pyx_n_s_ratesqr
#define __pyx_n_u_ratio_implicit __pyx_mstate_global->__pyx_n_u_ratio_implicit
#define __pyx_n_s_rbmax __pyx_mstate_global->__pyx_n_s_rbmax
#define __pyx_n_s_read_input __pyx_mstate_global->__pyx_n_s_read_input
#define __pyx_n_s_reduce __pyx_mstate_global->__pyx_n_s_reduce
#define __pyx_n_s_reduce_cython __pyx_mstate_global->__pyx_n_s_reduce_cython
#define __pyx_n_s_reduce_ex __pyx_mstate_global->__pyx_n_s_reduce_ex
#define __pyx_n_s_ref_et __pyx_mstate_global->__pyx_n_s_ref_et
#define __pyx_n_s_replace __pyx_mstate_global->__pyx_n_s_replace
#define __pyx_n_s_result __pyx_mstate_global->__pyx_n_s_result
#define __pyx_n_s_root __pyx_mstate_global->__pyx_n_s_root
#define __pyx_n_s_root_nitrogen_concentration __pyx_mstate_global->__pyx_n_s_root_nitrogen_concentration
#define __pyx_n_s_row_space __pyx_mstate_global->__pyx_n_s_row_space
#define __pyx_n_s_rsubl __pyx_mstate_global->__pyx_n_s_rsubl
#define __pyx_n_s_rsubo __pyx_mstate_global->__pyx_n_s_rsubo
#define __pyx_n_s_run __pyx_mstate_global->__pyx_n_s_run
#define __pyx_n_s_runoff __pyx_mstate_global->__pyx_n_s_runoff
#define __pyx_n_s_runoffToday __pyx_mstate_global->__pyx_n_s_runoffToday
#define __pyx_n_u_sand __pyx_mstate_global->__pyx_n_u_sand
#define __pyx_n_u_saturated_hydraulic_conductivity __pyx_mstate_global->__pyx_n_u_saturated_hydraulic_conductivity
#define __pyx_n_s_sd __pyx_mstate_global->__pyx_n_s_sd
#define __pyx_n_s_second __pyx_mstate_global->__pyx_n_s_second
#define __pyx_n_s_seed_nitrogen __pyx_mstate_global->__pyx_n_s_seed_nitrogen
#define __pyx_n_s_seed_nitrogen_concentration __pyx_mstate_global->__pyx_n_s_seed_nitrogen_concentration
#define __pyx_n_s_self __pyx_mstate_global->__pyx_n_s_self
#define __pyx_kp_s_self___cannot_be_converted_to_a __pyx_mstate_global->__pyx_kp_s_self___cannot_be_converted_to_a
#define __pyx_kp_s_self_climate_cannot_be_converted __pyx_mstate_global->__pyx_kp_s_self_climate_cannot_be_converted
#define __pyx_n_s_set_name __pyx_mstate_global->__pyx_n_s_set_name
#define __pyx_n_s_setstate __pyx_mstate_global->__pyx_n_s_setstate
#define __pyx_n_s_setstate_cython __pyx_mstate_global->__pyx_n_s_setstate_cython
#define __pyx_n_s_shade __pyx_mstate_global->__pyx_n_s_shade
#define __pyx_n_s_simulate __pyx_mstate_global->__pyx_n_s_simulate
#define __pyx_n_s_simulate_this_day __pyx_mstate_global->__pyx_n_s_simulate_this_day
#define __pyx_n_s_sin __pyx_mstate_global->__pyx_n_s_sin
#define __pyx_n_s_sinb __pyx_mstate_global->__pyx_n_s_sinb
#define __pyx_n_s_smax __pyx_mstate_global->__pyx_n_s_smax
#define __pyx_n_s_smaxx __pyx_mstate_global->__pyx_n_s_smaxx
#define __pyx_n_s_soil __pyx_mstate_global->__pyx_n_s_soil
#define __pyx_n_s_solar_noon __pyx_mstate_global->__pyx_n_s_solar_noon
#define __pyx_n_u_solar_noon __pyx_mstate_global->__pyx_n_u_solar_noon
#define __pyx_n_s_sqrt __pyx_mstate_global->__pyx_n_s_sqrt
#define __pyx_n_s_square __pyx_mstate_global->__pyx_n_s_square
#define __pyx_n_s_square_nitrogen __pyx_mstate_global->__pyx_n_s_square_nitrogen
#define __pyx_n_s_square_nitrogen_concentration __pyx_mstate_global->__pyx_n_s_square_nitrogen_concentration
#define __pyx_n_s_square_weight __pyx_mstate_global->__pyx_n_s_square_weight
#define __pyx_kp_s_src__cotton2k_simulation_pyx __pyx_mstate_global->__pyx_kp_s_src__cotton2k_simulation_pyx
#define __pyx_n_s_stage __pyx_mstate_global->__pyx_n_s_stage
#define __pyx_n_s_start __pyx_mstate_global->__pyx_n_s_start
#define __pyx_n_s_start_date __pyx_mstate_global->__pyx_n_s_start_date
#define __pyx_n_s_state __pyx_mstate_global->__pyx_n_s_state
#define __pyx_n_s_state0 __pyx_mstate_global->__pyx_n_s_state0
#define __pyx_n_s_stemNRatio __pyx_mstate_global->__pyx_n_s_stemNRatio
#define __pyx_n_s_stem_nitrogen __pyx_mstate_global->__pyx_n_s_stem_nitrogen
#define __pyx_n_s_stem_weight __pyx_mstate_global->__pyx_n_s_stem_weight
#define __pyx_n_s_stemnew __pyx_mstate_global->__pyx_n_s_stemnew
#define __pyx_n_s_step __pyx_mstate_global->__pyx_n_s_step
#define __pyx_n_s_stop __pyx_mstate_global->__pyx_n_s_stop
#define __pyx_n_s_stress __pyx_mstate_global->__pyx_n_s_stress
#define __pyx_kp_s_stringsource __pyx_mstate_global->__pyx_kp_s_stringsource
#define __pyx_n_s_strptime __pyx_mstate_global->__pyx_n_s_strptime
#define __pyx_n_s_sumpdr __pyx_mstate_global->__pyx_n_s_sumpdr
#define __pyx_n_s_sumwk __pyx_mstate_global->__pyx_n_s_sumwk
#define __pyx_n_s_sunr __pyx_mstate_global->__pyx_n_s_sunr
#define __pyx_n_u_sunr __pyx_mstate_global->__pyx_n_u_sunr
#define __pyx_n_s_suns __pyx_mstate_global->__pyx_n_s_suns
#define __pyx_n_u_suns __pyx_mstate_global->__pyx_n_u_suns
#define __pyx_n_s_super __pyx_mstate_global->__pyx_n_s_super
#define __pyx_n_s_sw __pyx_mstate_global->__pyx_n_s_sw
#define __pyx_n_s_sw0 __pyx_mstate_global->__pyx_n_s_sw0
#define __pyx_n_s_sw1 __pyx_mstate_global->__pyx_n_s_sw1
#define __pyx_n_s_t1 __pyx_mstate_global->__pyx_n_s_t1
#define __pyx_n_s_t2 __pyx_mstate_global->__pyx_n_s_t2
#define __pyx_n_s_t3 __pyx_mstate_global->__pyx_n_s_t3
#define __pyx_n_s_tav __pyx_mstate_global->__pyx_n_s_tav
#define __pyx_n_s_tdday __pyx_mstate_global->__pyx_n_s_tdday
#define __pyx_n_s_temperature __pyx_mstate_global->__pyx_n_s_temperature
#define __pyx_n_s_temperature_on_leaf_growth_rate __pyx_mstate_global->__pyx_n_s_temperature_on_leaf_growth_rate
#define __pyx_n_s_test __pyx_mstate_global->__pyx_n_s_test
#define __pyx_n_s_tfrt __pyx_mstate_global->__pyx_n_s_tfrt
#define __pyx_n_u_theta __pyx_mstate_global->__pyx_n_u_theta
#define __pyx_n_s_ti __pyx_mstate_global->__pyx_n_s_ti
#define __pyx_n_s_time_to_new_fruiting_branch __pyx_mstate_global->__pyx_n_s_time_to_new_fruiting_branch
#define __pyx_n_s_timedelta __pyx_mstate_global->__pyx_n_s_timedelta
#define __pyx_n_s_tmpisr __pyx_mstate_global->__pyx_n_s_tmpisr
#define __pyx_n_u_tmpisr __pyx_mstate_global->__pyx_n_u_tmpisr
#define __pyx_n_s_total_required_nitrogen __pyx_mstate_global->__pyx_n_s_total_required_nitrogen
#define __pyx_n_u_type __pyx_mstate_global->__pyx_n_u_type
#define __pyx_n_s_u __pyx_mstate_global->__pyx_n_s_u
#define __pyx_n_s_update __pyx_mstate_global->__pyx_n_s_update
#define __pyx_n_u_urea __pyx_mstate_global->__pyx_n_u_urea
#define __pyx_n_s_use_setstate __pyx_mstate_global->__pyx_n_s_use_setstate
#define __pyx_n_s_vegetative_branch __pyx_mstate_global->__pyx_n_s_vegetative_branch
#define __pyx_n_s_vegetative_branches __pyx_mstate_global->__pyx_n_s_vegetative_branches
#define __pyx_n_s_version __pyx_mstate_global->__pyx_n_s_version
#define __pyx_n_s_vfrtbr __pyx_mstate_global->__pyx_n_s_vfrtbr
#define __pyx_n_s_voldstm __pyx_mstate_global->__pyx_n_s_voldstm
#define __pyx_n_s_vpheno __pyx_mstate_global->__pyx_n_s_vpheno
#define __pyx_n_s_vpnet __pyx_mstate_global->__pyx_n_s_vpnet
#define __pyx_n_s_vpotfrt __pyx_mstate_global->__pyx_n_s_vpotfrt
#define __pyx_n_s_vpotlf __pyx_mstate_global->__pyx_n_s_vpotlf
#define __pyx_n_s_vpvegb __pyx_mstate_global->__pyx_n_s_vpvegb
#define __pyx_n_s_vstrs __pyx_mstate_global->__pyx_n_s_vstrs
#define __pyx_n_u_water __pyx_mstate_global->__pyx_n_u_water
#define __pyx_n_s_water_stress __pyx_mstate_global->__pyx_n_s_water_stress
#define __pyx_n_s_water_stress_stem __pyx_mstate_global->__pyx_n_s_water_stress_stem
#define __pyx_n_s_wattsm __pyx_mstate_global->__pyx_n_s_wattsm
#define __pyx_n_s_wbmax __pyx_mstate_global->__pyx_n_s_wbmax
#define __pyx_n_s_weight __pyx_mstate_global->__pyx_n_s_weight
#define __pyx_n_s_weight_capable_uptake __pyx_mstate_global->__pyx_n_s_weight_capable_uptake
#define __pyx_n_s_wfdb __pyx_mstate_global->__pyx_n_s_wfdb
#define __pyx_n_u_wind __pyx_mstate_global->__pyx_n_u_wind
#define __pyx_n_s_wind_speed __pyx_mstate_global->__pyx_n_s_wind_speed
#define __pyx_n_s_wnytf __pyx_mstate_global->__pyx_n_s_wnytf
#define __pyx_n_s_wstrlf __pyx_mstate_global->__pyx_n_s_wstrlf
#define __pyx_n_s_wtfstrs __pyx_mstate_global->__pyx_n_s_wtfstrs
#define __pyx_n_s_xlat __pyx_mstate_global->__pyx_n_s_xlat
#define __pyx_n_s_year __pyx_mstate_global->__pyx_n_s_year
#define __pyx_n_s_z1 __pyx_mstate_global->__pyx_n_s_z1
#define __pyx_n_s_zero __pyx_mstate_global->__pyx_n_s_zero
#define __pyx_n_s_zint __pyx_mstate_global->__pyx_n_s_zint
#define __pyx_float_0_3 __pyx_mstate_global->__pyx_float_0_3
#define __pyx_float_0_5 __pyx_mstate_global->__pyx_float_0_5
#define __pyx_float_0_08 __pyx_mstate_global->__pyx_float_0_08
#define __pyx_float_0_0002 __pyx_mstate_global->__pyx_float_0_0002
#define __pyx_int_0 __pyx_mstate_global->__pyx_int_0
#define __pyx_int_1 __pyx_mstate_global->__pyx_int_1
#define __pyx_int_2 __pyx_mstate_global->__pyx_int_2
#define __pyx_int_4 __pyx_mstate_global->__pyx_int_4
#define __pyx_int_10 __pyx_mstate_global->__pyx_int_10
#define __pyx_int_12 __pyx_mstate_global->__pyx_int_12
#define __pyx_int_24 __pyx_mstate_global->__pyx_int_24
#define __pyx_int_30 __pyx_mstate_global->__pyx_int_30
#define __pyx_int_180 __pyx_mstate_global->__pyx_int_180
#define __pyx_int_1024 __pyx_mstate_global->__pyx_int_1024
#define __pyx_int_1000000 __pyx_mstate_global->__pyx_int_1000000
#define __pyx_int_139140702 __pyx_mstate_global->__pyx_int_139140702
#define __pyx_tuple_ __pyx_mstate_global->__pyx_tuple_
#define __pyx_tuple__2 __pyx_mstate_global->__pyx_tuple__2
#define __pyx_tuple__3 __pyx_mstate_global->__pyx_tuple__3
#define __pyx_tuple__4 __pyx_mstate_global->__pyx_tuple__4
#define __pyx_tuple__5 __pyx_mstate_global->__pyx_tuple__5
#define __pyx_tuple__6 __pyx_mstate_global->__pyx_tuple__6
#define __pyx_tuple__7 __pyx_mstate_global->__pyx_tuple__7
#define __pyx_tuple__9 __pyx_mstate_global->__pyx_tuple__9
#define __pyx_tuple__10 __pyx_mstate_global->__pyx_tuple__10
#define __pyx_tuple__11 __pyx_mstate_global->__pyx_tuple__11
#define __pyx_tuple__12 __pyx_mstate_global->__pyx_tuple__12
#define __pyx_tuple__13 __pyx_mstate_global->__pyx_tuple__13
#define __pyx_tuple__14 __pyx_mstate_global->__pyx_tuple__14
#define __pyx_tuple__15 __pyx_mstate_global->__pyx_tuple__15
#define __pyx_tuple__16 __pyx_mstate_global->__pyx_tuple__16
#define __pyx_tuple__17 __pyx_mstate_global->__pyx_tuple__17
#define __pyx_tuple__18 __pyx_mstate_global->__pyx_tuple__18
#define __pyx_tuple__19 __pyx_mstate_global->__pyx_tuple__19
#define __pyx_tuple__20 __pyx_mstate_global->__pyx_tuple__20
#define __pyx_tuple__21 __pyx_mstate_global->__pyx_tuple__21
#define __pyx_tuple__22 __pyx_mstate_global->__pyx_tuple__22
#define __pyx_tuple__23 __pyx_mstate_global->__pyx_tuple__23
#define __pyx_tuple__24 __pyx_mstate_global->__pyx_tuple__24
#define __pyx_tuple__25 __pyx_mstate_global->__pyx_tuple__25
#define __pyx_tuple__26 __pyx_mstate_global->__pyx_tuple__26
#define __pyx_tuple__27 __pyx_mstate_global->__pyx_tuple__27
#define __pyx_tuple__28 __pyx_mstate_global->__pyx_tuple__28
#define __pyx_tuple__29 __pyx_mstate_global->__pyx_tuple__29
#define __pyx_tuple__30 __pyx_mstate_global->__pyx_tuple__30
#define __pyx_tuple__31 __pyx_mstate_global->__pyx_tuple__31
#define __pyx_tuple__32 __pyx_mstate_global->__pyx_tuple__32
#define __pyx_tuple__33 __pyx_mstate_global->__pyx_tuple__33
#define __pyx_tuple__34 __pyx_mstate_global->__pyx_tuple__34
#define __pyx_tuple__35 __pyx_mstate_global->__pyx_tuple__35
#define __pyx_tuple__36 __pyx_mstate_global->__pyx_tuple__36
#define __pyx_tuple__37 __pyx_mstate_global->__pyx_tuple__37
#define __pyx_tuple__38 __pyx_mstate_global->__pyx_tuple__38
#define __pyx_tuple__39 __pyx_mstate_global->__pyx_tuple__39
#define __pyx_tuple__40 __pyx_mstate_global->__pyx_tuple__40
#define __pyx_tuple__41 __pyx_mstate_global->__pyx_tuple__41
#define __pyx_tuple__42 __pyx_mstate_global->__pyx_tuple__42
#define __pyx_tuple__43 __pyx_mstate_global->__pyx_tuple__43
#define __pyx_tuple__44 __pyx_mstate_global->__pyx_tuple__44
#define __pyx_tuple__45 __pyx_mstate_global->__pyx_tuple__45
#define __pyx_tuple__46 __pyx_mstate_global->__pyx_tuple__46
#define __pyx_tuple__47 __pyx_mstate_global->__pyx_tuple__47
#define __pyx_tuple__48 __pyx_mstate_global->__pyx_tuple__48
#define __pyx_tuple__49 __pyx_mstate_global->__pyx_tuple__49
#define __pyx_tuple__50 __pyx_mstate_global->__pyx_tuple__50
#define __pyx_tuple__51 __pyx_mstate_global->__pyx_tuple__51
#define __pyx_tuple__52 __pyx_mstate_global->__pyx_tuple__52
#define __pyx_tuple__53 __pyx_mstate_global->__pyx_tuple__53
#define __pyx_tuple__54 __pyx_mstate_global->__pyx_tuple__54
#define __pyx_tuple__55 __pyx_mstate_global->__pyx_tuple__55
#define __pyx_tuple__56 __pyx_mstate_global->__pyx_tuple__56
#define __pyx_tuple__57 __pyx_mstate_global->__pyx_tuple__57
#define __pyx_tuple__58 __pyx_mstate_global->__pyx_tuple__58
#define __pyx_tuple__59 __pyx_mstate_global->__pyx_tuple__59
#define __pyx_tuple__60 __pyx_mstate_global->__pyx_tuple__60
#define __pyx_tuple__61 __pyx_mstate_global->__pyx_tuple__61
#define __pyx_tuple__62 __pyx_mstate_global->__pyx_tuple__62
#define __pyx_tuple__63 __pyx_mstate_global->__pyx_tuple__63
#define __pyx_tuple__64 __pyx_mstate_global->__pyx_tuple__64
#define __pyx_tuple__65 __pyx_mstate_global->__pyx_tuple__65
#define __pyx_tuple__66 __pyx_mstate_global->__pyx_tuple__66
#define __pyx_tuple__67 __pyx_mstate_global->__pyx_tuple__67
#define __pyx_tuple__68 __pyx_mstate_global->__pyx_tuple__68
#define __pyx_tuple__69 __pyx_mstate_global->__pyx_tuple__69
#define __pyx_tuple__70 __pyx_mstate_global->__pyx_tuple__70
#define __pyx_tuple__71 __pyx_mstate_global->__pyx_tuple__71
#define __pyx_tuple__72 __pyx_mstate_global->__pyx_tuple__72
#define __pyx_tuple__73 __pyx_mstate_global->__pyx_tuple__73
#define __pyx_tuple__74 __pyx_mstate_global->__pyx_tuple__74
#define __pyx_tuple__75 __pyx_mstate_global->__pyx_tuple__75
#define __pyx_tuple__76 __pyx_mstate_global->__pyx_tuple__76
#define __pyx_tuple__77 __pyx_mstate_global->__pyx_tuple__77
#define __pyx_tuple__78 __pyx_mstate_global->__pyx_tuple__78
#define __pyx_tuple__79 __pyx_mstate_global->__pyx_tuple__79
#define __pyx_tuple__80 __pyx_mstate_global->__pyx_tuple__80
#define __pyx_tuple__81 __pyx_mstate_global->__pyx_tuple__81
#define __pyx_tuple__82 __pyx_mstate_global->__pyx_tuple__82
#define __pyx_tuple__83 __pyx_mstate_global->__pyx_tuple__83
#define __pyx_tuple__84 __pyx_mstate_global->__pyx_tuple__84
#define __pyx_tuple__85 __pyx_mstate_global->__pyx_tuple__85
#define __pyx_tuple__86 __pyx_mstate_global->__pyx_tuple__86
#define __pyx_tuple__87 __pyx_mstate_global->__pyx_tuple__87
#define __pyx_tuple__88 __pyx_mstate_global->__pyx_tuple__88
#define __pyx_tuple__89 __pyx_mstate_global->__pyx_tuple__89
#define __pyx_tuple__90 __pyx_mstate_global->__pyx_tuple__90
#define __pyx_tuple__91 __pyx_mstate_global->__pyx_tuple__91
#define __pyx_tuple__92 __pyx_mstate_global->__pyx_tuple__92
#define __pyx_tuple__93 __pyx_mstate_global->__pyx_tuple__93
#define __pyx_tuple__94 __pyx_mstate_global->__pyx_tuple__94
#define __pyx_tuple__95 __pyx_mstate_global->__pyx_tuple__95
#define __pyx_tuple__96 __pyx_mstate_global->__pyx_tuple__96
#define __pyx_tuple__97 __pyx_mstate_global->__pyx_tuple__97
#define __pyx_tuple__98 __pyx_mstate_global->__pyx_tuple__98
#define __pyx_tuple__99 __pyx_mstate_global->__pyx_tuple__99
#define __pyx_tuple__100 __pyx_mstate_global->__pyx_tuple__100
#define __pyx_tuple__101 __pyx_mstate_global->__pyx_tuple__101
#define __pyx_tuple__102 __pyx_mstate_global->__pyx_tuple__102
#define __pyx_tuple__103 __pyx_mstate_global->__pyx_tuple__103
#define __pyx_tuple__104 __pyx_mstate_global->__pyx_tuple__104
#define __pyx_tuple__105 __pyx_mstate_global->__pyx_tuple__105
#define __pyx_tuple__106 __pyx_mstate_global->__pyx_tuple__106
#define __pyx_tuple__107 __pyx_mstate_global->__pyx_tuple__107
#define __pyx_tuple__108 __pyx_mstate_global->__pyx_tuple__108
#define __pyx_tuple__109 __pyx_mstate_global->__pyx_tuple__109
#define __pyx_tuple__110 __pyx_mstate_global->__pyx_tuple__110
#define __pyx_tuple__111 __pyx_mstate_global->__pyx_tuple__111
#define __pyx_tuple__112 __pyx_mstate_global->__pyx_tuple__112
#define __pyx_tuple__113 __pyx_mstate_global->__pyx_tuple__113
#define __pyx_tuple__114 __pyx_mstate_global->__pyx_tuple__114
#define __pyx_tuple__115 __pyx_mstate_global->__pyx_tuple__115
#define __pyx_tuple__116 __pyx_mstate_global->__pyx_tuple__116
#define __pyx_tuple__117 __pyx_mstate_global->__pyx_tuple__117
#define __pyx_tuple__118 __pyx_mstate_global->__pyx_tuple__118
#define __pyx_tuple__119 __pyx_mstate_global->__pyx_tuple__119
#define __pyx_tuple__120 __pyx_mstate_global->__pyx_tuple__120
#define __pyx_tuple__121 __pyx_mstate_global->__pyx_tuple__121
#define __pyx_tuple__122 __pyx_mstate_global->__pyx_tuple__122
#define __pyx_tuple__123 __pyx_mstate_global->__pyx_tuple__123
#define __pyx_tuple__124 __pyx_mstate_global->__pyx_tuple__124
#define __pyx_tuple__125 __pyx_mstate_global->__pyx_tuple__125
#define __pyx_tuple__126 __pyx_mstate_global->__pyx_tuple__126
#define __pyx_tuple__127 __pyx_mstate_global->__pyx_tuple__127
#define __pyx_tuple__128 __pyx_mstate_global->__pyx_tuple__128
#define __pyx_tuple__129 __pyx_mstate_global->__pyx_tuple__129
#define __pyx_tuple__131 __pyx_mstate_global->__pyx_tuple__131
#define __pyx_tuple__133 __pyx_mstate_global->__pyx_tuple__133
#define __pyx_tuple__135 __pyx_mstate_global->__pyx_tuple__135
#define __pyx_tuple__137 __pyx_mstate_global->__pyx_tuple__137
#define __pyx_tuple__139 __pyx_mstate_global->__pyx_tuple__139
#define __pyx_tuple__141 __pyx_mstate_global->__pyx_tuple__141
#define __pyx_tuple__143 __pyx_mstate_global->__pyx_tuple__143
#define __pyx_tuple__145 __pyx_mstate_global->__pyx_tuple__145
#define __pyx_tuple__147 __pyx_mstate_global->__pyx_tuple__147
#define __pyx_tuple__149 __pyx_mstate_global->__pyx_tuple__149
#define __pyx_tuple__151 __pyx_mstate_global->__pyx_tuple__151
#define __pyx_tuple__153 __pyx_mstate_global->__pyx_tuple__153
#define __pyx_tuple__155 __pyx_mstate_global->__pyx_tuple__155
#define __pyx_tuple__157 __pyx_mstate_global->__pyx_tuple__157
#define __pyx_tuple__159 __pyx_mstate_global->__pyx_tuple__159
#define __pyx_tuple__161 __pyx_mstate_global->__pyx_tuple__161
#define __pyx_tuple__163 __pyx_mstate_global->__pyx_tuple__163
#define __pyx_tuple__165 __pyx_mstate_global->__pyx_tuple__165
#define __pyx_tuple__167 __pyx_mstate_global->__pyx_tuple__167
#define __pyx_tuple__169 __pyx_mstate_global->__pyx_tuple__169
#define __pyx_tuple__171 __pyx_mstate_global->__pyx_tuple__171
#define __pyx_tuple__173 __pyx_mstate_global->__pyx_tuple__173
#define __pyx_tuple__175 __pyx_mstate_global->__pyx_tuple__175
#define __pyx_tuple__177 __pyx_mstate_global->__pyx_tuple__177
#define __pyx_tuple__179 __pyx_mstate_global->__pyx_tuple__179
#define __pyx_tuple__181 __pyx_mstate_global->__pyx_tuple__181
#define __pyx_tuple__183 __pyx_mstate_global->__pyx_tuple__183
#define __pyx_tuple__185 __pyx_mstate_global->__pyx_tuple__185
#define __pyx_tuple__187 __pyx_mstate_global->__pyx_tuple__187
#define __pyx_tuple__189 __pyx_mstate_global->__pyx_tuple__189
#define __pyx_tuple__191 __pyx_mstate_global->__pyx_tuple__191
#define __pyx_tuple__193 __pyx_mstate_global->__pyx_tuple__193
#define __pyx_tuple__195 __pyx_mstate_global->__pyx_tuple__195
#define __pyx_tuple__197 __pyx_mstate_global->__pyx_tuple__197
#define __pyx_tuple__199 __pyx_mstate_global->__pyx_tuple__199
#define __pyx_tuple__201 __pyx_mstate_global->__pyx_tuple__201
#define __pyx_tuple__203 __pyx_mstate_global->__pyx_tuple__203
#define __pyx_tuple__205 __pyx_mstate_global->__pyx_tuple__205
#define __pyx_tuple__207 __pyx_mstate_global->__pyx_tuple__207
#define __pyx_tuple__209 __pyx_mstate_global->__pyx_tuple__209
#define __pyx_tuple__211 __pyx_mstate_global->__pyx_tuple__211
#define __pyx_codeobj__130 __pyx_mstate_global->__pyx_codeobj__130
#define __pyx_codeobj__132 __pyx_mstate_global->__pyx_codeobj__132
#define __pyx_codeobj__134 __pyx_mstate_global->__pyx_codeobj__134
#define __pyx_codeobj__136 __pyx_mstate_global->__pyx_codeobj__136
#define __pyx_codeobj__138 __pyx_mstate_global->__pyx_codeobj__138
#define __pyx_codeobj__140 __pyx_mstate_global->__pyx_codeobj__140
#define __pyx_codeobj__142 __pyx_mstate_global->__pyx_codeobj__142
#define __pyx_codeobj__144 __pyx_mstate_global->__pyx_codeobj__144
#define __pyx_codeobj__146 __pyx_mstate_global->__pyx_codeobj__146
#define __pyx_codeobj__148 __pyx_mstate_global->__pyx_codeobj__148
#define __pyx_codeobj__150 __pyx_mstate_global->__pyx_codeobj__150
#define __pyx_codeobj__152 __pyx_mstate_global->__pyx_codeobj__152
#define __pyx_codeobj__154 __pyx_mstate_global->__pyx_codeobj__154
#define __pyx_codeobj__156 __pyx_mstate_global->__pyx_codeobj__156
#define __pyx_codeobj__158 __pyx_mstate_global->__pyx_codeobj__158
#define __pyx_codeobj__160 __pyx_mstate_global->__pyx_codeobj__160
#define __pyx_codeobj__162 __pyx_mstate_global->__pyx_codeobj__162
#define __pyx_codeobj__164 __pyx_mstate_global->__pyx_codeobj__164
#define __pyx_codeobj__166 __pyx_mstate_global->__pyx_codeobj__166
#define __pyx_codeobj__168 __pyx_mstate_global->__pyx_codeobj__168
#define __pyx_codeobj__170 __pyx_mstate_global->__pyx_codeobj__170
#define __pyx_codeobj__172 __pyx_mstate_global->__pyx_codeobj__172
#define __pyx_codeobj__174 __pyx_mstate_global->__pyx_codeobj__174
#define __pyx_codeobj__176 __pyx_mstate_global->__pyx_codeobj__176
#define __pyx_codeobj__178 __pyx_mstate_global->__pyx_codeobj__178
#define __pyx_codeobj__180 __pyx_mstate_global->__pyx_codeobj__180
#define __pyx_codeobj__182 __pyx_mstate_global->__pyx_codeobj__182
#define __pyx_codeobj__184 __pyx_mstate_global->__pyx_codeobj__184
#define __pyx_codeobj__186 __pyx_mstate_global->__pyx_codeobj__186
#define __pyx_codeobj__188 __pyx_mstate_global->__pyx_codeobj__188
#define __pyx_codeobj__190 __pyx_mstate_global->__pyx_codeobj__190
#define __pyx_codeobj__192 __pyx_mstate_global->__pyx_codeobj__192
#define __pyx_codeobj__194 __pyx_mstate_global->__pyx_codeobj__194
#define __pyx_codeobj__196 __pyx_mstate_global->__pyx_codeobj__196
#define __pyx_codeobj__198 __pyx_mstate_global->__pyx_codeobj__198
#define __pyx_codeobj__200 __pyx_mstate_global->__pyx_codeobj__200
#define __pyx_codeobj__202 __pyx_mstate_global->__pyx_codeobj__202
#define __pyx_codeobj__204 __pyx_mstate_global->__pyx_codeobj__204
#define __pyx_codeobj__206 __pyx_mstate_global->__pyx_codeobj__206
#define __pyx_codeobj__208 __pyx_mstate_global->__pyx_codeobj__208
#define __pyx_codeobj__210 __pyx_mstate_global->__pyx_codeobj__210
#define __pyx_codeobj__212 __pyx_mstate_global->__pyx_codeobj__212
#endif
/* #### Code section: module_code ### */

/* "_cotton2k/simulation.pyx":54
 * 
 * 
 * cdef CopyState(cSimulation & sim, uint32_t i):             # <<<<<<<<<<<<<<
 *     cdef cState state = sim.states[i]
 *     state.daynum = sim.day_start + i + 1
 */

static PyObject *__pyx_f_9_cotton2k_10simulation_CopyState(Simulation &__pyx_v_sim, uint32_t __pyx_v_i) {
  State __pyx_v_state;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("CopyState", 0);

  /* "_cotton2k/simulation.pyx":55
 * 
 * cdef CopyState(cSimulation & sim, uint32_t i):
 *     cdef cState state = sim.states[i]             # <<<<<<<<<<<<<<
 *     state.daynum = sim.day_start + i + 1
 *     sim.states[i + 1] = state
 */
  __pyx_v_state = (__pyx_v_sim.states[__pyx_v_i]);

  /* "_cotton2k/simulation.pyx":56
 * cdef CopyState(cSimulation & sim, uint32_t i):
 *     cdef cState state = sim.states[i]
 *     state.daynum = sim.day_start + i + 1             # <<<<<<<<<<<<<<
 *     sim.states[i + 1] = state
 * 
 */
  __pyx_v_state.daynum = ((__pyx_v_sim.day_start + __pyx_v_i) + 1);

  /* "_cotton2k/simulation.pyx":57
 *     cdef cState state = sim.states[i]
 *     state.daynum = sim.day_start + i + 1
 *     sim.states[i + 1] = state             # <<<<<<<<<<<<<<
 * 
 * cdef void initialize_switch(cSimulation & sim):
 */
  (__pyx_v_sim.states[(__pyx_v_i + 1)]) = __pyx_v_state;

  /* "_cotton2k/simulation.pyx":54
 * 
 * 
 * cdef CopyState(cSimulation & sim, uint32_t i):             # <<<<<<<<<<<<<<
 *     cdef cState state = sim.states[i]
 *     state.daynum = sim.day_start + i + 1
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":59
 *     sim.states[i + 1] = state
 * 
 * cdef void initialize_switch(cSimulation & sim):             # <<<<<<<<<<<<<<
 *     global isw
 *     cdef cState state0 = sim.states[0]
 */

static void __pyx_f_9_cotton2k_10simulation_initialize_switch(Simulation &__pyx_v_sim) {
  CYTHON_UNUSED State __pyx_v_state0;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("initialize_switch", 0);

  /* "_cotton2k/simulation.pyx":61
 * cdef void initialize_switch(cSimulation & sim):
 *     global isw
 *     cdef cState state0 = sim.states[0]             # <<<<<<<<<<<<<<
 *     # If the date of emergence has not been given, emergence will be simulated
 *     # by the model. In this case, isw = 0, and a check is performed to make
 */
  __pyx_v_state0 = (__pyx_v_sim.states[0]);

  /* "_cotton2k/simulation.pyx":65
 *     # by the model. In this case, isw = 0, and a check is performed to make
 *     # sure that the date of planting has been given.
 *     if sim.day_emerge <= 0:             # <<<<<<<<<<<<<<
 *         if sim.day_plant <= 0:
 *             raise Exception(
 */
  __pyx_t_1 = ((__pyx_v_sim.day_emerge <= 0) != 0);
  if (__pyx_t_1) {

    /* "_cotton2k/simulation.pyx":66
 *     # sure that the date of planting has been given.
 *     if sim.day_emerge <= 0:
 *         if sim.day_plant <= 0:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 " planting date or emergence date must be given in the profile file !!")
 */
    __pyx_t_1 = ((__pyx_v_sim.day_plant <= 0) != 0);
    if (unlikely(__pyx_t_1)) {

      /* "_cotton2k/simulation.pyx":67
 *     if sim.day_emerge <= 0:
 *         if sim.day_plant <= 0:
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 " planting date or emergence date must be given in the profile file !!")
 *         isw = 0
 */
      __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])), __pyx_tuple_, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 67, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_Raise(__pyx_t_2, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __PYX_ERR(0, 67, __pyx_L1_error)

      /* "_cotton2k/simulation.pyx":66
 *     # sure that the date of planting has been given.
 *     if sim.day_emerge <= 0:
 *         if sim.day_plant <= 0:             # <<<<<<<<<<<<<<
 *             raise Exception(
 *                 " planting date or emergence date must be given in the profile file !!")
 */
    }

    /* "_cotton2k/simulation.pyx":69
 *             raise Exception(
 *                 " planting date or emergence date must be given in the profile file !!")
 *         isw = 0             # <<<<<<<<<<<<<<
 *     # If the date of emergence has been given in the input: isw = 1 if
 *     # simulation starts before emergence, or isw = 2 if simulation starts at emergence.
 */
    isw = 0;

    /* "_cotton2k/simulation.pyx":65
 *     # by the model. In this case, isw = 0, and a check is performed to make
 *     # sure that the date of planting has been given.
 *     if sim.day_emerge <= 0:             # <<<<<<<<<<<<<<
 *         if sim.day_plant <= 0:
 *             raise Exception(
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":72
 *     # If the date of emergence has been given in the input: isw = 1 if
 *     # simulation starts before emergence, or isw = 2 if simulation starts at emergence.
 *     elif sim.day_emerge > sim.day_start:             # <<<<<<<<<<<<<<
 *         isw = 1
 *     else:
 */
  __pyx_t_1 = ((__pyx_v_sim.day_emerge > __pyx_v_sim.day_start) != 0);
  if (__pyx_t_1) {

    /* "_cotton2k/simulation.pyx":73
 *     # simulation starts before emergence, or isw = 2 if simulation starts at emergence.
 *     elif sim.day_emerge > sim.day_start:
 *         isw = 1             # <<<<<<<<<<<<<<
 *     else:
 *         isw = 2
 */
    isw = 1;

    /* "_cotton2k/simulation.pyx":72
 *     # If the date of emergence has been given in the input: isw = 1 if
 *     # simulation starts before emergence, or isw = 2 if simulation starts at emergence.
 *     elif sim.day_emerge > sim.day_start:             # <<<<<<<<<<<<<<
 *         isw = 1
 *     else:
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":75
 *         isw = 1
 *     else:
 *         isw = 2             # <<<<<<<<<<<<<<
 *         sim.states[0].kday = 1
 * 
 */
  /*else*/ {
    isw = 2;

    /* "_cotton2k/simulation.pyx":76
 *     else:
 *         isw = 2
 *         sim.states[0].kday = 1             # <<<<<<<<<<<<<<
 * 
 * cdef class SoilInit:
 */
    (__pyx_v_sim.states[0]).kday = 1;
  }
  __pyx_L3:;

  /* "_cotton2k/simulation.pyx":59
 *     sim.states[i + 1] = state
 * 
 * cdef void initialize_switch(cSimulation & sim):             # <<<<<<<<<<<<<<
 *     global isw
 *     cdef cState state0 = sim.states[0]
 */

  /* function exit code */
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_WriteUnraisable("_cotton2k.simulation.initialize_switch", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
}

/* "_cotton2k/simulation.pyx":80
 * cdef class SoilInit:
 *     cdef unsigned int number_of_layers
 *     def __init__(self, initial, hydrology, layer_depth=None):             # <<<<<<<<<<<<<<
 *         if layer_depth is not None:
 *             self.layer_depth = layer_depth
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_initial = 0;
  PyObject *__pyx_v_hydrology = 0;
  PyObject *__pyx_v_layer_depth = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_initial,&__pyx_n_s_hydrology,&__pyx_n_s_layer_depth,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_initial,&__pyx_n_s_hydrology,&__pyx_n_s_layer_depth,0};
    #endif
    PyObject* values[3] = {0,0,0};
    values[2] = ((PyObject *)Py_None);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_initial)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_hydrology)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, 1); __PYX_ERR(0, 80, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_layer_depth);
          if (value) { values[2] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 80, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 80, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_VARARGS(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_initial = values[0];
    __pyx_v_hydrology = values[1];
    __pyx_v_layer_depth = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 2, 3, __pyx_nargs); __PYX_ERR(0, 80, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit___init__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self), __pyx_v_initial, __pyx_v_hydrology, __pyx_v_layer_depth);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8SoilInit___init__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_initial, PyObject *__pyx_v_hydrology, PyObject *__pyx_v_layer_depth) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "_cotton2k/simulation.pyx":81
 *     cdef unsigned int number_of_layers
 *     def __init__(self, initial, hydrology, layer_depth=None):
 *         if layer_depth is not None:             # <<<<<<<<<<<<<<
 *             self.layer_depth = layer_depth
 *         self.initial = initial
 */
  __pyx_t_1 = (__pyx_v_layer_depth != Py_None);
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":82
 *     def __init__(self, initial, hydrology, layer_depth=None):
 *         if layer_depth is not None:
 *             self.layer_depth = layer_depth             # <<<<<<<<<<<<<<
 *         self.initial = initial
 *         self.hydrology = hydrology
 */
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_layer_depth, __pyx_v_layer_depth) < 0) __PYX_ERR(0, 82, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":81
 *     cdef unsigned int number_of_layers
 *     def __init__(self, initial, hydrology, layer_depth=None):
 *         if layer_depth is not None:             # <<<<<<<<<<<<<<
 *             self.layer_depth = layer_depth
 *         self.initial = initial
 */
  }

  /* "_cotton2k/simulation.pyx":83
 *         if layer_depth is not None:
 *             self.layer_depth = layer_depth
 *         self.initial = initial             # <<<<<<<<<<<<<<
 *         self.hydrology = hydrology
 *         self.number_of_layers = len(hydrology["layers"])
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_initial, __pyx_v_initial) < 0) __PYX_ERR(0, 83, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":84
 *             self.layer_depth = layer_depth
 *         self.initial = initial
 *         self.hydrology = hydrology             # <<<<<<<<<<<<<<
 *         self.number_of_layers = len(hydrology["layers"])
 * 
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_hydrology, __pyx_v_hydrology) < 0) __PYX_ERR(0, 84, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":85
 *         self.initial = initial
 *         self.hydrology = hydrology
 *         self.number_of_layers = len(hydrology["layers"])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_hydrology, __pyx_n_u_layers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyObject_Length(__pyx_t_3); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(0, 85, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_self->number_of_layers = __pyx_t_4;

  /* "_cotton2k/simulation.pyx":80
 * cdef class SoilInit:
 *     cdef unsigned int number_of_layers
 *     def __init__(self, initial, hydrology, layer_depth=None):             # <<<<<<<<<<<<<<
 *         if layer_depth is not None:
 *             self.layer_depth = layer_depth
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":87
 *         self.number_of_layers = len(hydrology["layers"])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def lyrsol(self):
 *         return self.number_of_layers
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_6lyrsol_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_6lyrsol_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_6lyrsol___get__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_6lyrsol___get__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":89
 *     @property
 *     def lyrsol(self):
 *         return self.number_of_layers             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->number_of_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 89, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":87
 *         self.number_of_layers = len(hydrology["layers"])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def lyrsol(self):
 *         return self.number_of_layers
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.lyrsol.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":91
 *         return self.number_of_layers
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def layer_depth(self):
 *         return LayerDepth
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth___get__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":93
 *     @property
 *     def layer_depth(self):
 *         return LayerDepth             # <<<<<<<<<<<<<<
 * 
 *     @layer_depth.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(LayerDepth); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 93, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":91
 *         return self.number_of_layers
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def layer_depth(self):
 *         return LayerDepth
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.layer_depth.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":95
 *         return LayerDepth
 * 
 *     @layer_depth.setter             # <<<<<<<<<<<<<<
 *     def layer_depth(self, value):
 *         global LayerDepth
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_11layer_depth_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":98
 *     def layer_depth(self, value):
 *         global LayerDepth
 *         LayerDepth = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 98, __pyx_L1_error)
  LayerDepth = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":95
 *         return LayerDepth
 * 
 *     @layer_depth.setter             # <<<<<<<<<<<<<<
 *     def layer_depth(self, value):
 *         global LayerDepth
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.layer_depth.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":100
 *         LayerDepth = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def initial(self):
 *         return [
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial___get__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self) {
  long __pyx_7genexpr__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":102
 *     @property
 *     def initial(self):
 *         return [             # <<<<<<<<<<<<<<
 *             {
 *                 "ammonium_nitrogen": rnnh4[i],
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 102, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "_cotton2k/simulation.pyx":108
 *                 "organic_matter": oma[i],
 *                 "water": h2oint[i]
 *             } for i in range(14)             # <<<<<<<<<<<<<<
 *         ]
 * 
 */
    for (__pyx_t_2 = 0; __pyx_t_2 < 14; __pyx_t_2+=1) {
      __pyx_7genexpr__pyx_v_i = __pyx_t_2;

      /* "_cotton2k/simulation.pyx":104
 *         return [
 *             {
 *                 "ammonium_nitrogen": rnnh4[i],             # <<<<<<<<<<<<<<
 *                 "nitrate_nitrogen": rnno3[i],
 *                 "organic_matter": oma[i],
 */
      __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_4 = PyFloat_FromDouble((rnnh4[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_ammonium_nitrogen, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":105
 *             {
 *                 "ammonium_nitrogen": rnnh4[i],
 *                 "nitrate_nitrogen": rnno3[i],             # <<<<<<<<<<<<<<
 *                 "organic_matter": oma[i],
 *                 "water": h2oint[i]
 */
      __pyx_t_4 = PyFloat_FromDouble((rnno3[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 105, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_nitrate_nitrogen, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":106
 *                 "ammonium_nitrogen": rnnh4[i],
 *                 "nitrate_nitrogen": rnno3[i],
 *                 "organic_matter": oma[i],             # <<<<<<<<<<<<<<
 *                 "water": h2oint[i]
 *             } for i in range(14)
 */
      __pyx_t_4 = PyFloat_FromDouble((oma[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 106, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_organic_matter, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":107
 *                 "nitrate_nitrogen": rnno3[i],
 *                 "organic_matter": oma[i],
 *                 "water": h2oint[i]             # <<<<<<<<<<<<<<
 *             } for i in range(14)
 *         ]
 */
      __pyx_t_4 = PyFloat_FromDouble((h2oint[__pyx_7genexpr__pyx_v_i])); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 107, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      if (PyDict_SetItem(__pyx_t_3, __pyx_n_u_water, __pyx_t_4) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 102, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":100
 *         LayerDepth = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def initial(self):
 *         return [
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.initial.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":111
 *         ]
 * 
 *     @initial.setter             # <<<<<<<<<<<<<<
 *     def initial(self, init_soil):
 *         for i, layer in enumerate(init_soil):
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_init_soil); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_init_soil) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self), ((PyObject *)__pyx_v_init_soil));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_7initial_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_init_soil) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_layer = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":113
 *     @initial.setter
 *     def initial(self, init_soil):
 *         for i, layer in enumerate(init_soil):             # <<<<<<<<<<<<<<
 *             rnnh4[i] = layer["ammonium_nitrogen"]
 *             rnno3[i] = layer["nitrate_nitrogen"]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_init_soil)) || PyTuple_CheckExact(__pyx_v_init_soil)) {
    __pyx_t_2 = __pyx_v_init_soil; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_init_soil); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 113, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 113, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 113, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 113, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_layer, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 113, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":114
 *     def initial(self, init_soil):
 *         for i, layer in enumerate(init_soil):
 *             rnnh4[i] = layer["ammonium_nitrogen"]             # <<<<<<<<<<<<<<
 *             rnno3[i] = layer["nitrate_nitrogen"]
 *             oma[i] = layer["organic_matter"]
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_ammonium_nitrogen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 114, __pyx_L1_error)
    (rnnh4[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":115
 *         for i, layer in enumerate(init_soil):
 *             rnnh4[i] = layer["ammonium_nitrogen"]
 *             rnno3[i] = layer["nitrate_nitrogen"]             # <<<<<<<<<<<<<<
 *             oma[i] = layer["organic_matter"]
 *             h2oint[i] = layer["water"]
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_nitrate_nitrogen); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 115, __pyx_L1_error)
    (rnno3[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":116
 *             rnnh4[i] = layer["ammonium_nitrogen"]
 *             rnno3[i] = layer["nitrate_nitrogen"]
 *             oma[i] = layer["organic_matter"]             # <<<<<<<<<<<<<<
 *             h2oint[i] = layer["water"]
 * 
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_organic_matter); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 116, __pyx_L1_error)
    (oma[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":117
 *             rnno3[i] = layer["nitrate_nitrogen"]
 *             oma[i] = layer["organic_matter"]
 *             h2oint[i] = layer["water"]             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_5 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_water); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 117, __pyx_L1_error)
    (h2oint[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":113
 *     @initial.setter
 *     def initial(self, init_soil):
 *         for i, layer in enumerate(init_soil):             # <<<<<<<<<<<<<<
 *             rnnh4[i] = layer["ammonium_nitrogen"]
 *             rnno3[i] = layer["nitrate_nitrogen"]
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":111
 *         ]
 * 
 *     @initial.setter             # <<<<<<<<<<<<<<
 *     def initial(self, init_soil):
 *         for i, layer in enumerate(init_soil):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.initial.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_layer);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":119
 *             h2oint[i] = layer["water"]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hydrology(self):
 *         return {
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology___get__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology___get__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self) {
  unsigned int __pyx_8genexpr1__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  unsigned int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":121
 *     @property
 *     def hydrology(self):
 *         return {             # <<<<<<<<<<<<<<
 *             "ratio_implicit": RatioImplicit,
 *             "max_conductivity": conmax,
 */
  __Pyx_XDECREF(__pyx_r);

  /* "_cotton2k/simulation.pyx":122
 *     def hydrology(self):
 *         return {
 *             "ratio_implicit": RatioImplicit,             # <<<<<<<<<<<<<<
 *             "max_conductivity": conmax,
 *             "field_capacity_water_potential": psisfc,
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(RatioImplicit); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_ratio_implicit, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":123
 *         return {
 *             "ratio_implicit": RatioImplicit,
 *             "max_conductivity": conmax,             # <<<<<<<<<<<<<<
 *             "field_capacity_water_potential": psisfc,
 *             "immediate_drainage_water_potential": psidra,
 */
  __pyx_t_2 = PyFloat_FromDouble(conmax); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 123, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_max_conductivity, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":124
 *             "ratio_implicit": RatioImplicit,
 *             "max_conductivity": conmax,
 *             "field_capacity_water_potential": psisfc,             # <<<<<<<<<<<<<<
 *             "immediate_drainage_water_potential": psidra,
 *             "layers": [
 */
  __pyx_t_2 = PyFloat_FromDouble(psisfc); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 124, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_field_capacity_water_potential, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":125
 *             "max_conductivity": conmax,
 *             "field_capacity_water_potential": psisfc,
 *             "immediate_drainage_water_potential": psidra,             # <<<<<<<<<<<<<<
 *             "layers": [
 *                 {
 */
  __pyx_t_2 = PyFloat_FromDouble(psidra); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_immediate_drainage_water_potenti, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  { /* enter inner scope */

    /* "_cotton2k/simulation.pyx":126
 *             "field_capacity_water_potential": psisfc,
 *             "immediate_drainage_water_potential": psidra,
 *             "layers": [             # <<<<<<<<<<<<<<
 *                 {
 *                     "depth": ldepth[i],
 */
    __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 126, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);

    /* "_cotton2k/simulation.pyx":139
 *                     "sand": psand[i],
 *                 }
 *                 for i in range(self.number_of_layers)             # <<<<<<<<<<<<<<
 *             ]
 *         }
 */
    __pyx_t_3 = __pyx_v_self->number_of_layers;
    __pyx_t_4 = __pyx_t_3;
    for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
      __pyx_8genexpr1__pyx_v_i = __pyx_t_5;

      /* "_cotton2k/simulation.pyx":128
 *             "layers": [
 *                 {
 *                     "depth": ldepth[i],             # <<<<<<<<<<<<<<
 *                     "air_dry": airdr[i],
 *                     "theta": thetas[i],
 */
      __pyx_t_6 = __Pyx_PyDict_NewPresized(10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = PyFloat_FromDouble((ldepth[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_depth, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":129
 *                 {
 *                     "depth": ldepth[i],
 *                     "air_dry": airdr[i],             # <<<<<<<<<<<<<<
 *                     "theta": thetas[i],
 *                     "alpha": alpha[i],
 */
      __pyx_t_7 = PyFloat_FromDouble((airdr[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 129, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_air_dry, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":130
 *                     "depth": ldepth[i],
 *                     "air_dry": airdr[i],
 *                     "theta": thetas[i],             # <<<<<<<<<<<<<<
 *                     "alpha": alpha[i],
 *                     "beta": vanGenuchtenBeta,
 */
      __pyx_t_7 = PyFloat_FromDouble((thetas[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 130, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_theta, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":131
 *                     "air_dry": airdr[i],
 *                     "theta": thetas[i],
 *                     "alpha": alpha[i],             # <<<<<<<<<<<<<<
 *                     "beta": vanGenuchtenBeta,
 *                     "saturated_hydraulic_conductivity": SaturatedHydCond[i],
 */
      __pyx_t_7 = PyFloat_FromDouble((alpha[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 131, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_alpha, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":132
 *                     "theta": thetas[i],
 *                     "alpha": alpha[i],
 *                     "beta": vanGenuchtenBeta,             # <<<<<<<<<<<<<<
 *                     "saturated_hydraulic_conductivity": SaturatedHydCond[i],
 *                     "field_capacity_hydraulic_conductivity": condfc[i],
 */
      __pyx_t_7 = __Pyx_carray_to_py_double(vanGenuchtenBeta, 9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 132, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_beta, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":133
 *                     "alpha": alpha[i],
 *                     "beta": vanGenuchtenBeta,
 *                     "saturated_hydraulic_conductivity": SaturatedHydCond[i],             # <<<<<<<<<<<<<<
 *                     "field_capacity_hydraulic_conductivity": condfc[i],
 *                     "bulk_density": BulkDensity[i],
 */
      __pyx_t_7 = PyFloat_FromDouble((SaturatedHydCond[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 133, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_saturated_hydraulic_conductivity, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":134
 *                     "beta": vanGenuchtenBeta,
 *                     "saturated_hydraulic_conductivity": SaturatedHydCond[i],
 *                     "field_capacity_hydraulic_conductivity": condfc[i],             # <<<<<<<<<<<<<<
 *                     "bulk_density": BulkDensity[i],
 *                     "clay": pclay[i],
 */
      __pyx_t_7 = PyFloat_FromDouble((condfc[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 134, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_field_capacity_hydraulic_conduct, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":135
 *                     "saturated_hydraulic_conductivity": SaturatedHydCond[i],
 *                     "field_capacity_hydraulic_conductivity": condfc[i],
 *                     "bulk_density": BulkDensity[i],             # <<<<<<<<<<<<<<
 *                     "clay": pclay[i],
 *                     "sand": psand[i],
 */
      __pyx_t_7 = PyFloat_FromDouble((BulkDensity[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 135, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_bulk_density, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":136
 *                     "field_capacity_hydraulic_conductivity": condfc[i],
 *                     "bulk_density": BulkDensity[i],
 *                     "clay": pclay[i],             # <<<<<<<<<<<<<<
 *                     "sand": psand[i],
 *                 }
 */
      __pyx_t_7 = PyFloat_FromDouble((pclay[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 136, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_clay, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":137
 *                     "bulk_density": BulkDensity[i],
 *                     "clay": pclay[i],
 *                     "sand": psand[i],             # <<<<<<<<<<<<<<
 *                 }
 *                 for i in range(self.number_of_layers)
 */
      __pyx_t_7 = PyFloat_FromDouble((psand[__pyx_8genexpr1__pyx_v_i])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 137, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      if (PyDict_SetItem(__pyx_t_6, __pyx_n_u_sand, __pyx_t_7) < 0) __PYX_ERR(0, 128, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 126, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    }
  } /* exit inner scope */
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_layers, __pyx_t_2) < 0) __PYX_ERR(0, 122, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":119
 *             h2oint[i] = layer["water"]
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def hydrology(self):
 *         return {
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.hydrology.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":143
 *         }
 * 
 *     @hydrology.setter             # <<<<<<<<<<<<<<
 *     def hydrology(self, soil_hydrology):
 *         global RatioImplicit, conmax, psisfc, psidra
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_soil_hydrology); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_soil_hydrology) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self), ((PyObject *)__pyx_v_soil_hydrology));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8SoilInit_9hydrology_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v_soil_hydrology) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_layer = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  double __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  Py_ssize_t __pyx_t_5;
  PyObject *(*__pyx_t_6)(PyObject *);
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":146
 *     def hydrology(self, soil_hydrology):
 *         global RatioImplicit, conmax, psisfc, psidra
 *         RatioImplicit = soil_hydrology["ratio_implicit"]             # <<<<<<<<<<<<<<
 *         conmax = soil_hydrology["max_conductivity"]
 *         psisfc = soil_hydrology["field_capacity_water_potential"]
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_soil_hydrology, __pyx_n_u_ratio_implicit); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 146, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  RatioImplicit = __pyx_t_2;

  /* "_cotton2k/simulation.pyx":147
 *         global RatioImplicit, conmax, psisfc, psidra
 *         RatioImplicit = soil_hydrology["ratio_implicit"]
 *         conmax = soil_hydrology["max_conductivity"]             # <<<<<<<<<<<<<<
 *         psisfc = soil_hydrology["field_capacity_water_potential"]
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_soil_hydrology, __pyx_n_u_max_conductivity); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 147, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  conmax = __pyx_t_2;

  /* "_cotton2k/simulation.pyx":148
 *         RatioImplicit = soil_hydrology["ratio_implicit"]
 *         conmax = soil_hydrology["max_conductivity"]
 *         psisfc = soil_hydrology["field_capacity_water_potential"]             # <<<<<<<<<<<<<<
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]
 *         for i, layer in enumerate(soil_hydrology["layers"]):
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_soil_hydrology, __pyx_n_u_field_capacity_water_potential); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 148, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  psisfc = __pyx_t_2;

  /* "_cotton2k/simulation.pyx":149
 *         conmax = soil_hydrology["max_conductivity"]
 *         psisfc = soil_hydrology["field_capacity_water_potential"]
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]             # <<<<<<<<<<<<<<
 *         for i, layer in enumerate(soil_hydrology["layers"]):
 *             ldepth[i] = layer["depth"]
 */
  __pyx_t_1 = __Pyx_PyObject_Dict_GetItem(__pyx_v_soil_hydrology, __pyx_n_u_immediate_drainage_water_potenti); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 149, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  psidra = __pyx_t_2;

  /* "_cotton2k/simulation.pyx":150
 *         psisfc = soil_hydrology["field_capacity_water_potential"]
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]
 *         for i, layer in enumerate(soil_hydrology["layers"]):             # <<<<<<<<<<<<<<
 *             ldepth[i] = layer["depth"]
 *             airdr[i] = layer["air_dry"]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_soil_hydrology, __pyx_n_u_layers); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
    __pyx_t_6 = NULL;
  } else {
    __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_6 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 150, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_6)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 150, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_3); __pyx_t_5++; if (unlikely((0 < 0))) __PYX_ERR(0, 150, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_6(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 150, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_layer, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":151
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]
 *         for i, layer in enumerate(soil_hydrology["layers"]):
 *             ldepth[i] = layer["depth"]             # <<<<<<<<<<<<<<
 *             airdr[i] = layer["air_dry"]
 *             thetas[i] = layer["theta"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_depth); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 151, __pyx_L1_error)
    (ldepth[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":152
 *         for i, layer in enumerate(soil_hydrology["layers"]):
 *             ldepth[i] = layer["depth"]
 *             airdr[i] = layer["air_dry"]             # <<<<<<<<<<<<<<
 *             thetas[i] = layer["theta"]
 *             alpha[i] = layer["alpha"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_air_dry); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 152, __pyx_L1_error)
    (airdr[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":153
 *             ldepth[i] = layer["depth"]
 *             airdr[i] = layer["air_dry"]
 *             thetas[i] = layer["theta"]             # <<<<<<<<<<<<<<
 *             alpha[i] = layer["alpha"]
 *             vanGenuchtenBeta[i] = layer["beta"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_theta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 153, __pyx_L1_error)
    (thetas[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":154
 *             airdr[i] = layer["air_dry"]
 *             thetas[i] = layer["theta"]
 *             alpha[i] = layer["alpha"]             # <<<<<<<<<<<<<<
 *             vanGenuchtenBeta[i] = layer["beta"]
 *             SaturatedHydCond[i] = layer["saturated_hydraulic_conductivity"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_alpha); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 154, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 154, __pyx_L1_error)
    (alpha[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":155
 *             thetas[i] = layer["theta"]
 *             alpha[i] = layer["alpha"]
 *             vanGenuchtenBeta[i] = layer["beta"]             # <<<<<<<<<<<<<<
 *             SaturatedHydCond[i] = layer["saturated_hydraulic_conductivity"]
 *             condfc[i] = layer["field_capacity_hydraulic_conductivity"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_beta); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 155, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 155, __pyx_L1_error)
    (vanGenuchtenBeta[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":156
 *             alpha[i] = layer["alpha"]
 *             vanGenuchtenBeta[i] = layer["beta"]
 *             SaturatedHydCond[i] = layer["saturated_hydraulic_conductivity"]             # <<<<<<<<<<<<<<
 *             condfc[i] = layer["field_capacity_hydraulic_conductivity"]
 *             BulkDensity[i] = layer["bulk_density"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_saturated_hydraulic_conductivity); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 156, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 156, __pyx_L1_error)
    (SaturatedHydCond[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":157
 *             vanGenuchtenBeta[i] = layer["beta"]
 *             SaturatedHydCond[i] = layer["saturated_hydraulic_conductivity"]
 *             condfc[i] = layer["field_capacity_hydraulic_conductivity"]             # <<<<<<<<<<<<<<
 *             BulkDensity[i] = layer["bulk_density"]
 *             pclay[i] = layer["clay"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_field_capacity_hydraulic_conduct); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 157, __pyx_L1_error)
    (condfc[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":158
 *             SaturatedHydCond[i] = layer["saturated_hydraulic_conductivity"]
 *             condfc[i] = layer["field_capacity_hydraulic_conductivity"]
 *             BulkDensity[i] = layer["bulk_density"]             # <<<<<<<<<<<<<<
 *             pclay[i] = layer["clay"]
 *             psand[i] = layer["sand"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_bulk_density); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 158, __pyx_L1_error)
    (BulkDensity[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":159
 *             condfc[i] = layer["field_capacity_hydraulic_conductivity"]
 *             BulkDensity[i] = layer["bulk_density"]
 *             pclay[i] = layer["clay"]             # <<<<<<<<<<<<<<
 *             psand[i] = layer["sand"]
 * 
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_clay); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 159, __pyx_L1_error)
    (pclay[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":160
 *             BulkDensity[i] = layer["bulk_density"]
 *             pclay[i] = layer["clay"]
 *             psand[i] = layer["sand"]             # <<<<<<<<<<<<<<
 * 
 * cdef class Climate:
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_layer, __pyx_n_u_sand); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_2 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 160, __pyx_L1_error)
    (psand[__pyx_t_7]) = __pyx_t_2;

    /* "_cotton2k/simulation.pyx":150
 *         psisfc = soil_hydrology["field_capacity_water_potential"]
 *         psidra = soil_hydrology["immediate_drainage_water_potential"]
 *         for i, layer in enumerate(soil_hydrology["layers"]):             # <<<<<<<<<<<<<<
 *             ldepth[i] = layer["depth"]
 *             airdr[i] = layer["air_dry"]
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":143
 *         }
 * 
 *     @hydrology.setter             # <<<<<<<<<<<<<<
 *     def hydrology(self, soil_hydrology):
 *         global RatioImplicit, conmax, psisfc, psidra
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.hydrology.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_layer);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_2__reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_2__reduce_cython__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self) {
  PyObject *__pyx_v_state = 0;
  PyObject *__pyx_v__dict = 0;
  int __pyx_v_use_setstate;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":5
 *     cdef object _dict
 *     cdef bint use_setstate
 *     state = (self.number_of_layers,)             # <<<<<<<<<<<<<<
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->number_of_layers); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
  __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "(tree fragment)":6
 *     cdef bint use_setstate
 *     state = (self.number_of_layers,)
 *     _dict = getattr(self, '__dict__', None)             # <<<<<<<<<<<<<<
 *     if _dict is not None:
 *         state += (_dict,)
 */
  __pyx_t_2 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_v__dict = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":7
 *     state = (self.number_of_layers,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
  __pyx_t_3 = (__pyx_v__dict != Py_None);
  __pyx_t_4 = (__pyx_t_3 != 0);
  if (__pyx_t_4) {

    /* "(tree fragment)":8
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:
 *         state += (_dict,)             # <<<<<<<<<<<<<<
 *         use_setstate = True
 *     else:
 */
    __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_v__dict);
    __Pyx_GIVEREF(__pyx_v__dict);
    PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v__dict);
    __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 8, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_1));
    __pyx_t_1 = 0;

    /* "(tree fragment)":9
 *     if _dict is not None:
 *         state += (_dict,)
 *         use_setstate = True             # <<<<<<<<<<<<<<
 *     else:
 *         use_setstate = False
 */
    __pyx_v_use_setstate = 1;

    /* "(tree fragment)":7
 *     state = (self.number_of_layers,)
 *     _dict = getattr(self, '__dict__', None)
 *     if _dict is not None:             # <<<<<<<<<<<<<<
 *         state += (_dict,)
 *         use_setstate = True
 */
    goto __pyx_L3;
  }

  /* "(tree fragment)":11
 *         use_setstate = True
 *     else:
 *         use_setstate = False             # <<<<<<<<<<<<<<
 *     if use_setstate:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, None), state
 */
  /*else*/ {
    __pyx_v_use_setstate = 0;
  }
  __pyx_L3:;

  /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, None), state
 *     else:
 */
  __pyx_t_4 = (__pyx_v_use_setstate != 0);
  if (__pyx_t_4) {

    /* "(tree fragment)":13
 *         use_setstate = False
 *     if use_setstate:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, None), state             # <<<<<<<<<<<<<<
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 */
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pyx_unpickle_SoilInit); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_139140702);
    __Pyx_GIVEREF(__pyx_int_139140702);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_139140702);
    __Pyx_INCREF(Py_None);
    __Pyx_GIVEREF(Py_None);
    PyTuple_SET_ITEM(__pyx_t_2, 2, Py_None);
    __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 13, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_1);
    PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
    __pyx_t_1 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;

    /* "(tree fragment)":12
 *     else:
 *         use_setstate = False
 *     if use_setstate:             # <<<<<<<<<<<<<<
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, None), state
 *     else:
 */
  }

  /* "(tree fragment)":15
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, None), state
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)
 */
  /*else*/ {
    __Pyx_XDECREF(__pyx_r);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_pyx_unpickle_SoilInit); if (unlikely(!__pyx_t_5)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = PyTuple_New(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    PyTuple_SET_ITEM(__pyx_t_2, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
    __Pyx_INCREF(__pyx_int_139140702);
    __Pyx_GIVEREF(__pyx_int_139140702);
    PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_int_139140702);
    __Pyx_INCREF(__pyx_v_state);
    __Pyx_GIVEREF(__pyx_v_state);
    PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_v_state);
    __pyx_t_1 = PyTuple_New(2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 15, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_GIVEREF(__pyx_t_5);
    PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_5);
    __Pyx_GIVEREF(__pyx_t_2);
    PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_2);
    __pyx_t_5 = 0;
    __pyx_t_2 = 0;
    __pyx_r = __pyx_t_1;
    __pyx_t_1 = 0;
    goto __pyx_L0;
  }

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v__dict);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 16, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 16, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 16, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8SoilInit_4__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8SoilInit_4__setstate_cython__(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":17
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 * def __setstate_cython__(self, __pyx_state):
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)             # <<<<<<<<<<<<<<
 */
  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 17, __pyx_L1_error)
  __pyx_t_1 = __pyx_f_9_cotton2k_10simulation___pyx_unpickle_SoilInit__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 17, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.SoilInit.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":168
 *     cdef unsigned int current
 * 
 *     def __init__(self, start_date, climate):             # <<<<<<<<<<<<<<
 *         global LastDayWeatherData
 *         self.start_day = date2doy(start_date)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_7Climate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_7Climate_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_start_date = 0;
  PyObject *__pyx_v_climate = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_date,&__pyx_n_s_climate,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_start_date,&__pyx_n_s_climate,0};
    #endif
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_start_date)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_climate)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 168, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, 1); __PYX_ERR(0, 168, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 168, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
      values[1] = __Pyx_Arg_VARARGS(__pyx_args, 1);
    }
    __pyx_v_start_date = values[0];
    __pyx_v_climate = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 168, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate___init__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self), __pyx_v_start_date, __pyx_v_climate);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_7Climate___init__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, PyObject *__pyx_v_start_date, PyObject *__pyx_v_climate) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_daily_climate = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  double __pyx_t_8;
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "_cotton2k/simulation.pyx":170
 *     def __init__(self, start_date, climate):
 *         global LastDayWeatherData
 *         self.start_day = date2doy(start_date)             # <<<<<<<<<<<<<<
 *         self.current = self.start_day
 *         self.days = len(climate)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_start_date};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 170, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 170, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->start_day = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":171
 *         global LastDayWeatherData
 *         self.start_day = date2doy(start_date)
 *         self.current = self.start_day             # <<<<<<<<<<<<<<
 *         self.days = len(climate)
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))
 */
  __pyx_t_5 = __pyx_v_self->start_day;
  __pyx_v_self->current = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":172
 *         self.start_day = date2doy(start_date)
 *         self.current = self.start_day
 *         self.days = len(climate)             # <<<<<<<<<<<<<<
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))
 *         LastDayWeatherData = len(climate) + self.start_day - 1
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_climate); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 172, __pyx_L1_error)
  __pyx_v_self->days = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":173
 *         self.current = self.start_day
 *         self.days = len(climate)
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))             # <<<<<<<<<<<<<<
 *         LastDayWeatherData = len(climate) + self.start_day - 1
 *         for i, daily_climate in enumerate(climate):
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_climate); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 173, __pyx_L1_error)
  __pyx_v_self->climate = ((ClimateStruct *)malloc(((sizeof(ClimateStruct)) * __pyx_t_6)));

  /* "_cotton2k/simulation.pyx":174
 *         self.days = len(climate)
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))
 *         LastDayWeatherData = len(climate) + self.start_day - 1             # <<<<<<<<<<<<<<
 *         for i, daily_climate in enumerate(climate):
 *             self.climate[i].Rad = daily_climate["radiation"]
 */
  __pyx_t_6 = PyObject_Length(__pyx_v_climate); if (unlikely(__pyx_t_6 == ((Py_ssize_t)-1))) __PYX_ERR(0, 174, __pyx_L1_error)
  LastDayWeatherData = ((__pyx_t_6 + __pyx_v_self->start_day) - 1);

  /* "_cotton2k/simulation.pyx":175
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))
 *         LastDayWeatherData = len(climate) + self.start_day - 1
 *         for i, daily_climate in enumerate(climate):             # <<<<<<<<<<<<<<
 *             self.climate[i].Rad = daily_climate["radiation"]
 *             self.climate[i].Tmax = daily_climate["max"]
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_climate)) || PyTuple_CheckExact(__pyx_v_climate)) {
    __pyx_t_2 = __pyx_v_climate; __Pyx_INCREF(__pyx_t_2); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_climate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 175, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 175, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_6); __Pyx_INCREF(__pyx_t_3); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 175, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_7(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 175, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_daily_climate, __pyx_t_3);
    __pyx_t_3 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 175, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":176
 *         LastDayWeatherData = len(climate) + self.start_day - 1
 *         for i, daily_climate in enumerate(climate):
 *             self.climate[i].Rad = daily_climate["radiation"]             # <<<<<<<<<<<<<<
 *             self.climate[i].Tmax = daily_climate["max"]
 *             self.climate[i].Tmin = daily_climate["min"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_radiation); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 176, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Rad = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":177
 *         for i, daily_climate in enumerate(climate):
 *             self.climate[i].Rad = daily_climate["radiation"]
 *             self.climate[i].Tmax = daily_climate["max"]             # <<<<<<<<<<<<<<
 *             self.climate[i].Tmin = daily_climate["min"]
 *             self.climate[i].Wind = daily_climate["wind"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_max); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 177, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Tmax = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":178
 *             self.climate[i].Rad = daily_climate["radiation"]
 *             self.climate[i].Tmax = daily_climate["max"]
 *             self.climate[i].Tmin = daily_climate["min"]             # <<<<<<<<<<<<<<
 *             self.climate[i].Wind = daily_climate["wind"]
 *             self.climate[i].Rain = daily_climate["rain"]
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_min); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 178, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Tmin = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":179
 *             self.climate[i].Tmax = daily_climate["max"]
 *             self.climate[i].Tmin = daily_climate["min"]
 *             self.climate[i].Wind = daily_climate["wind"]             # <<<<<<<<<<<<<<
 *             self.climate[i].Rain = daily_climate["rain"]
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_wind); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 179, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Wind = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":180
 *             self.climate[i].Tmin = daily_climate["min"]
 *             self.climate[i].Wind = daily_climate["wind"]
 *             self.climate[i].Rain = daily_climate["rain"]             # <<<<<<<<<<<<<<
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",
 *                                                      tdewest(daily_climate["max"],
 */
    __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_rain); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 180, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Rain = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":181
 *             self.climate[i].Wind = daily_climate["wind"]
 *             self.climate[i].Rain = daily_climate["rain"]
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",             # <<<<<<<<<<<<<<
 *                                                      tdewest(daily_climate["max"],
 *                                                              SitePar[5], SitePar[6]))
 */
    __pyx_t_10 = __Pyx_PyObject_GetAttrStr(__pyx_v_daily_climate, __pyx_n_s_get); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);

    /* "_cotton2k/simulation.pyx":182
 *             self.climate[i].Rain = daily_climate["rain"]
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",
 *                                                      tdewest(daily_climate["max"],             # <<<<<<<<<<<<<<
 *                                                              SitePar[5], SitePar[6]))
 * 
 */
    __pyx_t_11 = __Pyx_PyObject_Dict_GetItem(__pyx_v_daily_climate, __pyx_n_u_max); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;

    /* "_cotton2k/simulation.pyx":183
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",
 *                                                      tdewest(daily_climate["max"],
 *                                                              SitePar[5], SitePar[6]))             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, key):
 */
    __pyx_t_11 = PyFloat_FromDouble(tdewest(__pyx_t_8, (SitePar[5]), (SitePar[6]))); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 182, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_12 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_10))) {
      __pyx_t_12 = PyMethod_GET_SELF(__pyx_t_10);
      if (likely(__pyx_t_12)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
        __Pyx_INCREF(__pyx_t_12);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_10, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[3] = {__pyx_t_12, __pyx_n_u_dewpoint, __pyx_t_11};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 181, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    }

    /* "_cotton2k/simulation.pyx":181
 *             self.climate[i].Wind = daily_climate["wind"]
 *             self.climate[i].Rain = daily_climate["rain"]
 *             self.climate[i].Tdew = daily_climate.get("dewpoint",             # <<<<<<<<<<<<<<
 *                                                      tdewest(daily_climate["max"],
 *                                                              SitePar[5], SitePar[6]))
 */
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 181, __pyx_L1_error)
    (__pyx_v_self->climate[__pyx_t_9]).Tdew = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":175
 *         self.climate = <ClimateStruct *> malloc(sizeof(ClimateStruct) * len(climate))
 *         LastDayWeatherData = len(climate) + self.start_day - 1
 *         for i, daily_climate in enumerate(climate):             # <<<<<<<<<<<<<<
 *             self.climate[i].Rad = daily_climate["radiation"]
 *             self.climate[i].Tmax = daily_climate["max"]
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":168
 *     cdef unsigned int current
 * 
 *     def __init__(self, start_date, climate):             # <<<<<<<<<<<<<<
 *         global LastDayWeatherData
 *         self.start_day = date2doy(start_date)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_daily_climate);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":185
 *                                                              SitePar[5], SitePar[6]))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             start = key.start or 0
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_3__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_key) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate_2__getitem__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self), ((PyObject *)__pyx_v_key));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_2__getitem__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, PyObject *__pyx_v_key) {
  PyObject *__pyx_v_start = NULL;
  PyObject *__pyx_v_stop = NULL;
  PyObject *__pyx_v_step = NULL;
  PyObject *__pyx_v_climate = NULL;
  PyObject *__pyx_8genexpr2__pyx_v_i = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);
  __Pyx_INCREF(__pyx_v_key);

  /* "_cotton2k/simulation.pyx":186
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             start = key.start or 0
 *             stop = key.stop or self.days
 */
  __pyx_t_1 = PySlice_Check(__pyx_v_key); 
  __pyx_t_2 = (__pyx_t_1 != 0);
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":187
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):
 *             start = key.start or 0             # <<<<<<<<<<<<<<
 *             stop = key.stop or self.days
 *             step = key.step or 1
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_start); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 187, __pyx_L1_error)
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L4_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_long(0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 187, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_L4_bool_binop_done:;
    __pyx_v_start = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":188
 *         if isinstance(key, slice):
 *             start = key.start or 0
 *             stop = key.stop or self.days             # <<<<<<<<<<<<<<
 *             step = key.step or 1
 *             if isinstance(start, date):
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_stop); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 188, __pyx_L1_error)
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L6_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->days); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 188, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_L6_bool_binop_done:;
    __pyx_v_stop = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":189
 *             start = key.start or 0
 *             stop = key.stop or self.days
 *             step = key.step or 1             # <<<<<<<<<<<<<<
 *             if isinstance(start, date):
 *                 start = date2doy(start) - self.start_day
 */
    __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_key, __pyx_n_s_step); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 189, __pyx_L1_error)
    if (!__pyx_t_2) {
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    } else {
      __Pyx_INCREF(__pyx_t_4);
      __pyx_t_3 = __pyx_t_4;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      goto __pyx_L8_bool_binop_done;
    }
    __pyx_t_4 = __Pyx_PyInt_From_long(1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 189, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __pyx_t_4;
    __pyx_t_4 = 0;
    __pyx_L8_bool_binop_done:;
    __pyx_v_step = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":190
 *             stop = key.stop or self.days
 *             step = key.step or 1
 *             if isinstance(start, date):             # <<<<<<<<<<<<<<
 *                 start = date2doy(start) - self.start_day
 *             if isinstance(stop, date):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_date); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 190, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_IsInstance(__pyx_v_start, __pyx_t_3); if (unlikely(__pyx_t_2 == ((int)-1))) __PYX_ERR(0, 190, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_1 = (__pyx_t_2 != 0);
    if (__pyx_t_1) {

      /* "_cotton2k/simulation.pyx":191
 *             step = key.step or 1
 *             if isinstance(start, date):
 *                 start = date2doy(start) - self.start_day             # <<<<<<<<<<<<<<
 *             if isinstance(stop, date):
 *                 stop = date2doy(stop) - self.start_day
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_start};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 191, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_start, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "_cotton2k/simulation.pyx":190
 *             stop = key.stop or self.days
 *             step = key.step or 1
 *             if isinstance(start, date):             # <<<<<<<<<<<<<<
 *                 start = date2doy(start) - self.start_day
 *             if isinstance(stop, date):
 */
    }

    /* "_cotton2k/simulation.pyx":192
 *             if isinstance(start, date):
 *                 start = date2doy(start) - self.start_day
 *             if isinstance(stop, date):             # <<<<<<<<<<<<<<
 *                 stop = date2doy(stop) - self.start_day
 *             return [{
 */
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = PyObject_IsInstance(__pyx_v_stop, __pyx_t_5); if (unlikely(__pyx_t_1 == ((int)-1))) __PYX_ERR(0, 192, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_2 = (__pyx_t_1 != 0);
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":193
 *                 start = date2doy(start) - self.start_day
 *             if isinstance(stop, date):
 *                 stop = date2doy(stop) - self.start_day             # <<<<<<<<<<<<<<
 *             return [{
 *                 "radiation": self.climate[i].Rad,
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_stop};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 193, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 193, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_stop, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "_cotton2k/simulation.pyx":192
 *             if isinstance(start, date):
 *                 start = date2doy(start) - self.start_day
 *             if isinstance(stop, date):             # <<<<<<<<<<<<<<
 *                 stop = date2doy(stop) - self.start_day
 *             return [{
 */
    }

    /* "_cotton2k/simulation.pyx":194
 *             if isinstance(stop, date):
 *                 stop = date2doy(stop) - self.start_day
 *             return [{             # <<<<<<<<<<<<<<
 *                 "radiation": self.climate[i].Rad,
 *                 "max": self.climate[i].Tmax,
 */
    __Pyx_XDECREF(__pyx_r);
    { /* enter inner scope */
      __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 194, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_3);

      /* "_cotton2k/simulation.pyx":201
 *                 "rain": self.climate[i].Rain,
 *                 "dewpoint": self.climate[i].Tdew,
 *             } for i in range(start, stop, step)]             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(key, int):
 */
      __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_INCREF(__pyx_v_start);
      __Pyx_GIVEREF(__pyx_v_start);
      PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_v_start);
      __Pyx_INCREF(__pyx_v_stop);
      __Pyx_GIVEREF(__pyx_v_stop);
      PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_v_stop);
      __Pyx_INCREF(__pyx_v_step);
      __Pyx_GIVEREF(__pyx_v_step);
      PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_v_step);
      __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_range, __pyx_t_4, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L14_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
        __pyx_t_4 = __pyx_t_5; __Pyx_INCREF(__pyx_t_4); __pyx_t_7 = 0;
        __pyx_t_8 = NULL;
      } else {
        __pyx_t_7 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 201, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 201, __pyx_L14_error)
      }
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      for (;;) {
        if (likely(!__pyx_t_8)) {
          if (likely(PyList_CheckExact(__pyx_t_4))) {
            if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 201, __pyx_L14_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L14_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          } else {
            if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_7); __Pyx_INCREF(__pyx_t_5); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 201, __pyx_L14_error)
            #else
            __pyx_t_5 = PySequence_ITEM(__pyx_t_4, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 201, __pyx_L14_error)
            __Pyx_GOTREF(__pyx_t_5);
            #endif
          }
        } else {
          __pyx_t_5 = __pyx_t_8(__pyx_t_4);
          if (unlikely(!__pyx_t_5)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 201, __pyx_L14_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_5);
        }
        __Pyx_XDECREF_SET(__pyx_8genexpr2__pyx_v_i, __pyx_t_5);
        __pyx_t_5 = 0;

        /* "_cotton2k/simulation.pyx":195
 *                 stop = date2doy(stop) - self.start_day
 *             return [{
 *                 "radiation": self.climate[i].Rad,             # <<<<<<<<<<<<<<
 *                 "max": self.climate[i].Tmax,
 *                 "min": self.climate[i].Tmin,
 */
        __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 195, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Rad); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_radiation, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_cotton2k/simulation.pyx":196
 *             return [{
 *                 "radiation": self.climate[i].Rad,
 *                 "max": self.climate[i].Tmax,             # <<<<<<<<<<<<<<
 *                 "min": self.climate[i].Tmin,
 *                 "wind": self.climate[i].Wind,
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 196, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Tmax); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 196, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_max, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_cotton2k/simulation.pyx":197
 *                 "radiation": self.climate[i].Rad,
 *                 "max": self.climate[i].Tmax,
 *                 "min": self.climate[i].Tmin,             # <<<<<<<<<<<<<<
 *                 "wind": self.climate[i].Wind,
 *                 "rain": self.climate[i].Rain,
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 197, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Tmin); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 197, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_min, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_cotton2k/simulation.pyx":198
 *                 "max": self.climate[i].Tmax,
 *                 "min": self.climate[i].Tmin,
 *                 "wind": self.climate[i].Wind,             # <<<<<<<<<<<<<<
 *                 "rain": self.climate[i].Rain,
 *                 "dewpoint": self.climate[i].Tdew,
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 198, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Wind); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 198, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_wind, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_cotton2k/simulation.pyx":199
 *                 "min": self.climate[i].Tmin,
 *                 "wind": self.climate[i].Wind,
 *                 "rain": self.climate[i].Rain,             # <<<<<<<<<<<<<<
 *                 "dewpoint": self.climate[i].Tdew,
 *             } for i in range(start, stop, step)]
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 199, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Rain); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 199, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_rain, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

        /* "_cotton2k/simulation.pyx":200
 *                 "wind": self.climate[i].Wind,
 *                 "rain": self.climate[i].Rain,
 *                 "dewpoint": self.climate[i].Tdew,             # <<<<<<<<<<<<<<
 *             } for i in range(start, stop, step)]
 *         else:
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr2__pyx_v_i); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 200, __pyx_L14_error)
        __pyx_t_10 = PyFloat_FromDouble((__pyx_v_self->climate[__pyx_t_9]).Tdew); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 200, __pyx_L14_error)
        __Pyx_GOTREF(__pyx_t_10);
        if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_dewpoint, __pyx_t_10) < 0) __PYX_ERR(0, 195, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 194, __pyx_L14_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

        /* "_cotton2k/simulation.pyx":201
 *                 "rain": self.climate[i].Rain,
 *                 "dewpoint": self.climate[i].Tdew,
 *             } for i in range(start, stop, step)]             # <<<<<<<<<<<<<<
 *         else:
 *             if not isinstance(key, int):
 */
      }
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i); __pyx_8genexpr2__pyx_v_i = 0;
      goto __pyx_L17_exit_scope;
      __pyx_L14_error:;
      __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i); __pyx_8genexpr2__pyx_v_i = 0;
      goto __pyx_L1_error;
      __pyx_L17_exit_scope:;
    } /* exit inner scope */
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":186
 * 
 *     def __getitem__(self, key):
 *         if isinstance(key, slice):             # <<<<<<<<<<<<<<
 *             start = key.start or 0
 *             stop = key.stop or self.days
 */
  }

  /* "_cotton2k/simulation.pyx":203
 *             } for i in range(start, stop, step)]
 *         else:
 *             if not isinstance(key, int):             # <<<<<<<<<<<<<<
 *                 key = date2doy(key) - self.start_day
 *             climate = self.climate[key]
 */
  /*else*/ {
    __pyx_t_2 = PyInt_Check(__pyx_v_key); 
    __pyx_t_1 = ((!(__pyx_t_2 != 0)) != 0);
    if (__pyx_t_1) {

      /* "_cotton2k/simulation.pyx":204
 *         else:
 *             if not isinstance(key, int):
 *                 key = date2doy(key) - self.start_day             # <<<<<<<<<<<<<<
 *             climate = self.climate[key]
 *             return {
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = NULL;
      __pyx_t_6 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_6 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_v_key};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_6, 1+__pyx_t_6);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 204, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->start_day); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = PyNumber_Subtract(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 204, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF_SET(__pyx_v_key, __pyx_t_5);
      __pyx_t_5 = 0;

      /* "_cotton2k/simulation.pyx":203
 *             } for i in range(start, stop, step)]
 *         else:
 *             if not isinstance(key, int):             # <<<<<<<<<<<<<<
 *                 key = date2doy(key) - self.start_day
 *             climate = self.climate[key]
 */
    }

    /* "_cotton2k/simulation.pyx":205
 *             if not isinstance(key, int):
 *                 key = date2doy(key) - self.start_day
 *             climate = self.climate[key]             # <<<<<<<<<<<<<<
 *             return {
 *                 "radiation": climate["Rad"],
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_key); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 205, __pyx_L1_error)
    __pyx_t_5 = __pyx_convert__to_py_ClimateStruct((__pyx_v_self->climate[__pyx_t_7])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 205, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_v_climate = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":206
 *                 key = date2doy(key) - self.start_day
 *             climate = self.climate[key]
 *             return {             # <<<<<<<<<<<<<<
 *                 "radiation": climate["Rad"],
 *                 "max": climate["Tmax"],
 */
    __Pyx_XDECREF(__pyx_r);

    /* "_cotton2k/simulation.pyx":207
 *             climate = self.climate[key]
 *             return {
 *                 "radiation": climate["Rad"],             # <<<<<<<<<<<<<<
 *                 "max": climate["Tmax"],
 *                 "min": climate["Tmin"],
 */
    __pyx_t_5 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Rad); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_radiation, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":208
 *             return {
 *                 "radiation": climate["Rad"],
 *                 "max": climate["Tmax"],             # <<<<<<<<<<<<<<
 *                 "min": climate["Tmin"],
 *                 "wind": climate["Wind"],
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Tmax); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 208, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_max, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":209
 *                 "radiation": climate["Rad"],
 *                 "max": climate["Tmax"],
 *                 "min": climate["Tmin"],             # <<<<<<<<<<<<<<
 *                 "wind": climate["Wind"],
 *                 "rain": climate["Rain"],
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Tmin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 209, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_min, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":210
 *                 "max": climate["Tmax"],
 *                 "min": climate["Tmin"],
 *                 "wind": climate["Wind"],             # <<<<<<<<<<<<<<
 *                 "rain": climate["Rain"],
 *                 "dewpoint": climate["Tdew"],
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Wind); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 210, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_wind, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":211
 *                 "min": climate["Tmin"],
 *                 "wind": climate["Wind"],
 *                 "rain": climate["Rain"],             # <<<<<<<<<<<<<<
 *                 "dewpoint": climate["Tdew"],
 *             }
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Rain); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 211, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_rain, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":212
 *                 "wind": climate["Wind"],
 *                 "rain": climate["Rain"],
 *                 "dewpoint": climate["Tdew"],             # <<<<<<<<<<<<<<
 *             }
 * 
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_climate, __pyx_n_u_Tdew); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 212, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    if (PyDict_SetItem(__pyx_t_5, __pyx_n_u_dewpoint, __pyx_t_4) < 0) __PYX_ERR(0, 207, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_r = __pyx_t_5;
    __pyx_t_5 = 0;
    goto __pyx_L0;
  }

  /* "_cotton2k/simulation.pyx":185
 *                                                              SitePar[5], SitePar[6]))
 * 
 *     def __getitem__(self, key):             # <<<<<<<<<<<<<<
 *         if isinstance(key, slice):
 *             start = key.start or 0
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_start);
  __Pyx_XDECREF(__pyx_v_stop);
  __Pyx_XDECREF(__pyx_v_step);
  __Pyx_XDECREF(__pyx_v_climate);
  __Pyx_XDECREF(__pyx_8genexpr2__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_key);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":215
 *             }
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_5__iter__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_5__iter__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate_4__iter__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_4__iter__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__iter__", 0);

  /* "_cotton2k/simulation.pyx":216
 * 
 *     def __iter__(self):
 *         return self             # <<<<<<<<<<<<<<
 * 
 *     def __next__(self):
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_self);
  __pyx_r = ((PyObject *)__pyx_v_self);
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":215
 *             }
 * 
 *     def __iter__(self):             # <<<<<<<<<<<<<<
 *         return self
 * 
 */

  /* function exit code */
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":218
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.current < self.start_day + self.days:
 *             self.current += 1
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_7__next__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_7__next__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__next__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate_6__next__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_6__next__(struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  long __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__next__", 0);

  /* "_cotton2k/simulation.pyx":219
 * 
 *     def __next__(self):
 *         if self.current < self.start_day + self.days:             # <<<<<<<<<<<<<<
 *             self.current += 1
 *             return self[self.current - 1]
 */
  __pyx_t_1 = ((__pyx_v_self->current < (__pyx_v_self->start_day + __pyx_v_self->days)) != 0);
  if (likely(__pyx_t_1)) {

    /* "_cotton2k/simulation.pyx":220
 *     def __next__(self):
 *         if self.current < self.start_day + self.days:
 *             self.current += 1             # <<<<<<<<<<<<<<
 *             return self[self.current - 1]
 *         else:
 */
    __pyx_v_self->current = (__pyx_v_self->current + 1);

    /* "_cotton2k/simulation.pyx":221
 *         if self.current < self.start_day + self.days:
 *             self.current += 1
 *             return self[self.current - 1]             # <<<<<<<<<<<<<<
 *         else:
 *             raise StopIteration
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_t_2 = (__pyx_v_self->current - 1);
    __pyx_t_3 = __Pyx_GetItemInt(((PyObject *)__pyx_v_self), __pyx_t_2, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 221, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_r = __pyx_t_3;
    __pyx_t_3 = 0;
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":219
 * 
 *     def __next__(self):
 *         if self.current < self.start_day + self.days:             # <<<<<<<<<<<<<<
 *             self.current += 1
 *             return self[self.current - 1]
 */
  }

  /* "_cotton2k/simulation.pyx":223
 *             return self[self.current - 1]
 *         else:
 *             raise StopIteration             # <<<<<<<<<<<<<<
 * 
 * cdef read_agricultural_input(cSimulation & sim, inputs):
 */
  /*else*/ {
    __Pyx_Raise(__pyx_builtin_StopIteration, 0, 0, 0);
    __PYX_ERR(0, 223, __pyx_L1_error)
  }

  /* "_cotton2k/simulation.pyx":218
 *         return self
 * 
 *     def __next__(self):             # <<<<<<<<<<<<<<
 *         if self.current < self.start_day + self.days:
 *             self.current += 1
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__next__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_7Climate_9__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_7Climate_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_9__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate_8__reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_8__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_climate_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_7Climate_11__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_7Climate_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_7Climate_11__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_7Climate_10__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_Climate *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_7Climate_10__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Climate *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self_climate_cannot_be_converted, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Climate.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":225
 *             raise StopIteration
 * 
 * cdef read_agricultural_input(cSimulation & sim, inputs):             # <<<<<<<<<<<<<<
 *     global NumNitApps, NumIrrigations
 *     NumNitApps = 0
 */

static PyObject *__pyx_f_9_cotton2k_10simulation_read_agricultural_input(Simulation &__pyx_v_sim, PyObject *__pyx_v_inputs) {
  PyObject *__pyx_v_idef = NULL;
  Irrigation __pyx_v_irrigation;
  NitrogenFertilizer __pyx_v_nf;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_isdhrz = NULL;
  PyObject *__pyx_v_isddph = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  Py_ssize_t __pyx_t_2;
  PyObject *(*__pyx_t_3)(PyObject *);
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_agricultural_input", 0);

  /* "_cotton2k/simulation.pyx":227
 * cdef read_agricultural_input(cSimulation & sim, inputs):
 *     global NumNitApps, NumIrrigations
 *     NumNitApps = 0             # <<<<<<<<<<<<<<
 *     idef = 0
 *     cdef Irrigation irrigation
 */
  NumNitApps = 0;

  /* "_cotton2k/simulation.pyx":228
 *     global NumNitApps, NumIrrigations
 *     NumNitApps = 0
 *     idef = 0             # <<<<<<<<<<<<<<
 *     cdef Irrigation irrigation
 *     cdef NitrogenFertilizer nf
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_idef = __pyx_int_0;

  /* "_cotton2k/simulation.pyx":231
 *     cdef Irrigation irrigation
 *     cdef NitrogenFertilizer nf
 *     for i in inputs:             # <<<<<<<<<<<<<<
 *         if i["type"] == "irrigation":
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 */
  if (likely(PyList_CheckExact(__pyx_v_inputs)) || PyTuple_CheckExact(__pyx_v_inputs)) {
    __pyx_t_1 = __pyx_v_inputs; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
    __pyx_t_3 = NULL;
  } else {
    __pyx_t_2 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_v_inputs); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 231, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 231, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_3)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 231, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_4); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 231, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 231, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_3(__pyx_t_1);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 231, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":232
 *     cdef NitrogenFertilizer nf
 *     for i in inputs:
 *         if i["type"] == "irrigation":             # <<<<<<<<<<<<<<
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 */
    __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_type); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_4, __pyx_n_u_irrigation, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 232, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (__pyx_t_5) {

      /* "_cotton2k/simulation.pyx":233
 *     for i in inputs:
 *         if i["type"] == "irrigation":
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation             # <<<<<<<<<<<<<<
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 */
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 233, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 233, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_irrigation.day = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":234
 *         if i["type"] == "irrigation":
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm             # <<<<<<<<<<<<<<
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm
 */
      __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_amount); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 234, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_irrigation.amount = __pyx_t_10;

      /* "_cotton2k/simulation.pyx":235
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip             # <<<<<<<<<<<<<<
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 235, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_irrigation.method = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":236
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm             # <<<<<<<<<<<<<<
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm
 *             # If this is a drip irrigation, convert distances to soil
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 236, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_isdhrz, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":237
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm             # <<<<<<<<<<<<<<
 *             # If this is a drip irrigation, convert distances to soil
 *             # layer and column numbers by calling SlabLoc.
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 237, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_isddph, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "_cotton2k/simulation.pyx":240
 *             # If this is a drip irrigation, convert distances to soil
 *             # layer and column numbers by calling SlabLoc.
 *             if irrigation.method == 2:             # <<<<<<<<<<<<<<
 *                 irrigation.LocationColumnDrip = SlabLoc(isdhrz, sim.row_space)
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)
 */
      __pyx_t_5 = ((__pyx_v_irrigation.method == 2) != 0);
      if (__pyx_t_5) {

        /* "_cotton2k/simulation.pyx":241
 *             # layer and column numbers by calling SlabLoc.
 *             if irrigation.method == 2:
 *                 irrigation.LocationColumnDrip = SlabLoc(isdhrz, sim.row_space)             # <<<<<<<<<<<<<<
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)
 *             sim.irrigation[NumIrrigations] = irrigation
 */
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_isdhrz); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 241, __pyx_L1_error)
        __pyx_v_irrigation.LocationColumnDrip = SlabLoc(__pyx_t_9, __pyx_v_sim.row_space);

        /* "_cotton2k/simulation.pyx":242
 *             if irrigation.method == 2:
 *                 irrigation.LocationColumnDrip = SlabLoc(isdhrz, sim.row_space)
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)             # <<<<<<<<<<<<<<
 *             sim.irrigation[NumIrrigations] = irrigation
 *             NumIrrigations += 1
 */
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_isddph); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 242, __pyx_L1_error)
        __pyx_v_irrigation.LocationLayerDrip = SlabLoc(__pyx_t_9, 0.0);

        /* "_cotton2k/simulation.pyx":240
 *             # If this is a drip irrigation, convert distances to soil
 *             # layer and column numbers by calling SlabLoc.
 *             if irrigation.method == 2:             # <<<<<<<<<<<<<<
 *                 irrigation.LocationColumnDrip = SlabLoc(isdhrz, sim.row_space)
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)
 */
      }

      /* "_cotton2k/simulation.pyx":243
 *                 irrigation.LocationColumnDrip = SlabLoc(isdhrz, sim.row_space)
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)
 *             sim.irrigation[NumIrrigations] = irrigation             # <<<<<<<<<<<<<<
 *             NumIrrigations += 1
 *         elif i["type"] == "fertilization":
 */
      (__pyx_v_sim.irrigation[NumIrrigations]) = __pyx_v_irrigation;

      /* "_cotton2k/simulation.pyx":244
 *                 irrigation.LocationLayerDrip = SlabLoc(isddph, 0)
 *             sim.irrigation[NumIrrigations] = irrigation
 *             NumIrrigations += 1             # <<<<<<<<<<<<<<
 *         elif i["type"] == "fertilization":
 *             nf.day = date2doy(i["date"])
 */
      NumIrrigations = (NumIrrigations + 1);

      /* "_cotton2k/simulation.pyx":232
 *     cdef NitrogenFertilizer nf
 *     for i in inputs:
 *         if i["type"] == "irrigation":             # <<<<<<<<<<<<<<
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":245
 *             sim.irrigation[NumIrrigations] = irrigation
 *             NumIrrigations += 1
 *         elif i["type"] == "fertilization":             # <<<<<<<<<<<<<<
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_n_u_fertilization, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 245, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_5) {

      /* "_cotton2k/simulation.pyx":246
 *             NumIrrigations += 1
 *         elif i["type"] == "fertilization":
 *             nf.day = date2doy(i["date"])             # <<<<<<<<<<<<<<
 *             nf.amtamm = i.get("ammonium", 0)
 *             nf.amtnit = i.get("nitrate", 0)
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 246, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_9 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 246, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 246, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_nf.day = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":247
 *         elif i["type"] == "fertilization":
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)             # <<<<<<<<<<<<<<
 *             nf.amtnit = i.get("nitrate", 0)
 *             nf.amtura = i.get("urea", 0)
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 247, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_nf.amtamm = __pyx_t_10;

      /* "_cotton2k/simulation.pyx":248
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)
 *             nf.amtnit = i.get("nitrate", 0)             # <<<<<<<<<<<<<<
 *             nf.amtura = i.get("urea", 0)
 *             nf.mthfrt = i.get("method", 0)
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 248, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 248, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_nf.amtnit = __pyx_t_10;

      /* "_cotton2k/simulation.pyx":249
 *             nf.amtamm = i.get("ammonium", 0)
 *             nf.amtnit = i.get("nitrate", 0)
 *             nf.amtura = i.get("urea", 0)             # <<<<<<<<<<<<<<
 *             nf.mthfrt = i.get("method", 0)
 *             isdhrz = i.get("drip_horizontal_place",
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 249, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_v_nf.amtura = __pyx_t_10;

      /* "_cotton2k/simulation.pyx":250
 *             nf.amtnit = i.get("nitrate", 0)
 *             nf.amtura = i.get("urea", 0)
 *             nf.mthfrt = i.get("method", 0)             # <<<<<<<<<<<<<<
 *             isdhrz = i.get("drip_horizontal_place",
 *                            0)  # horizontal placement of DRIP, cm from left edge of soil slab.
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 250, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_nf.mthfrt = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":251
 *             nf.amtura = i.get("urea", 0)
 *             nf.mthfrt = i.get("method", 0)
 *             isdhrz = i.get("drip_horizontal_place",             # <<<<<<<<<<<<<<
 *                            0)  # horizontal placement of DRIP, cm from left edge of soil slab.
 *             isddph = i.get("drip_depth",
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 251, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF_SET(__pyx_v_isdhrz, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":253
 *             isdhrz = i.get("drip_horizontal_place",
 *                            0)  # horizontal placement of DRIP, cm from left edge of soil slab.
 *             isddph = i.get("drip_depth",             # <<<<<<<<<<<<<<
 *                            0)  # vertical placement of DRIP, cm from soil surface.
 *             if nf.mthfrt == 1 or nf.mthfrt == 3:
 */
      __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_6 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 253, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_XDECREF_SET(__pyx_v_isddph, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "_cotton2k/simulation.pyx":255
 *             isddph = i.get("drip_depth",
 *                            0)  # vertical placement of DRIP, cm from soil surface.
 *             if nf.mthfrt == 1 or nf.mthfrt == 3:             # <<<<<<<<<<<<<<
 *                 nf.ksdr = SlabLoc(isdhrz, sim.row_space)
 *                 nf.lsdr = SlabLoc(isddph, 0)
 */
      switch (__pyx_v_nf.mthfrt) {
        case 1:
        case 3:

        /* "_cotton2k/simulation.pyx":256
 *                            0)  # vertical placement of DRIP, cm from soil surface.
 *             if nf.mthfrt == 1 or nf.mthfrt == 3:
 *                 nf.ksdr = SlabLoc(isdhrz, sim.row_space)             # <<<<<<<<<<<<<<
 *                 nf.lsdr = SlabLoc(isddph, 0)
 *             else:
 */
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_isdhrz); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 256, __pyx_L1_error)
        __pyx_v_nf.ksdr = SlabLoc(__pyx_t_9, __pyx_v_sim.row_space);

        /* "_cotton2k/simulation.pyx":257
 *             if nf.mthfrt == 1 or nf.mthfrt == 3:
 *                 nf.ksdr = SlabLoc(isdhrz, sim.row_space)
 *                 nf.lsdr = SlabLoc(isddph, 0)             # <<<<<<<<<<<<<<
 *             else:
 *                 nf.ksdr = 0
 */
        __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_v_isddph); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 257, __pyx_L1_error)
        __pyx_v_nf.lsdr = SlabLoc(__pyx_t_9, 0.0);

        /* "_cotton2k/simulation.pyx":255
 *             isddph = i.get("drip_depth",
 *                            0)  # vertical placement of DRIP, cm from soil surface.
 *             if nf.mthfrt == 1 or nf.mthfrt == 3:             # <<<<<<<<<<<<<<
 *                 nf.ksdr = SlabLoc(isdhrz, sim.row_space)
 *                 nf.lsdr = SlabLoc(isddph, 0)
 */
        break;
        default:

        /* "_cotton2k/simulation.pyx":259
 *                 nf.lsdr = SlabLoc(isddph, 0)
 *             else:
 *                 nf.ksdr = 0             # <<<<<<<<<<<<<<
 *                 nf.lsdr = 0
 *             NFertilizer[NumNitApps] = nf
 */
        __pyx_v_nf.ksdr = 0;

        /* "_cotton2k/simulation.pyx":260
 *             else:
 *                 nf.ksdr = 0
 *                 nf.lsdr = 0             # <<<<<<<<<<<<<<
 *             NFertilizer[NumNitApps] = nf
 *             NumNitApps += 1
 */
        __pyx_v_nf.lsdr = 0;
        break;
      }

      /* "_cotton2k/simulation.pyx":261
 *                 nf.ksdr = 0
 *                 nf.lsdr = 0
 *             NFertilizer[NumNitApps] = nf             # <<<<<<<<<<<<<<
 *             NumNitApps += 1
 *         elif i["type"] == "defoliation prediction":
 */
      (NFertilizer[NumNitApps]) = __pyx_v_nf;

      /* "_cotton2k/simulation.pyx":262
 *                 nf.lsdr = 0
 *             NFertilizer[NumNitApps] = nf
 *             NumNitApps += 1             # <<<<<<<<<<<<<<
 *         elif i["type"] == "defoliation prediction":
 *             DefoliationDate[idef] = date2doy(i["date"])
 */
      NumNitApps = (NumNitApps + 1);

      /* "_cotton2k/simulation.pyx":245
 *             sim.irrigation[NumIrrigations] = irrigation
 *             NumIrrigations += 1
 *         elif i["type"] == "fertilization":             # <<<<<<<<<<<<<<
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":263
 *             NFertilizer[NumNitApps] = nf
 *             NumNitApps += 1
 *         elif i["type"] == "defoliation prediction":             # <<<<<<<<<<<<<<
 *             DefoliationDate[idef] = date2doy(i["date"])
 *             DefoliantAppRate[idef] = -99.9
 */
    __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_type); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = (__Pyx_PyUnicode_Equals(__pyx_t_6, __pyx_kp_u_defoliation_prediction, Py_EQ)); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 263, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (__pyx_t_5) {

      /* "_cotton2k/simulation.pyx":264
 *             NumNitApps += 1
 *         elif i["type"] == "defoliation prediction":
 *             DefoliationDate[idef] = date2doy(i["date"])             # <<<<<<<<<<<<<<
 *             DefoliantAppRate[idef] = -99.9
 *             if idef == 0:
 */
      __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_7 = __Pyx_PyObject_Dict_GetItem(__pyx_v_i, __pyx_n_u_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_4);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_4, function);
          __pyx_t_9 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_6 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 264, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_6);
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      }
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_6); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idef); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 264, __pyx_L1_error)
      (DefoliationDate[__pyx_t_11]) = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":265
 *         elif i["type"] == "defoliation prediction":
 *             DefoliationDate[idef] = date2doy(i["date"])
 *             DefoliantAppRate[idef] = -99.9             # <<<<<<<<<<<<<<
 *             if idef == 0:
 *                 sim.day_defoliate = DefoliationDate[0]
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idef); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 265, __pyx_L1_error)
      (DefoliantAppRate[__pyx_t_11]) = -99.9;

      /* "_cotton2k/simulation.pyx":266
 *             DefoliationDate[idef] = date2doy(i["date"])
 *             DefoliantAppRate[idef] = -99.9
 *             if idef == 0:             # <<<<<<<<<<<<<<
 *                 sim.day_defoliate = DefoliationDate[0]
 *             DefoliationMethod[idef] = i.get("method", 0)
 */
      __pyx_t_6 = __Pyx_PyInt_EqObjC(__pyx_v_idef, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_6); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 266, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (__pyx_t_5) {

        /* "_cotton2k/simulation.pyx":267
 *             DefoliantAppRate[idef] = -99.9
 *             if idef == 0:
 *                 sim.day_defoliate = DefoliationDate[0]             # <<<<<<<<<<<<<<
 *             DefoliationMethod[idef] = i.get("method", 0)
 *             idef += 1
 */
        __pyx_v_sim.day_defoliate = (DefoliationDate[0]);

        /* "_cotton2k/simulation.pyx":266
 *             DefoliationDate[idef] = date2doy(i["date"])
 *             DefoliantAppRate[idef] = -99.9
 *             if idef == 0:             # <<<<<<<<<<<<<<
 *                 sim.day_defoliate = DefoliationDate[0]
 *             DefoliationMethod[idef] = i.get("method", 0)
 */
      }

      /* "_cotton2k/simulation.pyx":268
 *             if idef == 0:
 *                 sim.day_defoliate = DefoliationDate[0]
 *             DefoliationMethod[idef] = i.get("method", 0)             # <<<<<<<<<<<<<<
 *             idef += 1
 * 
 */
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_i, __pyx_n_s_get); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_9 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_9 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idef); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 268, __pyx_L1_error)
      (DefoliationMethod[__pyx_t_11]) = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":269
 *                 sim.day_defoliate = DefoliationDate[0]
 *             DefoliationMethod[idef] = i.get("method", 0)
 *             idef += 1             # <<<<<<<<<<<<<<
 * 
 * 
 */
      __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_idef, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 269, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF_SET(__pyx_v_idef, __pyx_t_4);
      __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":263
 *             NFertilizer[NumNitApps] = nf
 *             NumNitApps += 1
 *         elif i["type"] == "defoliation prediction":             # <<<<<<<<<<<<<<
 *             DefoliationDate[idef] = date2doy(i["date"])
 *             DefoliantAppRate[idef] = -99.9
 */
    }
    __pyx_L5:;

    /* "_cotton2k/simulation.pyx":231
 *     cdef Irrigation irrigation
 *     cdef NitrogenFertilizer nf
 *     for i in inputs:             # <<<<<<<<<<<<<<
 *         if i["type"] == "irrigation":
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":225
 *             raise StopIteration
 * 
 * cdef read_agricultural_input(cSimulation & sim, inputs):             # <<<<<<<<<<<<<<
 *     global NumNitApps, NumIrrigations
 *     NumNitApps = 0
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_cotton2k.simulation.read_agricultural_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_idef);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_isdhrz);
  __Pyx_XDECREF(__pyx_v_isddph);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":275
 *     cdef Leaf *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def area(self):
 *         return self._[0].area
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area___get__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area___get__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":277
 *     @property
 *     def area(self):
 *         return self._[0].area             # <<<<<<<<<<<<<<
 * 
 *     @area.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).area); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 277, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":275
 *     cdef Leaf *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def area(self):
 *         return self._[0].area
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.area.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":279
 *         return self._[0].area
 * 
 *     @area.setter             # <<<<<<<<<<<<<<
 *     def area(self, value):
 *         self._[0].area = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_4area_2__set__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":281
 *     @area.setter
 *     def area(self, value):
 *         self._[0].area = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 281, __pyx_L1_error)
  (__pyx_v_self->_[0]).area = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":279
 *         return self._[0].area
 * 
 *     @area.setter             # <<<<<<<<<<<<<<
 *     def area(self, value):
 *         self._[0].area = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.area.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":283
 *         self._[0].area = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def weight(self):
 *         return self._[0].weight
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight___get__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight___get__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":285
 *     @property
 *     def weight(self):
 *         return self._[0].weight             # <<<<<<<<<<<<<<
 * 
 *     @weight.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":283
 *         self._[0].area = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def weight(self):
 *         return self._[0].weight
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.weight.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":287
 *         return self._[0].weight
 * 
 *     @weight.setter             # <<<<<<<<<<<<<<
 *     def weight(self, value):
 *         self._[0].weight = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_6weight_2__set__(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":289
 *     @weight.setter
 *     def weight(self, value):
 *         self._[0].weight = value             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 289, __pyx_L1_error)
  (__pyx_v_self->_[0]).weight = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":287
 *         return self._[0].weight
 * 
 *     @weight.setter             # <<<<<<<<<<<<<<
 *     def weight(self, value):
 *         self._[0].weight = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.weight.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":292
 * 
 *     @staticmethod
 *     cdef NodeLeaf from_ptr(Leaf *_ptr):             # <<<<<<<<<<<<<<
 *         cdef NodeLeaf leaf = NodeLeaf.__new__(NodeLeaf)
 *         leaf._ = _ptr
 */

static struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_f_9_cotton2k_10simulation_8NodeLeaf_from_ptr(Leaf *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_leaf = 0;
  struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":293
 *     @staticmethod
 *     cdef NodeLeaf from_ptr(Leaf *_ptr):
 *         cdef NodeLeaf leaf = NodeLeaf.__new__(NodeLeaf)             # <<<<<<<<<<<<<<
 *         leaf._ = _ptr
 *         return leaf
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_NodeLeaf(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_NodeLeaf), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 293, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_leaf = ((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":294
 *     cdef NodeLeaf from_ptr(Leaf *_ptr):
 *         cdef NodeLeaf leaf = NodeLeaf.__new__(NodeLeaf)
 *         leaf._ = _ptr             # <<<<<<<<<<<<<<
 *         return leaf
 * 
 */
  __pyx_v_leaf->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":295
 *         cdef NodeLeaf leaf = NodeLeaf.__new__(NodeLeaf)
 *         leaf._ = _ptr
 *         return leaf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_leaf);
  __pyx_r = __pyx_v_leaf;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":292
 * 
 *     @staticmethod
 *     cdef NodeLeaf from_ptr(Leaf *_ptr):             # <<<<<<<<<<<<<<
 *         cdef NodeLeaf leaf = NodeLeaf.__new__(NodeLeaf)
 *         leaf._ = _ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_leaf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf___reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_8NodeLeaf_2__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_8NodeLeaf_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.NodeLeaf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":301
 *     cdef FruitingSite *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def average_temperature(self):
 *         return self._[0].average_temperature
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":303
 *     @property
 *     def average_temperature(self):
 *         return self._[0].average_temperature             # <<<<<<<<<<<<<<
 * 
 *     @average_temperature.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).average_temperature); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 303, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":301
 *     cdef FruitingSite *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def average_temperature(self):
 *         return self._[0].average_temperature
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.average_temperature.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":305
 *         return self._[0].average_temperature
 * 
 *     @average_temperature.setter             # <<<<<<<<<<<<<<
 *     def average_temperature(self, value):
 *         self._[0].average_temperature = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_19average_temperature_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":307
 *     @average_temperature.setter
 *     def average_temperature(self, value):
 *         self._[0].average_temperature = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 307, __pyx_L1_error)
  (__pyx_v_self->_[0]).average_temperature = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":305
 *         return self._[0].average_temperature
 * 
 *     @average_temperature.setter             # <<<<<<<<<<<<<<
 *     def average_temperature(self, value):
 *         self._[0].average_temperature = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.average_temperature.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":309
 *         self._[0].average_temperature = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def age(self):
 *         return self._[0].age
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3age_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3age_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_3age___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_3age___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":311
 *     @property
 *     def age(self):
 *         return self._[0].age             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).age); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 311, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":309
 *         self._[0].average_temperature = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def age(self):
 *         return self._[0].age
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.age.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":313
 *         return self._[0].age
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fraction(self):
 *         return self._[0].fraction
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":315
 *     @property
 *     def fraction(self):
 *         return self._[0].fraction             # <<<<<<<<<<<<<<
 * 
 *     @fraction.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).fraction); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":313
 *         return self._[0].age
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fraction(self):
 *         return self._[0].fraction
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.fraction.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":317
 *         return self._[0].fraction
 * 
 *     @fraction.setter             # <<<<<<<<<<<<<<
 *     def fraction(self, value):
 *         self._[0].fraction = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_8fraction_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":319
 *     @fraction.setter
 *     def fraction(self, value):
 *         self._[0].fraction = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 319, __pyx_L1_error)
  (__pyx_v_self->_[0]).fraction = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":317
 *         return self._[0].fraction
 * 
 *     @fraction.setter             # <<<<<<<<<<<<<<
 *     def fraction(self, value):
 *         self._[0].fraction = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.fraction.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":321
 *         self._[0].fraction = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def leaf(self):
 *         return NodeLeaf.from_ptr(&self._.leaf)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_4leaf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_4leaf_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_4leaf___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_4leaf___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":323
 *     @property
 *     def leaf(self):
 *         return NodeLeaf.from_ptr(&self._.leaf)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_8NodeLeaf_from_ptr((&__pyx_v_self->_->leaf))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 323, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":321
 *         self._[0].fraction = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def leaf(self):
 *         return NodeLeaf.from_ptr(&self._.leaf)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.leaf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":325
 *         return NodeLeaf.from_ptr(&self._.leaf)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stage(self):
 *         return self._[0].stage
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":327
 *     @property
 *     def stage(self):
 *         return self._[0].stage             # <<<<<<<<<<<<<<
 * 
 *     @stage.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_enum__Stage((__pyx_v_self->_[0]).stage); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 327, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":325
 *         return NodeLeaf.from_ptr(&self._.leaf)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stage(self):
 *         return self._[0].stage
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.stage.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":329
 *         return self._[0].stage
 * 
 *     @stage.setter             # <<<<<<<<<<<<<<
 *     def stage(self, value):
 *         self._[0].stage = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_12FruitingNode_5stage_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  enum Stage __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":331
 *     @stage.setter
 *     def stage(self, value):
 *         self._[0].stage = value             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = ((enum Stage)__Pyx_PyInt_As_enum__Stage(__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 331, __pyx_L1_error)
  (__pyx_v_self->_[0]).stage = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":329
 *         return self._[0].stage
 * 
 *     @stage.setter             # <<<<<<<<<<<<<<
 *     def stage(self, value):
 *         self._[0].stage = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.stage.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":334
 * 
 *     @staticmethod
 *     cdef FruitingNode from_ptr(FruitingSite *_ptr):             # <<<<<<<<<<<<<<
 *         cdef FruitingNode node = FruitingNode.__new__(FruitingNode)
 *         node._ = _ptr
 */

static struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_f_9_cotton2k_10simulation_12FruitingNode_from_ptr(FruitingSite *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_node = 0;
  struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":335
 *     @staticmethod
 *     cdef FruitingNode from_ptr(FruitingSite *_ptr):
 *         cdef FruitingNode node = FruitingNode.__new__(FruitingNode)             # <<<<<<<<<<<<<<
 *         node._ = _ptr
 *         return node
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_FruitingNode(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_FruitingNode), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 335, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_node = ((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":336
 *     cdef FruitingNode from_ptr(FruitingSite *_ptr):
 *         cdef FruitingNode node = FruitingNode.__new__(FruitingNode)
 *         node._ = _ptr             # <<<<<<<<<<<<<<
 *         return node
 * 
 */
  __pyx_v_node->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":337
 *         cdef FruitingNode node = FruitingNode.__new__(FruitingNode)
 *         node._ = _ptr
 *         return node             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_node);
  __pyx_r = __pyx_v_node;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":334
 * 
 *     @staticmethod
 *     cdef FruitingNode from_ptr(FruitingSite *_ptr):             # <<<<<<<<<<<<<<
 *         cdef FruitingNode node = FruitingNode.__new__(FruitingNode)
 *         node._ = _ptr
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_node);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode___reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12FruitingNode_2__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12FruitingNode_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingNode.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":343
 *     cdef cMainStemLeaf *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def area(self):
 *         return self._.leaf_area
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area___get__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area___get__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":345
 *     @property
 *     def area(self):
 *         return self._.leaf_area             # <<<<<<<<<<<<<<
 * 
 *     @area.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_->leaf_area); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":343
 *     cdef cMainStemLeaf *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def area(self):
 *         return self._.leaf_area
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.area.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":347
 *         return self._.leaf_area
 * 
 *     @area.setter             # <<<<<<<<<<<<<<
 *     def area(self, value):
 *         self._.leaf_area = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_4area_2__set__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":349
 *     @area.setter
 *     def area(self, value):
 *         self._.leaf_area = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 349, __pyx_L1_error)
  __pyx_v_self->_->leaf_area = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":347
 *         return self._.leaf_area
 * 
 *     @area.setter             # <<<<<<<<<<<<<<
 *     def area(self, value):
 *         self._.leaf_area = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.area.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":351
 *         self._.leaf_area = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def weight(self):
 *         return self._.leaf_weight
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight___get__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight___get__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":353
 *     @property
 *     def weight(self):
 *         return self._.leaf_weight             # <<<<<<<<<<<<<<
 * 
 *     @weight.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_->leaf_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 353, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":351
 *         self._.leaf_area = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def weight(self):
 *         return self._.leaf_weight
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.weight.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":355
 *         return self._.leaf_weight
 * 
 *     @weight.setter             # <<<<<<<<<<<<<<
 *     def weight(self, value):
 *         self._.leaf_weight = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_6weight_2__set__(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":357
 *     @weight.setter
 *     def weight(self, value):
 *         self._.leaf_weight = value             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 357, __pyx_L1_error)
  __pyx_v_self->_->leaf_weight = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":355
 *         return self._.leaf_weight
 * 
 *     @weight.setter             # <<<<<<<<<<<<<<
 *     def weight(self, value):
 *         self._.leaf_weight = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.weight.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":360
 * 
 *     @staticmethod
 *     cdef MainStemLeaf from_ptr(cMainStemLeaf *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

static struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_f_9_cotton2k_10simulation_12MainStemLeaf_from_ptr(MainStemLeaf *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_main_stem_leaf = 0;
  struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":368
 *         when the wrapper object is deallocated."""
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef MainStemLeaf main_stem_leaf = MainStemLeaf.__new__(MainStemLeaf)             # <<<<<<<<<<<<<<
 *         main_stem_leaf._ = _ptr
 *         return main_stem_leaf
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_MainStemLeaf(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_MainStemLeaf), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 368, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_main_stem_leaf = ((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":369
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef MainStemLeaf main_stem_leaf = MainStemLeaf.__new__(MainStemLeaf)
 *         main_stem_leaf._ = _ptr             # <<<<<<<<<<<<<<
 *         return main_stem_leaf
 * 
 */
  __pyx_v_main_stem_leaf->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":370
 *         cdef MainStemLeaf main_stem_leaf = MainStemLeaf.__new__(MainStemLeaf)
 *         main_stem_leaf._ = _ptr
 *         return main_stem_leaf             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_main_stem_leaf);
  __pyx_r = __pyx_v_main_stem_leaf;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":360
 * 
 *     @staticmethod
 *     cdef MainStemLeaf from_ptr(cMainStemLeaf *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_main_stem_leaf);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf___reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_2__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_12MainStemLeaf_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.MainStemLeaf.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":376
 *     cdef cFruitingBranch *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_nodes(self):
 *         return self._[0].number_of_fruiting_nodes
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":378
 *     @property
 *     def number_of_fruiting_nodes(self):
 *         return self._[0].number_of_fruiting_nodes             # <<<<<<<<<<<<<<
 * 
 *     @number_of_fruiting_nodes.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_[0]).number_of_fruiting_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 378, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":376
 *     cdef cFruitingBranch *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_nodes(self):
 *         return self._[0].number_of_fruiting_nodes
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.number_of_fruiting_nodes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":380
 *         return self._[0].number_of_fruiting_nodes
 * 
 *     @number_of_fruiting_nodes.setter             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_nodes(self, value):
 *         self._[0].number_of_fruiting_nodes = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":382
 *     @number_of_fruiting_nodes.setter
 *     def number_of_fruiting_nodes(self, value):
 *         self._[0].number_of_fruiting_nodes = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 382, __pyx_L1_error)
  (__pyx_v_self->_[0]).number_of_fruiting_nodes = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":380
 *         return self._[0].number_of_fruiting_nodes
 * 
 *     @number_of_fruiting_nodes.setter             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_nodes(self, value):
 *         self._[0].number_of_fruiting_nodes = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.number_of_fruiting_nodes.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":384
 *         self._[0].number_of_fruiting_nodes = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def delay_for_new_node(self):
 *         return self._[0].delay_for_new_node
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":386
 *     @property
 *     def delay_for_new_node(self):
 *         return self._[0].delay_for_new_node             # <<<<<<<<<<<<<<
 * 
 *     @delay_for_new_node.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).delay_for_new_node); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 386, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":384
 *         self._[0].number_of_fruiting_nodes = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def delay_for_new_node(self):
 *         return self._[0].delay_for_new_node
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.delay_for_new_node.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":388
 *         return self._[0].delay_for_new_node
 * 
 *     @delay_for_new_node.setter             # <<<<<<<<<<<<<<
 *     def delay_for_new_node(self, value):
 *         self._[0].delay_for_new_node = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_2__set__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":390
 *     @delay_for_new_node.setter
 *     def delay_for_new_node(self, value):
 *         self._[0].delay_for_new_node = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 390, __pyx_L1_error)
  (__pyx_v_self->_[0]).delay_for_new_node = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":388
 *         return self._[0].delay_for_new_node
 * 
 *     @delay_for_new_node.setter             # <<<<<<<<<<<<<<
 *     def delay_for_new_node(self, value):
 *         self._[0].delay_for_new_node = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.delay_for_new_node.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":392
 *         self._[0].delay_for_new_node = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def main_stem_leaf(self):
 *         return MainStemLeaf.from_ptr(&self._[0].main_stem_leaf)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":394
 *     @property
 *     def main_stem_leaf(self):
 *         return MainStemLeaf.from_ptr(&self._[0].main_stem_leaf)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_12MainStemLeaf_from_ptr((&(__pyx_v_self->_[0]).main_stem_leaf))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 394, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":392
 *         self._[0].delay_for_new_node = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def main_stem_leaf(self):
 *         return MainStemLeaf.from_ptr(&self._[0].main_stem_leaf)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.main_stem_leaf.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":396
 *         return MainStemLeaf.from_ptr(&self._[0].main_stem_leaf)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nodes(self):
 *         return [FruitingNode.from_ptr(&self._.nodes[i]) for i in
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_5nodes_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_5nodes_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_5nodes___get__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_5nodes___get__(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self) {
  unsigned int __pyx_8genexpr3__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":398
 *     @property
 *     def nodes(self):
 *         return [FruitingNode.from_ptr(&self._.nodes[i]) for i in             # <<<<<<<<<<<<<<
 *                 range(self._.number_of_fruiting_nodes)]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 398, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "_cotton2k/simulation.pyx":399
 *     def nodes(self):
 *         return [FruitingNode.from_ptr(&self._.nodes[i]) for i in
 *                 range(self._.number_of_fruiting_nodes)]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __pyx_t_2 = __pyx_v_self->_->number_of_fruiting_nodes;

    /* "_cotton2k/simulation.pyx":398
 *     @property
 *     def nodes(self):
 *         return [FruitingNode.from_ptr(&self._.nodes[i]) for i in             # <<<<<<<<<<<<<<
 *                 range(self._.number_of_fruiting_nodes)]
 * 
 */
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr3__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_12FruitingNode_from_ptr((&(__pyx_v_self->_->nodes[__pyx_8genexpr3__pyx_v_i])))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 398, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":396
 *         return MainStemLeaf.from_ptr(&self._[0].main_stem_leaf)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def nodes(self):
 *         return [FruitingNode.from_ptr(&self._.nodes[i]) for i in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.nodes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":402
 * 
 *     @staticmethod
 *     cdef FruitingBranch from_ptr(cFruitingBranch *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

static struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_f_9_cotton2k_10simulation_14FruitingBranch_from_ptr(FruitingBranch *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_fruiting_branch = 0;
  struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":410
 *         when the wrapper object is deallocated."""
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef FruitingBranch fruiting_branch = FruitingBranch.__new__(FruitingBranch)             # <<<<<<<<<<<<<<
 *         fruiting_branch._ = _ptr
 *         return fruiting_branch
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_FruitingBranch(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_FruitingBranch), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 410, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_fruiting_branch = ((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":411
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef FruitingBranch fruiting_branch = FruitingBranch.__new__(FruitingBranch)
 *         fruiting_branch._ = _ptr             # <<<<<<<<<<<<<<
 *         return fruiting_branch
 * 
 */
  __pyx_v_fruiting_branch->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":412
 *         cdef FruitingBranch fruiting_branch = FruitingBranch.__new__(FruitingBranch)
 *         fruiting_branch._ = _ptr
 *         return fruiting_branch             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_fruiting_branch);
  __pyx_r = __pyx_v_fruiting_branch;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":402
 * 
 *     @staticmethod
 *     cdef FruitingBranch from_ptr(cFruitingBranch *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_fruiting_branch);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch___reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_14FruitingBranch_2__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_14FruitingBranch_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.FruitingBranch.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":418
 *     cdef cVegetativeBranch *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_branches(self):
 *         return self._[0].number_of_fruiting_branches
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches___get__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":420
 *     @property
 *     def number_of_fruiting_branches(self):
 *         return self._[0].number_of_fruiting_branches             # <<<<<<<<<<<<<<
 * 
 *     @number_of_fruiting_branches.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_[0]).number_of_fruiting_branches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 420, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":418
 *     cdef cVegetativeBranch *_
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_branches(self):
 *         return self._[0].number_of_fruiting_branches
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.number_of_fruiting_branches.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":422
 *         return self._[0].number_of_fruiting_branches
 * 
 *     @number_of_fruiting_branches.setter             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_branches(self, value):
 *         self._[0].number_of_fruiting_branches = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_2__set__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":424
 *     @number_of_fruiting_branches.setter
 *     def number_of_fruiting_branches(self, value):
 *         self._[0].number_of_fruiting_branches = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 424, __pyx_L1_error)
  (__pyx_v_self->_[0]).number_of_fruiting_branches = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":422
 *         return self._[0].number_of_fruiting_branches
 * 
 *     @number_of_fruiting_branches.setter             # <<<<<<<<<<<<<<
 *     def number_of_fruiting_branches(self, value):
 *         self._[0].number_of_fruiting_branches = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.number_of_fruiting_branches.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":426
 *         self._[0].number_of_fruiting_branches = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def delay_for_new_fruiting_branch(self):
 *         return self._[0].delay_for_new_fruiting_branch
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch___get__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":428
 *     @property
 *     def delay_for_new_fruiting_branch(self):
 *         return self._[0].delay_for_new_fruiting_branch             # <<<<<<<<<<<<<<
 * 
 *     @delay_for_new_fruiting_branch.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble((__pyx_v_self->_[0]).delay_for_new_fruiting_branch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":426
 *         self._[0].number_of_fruiting_branches = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def delay_for_new_fruiting_branch(self):
 *         return self._[0].delay_for_new_fruiting_branch
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.delay_for_new_fruiting_branch.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":430
 *         return self._[0].delay_for_new_fruiting_branch
 * 
 *     @delay_for_new_fruiting_branch.setter             # <<<<<<<<<<<<<<
 *     def delay_for_new_fruiting_branch(self, value):
 *         self._[0].delay_for_new_fruiting_branch = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_2__set__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":432
 *     @delay_for_new_fruiting_branch.setter
 *     def delay_for_new_fruiting_branch(self, value):
 *         self._[0].delay_for_new_fruiting_branch = value             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 432, __pyx_L1_error)
  (__pyx_v_self->_[0]).delay_for_new_fruiting_branch = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":430
 *         return self._[0].delay_for_new_fruiting_branch
 * 
 *     @delay_for_new_fruiting_branch.setter             # <<<<<<<<<<<<<<
 *     def delay_for_new_fruiting_branch(self, value):
 *         self._[0].delay_for_new_fruiting_branch = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.delay_for_new_fruiting_branch.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":434
 *         self._[0].delay_for_new_fruiting_branch = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fruiting_branches(self):
 *         return [FruitingBranch.from_ptr(&self._[0].fruiting_branches[i]) for i in
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches___get__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self) {
  unsigned int __pyx_8genexpr4__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  unsigned int __pyx_t_3;
  unsigned int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":436
 *     @property
 *     def fruiting_branches(self):
 *         return [FruitingBranch.from_ptr(&self._[0].fruiting_branches[i]) for i in             # <<<<<<<<<<<<<<
 *                 range(self._[0].number_of_fruiting_branches)]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 436, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "_cotton2k/simulation.pyx":437
 *     def fruiting_branches(self):
 *         return [FruitingBranch.from_ptr(&self._[0].fruiting_branches[i]) for i in
 *                 range(self._[0].number_of_fruiting_branches)]             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
    __pyx_t_2 = (__pyx_v_self->_[0]).number_of_fruiting_branches;

    /* "_cotton2k/simulation.pyx":436
 *     @property
 *     def fruiting_branches(self):
 *         return [FruitingBranch.from_ptr(&self._[0].fruiting_branches[i]) for i in             # <<<<<<<<<<<<<<
 *                 range(self._[0].number_of_fruiting_branches)]
 * 
 */
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr4__pyx_v_i = __pyx_t_4;
      __pyx_t_5 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_14FruitingBranch_from_ptr((&((__pyx_v_self->_[0]).fruiting_branches[__pyx_8genexpr4__pyx_v_i])))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 436, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":434
 *         self._[0].delay_for_new_fruiting_branch = value
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def fruiting_branches(self):
 *         return [FruitingBranch.from_ptr(&self._[0].fruiting_branches[i]) for i in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.fruiting_branches.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":440
 * 
 *     @staticmethod
 *     cdef VegetativeBranch from_ptr(cVegetativeBranch *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

static struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_f_9_cotton2k_10simulation_16VegetativeBranch_from_ptr(VegetativeBranch *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_vegetative_branch = 0;
  struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":448
 *         when the wrapper object is deallocated."""
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef VegetativeBranch vegetative_branch = VegetativeBranch.__new__(VegetativeBranch)             # <<<<<<<<<<<<<<
 *         vegetative_branch._ = _ptr
 *         return vegetative_branch
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_VegetativeBranch(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_VegetativeBranch), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 448, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_vegetative_branch = ((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":449
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef VegetativeBranch vegetative_branch = VegetativeBranch.__new__(VegetativeBranch)
 *         vegetative_branch._ = _ptr             # <<<<<<<<<<<<<<
 *         return vegetative_branch
 * 
 */
  __pyx_v_vegetative_branch->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":450
 *         cdef VegetativeBranch vegetative_branch = VegetativeBranch.__new__(VegetativeBranch)
 *         vegetative_branch._ = _ptr
 *         return vegetative_branch             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_vegetative_branch);
  __pyx_r = __pyx_v_vegetative_branch;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":440
 * 
 *     @staticmethod
 *     cdef VegetativeBranch from_ptr(cVegetativeBranch *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_vegetative_branch);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch___reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch___reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_2__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_16VegetativeBranch_2__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.VegetativeBranch.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":456
 *     cdef cState *_
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return dict(self._[0]).keys()
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_1keys(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_5State_1keys = {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_1keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_1keys(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("keys (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("keys", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "keys", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_keys(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_keys(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("keys", 0);

  /* "_cotton2k/simulation.pyx":457
 * 
 *     def keys(self):
 *         return dict(self._[0]).keys()             # <<<<<<<<<<<<<<
 * 
 *     def __getattr__(self, item):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __pyx_convert__to_py_State((__pyx_v_self->_[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyDict_Keys(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 457, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":456
 *     cdef cState *_
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return dict(self._[0]).keys()
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_cotton2k.simulation.State.keys", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":459
 *         return dict(self._[0]).keys()
 * 
 *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
 *         state = dict(self._[0])
 *         return state[item]
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_3__getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_2__getattr__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), ((PyObject *)__pyx_v_item));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_2__getattr__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getattr__", 0);

  /* "_cotton2k/simulation.pyx":460
 * 
 *     def __getattr__(self, item):
 *         state = dict(self._[0])             # <<<<<<<<<<<<<<
 *         return state[item]
 * 
 */
  __pyx_t_1 = __pyx_convert__to_py_State((__pyx_v_self->_[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 460, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":461
 *     def __getattr__(self, item):
 *         state = dict(self._[0])
 *         return state[item]             # <<<<<<<<<<<<<<
 * 
 *     def __setattr__(self, key, value):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyDict_GetItem(__pyx_v_state, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 461, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":459
 *         return dict(self._[0]).keys()
 * 
 *     def __getattr__(self, item):             # <<<<<<<<<<<<<<
 *         state = dict(self._[0])
 *         return state[item]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_cotton2k.simulation.State.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":463
 *         return state[item]
 * 
 *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
 *         state = dict(self._[0])
 *         state[key] = value
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_5State_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_5State_5__setattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setattr__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_4__setattr__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), ((PyObject *)__pyx_v_key), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_5State_4__setattr__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_key, PyObject *__pyx_v_value) {
  PyObject *__pyx_v_state = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  State __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setattr__", 0);

  /* "_cotton2k/simulation.pyx":464
 * 
 *     def __setattr__(self, key, value):
 *         state = dict(self._[0])             # <<<<<<<<<<<<<<
 *         state[key] = value
 *         self._[0] = state
 */
  __pyx_t_1 = __pyx_convert__to_py_State((__pyx_v_self->_[0])); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_CallOneArg(((PyObject *)(&PyDict_Type)), __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 464, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_state = ((PyObject*)__pyx_t_2);
  __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":465
 *     def __setattr__(self, key, value):
 *         state = dict(self._[0])
 *         state[key] = value             # <<<<<<<<<<<<<<
 *         self._[0] = state
 * 
 */
  if (unlikely((PyDict_SetItem(__pyx_v_state, __pyx_v_key, __pyx_v_value) < 0))) __PYX_ERR(0, 465, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":466
 *         state = dict(self._[0])
 *         state[key] = value
 *         self._[0] = state             # <<<<<<<<<<<<<<
 * 
 *     def __getitem__(self, item):
 */
  __pyx_t_3 = __pyx_convert__from_py_State(__pyx_v_state); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 466, __pyx_L1_error)
  (__pyx_v_self->_[0]) = __pyx_t_3;

  /* "_cotton2k/simulation.pyx":463
 *         return state[item]
 * 
 *     def __setattr__(self, key, value):             # <<<<<<<<<<<<<<
 *         state = dict(self._[0])
 *         state[key] = value
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_cotton2k.simulation.State.__setattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":468
 *         self._[0] = state
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.__getattr__(item)
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_7__getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_6__getitem__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), ((PyObject *)__pyx_v_item));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_6__getitem__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_item) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__getitem__", 0);

  /* "_cotton2k/simulation.pyx":469
 * 
 *     def __getitem__(self, item):
 *         return self.__getattr__(item)             # <<<<<<<<<<<<<<
 * 
 *     @staticmethod
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_getattr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 469, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_item};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 469, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":468
 *         self._[0] = state
 * 
 *     def __getitem__(self, item):             # <<<<<<<<<<<<<<
 *         return self.__getattr__(item)
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.State.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":472
 * 
 *     @staticmethod
 *     cdef State from_ptr(cState *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

static struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_f_9_cotton2k_10simulation_5State_from_ptr(State *__pyx_v__ptr) {
  struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_state = 0;
  struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("from_ptr", 0);

  /* "_cotton2k/simulation.pyx":480
 *         when the wrapper object is deallocated."""
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef State state = State.__new__(State)             # <<<<<<<<<<<<<<
 *         state._ = _ptr
 *         return state
 */
  __pyx_t_1 = ((PyObject *)__pyx_tp_new_9_cotton2k_10simulation_State(((PyTypeObject *)__pyx_ptype_9_cotton2k_10simulation_State), __pyx_empty_tuple, NULL)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 480, __pyx_L1_error)
  __Pyx_GOTREF((PyObject *)__pyx_t_1);
  __pyx_v_state = ((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":481
 *         # Call to __new__ bypasses __init__ constructor
 *         cdef State state = State.__new__(State)
 *         state._ = _ptr             # <<<<<<<<<<<<<<
 *         return state
 * 
 */
  __pyx_v_state->_ = __pyx_v__ptr;

  /* "_cotton2k/simulation.pyx":482
 *         cdef State state = State.__new__(State)
 *         state._ = _ptr
 *         return state             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF((PyObject *)__pyx_r);
  __Pyx_INCREF((PyObject *)__pyx_v_state);
  __pyx_r = __pyx_v_state;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":472
 * 
 *     @staticmethod
 *     cdef State from_ptr(cState *_ptr):             # <<<<<<<<<<<<<<
 *         """Factory function to create WrapperClass objects from
 *         given my_c_struct pointer.
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.State.from_ptr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF((PyObject *)__pyx_v_state);
  __Pyx_XGIVEREF((PyObject *)__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":484
 *         return state
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def vegetative_branches(self):
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_19vegetative_branches_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_19vegetative_branches_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_19vegetative_branches___get__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_19vegetative_branches___get__(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self) {
  PyObject *__pyx_8genexpr5__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  PyObject *(*__pyx_t_5)(PyObject *);
  Py_ssize_t __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":486
 *     @property
 *     def vegetative_branches(self):
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]             # <<<<<<<<<<<<<<
 * 
 *     def create_first_square(self, stemNRatio, first_square_leaf_area):
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_number_of_vegetative_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L5_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
      __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_4 = 0;
      __pyx_t_5 = NULL;
    } else {
      __pyx_t_4 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 486, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 486, __pyx_L5_error)
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    for (;;) {
      if (likely(!__pyx_t_5)) {
        if (likely(PyList_CheckExact(__pyx_t_2))) {
          if (__pyx_t_4 >= PyList_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        } else {
          if (__pyx_t_4 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_4); __Pyx_INCREF(__pyx_t_3); __pyx_t_4++; if (unlikely((0 < 0))) __PYX_ERR(0, 486, __pyx_L5_error)
          #else
          __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_4); __pyx_t_4++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L5_error)
          __Pyx_GOTREF(__pyx_t_3);
          #endif
        }
      } else {
        __pyx_t_3 = __pyx_t_5(__pyx_t_2);
        if (unlikely(!__pyx_t_3)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 486, __pyx_L5_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_3);
      }
      __Pyx_XDECREF_SET(__pyx_8genexpr5__pyx_v_k, __pyx_t_3);
      __pyx_t_3 = 0;
      __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_8genexpr5__pyx_v_k); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 486, __pyx_L5_error)
      __pyx_t_3 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_16VegetativeBranch_from_ptr((&((__pyx_v_self->_[0]).vegetative_branches[__pyx_t_6])))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 486, __pyx_L5_error)
      __Pyx_GOTREF(__pyx_t_3);
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_3))) __PYX_ERR(0, 486, __pyx_L5_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0;
    goto __pyx_L8_exit_scope;
    __pyx_L5_error:;
    __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k); __pyx_8genexpr5__pyx_v_k = 0;
    goto __pyx_L1_error;
    __pyx_L8_exit_scope:;
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":484
 *         return state
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def vegetative_branches(self):
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.State.vegetative_branches.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_8genexpr5__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":488
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 * 
 *     def create_first_square(self, stemNRatio, first_square_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function initiates the first square. It is called from function CottonPhenology().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_9create_first_square(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_5State_8create_first_square, "\n        This function initiates the first square. It is called from function CottonPhenology().\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_5State_9create_first_square = {"create_first_square", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_9create_first_square, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_5State_8create_first_square};
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_9create_first_square(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_stemNRatio = 0;
  PyObject *__pyx_v_first_square_leaf_area = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("create_first_square (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stemNRatio,&__pyx_n_s_first_square_leaf_area,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_stemNRatio,&__pyx_n_s_first_square_leaf_area,0};
    #endif
    PyObject* values[2] = {0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stemNRatio)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_first_square_leaf_area)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 488, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("create_first_square", 1, 2, 2, 1); __PYX_ERR(0, 488, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "create_first_square") < 0)) __PYX_ERR(0, 488, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 2)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
    }
    __pyx_v_stemNRatio = values[0];
    __pyx_v_first_square_leaf_area = values[1];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("create_first_square", 1, 2, 2, __pyx_nargs); __PYX_ERR(0, 488, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.State.create_first_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_8create_first_square(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), __pyx_v_stemNRatio, __pyx_v_first_square_leaf_area);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_8create_first_square(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_first_square_leaf_area) {
  PyObject *__pyx_v_first_node = NULL;
  double __pyx_v_cotylwt;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("create_first_square", 0);

  /* "_cotton2k/simulation.pyx":493
 *         """
 *         # FruitFraction and FruitingCode are assigned 1 for the first fruiting site.
 *         self.vegetative_branches[0].number_of_fruiting_branches = 1             # <<<<<<<<<<<<<<
 *         self.vegetative_branches[0].fruiting_branches[0].number_of_fruiting_nodes = 1
 *         first_node = self.vegetative_branches[0].fruiting_branches[0].nodes[0]
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vegetative_branches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_number_of_fruiting_branches, __pyx_int_1) < 0) __PYX_ERR(0, 493, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":494
 *         # FruitFraction and FruitingCode are assigned 1 for the first fruiting site.
 *         self.vegetative_branches[0].number_of_fruiting_branches = 1
 *         self.vegetative_branches[0].fruiting_branches[0].number_of_fruiting_nodes = 1             # <<<<<<<<<<<<<<
 *         first_node = self.vegetative_branches[0].fruiting_branches[0].nodes[0]
 *         first_node.stage = Stage.Square
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vegetative_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_fruiting_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_1, __pyx_n_s_number_of_fruiting_nodes, __pyx_int_1) < 0) __PYX_ERR(0, 494, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":495
 *         self.vegetative_branches[0].number_of_fruiting_branches = 1
 *         self.vegetative_branches[0].fruiting_branches[0].number_of_fruiting_nodes = 1
 *         first_node = self.vegetative_branches[0].fruiting_branches[0].nodes[0]             # <<<<<<<<<<<<<<
 *         first_node.stage = Stage.Square
 *         first_node.fraction = 1
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vegetative_branches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_fruiting_branches); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 495, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_first_node = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":496
 *         self.vegetative_branches[0].fruiting_branches[0].number_of_fruiting_nodes = 1
 *         first_node = self.vegetative_branches[0].fruiting_branches[0].nodes[0]
 *         first_node.stage = Stage.Square             # <<<<<<<<<<<<<<
 *         first_node.fraction = 1
 *         # Initialize a new leaf at this position. define its initial weight and area. VarPar[34] is the initial area of a new leaf. The mass and nitrogen of the new leaf are substacted from the stem.
 */
  __pyx_t_2 = __Pyx_PyInt_From_enum__Stage(Square); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_first_node, __pyx_n_s_stage, __pyx_t_2) < 0) __PYX_ERR(0, 496, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":497
 *         first_node = self.vegetative_branches[0].fruiting_branches[0].nodes[0]
 *         first_node.stage = Stage.Square
 *         first_node.fraction = 1             # <<<<<<<<<<<<<<
 *         # Initialize a new leaf at this position. define its initial weight and area. VarPar[34] is the initial area of a new leaf. The mass and nitrogen of the new leaf are substacted from the stem.
 *         first_node.leaf.area = first_square_leaf_area
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_first_node, __pyx_n_s_fraction, __pyx_int_1) < 0) __PYX_ERR(0, 497, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":499
 *         first_node.fraction = 1
 *         # Initialize a new leaf at this position. define its initial weight and area. VarPar[34] is the initial area of a new leaf. The mass and nitrogen of the new leaf are substacted from the stem.
 *         first_node.leaf.area = first_square_leaf_area             # <<<<<<<<<<<<<<
 *         first_node.leaf.weight = first_square_leaf_area * self.leaf_weight_area_ratio
 *         self.stem_weight -= first_node.leaf.weight
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_area, __pyx_v_first_square_leaf_area) < 0) __PYX_ERR(0, 499, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":500
 *         # Initialize a new leaf at this position. define its initial weight and area. VarPar[34] is the initial area of a new leaf. The mass and nitrogen of the new leaf are substacted from the stem.
 *         first_node.leaf.area = first_square_leaf_area
 *         first_node.leaf.weight = first_square_leaf_area * self.leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *         self.stem_weight -= first_node.leaf.weight
 *         self.leaf_weight += first_node.leaf.weight
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight_area_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Multiply(__pyx_v_first_square_leaf_area, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_2, __pyx_n_s_weight, __pyx_t_1) < 0) __PYX_ERR(0, 500, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":501
 *         first_node.leaf.area = first_square_leaf_area
 *         first_node.leaf.weight = first_square_leaf_area * self.leaf_weight_area_ratio
 *         self.stem_weight -= first_node.leaf.weight             # <<<<<<<<<<<<<<
 *         self.leaf_weight += first_node.leaf.weight
 *         self.leaf_nitrogen += first_node.leaf.weight * stemNRatio
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_weight, __pyx_t_1) < 0) __PYX_ERR(0, 501, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":502
 *         first_node.leaf.weight = first_square_leaf_area * self.leaf_weight_area_ratio
 *         self.stem_weight -= first_node.leaf.weight
 *         self.leaf_weight += first_node.leaf.weight             # <<<<<<<<<<<<<<
 *         self.leaf_nitrogen += first_node.leaf.weight * stemNRatio
 *         self.stem_nitrogen -= first_node.leaf.weight * stemNRatio
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceAdd(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight, __pyx_t_3) < 0) __PYX_ERR(0, 502, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":503
 *         self.stem_weight -= first_node.leaf.weight
 *         self.leaf_weight += first_node.leaf.weight
 *         self.leaf_nitrogen += first_node.leaf.weight * stemNRatio             # <<<<<<<<<<<<<<
 *         self.stem_nitrogen -= first_node.leaf.weight * stemNRatio
 *         first_node.average_temperature = self.average_temperature
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_1, __pyx_v_stemNRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen, __pyx_t_1) < 0) __PYX_ERR(0, 503, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":504
 *         self.leaf_weight += first_node.leaf.weight
 *         self.leaf_nitrogen += first_node.leaf.weight * stemNRatio
 *         self.stem_nitrogen -= first_node.leaf.weight * stemNRatio             # <<<<<<<<<<<<<<
 *         first_node.average_temperature = self.average_temperature
 *         # Define the initial values of NumFruitBranches, NumNodes, state.fruit_growth_ratio, and AvrgNodeTemper.
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_nitrogen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_first_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_v_stemNRatio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_nitrogen, __pyx_t_3) < 0) __PYX_ERR(0, 504, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":505
 *         self.leaf_nitrogen += first_node.leaf.weight * stemNRatio
 *         self.stem_nitrogen -= first_node.leaf.weight * stemNRatio
 *         first_node.average_temperature = self.average_temperature             # <<<<<<<<<<<<<<
 *         # Define the initial values of NumFruitBranches, NumNodes, state.fruit_growth_ratio, and AvrgNodeTemper.
 *         self.fruit_growth_ratio = 1
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_first_node, __pyx_n_s_average_temperature, __pyx_t_3) < 0) __PYX_ERR(0, 505, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":507
 *         first_node.average_temperature = self.average_temperature
 *         # Define the initial values of NumFruitBranches, NumNodes, state.fruit_growth_ratio, and AvrgNodeTemper.
 *         self.fruit_growth_ratio = 1             # <<<<<<<<<<<<<<
 *         # It is assumed that the cotyledons are dropped at time of first square. compute changes in AbscisedLeafWeight, state.leaf_weight, state.leaf_nitrogen and CumPlantNLoss caused by the abscission of the cotyledons.
 *         cdef double cotylwt = 0.20  # cotylwt is the leaf weight of the cotyledons.
 */
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_fruit_growth_ratio, __pyx_int_1) < 0) __PYX_ERR(0, 507, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":509
 *         self.fruit_growth_ratio = 1
 *         # It is assumed that the cotyledons are dropped at time of first square. compute changes in AbscisedLeafWeight, state.leaf_weight, state.leaf_nitrogen and CumPlantNLoss caused by the abscission of the cotyledons.
 *         cdef double cotylwt = 0.20  # cotylwt is the leaf weight of the cotyledons.             # <<<<<<<<<<<<<<
 *         self.abscised_leaf_weight += cotylwt
 *         self.leaf_weight -= cotylwt
 */
  __pyx_v_cotylwt = 0.20;

  /* "_cotton2k/simulation.pyx":510
 *         # It is assumed that the cotyledons are dropped at time of first square. compute changes in AbscisedLeafWeight, state.leaf_weight, state.leaf_nitrogen and CumPlantNLoss caused by the abscission of the cotyledons.
 *         cdef double cotylwt = 0.20  # cotylwt is the leaf weight of the cotyledons.
 *         self.abscised_leaf_weight += cotylwt             # <<<<<<<<<<<<<<
 *         self.leaf_weight -= cotylwt
 *         self.cumulative_nitrogen_loss += cotylwt * self.leaf_nitrogen / self.leaf_weight
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abscised_leaf_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cotylwt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_abscised_leaf_weight, __pyx_t_1) < 0) __PYX_ERR(0, 510, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":511
 *         cdef double cotylwt = 0.20  # cotylwt is the leaf weight of the cotyledons.
 *         self.abscised_leaf_weight += cotylwt
 *         self.leaf_weight -= cotylwt             # <<<<<<<<<<<<<<
 *         self.cumulative_nitrogen_loss += cotylwt * self.leaf_nitrogen / self.leaf_weight
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cotylwt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight, __pyx_t_3) < 0) __PYX_ERR(0, 511, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":512
 *         self.abscised_leaf_weight += cotylwt
 *         self.leaf_weight -= cotylwt
 *         self.cumulative_nitrogen_loss += cotylwt * self.leaf_nitrogen / self.leaf_weight             # <<<<<<<<<<<<<<
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cumulative_nitrogen_loss); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cotylwt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cumulative_nitrogen_loss, __pyx_t_1) < 0) __PYX_ERR(0, 512, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":513
 *         self.leaf_weight -= cotylwt
 *         self.cumulative_nitrogen_loss += cotylwt * self.leaf_nitrogen / self.leaf_weight
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight             # <<<<<<<<<<<<<<
 * 
 *     def add_fruiting_branch(self, k, density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, time_to_new_fruiting_branch, new_node_initial_leaf_area):
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_cotylwt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen, __pyx_t_3) < 0) __PYX_ERR(0, 513, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":488
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 * 
 *     def create_first_square(self, stemNRatio, first_square_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function initiates the first square. It is called from function CottonPhenology().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.State.create_first_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_first_node);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":515
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 * 
 *     def add_fruiting_branch(self, k, density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, time_to_new_fruiting_branch, new_node_initial_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides if a new fruiting branch is to be added to a vegetative branch, and forms it. It is called from function CottonPhenology().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_11add_fruiting_branch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_5State_10add_fruiting_branch, "\n        This function decides if a new fruiting branch is to be added to a vegetative branch, and forms it. It is called from function CottonPhenology().\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_5State_11add_fruiting_branch = {"add_fruiting_branch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_11add_fruiting_branch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_5State_10add_fruiting_branch};
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_11add_fruiting_branch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_k = 0;
  PyObject *__pyx_v_density_factor = 0;
  PyObject *__pyx_v_delayVegByCStress = 0;
  CYTHON_UNUSED PyObject *__pyx_v_delayFrtByCStress = 0;
  PyObject *__pyx_v_stemNRatio = 0;
  PyObject *__pyx_v_PhenDelayByNStress = 0;
  PyObject *__pyx_v_time_to_new_fruiting_branch = 0;
  PyObject *__pyx_v_new_node_initial_leaf_area = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("add_fruiting_branch (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_density_factor,&__pyx_n_s_delayVegByCStress,&__pyx_n_s_delayFrtByCStress,&__pyx_n_s_stemNRatio,&__pyx_n_s_PhenDelayByNStress,&__pyx_n_s_time_to_new_fruiting_branch,&__pyx_n_s_new_node_initial_leaf_area,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_k,&__pyx_n_s_density_factor,&__pyx_n_s_delayVegByCStress,&__pyx_n_s_delayFrtByCStress,&__pyx_n_s_stemNRatio,&__pyx_n_s_PhenDelayByNStress,&__pyx_n_s_time_to_new_fruiting_branch,&__pyx_n_s_new_node_initial_leaf_area,0};
    #endif
    PyObject* values[8] = {0,0,0,0,0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  8: values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
        CYTHON_FALLTHROUGH;
        case  7: values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
        CYTHON_FALLTHROUGH;
        case  6: values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
        CYTHON_FALLTHROUGH;
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_k)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_density_factor)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 1); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delayVegByCStress)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 2); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delayFrtByCStress)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 3); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stemNRatio)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 4); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  5:
        if (likely((values[5] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_PhenDelayByNStress)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 5); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  6:
        if (likely((values[6] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_time_to_new_fruiting_branch)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 6); __PYX_ERR(0, 515, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  7:
        if (likely((values[7] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_new_node_initial_leaf_area)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 515, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, 7); __PYX_ERR(0, 515, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "add_fruiting_branch") < 0)) __PYX_ERR(0, 515, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 8)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
      values[5] = __Pyx_Arg_FASTCALL(__pyx_args, 5);
      values[6] = __Pyx_Arg_FASTCALL(__pyx_args, 6);
      values[7] = __Pyx_Arg_FASTCALL(__pyx_args, 7);
    }
    __pyx_v_k = values[0];
    __pyx_v_density_factor = values[1];
    __pyx_v_delayVegByCStress = values[2];
    __pyx_v_delayFrtByCStress = values[3];
    __pyx_v_stemNRatio = values[4];
    __pyx_v_PhenDelayByNStress = values[5];
    __pyx_v_time_to_new_fruiting_branch = values[6];
    __pyx_v_new_node_initial_leaf_area = values[7];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("add_fruiting_branch", 1, 8, 8, __pyx_nargs); __PYX_ERR(0, 515, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.State.add_fruiting_branch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_10add_fruiting_branch(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), __pyx_v_k, __pyx_v_density_factor, __pyx_v_delayVegByCStress, __pyx_v_delayFrtByCStress, __pyx_v_stemNRatio, __pyx_v_PhenDelayByNStress, __pyx_v_time_to_new_fruiting_branch, __pyx_v_new_node_initial_leaf_area);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_10add_fruiting_branch(struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, PyObject *__pyx_v_k, PyObject *__pyx_v_density_factor, PyObject *__pyx_v_delayVegByCStress, CYTHON_UNUSED PyObject *__pyx_v_delayFrtByCStress, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_PhenDelayByNStress, PyObject *__pyx_v_time_to_new_fruiting_branch, PyObject *__pyx_v_new_node_initial_leaf_area) {
  double __pyx_v_vfrtbr[8];
  PyObject *__pyx_v_vegetative_branch = NULL;
  PyObject *__pyx_v_last_fruiting_branch = NULL;
  double __pyx_v_tav;
  double __pyx_v_TimeToNextFruBranch;
  CYTHON_UNUSED int __pyx_v_newbr;
  PyObject *__pyx_v_new_branch = NULL;
  PyObject *__pyx_v_new_node = NULL;
  PyObject *__pyx_v_main_stem_leaf = NULL;
  double __pyx_v_addlfn;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1[8];
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  int __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("add_fruiting_branch", 0);

  /* "_cotton2k/simulation.pyx":520
 *         """
 *         # The following constant parameters are used:
 *         cdef double[8] vfrtbr = [0.8, 0.95, 33.0, 4.461, -0.1912, 0.00265, 1.8, -1.32]             # <<<<<<<<<<<<<<
 *         # Compute the cumulative delay for the appearance of the next caused by carbohydrate, nitrogen, and water stresses.
 *         vegetative_branch = self.vegetative_branches[k]
 */
  __pyx_t_1[0] = 0.8;
  __pyx_t_1[1] = 0.95;
  __pyx_t_1[2] = 33.0;
  __pyx_t_1[3] = 4.461;
  __pyx_t_1[4] = -0.1912;
  __pyx_t_1[5] = 0.00265;
  __pyx_t_1[6] = 1.8;
  __pyx_t_1[7] = -1.32;
  memcpy(&(__pyx_v_vfrtbr[0]), __pyx_t_1, sizeof(__pyx_v_vfrtbr[0]) * (8));

  /* "_cotton2k/simulation.pyx":522
 *         cdef double[8] vfrtbr = [0.8, 0.95, 33.0, 4.461, -0.1912, 0.00265, 1.8, -1.32]
 *         # Compute the cumulative delay for the appearance of the next caused by carbohydrate, nitrogen, and water stresses.
 *         vegetative_branch = self.vegetative_branches[k]             # <<<<<<<<<<<<<<
 *         vegetative_branch.delay_for_new_fruiting_branch += delayVegByCStress + vfrtbr[0] * PhenDelayByNStress
 *         vegetative_branch.delay_for_new_fruiting_branch += vfrtbr[1] * (1 - self.water_stress)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_vegetative_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetItem(__pyx_t_2, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 522, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_vegetative_branch = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":523
 *         # Compute the cumulative delay for the appearance of the next caused by carbohydrate, nitrogen, and water stresses.
 *         vegetative_branch = self.vegetative_branches[k]
 *         vegetative_branch.delay_for_new_fruiting_branch += delayVegByCStress + vfrtbr[0] * PhenDelayByNStress             # <<<<<<<<<<<<<<
 *         vegetative_branch.delay_for_new_fruiting_branch += vfrtbr[1] * (1 - self.water_stress)
 *         # Define nbrch and compute TimeToNextFruBranch, the time (in physiological days) needed for the formation of each successive fruiting branch, as a function of the average temperature. This function is derived from data of K. R. Reddy, CSRU, adjusted for age expressed in physiological days.
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_vfrtbr[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_2, __pyx_v_PhenDelayByNStress); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Add(__pyx_v_delayVegByCStress, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch, __pyx_t_4) < 0) __PYX_ERR(0, 523, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":524
 *         vegetative_branch = self.vegetative_branches[k]
 *         vegetative_branch.delay_for_new_fruiting_branch += delayVegByCStress + vfrtbr[0] * PhenDelayByNStress
 *         vegetative_branch.delay_for_new_fruiting_branch += vfrtbr[1] * (1 - self.water_stress)             # <<<<<<<<<<<<<<
 *         # Define nbrch and compute TimeToNextFruBranch, the time (in physiological days) needed for the formation of each successive fruiting branch, as a function of the average temperature. This function is derived from data of K. R. Reddy, CSRU, adjusted for age expressed in physiological days.
 *         # It is different for the main stem (k = 0) than for the other vegetative branches. TimeToNextFruNode is modified for plant density. Add DelayNewFruBranch to TimeToNextFruNode.
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyFloat_FromDouble((__pyx_v_vfrtbr[1])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_water_stress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_InPlaceAdd(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch, __pyx_t_5) < 0) __PYX_ERR(0, 524, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "_cotton2k/simulation.pyx":527
 *         # Define nbrch and compute TimeToNextFruBranch, the time (in physiological days) needed for the formation of each successive fruiting branch, as a function of the average temperature. This function is derived from data of K. R. Reddy, CSRU, adjusted for age expressed in physiological days.
 *         # It is different for the main stem (k = 0) than for the other vegetative branches. TimeToNextFruNode is modified for plant density. Add DelayNewFruBranch to TimeToNextFruNode.
 *         last_fruiting_branch = vegetative_branch.fruiting_branches[-1]             # <<<<<<<<<<<<<<
 *         cdef double tav = last_fruiting_branch.nodes[0].average_temperature  # modified average daily temperature.
 *         if tav > vfrtbr[2]:
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_fruiting_branches); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_5, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 527, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_last_fruiting_branch = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":528
 *         # It is different for the main stem (k = 0) than for the other vegetative branches. TimeToNextFruNode is modified for plant density. Add DelayNewFruBranch to TimeToNextFruNode.
 *         last_fruiting_branch = vegetative_branch.fruiting_branches[-1]
 *         cdef double tav = last_fruiting_branch.nodes[0].average_temperature  # modified average daily temperature.             # <<<<<<<<<<<<<<
 *         if tav > vfrtbr[2]:
 *             tav = vfrtbr[2]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_fruiting_branch, __pyx_n_s_nodes); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_3, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 528, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_tav = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":529
 *         last_fruiting_branch = vegetative_branch.fruiting_branches[-1]
 *         cdef double tav = last_fruiting_branch.nodes[0].average_temperature  # modified average daily temperature.
 *         if tav > vfrtbr[2]:             # <<<<<<<<<<<<<<
 *             tav = vfrtbr[2]
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 */
  __pyx_t_7 = ((__pyx_v_tav > (__pyx_v_vfrtbr[2])) != 0);
  if (__pyx_t_7) {

    /* "_cotton2k/simulation.pyx":530
 *         cdef double tav = last_fruiting_branch.nodes[0].average_temperature  # modified average daily temperature.
 *         if tav > vfrtbr[2]:
 *             tav = vfrtbr[2]             # <<<<<<<<<<<<<<
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 *         cdef double TimeToNextFruBranch = time_to_new_fruiting_branch + tav * (vfrtbr[3] + tav * (vfrtbr[4] + tav * vfrtbr[5]))
 */
    __pyx_v_tav = (__pyx_v_vfrtbr[2]);

    /* "_cotton2k/simulation.pyx":529
 *         last_fruiting_branch = vegetative_branch.fruiting_branches[-1]
 *         cdef double tav = last_fruiting_branch.nodes[0].average_temperature  # modified average daily temperature.
 *         if tav > vfrtbr[2]:             # <<<<<<<<<<<<<<
 *             tav = vfrtbr[2]
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 */
  }

  /* "_cotton2k/simulation.pyx":532
 *             tav = vfrtbr[2]
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 *         cdef double TimeToNextFruBranch = time_to_new_fruiting_branch + tav * (vfrtbr[3] + tav * (vfrtbr[4] + tav * vfrtbr[5]))             # <<<<<<<<<<<<<<
 *         if k > 0:
 *             TimeToNextFruBranch = TimeToNextFruBranch * vfrtbr[6]
 */
  __pyx_t_3 = PyFloat_FromDouble((__pyx_v_tav * ((__pyx_v_vfrtbr[3]) + (__pyx_v_tav * ((__pyx_v_vfrtbr[4]) + (__pyx_v_tav * (__pyx_v_vfrtbr[5]))))))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyNumber_Add(__pyx_v_time_to_new_fruiting_branch, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 532, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_TimeToNextFruBranch = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":533
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 *         cdef double TimeToNextFruBranch = time_to_new_fruiting_branch + tav * (vfrtbr[3] + tav * (vfrtbr[4] + tav * vfrtbr[5]))
 *         if k > 0:             # <<<<<<<<<<<<<<
 *             TimeToNextFruBranch = TimeToNextFruBranch * vfrtbr[6]
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch
 */
  __pyx_t_5 = PyObject_RichCompare(__pyx_v_k, __pyx_int_0, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 533, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 533, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_7) {

    /* "_cotton2k/simulation.pyx":534
 *         cdef double TimeToNextFruBranch = time_to_new_fruiting_branch + tav * (vfrtbr[3] + tav * (vfrtbr[4] + tav * vfrtbr[5]))
 *         if k > 0:
 *             TimeToNextFruBranch = TimeToNextFruBranch * vfrtbr[6]             # <<<<<<<<<<<<<<
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch
 *         # Check if the the age of the last fruiting branch exceeds TimeToNextFruBranch. If so, form the new fruiting branch:
 */
    __pyx_v_TimeToNextFruBranch = (__pyx_v_TimeToNextFruBranch * (__pyx_v_vfrtbr[6]));

    /* "_cotton2k/simulation.pyx":533
 *         # TimeToNextFruBranch is the time, in physiological days, for the next fruiting branch to be formed.
 *         cdef double TimeToNextFruBranch = time_to_new_fruiting_branch + tav * (vfrtbr[3] + tav * (vfrtbr[4] + tav * vfrtbr[5]))
 *         if k > 0:             # <<<<<<<<<<<<<<
 *             TimeToNextFruBranch = TimeToNextFruBranch * vfrtbr[6]
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch
 */
  }

  /* "_cotton2k/simulation.pyx":535
 *         if k > 0:
 *             TimeToNextFruBranch = TimeToNextFruBranch * vfrtbr[6]
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch             # <<<<<<<<<<<<<<
 *         # Check if the the age of the last fruiting branch exceeds TimeToNextFruBranch. If so, form the new fruiting branch:
 *         if last_fruiting_branch.nodes[0].age < TimeToNextFruBranch:
 */
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_TimeToNextFruBranch); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyFloat_FromDouble((__pyx_v_vfrtbr[7])); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_density_factor, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_AddCObj(__pyx_int_1, __pyx_t_2, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 535, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_TimeToNextFruBranch = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":537
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch
 *         # Check if the the age of the last fruiting branch exceeds TimeToNextFruBranch. If so, form the new fruiting branch:
 *         if last_fruiting_branch.nodes[0].age < TimeToNextFruBranch:             # <<<<<<<<<<<<<<
 *             return
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_last_fruiting_branch, __pyx_n_s_nodes); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_age); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_TimeToNextFruBranch); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_t_4, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_7) {

    /* "_cotton2k/simulation.pyx":538
 *         # Check if the the age of the last fruiting branch exceeds TimeToNextFruBranch. If so, form the new fruiting branch:
 *         if last_fruiting_branch.nodes[0].age < TimeToNextFruBranch:
 *             return             # <<<<<<<<<<<<<<
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 *         vegetative_branch.number_of_fruiting_branches += 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":537
 *         TimeToNextFruBranch = TimeToNextFruBranch * (1 + vfrtbr[7] * (1 - density_factor)) + vegetative_branch.delay_for_new_fruiting_branch
 *         # Check if the the age of the last fruiting branch exceeds TimeToNextFruBranch. If so, form the new fruiting branch:
 *         if last_fruiting_branch.nodes[0].age < TimeToNextFruBranch:             # <<<<<<<<<<<<<<
 *             return
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 */
  }

  /* "_cotton2k/simulation.pyx":540
 *             return
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 *         vegetative_branch.number_of_fruiting_branches += 1             # <<<<<<<<<<<<<<
 *         if vegetative_branch.number_of_fruiting_branches > 30:
 *             vegetative_branch.number_of_fruiting_branches = 30
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_number_of_fruiting_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_t_2, __pyx_int_1, 1, 1, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_number_of_fruiting_branches, __pyx_t_4) < 0) __PYX_ERR(0, 540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":541
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 *         vegetative_branch.number_of_fruiting_branches += 1
 *         if vegetative_branch.number_of_fruiting_branches > 30:             # <<<<<<<<<<<<<<
 *             vegetative_branch.number_of_fruiting_branches = 30
 *             return
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_number_of_fruiting_branches); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_4, __pyx_int_30, Py_GT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_7 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_7 < 0))) __PYX_ERR(0, 541, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_7) {

    /* "_cotton2k/simulation.pyx":542
 *         vegetative_branch.number_of_fruiting_branches += 1
 *         if vegetative_branch.number_of_fruiting_branches > 30:
 *             vegetative_branch.number_of_fruiting_branches = 30             # <<<<<<<<<<<<<<
 *             return
 *         cdef int newbr  # the index number of the new fruiting branch on this vegetative branch, after a new branch has been added.
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_number_of_fruiting_branches, __pyx_int_30) < 0) __PYX_ERR(0, 542, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":543
 *         if vegetative_branch.number_of_fruiting_branches > 30:
 *             vegetative_branch.number_of_fruiting_branches = 30
 *             return             # <<<<<<<<<<<<<<
 *         cdef int newbr  # the index number of the new fruiting branch on this vegetative branch, after a new branch has been added.
 *         newbr = vegetative_branch.number_of_fruiting_branches - 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":541
 *         # Increment NumFruitBranches, define newbr, and assign 1 to NumNodes, FruitFraction and FruitingCode.
 *         vegetative_branch.number_of_fruiting_branches += 1
 *         if vegetative_branch.number_of_fruiting_branches > 30:             # <<<<<<<<<<<<<<
 *             vegetative_branch.number_of_fruiting_branches = 30
 *             return
 */
  }

  /* "_cotton2k/simulation.pyx":545
 *             return
 *         cdef int newbr  # the index number of the new fruiting branch on this vegetative branch, after a new branch has been added.
 *         newbr = vegetative_branch.number_of_fruiting_branches - 1             # <<<<<<<<<<<<<<
 *         new_branch = vegetative_branch.fruiting_branches[-1]
 *         new_branch.number_of_fruiting_nodes = 1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_number_of_fruiting_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_t_2, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_8 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_8 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 545, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_newbr = __pyx_t_8;

  /* "_cotton2k/simulation.pyx":546
 *         cdef int newbr  # the index number of the new fruiting branch on this vegetative branch, after a new branch has been added.
 *         newbr = vegetative_branch.number_of_fruiting_branches - 1
 *         new_branch = vegetative_branch.fruiting_branches[-1]             # <<<<<<<<<<<<<<
 *         new_branch.number_of_fruiting_nodes = 1
 *         new_node = new_branch.nodes[0]
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_fruiting_branches); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_4, -1L, long, 1, __Pyx_PyInt_From_long, 0, 1, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 546, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_new_branch = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":547
 *         newbr = vegetative_branch.number_of_fruiting_branches - 1
 *         new_branch = vegetative_branch.fruiting_branches[-1]
 *         new_branch.number_of_fruiting_nodes = 1             # <<<<<<<<<<<<<<
 *         new_node = new_branch.nodes[0]
 *         new_node.fraction = 1
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_branch, __pyx_n_s_number_of_fruiting_nodes, __pyx_int_1) < 0) __PYX_ERR(0, 547, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":548
 *         new_branch = vegetative_branch.fruiting_branches[-1]
 *         new_branch.number_of_fruiting_nodes = 1
 *         new_node = new_branch.nodes[0]             # <<<<<<<<<<<<<<
 *         new_node.fraction = 1
 *         new_node.stage = Stage.Square
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_branch, __pyx_n_s_nodes); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_2, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 548, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_new_node = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":549
 *         new_branch.number_of_fruiting_nodes = 1
 *         new_node = new_branch.nodes[0]
 *         new_node.fraction = 1             # <<<<<<<<<<<<<<
 *         new_node.stage = Stage.Square
 *         # Initiate new leaves at the first node of the new fruiting branch, and at the corresponding main stem node. The mass and nitrogen in the new leaves is substacted from the stem.
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_node, __pyx_n_s_fraction, __pyx_int_1) < 0) __PYX_ERR(0, 549, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":550
 *         new_node = new_branch.nodes[0]
 *         new_node.fraction = 1
 *         new_node.stage = Stage.Square             # <<<<<<<<<<<<<<
 *         # Initiate new leaves at the first node of the new fruiting branch, and at the corresponding main stem node. The mass and nitrogen in the new leaves is substacted from the stem.
 *         new_node.leaf.area = new_node_initial_leaf_area
 */
  __pyx_t_4 = __Pyx_PyInt_From_enum__Stage(Square); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_node, __pyx_n_s_stage, __pyx_t_4) < 0) __PYX_ERR(0, 550, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":552
 *         new_node.stage = Stage.Square
 *         # Initiate new leaves at the first node of the new fruiting branch, and at the corresponding main stem node. The mass and nitrogen in the new leaves is substacted from the stem.
 *         new_node.leaf.area = new_node_initial_leaf_area             # <<<<<<<<<<<<<<
 *         new_node.leaf.weight = new_node_initial_leaf_area * self.leaf_weight_area_ratio
 *         main_stem_leaf = new_branch.main_stem_leaf
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_area, __pyx_v_new_node_initial_leaf_area) < 0) __PYX_ERR(0, 552, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":553
 *         # Initiate new leaves at the first node of the new fruiting branch, and at the corresponding main stem node. The mass and nitrogen in the new leaves is substacted from the stem.
 *         new_node.leaf.area = new_node_initial_leaf_area
 *         new_node.leaf.weight = new_node_initial_leaf_area * self.leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *         main_stem_leaf = new_branch.main_stem_leaf
 *         main_stem_leaf.area = new_node_initial_leaf_area
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight_area_ratio); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_v_new_node_initial_leaf_area, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (__Pyx_PyObject_SetAttrStr(__pyx_t_4, __pyx_n_s_weight, __pyx_t_2) < 0) __PYX_ERR(0, 553, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":554
 *         new_node.leaf.area = new_node_initial_leaf_area
 *         new_node.leaf.weight = new_node_initial_leaf_area * self.leaf_weight_area_ratio
 *         main_stem_leaf = new_branch.main_stem_leaf             # <<<<<<<<<<<<<<
 *         main_stem_leaf.area = new_node_initial_leaf_area
 *         main_stem_leaf.weight = main_stem_leaf.area * self.leaf_weight_area_ratio
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_branch, __pyx_n_s_main_stem_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 554, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_v_main_stem_leaf = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":555
 *         new_node.leaf.weight = new_node_initial_leaf_area * self.leaf_weight_area_ratio
 *         main_stem_leaf = new_branch.main_stem_leaf
 *         main_stem_leaf.area = new_node_initial_leaf_area             # <<<<<<<<<<<<<<
 *         main_stem_leaf.weight = main_stem_leaf.area * self.leaf_weight_area_ratio
 *         self.stem_weight -= main_stem_leaf.weight + new_node.leaf.weight
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_area, __pyx_v_new_node_initial_leaf_area) < 0) __PYX_ERR(0, 555, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":556
 *         main_stem_leaf = new_branch.main_stem_leaf
 *         main_stem_leaf.area = new_node_initial_leaf_area
 *         main_stem_leaf.weight = main_stem_leaf.area * self.leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *         self.stem_weight -= main_stem_leaf.weight + new_node.leaf.weight
 *         self.leaf_weight += main_stem_leaf.weight + new_node.leaf.weight
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_area); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight_area_ratio); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_weight, __pyx_t_5) < 0) __PYX_ERR(0, 556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "_cotton2k/simulation.pyx":557
 *         main_stem_leaf.area = new_node_initial_leaf_area
 *         main_stem_leaf.weight = main_stem_leaf.area * self.leaf_weight_area_ratio
 *         self.stem_weight -= main_stem_leaf.weight + new_node.leaf.weight             # <<<<<<<<<<<<<<
 *         self.leaf_weight += main_stem_leaf.weight + new_node.leaf.weight
 *         # addlfn is the nitrogen added to new leaves from stem.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_weight); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_4, __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_weight, __pyx_t_3) < 0) __PYX_ERR(0, 557, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":558
 *         main_stem_leaf.weight = main_stem_leaf.area * self.leaf_weight_area_ratio
 *         self.stem_weight -= main_stem_leaf.weight + new_node.leaf.weight
 *         self.leaf_weight += main_stem_leaf.weight + new_node.leaf.weight             # <<<<<<<<<<<<<<
 *         # addlfn is the nitrogen added to new leaves from stem.
 *         cdef double addlfn = (main_stem_leaf.weight + new_node.leaf.weight) * stemNRatio
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_weight); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_weight, __pyx_t_2) < 0) __PYX_ERR(0, 558, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":560
 *         self.leaf_weight += main_stem_leaf.weight + new_node.leaf.weight
 *         # addlfn is the nitrogen added to new leaves from stem.
 *         cdef double addlfn = (main_stem_leaf.weight + new_node.leaf.weight) * stemNRatio             # <<<<<<<<<<<<<<
 *         self.leaf_nitrogen += addlfn
 *         self.stem_nitrogen -= addlfn
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_main_stem_leaf, __pyx_n_s_weight); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_new_node, __pyx_n_s_leaf); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_weight); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_5, __pyx_v_stemNRatio); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 560, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_addlfn = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":561
 *         # addlfn is the nitrogen added to new leaves from stem.
 *         cdef double addlfn = (main_stem_leaf.weight + new_node.leaf.weight) * stemNRatio
 *         self.leaf_nitrogen += addlfn             # <<<<<<<<<<<<<<
 *         self.stem_nitrogen -= addlfn
 *         # Begin computing AvrgNodeTemper of the new node and assign zero to DelayNewFruBranch.
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_addlfn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_3, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_leaf_nitrogen, __pyx_t_2) < 0) __PYX_ERR(0, 561, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":562
 *         cdef double addlfn = (main_stem_leaf.weight + new_node.leaf.weight) * stemNRatio
 *         self.leaf_nitrogen += addlfn
 *         self.stem_nitrogen -= addlfn             # <<<<<<<<<<<<<<
 *         # Begin computing AvrgNodeTemper of the new node and assign zero to DelayNewFruBranch.
 *         new_node.average_temperature = self.average_temperature
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_nitrogen); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_addlfn); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_3 = PyNumber_InPlaceSubtract(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stem_nitrogen, __pyx_t_3) < 0) __PYX_ERR(0, 562, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":564
 *         self.stem_nitrogen -= addlfn
 *         # Begin computing AvrgNodeTemper of the new node and assign zero to DelayNewFruBranch.
 *         new_node.average_temperature = self.average_temperature             # <<<<<<<<<<<<<<
 *         vegetative_branch.delay_for_new_fruiting_branch = 0
 * 
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_new_node, __pyx_n_s_average_temperature, __pyx_t_3) < 0) __PYX_ERR(0, 564, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":565
 *         # Begin computing AvrgNodeTemper of the new node and assign zero to DelayNewFruBranch.
 *         new_node.average_temperature = self.average_temperature
 *         vegetative_branch.delay_for_new_fruiting_branch = 0             # <<<<<<<<<<<<<<
 * 
 * cdef class Simulation:
 */
  if (__Pyx_PyObject_SetAttrStr(__pyx_v_vegetative_branch, __pyx_n_s_delay_for_new_fruiting_branch, __pyx_int_0) < 0) __PYX_ERR(0, 565, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":515
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 * 
 *     def add_fruiting_branch(self, k, density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, time_to_new_fruiting_branch, new_node_initial_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides if a new fruiting branch is to be added to a vegetative branch, and forms it. It is called from function CottonPhenology().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.State.add_fruiting_branch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_vegetative_branch);
  __Pyx_XDECREF(__pyx_v_last_fruiting_branch);
  __Pyx_XDECREF(__pyx_v_new_branch);
  __Pyx_XDECREF(__pyx_v_new_node);
  __Pyx_XDECREF(__pyx_v_main_stem_leaf);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_5State_13__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_13__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_12__reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_12__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.State.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_5State_15__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_5State_15__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.State.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_5State_14__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_State *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_5State_14__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_State *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_self___cannot_be_converted_to_a, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.State.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":582
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.
 * 
 *     def _doy2date(self, j):             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_1_doy2date(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_1_doy2date = {"_doy2date", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_1_doy2date, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_1_doy2date(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_j = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_doy2date (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_j,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_j,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_j)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 582, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_doy2date") < 0)) __PYX_ERR(0, 582, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_j = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_doy2date", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 582, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._doy2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation__doy2date(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_j);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation__doy2date(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_j) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  Py_UCS4 __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_doy2date", 0);

  /* "_cotton2k/simulation.pyx":583
 * 
 *     def _doy2date(self, j):
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 *         except:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "_cotton2k/simulation.pyx":584
 *     def _doy2date(self, j):
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()             # <<<<<<<<<<<<<<
 *         except:
 *             return
 */
      __Pyx_XDECREF(__pyx_r);
      __Pyx_GetModuleGlobalName(__pyx_t_6, __pyx_n_s_datetime); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_strptime); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = PyTuple_New(3); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_8 = 0;
      __pyx_t_9 = 127;
      __pyx_t_10 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_year); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_t_10, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_11);
      __pyx_t_11 = 0;
      __Pyx_INCREF(__pyx_kp_u__8);
      __pyx_t_8 += 1;
      __Pyx_GIVEREF(__pyx_kp_u__8);
      PyTuple_SET_ITEM(__pyx_t_6, 1, __pyx_kp_u__8);
      __pyx_t_11 = __Pyx_PyObject_FormatSimple(__pyx_v_j, __pyx_empty_unicode); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_9 = (__Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) > __pyx_t_9) ? __Pyx_PyUnicode_MAX_CHAR_VALUE(__pyx_t_11) : __pyx_t_9;
      __pyx_t_8 += __Pyx_PyUnicode_GET_LENGTH(__pyx_t_11);
      __Pyx_GIVEREF(__pyx_t_11);
      PyTuple_SET_ITEM(__pyx_t_6, 2, __pyx_t_11);
      __pyx_t_11 = 0;
      __pyx_t_11 = __Pyx_PyUnicode_Join(__pyx_t_6, 3, __pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_t_6 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_6)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_6);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_12 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_6, __pyx_t_11, __pyx_kp_u_Y_j};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 2+__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 584, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_5, __pyx_n_s_date); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 584, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = NULL;
      __pyx_t_12 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
        __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_7);
        if (likely(__pyx_t_5)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
          __Pyx_INCREF(__pyx_t_5);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_7, function);
          __pyx_t_12 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[1] = {__pyx_t_5, };
        __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_7, __pyx_callargs+1-__pyx_t_12, 0+__pyx_t_12);
        __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
        if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 584, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_4);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      }
      __pyx_r = __pyx_t_4;
      __pyx_t_4 = 0;
      goto __pyx_L7_try_return;

      /* "_cotton2k/simulation.pyx":583
 * 
 *     def _doy2date(self, j):
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 *         except:
 */
    }
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
    __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "_cotton2k/simulation.pyx":585
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 *         except:             # <<<<<<<<<<<<<<
 *             return
 * 
 */
    /*except:*/ {
      __Pyx_AddTraceback("_cotton2k.simulation.Simulation._doy2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_4, &__pyx_t_7, &__pyx_t_5) < 0) __PYX_ERR(0, 585, __pyx_L5_except_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_5);

      /* "_cotton2k/simulation.pyx":586
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 *         except:
 *             return             # <<<<<<<<<<<<<<
 * 
 *     def __init__(self, version=0x0400):
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      goto __pyx_L6_except_return;
    }
    __pyx_L5_except_error:;

    /* "_cotton2k/simulation.pyx":583
 * 
 *     def _doy2date(self, j):
 *         try:             # <<<<<<<<<<<<<<
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 *         except:
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L7_try_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
    __pyx_L6_except_return:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L0;
  }

  /* "_cotton2k/simulation.pyx":582
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.
 * 
 *     def _doy2date(self, j):             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._doy2date", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":588
 *             return
 * 
 *     def __init__(self, version=0x0400):             # <<<<<<<<<<<<<<
 *         self.version = version
 *         self.max_leaf_area_index = 0.001
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_3__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
  PyObject *__pyx_v_version = 0;
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_version,0};
    #endif
    PyObject* values[1] = {0};
    values[0] = ((PyObject *)__pyx_int_1024);
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_VARARGS(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (kw_args > 0) {
          PyObject* value = __Pyx_GetKwValue_VARARGS(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_version);
          if (value) { values[0] = value; kw_args--; }
          else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 588, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__init__") < 0)) __PYX_ERR(0, 588, __pyx_L3_error)
      }
    } else {
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_VARARGS(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
    }
    __pyx_v_version = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 1, __pyx_nargs); __PYX_ERR(0, 588, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return -1;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_2__init__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_version);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_2__init__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_version) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__init__", 0);

  /* "_cotton2k/simulation.pyx":589
 * 
 *     def __init__(self, version=0x0400):
 *         self.version = version             # <<<<<<<<<<<<<<
 *         self.max_leaf_area_index = 0.001
 * 
 */
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_version); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 589, __pyx_L1_error)
  __pyx_v_self->version = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":590
 *     def __init__(self, version=0x0400):
 *         self.version = version
 *         self.max_leaf_area_index = 0.001             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_v_self->max_leaf_area_index = 0.001;

  /* "_cotton2k/simulation.pyx":588
 *             return
 * 
 *     def __init__(self, version=0x0400):             # <<<<<<<<<<<<<<
 *         self.version = version
 *         self.max_leaf_area_index = 0.001
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":592
 *         self.max_leaf_area_index = 0.001
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self):
 *         return self._sim.year
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_4year_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_4year_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_4year___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_4year___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":594
 *     @property
 *     def year(self):
 *         return self._sim.year             # <<<<<<<<<<<<<<
 * 
 *     @year.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->_sim.year); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 594, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":592
 *         self.max_leaf_area_index = 0.001
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def year(self):
 *         return self._sim.year
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.year.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":596
 *         return self._sim.year
 * 
 *     @year.setter             # <<<<<<<<<<<<<<
 *     def year(self, year):
 *         self._sim.year = year
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_4year_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_year); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_4year_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_year) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_4year_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_year));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_4year_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_year) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":598
 *     @year.setter
 *     def year(self, year):
 *         self._sim.year = year             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_year); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 598, __pyx_L1_error)
  __pyx_v_self->_sim.year = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":596
 *         return self._sim.year
 * 
 *     @year.setter             # <<<<<<<<<<<<<<
 *     def year(self, year):
 *         self._sim.year = year
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.year.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":600
 *         self._sim.year = year
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def start_date(self):
 *         return self._doy2date(self._sim.day_start)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":602
 *     @property
 *     def start_date(self):
 *         return self._doy2date(self._sim.day_start)             # <<<<<<<<<<<<<<
 * 
 *     @start_date.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 602, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 602, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":600
 *         self._sim.year = year
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def start_date(self):
 *         return self._doy2date(self._sim.day_start)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.start_date.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":604
 *         return self._doy2date(self._sim.day_start)
 * 
 *     @start_date.setter             # <<<<<<<<<<<<<<
 *     def start_date(self, d):
 *         self._sim.day_start = date2doy(d)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_10start_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":606
 *     @start_date.setter
 *     def start_date(self, d):
 *         self._sim.day_start = date2doy(d)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 606, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 606, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.day_start = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":604
 *         return self._doy2date(self._sim.day_start)
 * 
 *     @start_date.setter             # <<<<<<<<<<<<<<
 *     def start_date(self, d):
 *         self._sim.day_start = date2doy(d)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.start_date.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":608
 *         self._sim.day_start = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stop_date(self):
 *         return self._doy2date(self._sim.day_finish)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":610
 *     @property
 *     def stop_date(self):
 *         return self._doy2date(self._sim.day_finish)             # <<<<<<<<<<<<<<
 * 
 *     @stop_date.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_finish); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 610, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 610, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":608
 *         self._sim.day_start = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def stop_date(self):
 *         return self._doy2date(self._sim.day_finish)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.stop_date.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":612
 *         return self._doy2date(self._sim.day_finish)
 * 
 *     @stop_date.setter             # <<<<<<<<<<<<<<
 *     def stop_date(self, d):
 *         self._sim.day_finish = date2doy(d)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9stop_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":614
 *     @stop_date.setter
 *     def stop_date(self, d):
 *         self._sim.day_finish = date2doy(d)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 614, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 614, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.day_finish = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":612
 *         return self._doy2date(self._sim.day_finish)
 * 
 *     @stop_date.setter             # <<<<<<<<<<<<<<
 *     def stop_date(self, d):
 *         self._sim.day_finish = date2doy(d)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.stop_date.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":616
 *         self._sim.day_finish = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def emerge_date(self):
 *         return self._doy2date(self._sim.day_emerge)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":618
 *     @property
 *     def emerge_date(self):
 *         return self._doy2date(self._sim.day_emerge)             # <<<<<<<<<<<<<<
 * 
 *     @emerge_date.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 618, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":616
 *         self._sim.day_finish = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def emerge_date(self):
 *         return self._doy2date(self._sim.day_emerge)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.emerge_date.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":620
 *         return self._doy2date(self._sim.day_emerge)
 * 
 *     @emerge_date.setter             # <<<<<<<<<<<<<<
 *     def emerge_date(self, d):
 *         self._sim.day_emerge = date2doy(d)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_11emerge_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":622
 *     @emerge_date.setter
 *     def emerge_date(self, d):
 *         self._sim.day_emerge = date2doy(d)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 622, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 622, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.day_emerge = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":620
 *         return self._doy2date(self._sim.day_emerge)
 * 
 *     @emerge_date.setter             # <<<<<<<<<<<<<<
 *     def emerge_date(self, d):
 *         self._sim.day_emerge = date2doy(d)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.emerge_date.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":624
 *         self._sim.day_emerge = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def plant_date(self):
 *         return self._doy2date(self._sim.day_plant)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":626
 *     @property
 *     def plant_date(self):
 *         return self._doy2date(self._sim.day_plant)             # <<<<<<<<<<<<<<
 * 
 *     @plant_date.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_plant); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 626, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 626, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":624
 *         self._sim.day_emerge = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def plant_date(self):
 *         return self._doy2date(self._sim.day_plant)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.plant_date.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":628
 *         return self._doy2date(self._sim.day_plant)
 * 
 *     @plant_date.setter             # <<<<<<<<<<<<<<
 *     def plant_date(self, d):
 *         self._sim.day_plant = date2doy(d)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_10plant_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":630
 *     @plant_date.setter
 *     def plant_date(self, d):
 *         self._sim.day_plant = date2doy(d)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 630, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 630, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.day_plant = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":628
 *         return self._doy2date(self._sim.day_plant)
 * 
 *     @plant_date.setter             # <<<<<<<<<<<<<<
 *     def plant_date(self, d):
 *         self._sim.day_plant = date2doy(d)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.plant_date.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":632
 *         self._sim.day_plant = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def topping_date(self):
 *         return self._doy2date(self._sim.day_topping)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":634
 *     @property
 *     def topping_date(self):
 *         return self._doy2date(self._sim.day_topping)             # <<<<<<<<<<<<<<
 * 
 *     @topping_date.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_topping); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 634, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_t_3};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 634, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":632
 *         self._sim.day_plant = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def topping_date(self):
 *         return self._doy2date(self._sim.day_topping)
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.topping_date.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":636
 *         return self._doy2date(self._sim.day_topping)
 * 
 *     @topping_date.setter             # <<<<<<<<<<<<<<
 *     def topping_date(self, d):
 *         self._sim.day_topping = date2doy(d)
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_d) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_d));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_12topping_date_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_d) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":638
 *     @topping_date.setter
 *     def topping_date(self, d):
 *         self._sim.day_topping = date2doy(d)             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_d};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 638, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 638, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.day_topping = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":636
 *         return self._doy2date(self._sim.day_topping)
 * 
 *     @topping_date.setter             # <<<<<<<<<<<<<<
 *     def topping_date(self, d):
 *         self._sim.day_topping = date2doy(d)
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.topping_date.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":640
 *         self._sim.day_topping = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def latitude(self):
 *         return self._sim.latitude
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":642
 *     @property
 *     def latitude(self):
 *         return self._sim.latitude             # <<<<<<<<<<<<<<
 * 
 *     @latitude.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_sim.latitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 642, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":640
 *         self._sim.day_topping = date2doy(d)
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def latitude(self):
 *         return self._sim.latitude
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.latitude.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":644
 *         return self._sim.latitude
 * 
 *     @latitude.setter             # <<<<<<<<<<<<<<
 *     def latitude(self, value):
 *         self._sim.latitude = value or 0
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_8latitude_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":646
 *     @latitude.setter
 *     def latitude(self, value):
 *         self._sim.latitude = value or 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 646, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 646, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_self->_sim.latitude = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":644
 *         return self._sim.latitude
 * 
 *     @latitude.setter             # <<<<<<<<<<<<<<
 *     def latitude(self, value):
 *         self._sim.latitude = value or 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.latitude.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":648
 *         self._sim.latitude = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def longitude(self):
 *         return self._sim.longitude
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":650
 *     @property
 *     def longitude(self):
 *         return self._sim.longitude             # <<<<<<<<<<<<<<
 * 
 *     @longitude.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_sim.longitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 650, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":648
 *         self._sim.latitude = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def longitude(self):
 *         return self._sim.longitude
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.longitude.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":652
 *         return self._sim.longitude
 * 
 *     @longitude.setter             # <<<<<<<<<<<<<<
 *     def longitude(self, value):
 *         self._sim.longitude = value or 0
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9longitude_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":654
 *     @longitude.setter
 *     def longitude(self, value):
 *         self._sim.longitude = value or 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 654, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 654, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_self->_sim.longitude = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":652
 *         return self._sim.longitude
 * 
 *     @longitude.setter             # <<<<<<<<<<<<<<
 *     def longitude(self, value):
 *         self._sim.longitude = value or 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.longitude.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":656
 *         self._sim.longitude = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def elevation(self):
 *         return self._sim.elevation
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":658
 *     @property
 *     def elevation(self):
 *         return self._sim.elevation             # <<<<<<<<<<<<<<
 * 
 *     @elevation.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_sim.elevation); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 658, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":656
 *         self._sim.longitude = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def elevation(self):
 *         return self._sim.elevation
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.elevation.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":660
 *         return self._sim.elevation
 * 
 *     @elevation.setter             # <<<<<<<<<<<<<<
 *     def elevation(self, value):
 *         self._sim.elevation = value or 0
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9elevation_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":662
 *     @elevation.setter
 *     def elevation(self, value):
 *         self._sim.elevation = value or 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 662, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 662, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_self->_sim.elevation = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":660
 *         return self._sim.elevation
 * 
 *     @elevation.setter             # <<<<<<<<<<<<<<
 *     def elevation(self, value):
 *         self._sim.elevation = value or 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.elevation.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":664
 *         self._sim.elevation = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def site_parameters(self):
 *         return SitePar
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters___get__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":666
 *     @property
 *     def site_parameters(self):
 *         return SitePar             # <<<<<<<<<<<<<<
 * 
 *     @site_parameters.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_carray_to_py_double(SitePar, 21); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 666, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":664
 *         self._sim.elevation = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def site_parameters(self):
 *         return SitePar
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.site_parameters.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":668
 *         return SitePar
 * 
 *     @site_parameters.setter             # <<<<<<<<<<<<<<
 *     def site_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_parameters));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_15site_parameters_2__set__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_parameters) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_p = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":670
 *     @site_parameters.setter
 *     def site_parameters(self, parameters):
 *         for i, p in enumerate(parameters):             # <<<<<<<<<<<<<<
 *             SitePar[i + 1] = p
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_parameters)) || PyTuple_CheckExact(__pyx_v_parameters)) {
    __pyx_t_2 = __pyx_v_parameters; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 670, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 670, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 670, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 670, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 670, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":671
 *     def site_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 *             SitePar[i + 1] = p             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_p); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 671, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (SitePar[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":670
 *     @site_parameters.setter
 *     def site_parameters(self, parameters):
 *         for i, p in enumerate(parameters):             # <<<<<<<<<<<<<<
 *             SitePar[i + 1] = p
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":668
 *         return SitePar
 * 
 *     @site_parameters.setter             # <<<<<<<<<<<<<<
 *     def site_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.site_parameters.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":673
 *             SitePar[i + 1] = p
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def cultivar_parameters(self):
 *         return self._sim.cultivar_parameters
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":675
 *     @property
 *     def cultivar_parameters(self):
 *         return self._sim.cultivar_parameters             # <<<<<<<<<<<<<<
 * 
 *     @cultivar_parameters.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_carray_to_py_double(__pyx_v_self->_sim.cultivar_parameters, 61); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 675, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":673
 *             SitePar[i + 1] = p
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def cultivar_parameters(self):
 *         return self._sim.cultivar_parameters
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.cultivar_parameters.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":677
 *         return self._sim.cultivar_parameters
 * 
 *     @cultivar_parameters.setter             # <<<<<<<<<<<<<<
 *     def cultivar_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_parameters) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_parameters));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_parameters) {
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_p = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":679
 *     @cultivar_parameters.setter
 *     def cultivar_parameters(self, parameters):
 *         for i, p in enumerate(parameters):             # <<<<<<<<<<<<<<
 *             self._sim.cultivar_parameters[i + 1] = p
 * 
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_parameters)) || PyTuple_CheckExact(__pyx_v_parameters)) {
    __pyx_t_2 = __pyx_v_parameters; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 679, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 679, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 679, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_p, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 679, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":680
 *     def cultivar_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 *             self._sim.cultivar_parameters[i + 1] = p             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_v_p); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 680, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 680, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    (__pyx_v_self->_sim.cultivar_parameters[__pyx_t_7]) = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":679
 *     @cultivar_parameters.setter
 *     def cultivar_parameters(self, parameters):
 *         for i, p in enumerate(parameters):             # <<<<<<<<<<<<<<
 *             self._sim.cultivar_parameters[i + 1] = p
 * 
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":677
 *         return self._sim.cultivar_parameters
 * 
 *     @cultivar_parameters.setter             # <<<<<<<<<<<<<<
 *     def cultivar_parameters(self, parameters):
 *         for i, p in enumerate(parameters):
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.cultivar_parameters.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_p);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":682
 *             self._sim.cultivar_parameters[i + 1] = p
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def row_space(self):
 *         return self._sim.row_space
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":684
 *     @property
 *     def row_space(self):
 *         return self._sim.row_space             # <<<<<<<<<<<<<<
 * 
 *     @row_space.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->_sim.row_space); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 684, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":682
 *             self._sim.cultivar_parameters[i + 1] = p
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def row_space(self):
 *         return self._sim.row_space
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.row_space.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":686
 *         return self._sim.row_space
 * 
 *     @row_space.setter             # <<<<<<<<<<<<<<
 *     def row_space(self, value):
 *         self._sim.row_space = value or 0
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_9row_space_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":688
 *     @row_space.setter
 *     def row_space(self, value):
 *         self._sim.row_space = value or 0             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 688, __pyx_L1_error)
  if (!__pyx_t_2) {
  } else {
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 688, __pyx_L1_error)
    __pyx_t_1 = __pyx_t_3;
    goto __pyx_L3_bool_binop_done;
  }
  __pyx_t_1 = 0;
  __pyx_L3_bool_binop_done:;
  __pyx_v_self->_sim.row_space = __pyx_t_1;

  /* "_cotton2k/simulation.pyx":686
 *         return self._sim.row_space
 * 
 *     @row_space.setter             # <<<<<<<<<<<<<<
 *     def row_space(self, value):
 *         self._sim.row_space = value or 0
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.row_space.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":690
 *         self._sim.row_space = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def states(self):
 *         return [self.state(i) for i in
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_6states_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_6states_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_6states___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_6states___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  long __pyx_8genexpr6__pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  long __pyx_t_2;
  long __pyx_t_3;
  long __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":692
 *     @property
 *     def states(self):
 *         return [self.state(i) for i in             # <<<<<<<<<<<<<<
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  { /* enter inner scope */
    __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 692, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);

    /* "_cotton2k/simulation.pyx":693
 *     def states(self):
 *         return [self.state(i) for i in
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]             # <<<<<<<<<<<<<<
 * 
 *     def state(self, i):
 */
    __pyx_t_2 = ((__pyx_v_self->_sim.day_finish - __pyx_v_self->_sim.day_start) + 1);

    /* "_cotton2k/simulation.pyx":692
 *     @property
 *     def states(self):
 *         return [self.state(i) for i in             # <<<<<<<<<<<<<<
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 */
    __pyx_t_3 = __pyx_t_2;
    for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
      __pyx_8genexpr6__pyx_v_i = __pyx_t_4;
      __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_t_7 = __Pyx_PyInt_From_long(__pyx_8genexpr6__pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_8 = NULL;
      __pyx_t_9 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
        __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_6);
        if (likely(__pyx_t_8)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
          __Pyx_INCREF(__pyx_t_8);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_6, function);
          __pyx_t_9 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
        __pyx_t_5 = __Pyx_PyObject_FastCall(__pyx_t_6, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
        __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 692, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      }
      if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 692, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
  } /* exit inner scope */
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":690
 *         self._sim.row_space = value or 0
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def states(self):
 *         return [self.state(i) for i in
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.states.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":695
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 *     def state(self, i):             # <<<<<<<<<<<<<<
 *         return State.from_ptr(&self._sim.states[i])
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_5state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_5state = {"state", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_5state, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_5state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_i = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("state (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_i,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_i)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 695, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "state") < 0)) __PYX_ERR(0, 695, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_i = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("state", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 695, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_4state(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_i);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_4state(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_i) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("state", 0);

  /* "_cotton2k/simulation.pyx":696
 * 
 *     def state(self, i):
 *         return State.from_ptr(&self._sim.states[i])             # <<<<<<<<<<<<<<
 * 
 *     @property
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 696, __pyx_L1_error)
  __pyx_t_2 = ((PyObject *)__pyx_f_9_cotton2k_10simulation_5State_from_ptr((&(__pyx_v_self->_sim.states[__pyx_t_1])))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 696, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":695
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 *     def state(self, i):             # <<<<<<<<<<<<<<
 *         return State.from_ptr(&self._sim.states[i])
 * 
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":698
 *         return State.from_ptr(&self._sim.states[i])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def climate(self):
 *         return self._sim.climate
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_7climate___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_7climate___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);

  /* "_cotton2k/simulation.pyx":700
 *     @property
 *     def climate(self):
 *         return self._sim.climate             # <<<<<<<<<<<<<<
 * 
 *     @climate.setter
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_carray_to_py_ClimateStruct(__pyx_v_self->_sim.climate, 0x190); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 700, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":698
 *         return State.from_ptr(&self._sim.states[i])
 * 
 *     @property             # <<<<<<<<<<<<<<
 *     def climate(self):
 *         return self._sim.climate
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.climate.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":702
 *         return self._sim.climate
 * 
 *     @climate.setter             # <<<<<<<<<<<<<<
 *     def climate(self, climate):
 *         alias = {
 */

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_climate); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_climate) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_7climate_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_climate));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_7climate_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_climate) {
  PyObject *__pyx_v_alias = NULL;
  PyObject *__pyx_v_i = NULL;
  PyObject *__pyx_v_daily_climate = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_k = NULL;
  PyObject *__pyx_8genexpr7__pyx_v_v = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  Py_ssize_t __pyx_t_3;
  PyObject *(*__pyx_t_4)(PyObject *);
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  Py_ssize_t __pyx_t_7;
  Py_ssize_t __pyx_t_8;
  int __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  int __pyx_t_12;
  ClimateStruct __pyx_t_13;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);

  /* "_cotton2k/simulation.pyx":705
 *     def climate(self, climate):
 *         alias = {
 *             "radiation": "Rad",             # <<<<<<<<<<<<<<
 *             "max": "Tmax",
 *             "min": "Tmin",
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 705, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_radiation, __pyx_n_u_Rad) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_max, __pyx_n_u_Tmax) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_min, __pyx_n_u_Tmin) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_wind, __pyx_n_u_Wind) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_rain, __pyx_n_u_Rain) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_1, __pyx_n_u_dewpoint, __pyx_n_u_Tdew) < 0) __PYX_ERR(0, 705, __pyx_L1_error)
  __pyx_v_alias = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":712
 *             "dewpoint": "Tdew",
 *         }
 *         for i, daily_climate in enumerate(climate):             # <<<<<<<<<<<<<<
 *             self._sim.climate[i] = {
 *                 alias[k]: v for k, v in daily_climate.items()
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_t_1 = __pyx_int_0;
  if (likely(PyList_CheckExact(__pyx_v_climate)) || PyTuple_CheckExact(__pyx_v_climate)) {
    __pyx_t_2 = __pyx_v_climate; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
    __pyx_t_4 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_climate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_4 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 712, __pyx_L1_error)
  }
  for (;;) {
    if (likely(!__pyx_t_4)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 712, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_4(__pyx_t_2);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 712, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_daily_climate, __pyx_t_5);
    __pyx_t_5 = 0;
    __Pyx_INCREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_1);
    __pyx_t_5 = __Pyx_PyInt_AddObjC(__pyx_t_1, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 712, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1);
    __pyx_t_1 = __pyx_t_5;
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":713
 *         }
 *         for i, daily_climate in enumerate(climate):
 *             self._sim.climate[i] = {             # <<<<<<<<<<<<<<
 *                 alias[k]: v for k, v in daily_climate.items()
 *             }
 */
    { /* enter inner scope */
      __pyx_t_5 = PyDict_New(); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 713, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_5);

      /* "_cotton2k/simulation.pyx":714
 *         for i, daily_climate in enumerate(climate):
 *             self._sim.climate[i] = {
 *                 alias[k]: v for k, v in daily_climate.items()             # <<<<<<<<<<<<<<
 *             }
 * 
 */
      __pyx_t_7 = 0;
      if (unlikely(__pyx_v_daily_climate == Py_None)) {
        PyErr_Format(PyExc_AttributeError, "'NoneType' object has no attribute '%.30s'", "items");
        __PYX_ERR(0, 714, __pyx_L7_error)
      }
      __pyx_t_10 = __Pyx_dict_iterator(__pyx_v_daily_climate, 0, __pyx_n_s_items, (&__pyx_t_8), (&__pyx_t_9)); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 714, __pyx_L7_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_6);
      __pyx_t_6 = __pyx_t_10;
      __pyx_t_10 = 0;
      while (1) {
        __pyx_t_12 = __Pyx_dict_iter_next(__pyx_t_6, __pyx_t_8, &__pyx_t_7, &__pyx_t_10, &__pyx_t_11, NULL, __pyx_t_9);
        if (unlikely(__pyx_t_12 == 0)) break;
        if (unlikely(__pyx_t_12 == -1)) __PYX_ERR(0, 714, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_k, __pyx_t_10);
        __pyx_t_10 = 0;
        __Pyx_XDECREF_SET(__pyx_8genexpr7__pyx_v_v, __pyx_t_11);
        __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyDict_GetItem(__pyx_v_alias, __pyx_8genexpr7__pyx_v_k); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 714, __pyx_L7_error)
        __Pyx_GOTREF(__pyx_t_11);
        if (unlikely(PyDict_SetItem(__pyx_t_5, (PyObject*)__pyx_t_11, (PyObject*)__pyx_8genexpr7__pyx_v_v))) __PYX_ERR(0, 714, __pyx_L7_error)
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      }
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k); __pyx_8genexpr7__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0;
      goto __pyx_L10_exit_scope;
      __pyx_L7_error:;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k); __pyx_8genexpr7__pyx_v_k = 0;
      __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v); __pyx_8genexpr7__pyx_v_v = 0;
      goto __pyx_L1_error;
      __pyx_L10_exit_scope:;
    } /* exit inner scope */

    /* "_cotton2k/simulation.pyx":713
 *         }
 *         for i, daily_climate in enumerate(climate):
 *             self._sim.climate[i] = {             # <<<<<<<<<<<<<<
 *                 alias[k]: v for k, v in daily_climate.items()
 *             }
 */
    __pyx_t_13 = __pyx_convert__from_py_ClimateStruct(__pyx_t_5); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 713, __pyx_L1_error)
    (__pyx_v_self->_sim.climate[__pyx_t_8]) = __pyx_t_13;

    /* "_cotton2k/simulation.pyx":712
 *             "dewpoint": "Tdew",
 *         }
 *         for i, daily_climate in enumerate(climate):             # <<<<<<<<<<<<<<
 *             self._sim.climate[i] = {
 *                 alias[k]: v for k, v in daily_climate.items()
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":702
 *         return self._sim.climate
 * 
 *     @climate.setter             # <<<<<<<<<<<<<<
 *     def climate(self, climate):
 *         alias = {
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.climate.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_alias);
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XDECREF(__pyx_v_daily_climate);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_k);
  __Pyx_XDECREF(__pyx_8genexpr7__pyx_v_v);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":717
 *             }
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         self._init_state()
 *         try:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7run(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_7run = {"run", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_7run, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7run(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("run (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("run", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "run", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_6run(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_6run(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("run", 0);

  /* "_cotton2k/simulation.pyx":718
 * 
 *     def run(self):
 *         self._init_state()             # <<<<<<<<<<<<<<
 *         try:
 *             self._simulate()
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 718, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_3, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 718, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":719
 *     def run(self):
 *         self._init_state()
 *         try:             # <<<<<<<<<<<<<<
 *             self._simulate()
 *         except RuntimeError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_6);
    __Pyx_XGOTREF(__pyx_t_7);
    /*try:*/ {

      /* "_cotton2k/simulation.pyx":720
 *         self._init_state()
 *         try:
 *             self._simulate()             # <<<<<<<<<<<<<<
 *         except RuntimeError:
 *             pass
 */
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_simulate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 720, __pyx_L3_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
        __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
        if (likely(__pyx_t_3)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
          __Pyx_INCREF(__pyx_t_3);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_2, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[1] = {__pyx_t_3, };
        __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
        if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 720, __pyx_L3_error)
        __Pyx_GOTREF(__pyx_t_1);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_cotton2k/simulation.pyx":719
 *     def run(self):
 *         self._init_state()
 *         try:             # <<<<<<<<<<<<<<
 *             self._simulate()
 *         except RuntimeError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":721
 *         try:
 *             self._simulate()
 *         except RuntimeError:             # <<<<<<<<<<<<<<
 *             pass
 * 
 */
    __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_RuntimeError);
    if (__pyx_t_4) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "_cotton2k/simulation.pyx":719
 *     def run(self):
 *         self._init_state()
 *         try:             # <<<<<<<<<<<<<<
 *             self._simulate()
 *         except RuntimeError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_6);
    __Pyx_XGIVEREF(__pyx_t_7);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_6, __pyx_t_7);
    __pyx_L8_try_end:;
  }

  /* "_cotton2k/simulation.pyx":717
 *             }
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         self._init_state()
 *         try:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.run", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":724
 *             pass
 * 
 *     def _init_state(self):             # <<<<<<<<<<<<<<
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9_init_state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_9_init_state = {"_init_state", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_9_init_state, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_9_init_state(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_state (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_init_state", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_state", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_8_init_state(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_8_init_state(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  State __pyx_v_state0;
  long __pyx_v_i;
  long __pyx_v_k;
  long __pyx_v_l;
  long __pyx_v_m;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  State __pyx_t_5;
  unsigned int __pyx_t_6;
  long __pyx_t_7;
  long __pyx_t_8;
  MainStemLeaf __pyx_t_9;
  long __pyx_t_10;
  FruitingSite __pyx_t_11;
  Leaf __pyx_t_12;
  struct SquareStruct __pyx_t_13;
  Boll __pyx_t_14;
  Burr __pyx_t_15;
  Petiole __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_state", 0);

  /* "_cotton2k/simulation.pyx":725
 * 
 *     def _init_state(self):
 *         cdef cState state0 = self.state(0)             # <<<<<<<<<<<<<<
 *         state0.daynum = self._sim.day_start
 *         state0.lint_yield = 0
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_int_0};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 725, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_t_5 = __pyx_convert__from_py_State(__pyx_t_1); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 725, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_state0 = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":726
 *     def _init_state(self):
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start             # <<<<<<<<<<<<<<
 *         state0.lint_yield = 0
 *         state0.soil.number_of_layers_with_root = 7
 */
  __pyx_t_6 = __pyx_v_self->_sim.day_start;
  __pyx_v_state0.daynum = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":727
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start
 *         state0.lint_yield = 0             # <<<<<<<<<<<<<<
 *         state0.soil.number_of_layers_with_root = 7
 *         state0.plant_height = 4.0
 */
  __pyx_v_state0.lint_yield = 0.0;

  /* "_cotton2k/simulation.pyx":728
 *         state0.daynum = self._sim.day_start
 *         state0.lint_yield = 0
 *         state0.soil.number_of_layers_with_root = 7             # <<<<<<<<<<<<<<
 *         state0.plant_height = 4.0
 *         state0.plant_weight = 0
 */
  __pyx_v_state0.soil.number_of_layers_with_root = 7;

  /* "_cotton2k/simulation.pyx":729
 *         state0.lint_yield = 0
 *         state0.soil.number_of_layers_with_root = 7
 *         state0.plant_height = 4.0             # <<<<<<<<<<<<<<
 *         state0.plant_weight = 0
 *         state0.stem_weight = 0.2
 */
  __pyx_v_state0.plant_height = 4.0;

  /* "_cotton2k/simulation.pyx":730
 *         state0.soil.number_of_layers_with_root = 7
 *         state0.plant_height = 4.0
 *         state0.plant_weight = 0             # <<<<<<<<<<<<<<
 *         state0.stem_weight = 0.2
 *         state0.square_weight = 0
 */
  __pyx_v_state0.plant_weight = 0.0;

  /* "_cotton2k/simulation.pyx":731
 *         state0.plant_height = 4.0
 *         state0.plant_weight = 0
 *         state0.stem_weight = 0.2             # <<<<<<<<<<<<<<
 *         state0.square_weight = 0
 *         state0.green_bolls_weight = 0
 */
  __pyx_v_state0.stem_weight = 0.2;

  /* "_cotton2k/simulation.pyx":732
 *         state0.plant_weight = 0
 *         state0.stem_weight = 0.2
 *         state0.square_weight = 0             # <<<<<<<<<<<<<<
 *         state0.green_bolls_weight = 0
 *         state0.green_bolls_burr_weight = 0
 */
  __pyx_v_state0.square_weight = 0.0;

  /* "_cotton2k/simulation.pyx":733
 *         state0.stem_weight = 0.2
 *         state0.square_weight = 0
 *         state0.green_bolls_weight = 0             # <<<<<<<<<<<<<<
 *         state0.green_bolls_burr_weight = 0
 *         state0.open_bolls_weight = 0
 */
  __pyx_v_state0.green_bolls_weight = 0.0;

  /* "_cotton2k/simulation.pyx":734
 *         state0.square_weight = 0
 *         state0.green_bolls_weight = 0
 *         state0.green_bolls_burr_weight = 0             # <<<<<<<<<<<<<<
 *         state0.open_bolls_weight = 0
 *         state0.open_bolls_burr_weight = 0
 */
  __pyx_v_state0.green_bolls_burr_weight = 0.0;

  /* "_cotton2k/simulation.pyx":735
 *         state0.green_bolls_weight = 0
 *         state0.green_bolls_burr_weight = 0
 *         state0.open_bolls_weight = 0             # <<<<<<<<<<<<<<
 *         state0.open_bolls_burr_weight = 0
 *         state0.bloom_weight_loss = 0
 */
  __pyx_v_state0.open_bolls_weight = 0.0;

  /* "_cotton2k/simulation.pyx":736
 *         state0.green_bolls_burr_weight = 0
 *         state0.open_bolls_weight = 0
 *         state0.open_bolls_burr_weight = 0             # <<<<<<<<<<<<<<
 *         state0.bloom_weight_loss = 0
 *         state0.abscised_fruit_sites = 0
 */
  __pyx_v_state0.open_bolls_burr_weight = 0.0;

  /* "_cotton2k/simulation.pyx":737
 *         state0.open_bolls_weight = 0
 *         state0.open_bolls_burr_weight = 0
 *         state0.bloom_weight_loss = 0             # <<<<<<<<<<<<<<
 *         state0.abscised_fruit_sites = 0
 *         state0.abscised_leaf_weight = 0
 */
  __pyx_v_state0.bloom_weight_loss = 0.0;

  /* "_cotton2k/simulation.pyx":738
 *         state0.open_bolls_burr_weight = 0
 *         state0.bloom_weight_loss = 0
 *         state0.abscised_fruit_sites = 0             # <<<<<<<<<<<<<<
 *         state0.abscised_leaf_weight = 0
 *         state0.cumulative_nitrogen_loss = 0
 */
  __pyx_v_state0.abscised_fruit_sites = 0.0;

  /* "_cotton2k/simulation.pyx":739
 *         state0.bloom_weight_loss = 0
 *         state0.abscised_fruit_sites = 0
 *         state0.abscised_leaf_weight = 0             # <<<<<<<<<<<<<<
 *         state0.cumulative_nitrogen_loss = 0
 *         state0.cumulative_transpiration = 0
 */
  __pyx_v_state0.abscised_leaf_weight = 0.0;

  /* "_cotton2k/simulation.pyx":740
 *         state0.abscised_fruit_sites = 0
 *         state0.abscised_leaf_weight = 0
 *         state0.cumulative_nitrogen_loss = 0             # <<<<<<<<<<<<<<
 *         state0.cumulative_transpiration = 0
 *         state0.cumulative_evaporation = 0
 */
  __pyx_v_state0.cumulative_nitrogen_loss = 0.0;

  /* "_cotton2k/simulation.pyx":741
 *         state0.abscised_leaf_weight = 0
 *         state0.cumulative_nitrogen_loss = 0
 *         state0.cumulative_transpiration = 0             # <<<<<<<<<<<<<<
 *         state0.cumulative_evaporation = 0
 *         state0.applied_water = 0
 */
  __pyx_v_state0.cumulative_transpiration = 0.0;

  /* "_cotton2k/simulation.pyx":742
 *         state0.cumulative_nitrogen_loss = 0
 *         state0.cumulative_transpiration = 0
 *         state0.cumulative_evaporation = 0             # <<<<<<<<<<<<<<
 *         state0.applied_water = 0
 *         state0.water_stress = 1
 */
  __pyx_v_state0.cumulative_evaporation = 0.0;

  /* "_cotton2k/simulation.pyx":743
 *         state0.cumulative_transpiration = 0
 *         state0.cumulative_evaporation = 0
 *         state0.applied_water = 0             # <<<<<<<<<<<<<<
 *         state0.water_stress = 1
 *         state0.water_stress_stem = 1
 */
  __pyx_v_state0.applied_water = 0.0;

  /* "_cotton2k/simulation.pyx":744
 *         state0.cumulative_evaporation = 0
 *         state0.applied_water = 0
 *         state0.water_stress = 1             # <<<<<<<<<<<<<<
 *         state0.water_stress_stem = 1
 *         state0.carbon_stress = 1
 */
  __pyx_v_state0.water_stress = 1.0;

  /* "_cotton2k/simulation.pyx":745
 *         state0.applied_water = 0
 *         state0.water_stress = 1
 *         state0.water_stress_stem = 1             # <<<<<<<<<<<<<<
 *         state0.carbon_stress = 1
 *         state0.extra_carbon = 0
 */
  __pyx_v_state0.water_stress_stem = 1.0;

  /* "_cotton2k/simulation.pyx":746
 *         state0.water_stress = 1
 *         state0.water_stress_stem = 1
 *         state0.carbon_stress = 1             # <<<<<<<<<<<<<<
 *         state0.extra_carbon = 0
 *         state0.leaf_area_index = 0.001
 */
  __pyx_v_state0.carbon_stress = 1.0;

  /* "_cotton2k/simulation.pyx":747
 *         state0.water_stress_stem = 1
 *         state0.carbon_stress = 1
 *         state0.extra_carbon = 0             # <<<<<<<<<<<<<<
 *         state0.leaf_area_index = 0.001
 *         state0.leaf_area = 0
 */
  __pyx_v_state0.extra_carbon = 0.0;

  /* "_cotton2k/simulation.pyx":748
 *         state0.carbon_stress = 1
 *         state0.extra_carbon = 0
 *         state0.leaf_area_index = 0.001             # <<<<<<<<<<<<<<
 *         state0.leaf_area = 0
 *         state0.leaf_weight = 0.20
 */
  __pyx_v_state0.leaf_area_index = 0.001;

  /* "_cotton2k/simulation.pyx":749
 *         state0.extra_carbon = 0
 *         state0.leaf_area_index = 0.001
 *         state0.leaf_area = 0             # <<<<<<<<<<<<<<
 *         state0.leaf_weight = 0.20
 *         state0.leaf_nitrogen = 0.0112
 */
  __pyx_v_state0.leaf_area = 0.0;

  /* "_cotton2k/simulation.pyx":750
 *         state0.leaf_area_index = 0.001
 *         state0.leaf_area = 0
 *         state0.leaf_weight = 0.20             # <<<<<<<<<<<<<<
 *         state0.leaf_nitrogen = 0.0112
 *         state0.number_of_vegetative_branches = 1
 */
  __pyx_v_state0.leaf_weight = 0.20;

  /* "_cotton2k/simulation.pyx":751
 *         state0.leaf_area = 0
 *         state0.leaf_weight = 0.20
 *         state0.leaf_nitrogen = 0.0112             # <<<<<<<<<<<<<<
 *         state0.number_of_vegetative_branches = 1
 *         state0.number_of_squares = 0
 */
  __pyx_v_state0.leaf_nitrogen = 0.0112;

  /* "_cotton2k/simulation.pyx":752
 *         state0.leaf_weight = 0.20
 *         state0.leaf_nitrogen = 0.0112
 *         state0.number_of_vegetative_branches = 1             # <<<<<<<<<<<<<<
 *         state0.number_of_squares = 0
 *         state0.number_of_green_bolls = 0
 */
  __pyx_v_state0.number_of_vegetative_branches = 1;

  /* "_cotton2k/simulation.pyx":753
 *         state0.leaf_nitrogen = 0.0112
 *         state0.number_of_vegetative_branches = 1
 *         state0.number_of_squares = 0             # <<<<<<<<<<<<<<
 *         state0.number_of_green_bolls = 0
 *         state0.number_of_open_bolls = 0
 */
  __pyx_v_state0.number_of_squares = 0.0;

  /* "_cotton2k/simulation.pyx":754
 *         state0.number_of_vegetative_branches = 1
 *         state0.number_of_squares = 0
 *         state0.number_of_green_bolls = 0             # <<<<<<<<<<<<<<
 *         state0.number_of_open_bolls = 0
 *         state0.nitrogen_stress = 1
 */
  __pyx_v_state0.number_of_green_bolls = 0.0;

  /* "_cotton2k/simulation.pyx":755
 *         state0.number_of_squares = 0
 *         state0.number_of_green_bolls = 0
 *         state0.number_of_open_bolls = 0             # <<<<<<<<<<<<<<
 *         state0.nitrogen_stress = 1
 *         state0.nitrogen_stress_vegetative = 1
 */
  __pyx_v_state0.number_of_open_bolls = 0.0;

  /* "_cotton2k/simulation.pyx":756
 *         state0.number_of_green_bolls = 0
 *         state0.number_of_open_bolls = 0
 *         state0.nitrogen_stress = 1             # <<<<<<<<<<<<<<
 *         state0.nitrogen_stress_vegetative = 1
 *         state0.nitrogen_stress_fruiting = 1
 */
  __pyx_v_state0.nitrogen_stress = 1.0;

  /* "_cotton2k/simulation.pyx":757
 *         state0.number_of_open_bolls = 0
 *         state0.nitrogen_stress = 1
 *         state0.nitrogen_stress_vegetative = 1             # <<<<<<<<<<<<<<
 *         state0.nitrogen_stress_fruiting = 1
 *         state0.nitrogen_stress_root = 1
 */
  __pyx_v_state0.nitrogen_stress_vegetative = 1.0;

  /* "_cotton2k/simulation.pyx":758
 *         state0.nitrogen_stress = 1
 *         state0.nitrogen_stress_vegetative = 1
 *         state0.nitrogen_stress_fruiting = 1             # <<<<<<<<<<<<<<
 *         state0.nitrogen_stress_root = 1
 *         state0.total_required_nitrogen = 0
 */
  __pyx_v_state0.nitrogen_stress_fruiting = 1.0;

  /* "_cotton2k/simulation.pyx":759
 *         state0.nitrogen_stress_vegetative = 1
 *         state0.nitrogen_stress_fruiting = 1
 *         state0.nitrogen_stress_root = 1             # <<<<<<<<<<<<<<
 *         state0.total_required_nitrogen = 0
 *         state0.leaf_nitrogen_concentration = .056
 */
  __pyx_v_state0.nitrogen_stress_root = 1.0;

  /* "_cotton2k/simulation.pyx":760
 *         state0.nitrogen_stress_fruiting = 1
 *         state0.nitrogen_stress_root = 1
 *         state0.total_required_nitrogen = 0             # <<<<<<<<<<<<<<
 *         state0.leaf_nitrogen_concentration = .056
 *         state0.petiole_nitrogen_concentration = 0
 */
  __pyx_v_state0.total_required_nitrogen = 0.0;

  /* "_cotton2k/simulation.pyx":761
 *         state0.nitrogen_stress_root = 1
 *         state0.total_required_nitrogen = 0
 *         state0.leaf_nitrogen_concentration = .056             # <<<<<<<<<<<<<<
 *         state0.petiole_nitrogen_concentration = 0
 *         state0.seed_nitrogen_concentration = 0
 */
  __pyx_v_state0.leaf_nitrogen_concentration = .056;

  /* "_cotton2k/simulation.pyx":762
 *         state0.total_required_nitrogen = 0
 *         state0.leaf_nitrogen_concentration = .056
 *         state0.petiole_nitrogen_concentration = 0             # <<<<<<<<<<<<<<
 *         state0.seed_nitrogen_concentration = 0
 *         state0.burr_nitrogen = 0
 */
  __pyx_v_state0.petiole_nitrogen_concentration = 0.0;

  /* "_cotton2k/simulation.pyx":763
 *         state0.leaf_nitrogen_concentration = .056
 *         state0.petiole_nitrogen_concentration = 0
 *         state0.seed_nitrogen_concentration = 0             # <<<<<<<<<<<<<<
 *         state0.burr_nitrogen = 0
 *         state0.seed_nitrogen = 0
 */
  __pyx_v_state0.seed_nitrogen_concentration = 0.0;

  /* "_cotton2k/simulation.pyx":764
 *         state0.petiole_nitrogen_concentration = 0
 *         state0.seed_nitrogen_concentration = 0
 *         state0.burr_nitrogen = 0             # <<<<<<<<<<<<<<
 *         state0.seed_nitrogen = 0
 *         state0.root_nitrogen_concentration = .026
 */
  __pyx_v_state0.burr_nitrogen = 0.0;

  /* "_cotton2k/simulation.pyx":765
 *         state0.seed_nitrogen_concentration = 0
 *         state0.burr_nitrogen = 0
 *         state0.seed_nitrogen = 0             # <<<<<<<<<<<<<<
 *         state0.root_nitrogen_concentration = .026
 *         state0.square_nitrogen_concentration = 0
 */
  __pyx_v_state0.seed_nitrogen = 0.0;

  /* "_cotton2k/simulation.pyx":766
 *         state0.burr_nitrogen = 0
 *         state0.seed_nitrogen = 0
 *         state0.root_nitrogen_concentration = .026             # <<<<<<<<<<<<<<
 *         state0.square_nitrogen_concentration = 0
 *         state0.square_nitrogen = 0
 */
  __pyx_v_state0.root_nitrogen_concentration = .026;

  /* "_cotton2k/simulation.pyx":767
 *         state0.seed_nitrogen = 0
 *         state0.root_nitrogen_concentration = .026
 *         state0.square_nitrogen_concentration = 0             # <<<<<<<<<<<<<<
 *         state0.square_nitrogen = 0
 *         state0.stem_nitrogen = 0.0072
 */
  __pyx_v_state0.square_nitrogen_concentration = 0.0;

  /* "_cotton2k/simulation.pyx":768
 *         state0.root_nitrogen_concentration = .026
 *         state0.square_nitrogen_concentration = 0
 *         state0.square_nitrogen = 0             # <<<<<<<<<<<<<<
 *         state0.stem_nitrogen = 0.0072
 *         state0.fruit_growth_ratio = 1
 */
  __pyx_v_state0.square_nitrogen = 0.0;

  /* "_cotton2k/simulation.pyx":769
 *         state0.square_nitrogen_concentration = 0
 *         state0.square_nitrogen = 0
 *         state0.stem_nitrogen = 0.0072             # <<<<<<<<<<<<<<
 *         state0.fruit_growth_ratio = 1
 *         state0.ginning_percent = 0.35
 */
  __pyx_v_state0.stem_nitrogen = 0.0072;

  /* "_cotton2k/simulation.pyx":770
 *         state0.square_nitrogen = 0
 *         state0.stem_nitrogen = 0.0072
 *         state0.fruit_growth_ratio = 1             # <<<<<<<<<<<<<<
 *         state0.ginning_percent = 0.35
 *         state0.number_of_pre_fruiting_nodes = 1
 */
  __pyx_v_state0.fruit_growth_ratio = 1.0;

  /* "_cotton2k/simulation.pyx":771
 *         state0.stem_nitrogen = 0.0072
 *         state0.fruit_growth_ratio = 1
 *         state0.ginning_percent = 0.35             # <<<<<<<<<<<<<<
 *         state0.number_of_pre_fruiting_nodes = 1
 *         for i in range(9):
 */
  __pyx_v_state0.ginning_percent = 0.35;

  /* "_cotton2k/simulation.pyx":772
 *         state0.fruit_growth_ratio = 1
 *         state0.ginning_percent = 0.35
 *         state0.number_of_pre_fruiting_nodes = 1             # <<<<<<<<<<<<<<
 *         for i in range(9):
 *             state0.age_of_pre_fruiting_nodes[i] = 0
 */
  __pyx_v_state0.number_of_pre_fruiting_nodes = 1;

  /* "_cotton2k/simulation.pyx":773
 *         state0.ginning_percent = 0.35
 *         state0.number_of_pre_fruiting_nodes = 1
 *         for i in range(9):             # <<<<<<<<<<<<<<
 *             state0.age_of_pre_fruiting_nodes[i] = 0
 *             state0.leaf_area_pre_fruiting[i] = 0
 */
  for (__pyx_t_7 = 0; __pyx_t_7 < 9; __pyx_t_7+=1) {
    __pyx_v_i = __pyx_t_7;

    /* "_cotton2k/simulation.pyx":774
 *         state0.number_of_pre_fruiting_nodes = 1
 *         for i in range(9):
 *             state0.age_of_pre_fruiting_nodes[i] = 0             # <<<<<<<<<<<<<<
 *             state0.leaf_area_pre_fruiting[i] = 0
 *             state0.leaf_weight_pre_fruiting[i] = 0
 */
    (__pyx_v_state0.age_of_pre_fruiting_nodes[__pyx_v_i]) = 0.0;

    /* "_cotton2k/simulation.pyx":775
 *         for i in range(9):
 *             state0.age_of_pre_fruiting_nodes[i] = 0
 *             state0.leaf_area_pre_fruiting[i] = 0             # <<<<<<<<<<<<<<
 *             state0.leaf_weight_pre_fruiting[i] = 0
 *         for k in range(3):
 */
    (__pyx_v_state0.leaf_area_pre_fruiting[__pyx_v_i]) = 0.0;

    /* "_cotton2k/simulation.pyx":776
 *             state0.age_of_pre_fruiting_nodes[i] = 0
 *             state0.leaf_area_pre_fruiting[i] = 0
 *             state0.leaf_weight_pre_fruiting[i] = 0             # <<<<<<<<<<<<<<
 *         for k in range(3):
 *             state0.vegetative_branches[k].number_of_fruiting_branches = 0
 */
    (__pyx_v_state0.leaf_weight_pre_fruiting[__pyx_v_i]) = 0.0;
  }

  /* "_cotton2k/simulation.pyx":777
 *             state0.leaf_area_pre_fruiting[i] = 0
 *             state0.leaf_weight_pre_fruiting[i] = 0
 *         for k in range(3):             # <<<<<<<<<<<<<<
 *             state0.vegetative_branches[k].number_of_fruiting_branches = 0
 *             for l in range(30):
 */
  for (__pyx_t_7 = 0; __pyx_t_7 < 3; __pyx_t_7+=1) {
    __pyx_v_k = __pyx_t_7;

    /* "_cotton2k/simulation.pyx":778
 *             state0.leaf_weight_pre_fruiting[i] = 0
 *         for k in range(3):
 *             state0.vegetative_branches[k].number_of_fruiting_branches = 0             # <<<<<<<<<<<<<<
 *             for l in range(30):
 *                 state0.vegetative_branches[k].fruiting_branches[
 */
    (__pyx_v_state0.vegetative_branches[__pyx_v_k]).number_of_fruiting_branches = 0;

    /* "_cotton2k/simulation.pyx":779
 *         for k in range(3):
 *             state0.vegetative_branches[k].number_of_fruiting_branches = 0
 *             for l in range(30):             # <<<<<<<<<<<<<<
 *                 state0.vegetative_branches[k].fruiting_branches[
 *                     l].number_of_fruiting_nodes = 0
 */
    for (__pyx_t_8 = 0; __pyx_t_8 < 30; __pyx_t_8+=1) {
      __pyx_v_l = __pyx_t_8;

      /* "_cotton2k/simulation.pyx":780
 *             state0.vegetative_branches[k].number_of_fruiting_branches = 0
 *             for l in range(30):
 *                 state0.vegetative_branches[k].fruiting_branches[             # <<<<<<<<<<<<<<
 *                     l].number_of_fruiting_nodes = 0
 *                 state0.vegetative_branches[k].fruiting_branches[l].delay_for_new_node = 0
 */
      ((__pyx_v_state0.vegetative_branches[__pyx_v_k]).fruiting_branches[__pyx_v_l]).number_of_fruiting_nodes = 0;

      /* "_cotton2k/simulation.pyx":782
 *                 state0.vegetative_branches[k].fruiting_branches[
 *                     l].number_of_fruiting_nodes = 0
 *                 state0.vegetative_branches[k].fruiting_branches[l].delay_for_new_node = 0             # <<<<<<<<<<<<<<
 *                 state0.vegetative_branches[k].fruiting_branches[l].main_stem_leaf = dict(
 *                     leaf_area=0,
 */
      ((__pyx_v_state0.vegetative_branches[__pyx_v_k]).fruiting_branches[__pyx_v_l]).delay_for_new_node = 0.0;

      /* "_cotton2k/simulation.pyx":784
 *                 state0.vegetative_branches[k].fruiting_branches[l].delay_for_new_node = 0
 *                 state0.vegetative_branches[k].fruiting_branches[l].main_stem_leaf = dict(
 *                     leaf_area=0,             # <<<<<<<<<<<<<<
 *                     leaf_weight=0,
 *                     petiole_weight=0,
 */
      __pyx_t_9.leaf_area = 0.0;
      __pyx_t_9.leaf_weight = 0.0;
      __pyx_t_9.petiole_weight = 0.0;
      __pyx_t_9.potential_growth_for_leaf_area = 0.0;
      __pyx_t_9.potential_growth_for_leaf_weight = 0.0;
      __pyx_t_9.potential_growth_for_petiole_weight = 0.0;

      /* "_cotton2k/simulation.pyx":783
 *                     l].number_of_fruiting_nodes = 0
 *                 state0.vegetative_branches[k].fruiting_branches[l].delay_for_new_node = 0
 *                 state0.vegetative_branches[k].fruiting_branches[l].main_stem_leaf = dict(             # <<<<<<<<<<<<<<
 *                     leaf_area=0,
 *                     leaf_weight=0,
 */
      ((__pyx_v_state0.vegetative_branches[__pyx_v_k]).fruiting_branches[__pyx_v_l]).main_stem_leaf = __pyx_t_9;

      /* "_cotton2k/simulation.pyx":791
 *                     potential_growth_for_petiole_weight=0,
 *                 )
 *                 for m in range(5):             # <<<<<<<<<<<<<<
 *                     state0.vegetative_branches[k].fruiting_branches[l].nodes[m] = dict(
 *                         age=0,
 */
      for (__pyx_t_10 = 0; __pyx_t_10 < 5; __pyx_t_10+=1) {
        __pyx_v_m = __pyx_t_10;

        /* "_cotton2k/simulation.pyx":793
 *                 for m in range(5):
 *                     state0.vegetative_branches[k].fruiting_branches[l].nodes[m] = dict(
 *                         age=0,             # <<<<<<<<<<<<<<
 *                         fraction=0,
 *                         average_temperature=0,
 */
        __pyx_t_11.age = 0.0;
        __pyx_t_11.fraction = 0.0;
        __pyx_t_11.average_temperature = 0.0;
        __pyx_t_11.ginning_percent = 0.35;

        /* "_cotton2k/simulation.pyx":797
 *                         average_temperature=0,
 *                         ginning_percent=0.35,
 *                         stage=Stage.NotYetFormed,             # <<<<<<<<<<<<<<
 *                         leaf=dict(
 *                             age=0,
 */
        __pyx_t_11.stage = NotYetFormed;

        /* "_cotton2k/simulation.pyx":799
 *                         stage=Stage.NotYetFormed,
 *                         leaf=dict(
 *                             age=0,             # <<<<<<<<<<<<<<
 *                             potential_growth=0,
 *                             area=0,
 */
        __pyx_t_12.age = 0.0;
        __pyx_t_12.potential_growth = 0.0;
        __pyx_t_12.area = 0.0;
        __pyx_t_12.weight = 0.0;
        __pyx_t_11.leaf = __pyx_t_12;

        /* "_cotton2k/simulation.pyx":805
 *                         ),
 *                         square=dict(
 *                             potential_growth=0,             # <<<<<<<<<<<<<<
 *                             weight=0,
 *                         ),
 */
        __pyx_t_13.potential_growth = 0.0;
        __pyx_t_13.weight = 0.0;
        __pyx_t_11.square = __pyx_t_13;

        /* "_cotton2k/simulation.pyx":809
 *                         ),
 *                         boll=dict(
 *                             age=0,             # <<<<<<<<<<<<<<
 *                             potential_growth=0,
 *                             weight=0,
 */
        __pyx_t_14.age = 0.0;
        __pyx_t_14.potential_growth = 0.0;
        __pyx_t_14.weight = 0.0;
        __pyx_t_11.boll = __pyx_t_14;

        /* "_cotton2k/simulation.pyx":814
 *                         ),
 *                         burr=dict(
 *                             potential_growth=0,             # <<<<<<<<<<<<<<
 *                             weight=0,
 *                         ),
 */
        __pyx_t_15.potential_growth = 0.0;
        __pyx_t_15.weight = 0.0;
        __pyx_t_11.burr = __pyx_t_15;

        /* "_cotton2k/simulation.pyx":818
 *                         ),
 *                         petiole=dict(
 *                             potential_growth=0,             # <<<<<<<<<<<<<<
 *                             weight=0,
 *                         ),
 */
        __pyx_t_16.potential_growth = 0.0;
        __pyx_t_16.weight = 0.0;
        __pyx_t_11.petiole = __pyx_t_16;

        /* "_cotton2k/simulation.pyx":792
 *                 )
 *                 for m in range(5):
 *                     state0.vegetative_branches[k].fruiting_branches[l].nodes[m] = dict(             # <<<<<<<<<<<<<<
 *                         age=0,
 *                         fraction=0,
 */
        (((__pyx_v_state0.vegetative_branches[__pyx_v_k]).fruiting_branches[__pyx_v_l]).nodes[__pyx_v_m]) = __pyx_t_11;
      }
    }
  }

  /* "_cotton2k/simulation.pyx":822
 *                         ),
 *                     )
 *         self._sim.states[0] = state0             # <<<<<<<<<<<<<<
 * 
 *     def _simulate(self):
 */
  (__pyx_v_self->_sim.states[0]) = __pyx_v_state0;

  /* "_cotton2k/simulation.pyx":724
 *             pass
 * 
 *     def _init_state(self):             # <<<<<<<<<<<<<<
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._init_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":824
 *         self._sim.states[0] = state0
 * 
 *     def _simulate(self):             # <<<<<<<<<<<<<<
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_11_simulate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_11_simulate = {"_simulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_11_simulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_11_simulate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_simulate (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_simulate", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_simulate", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_10_simulate(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_10_simulate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  long __pyx_v_i;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  long __pyx_t_1;
  long __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_simulate", 0);

  /* "_cotton2k/simulation.pyx":825
 * 
 *     def _simulate(self):
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):             # <<<<<<<<<<<<<<
 *             self._simulate_this_day(i)
 *             if i < self._sim.day_finish - self._sim.day_start:
 */
  __pyx_t_1 = ((__pyx_v_self->_sim.day_finish - __pyx_v_self->_sim.day_start) + 1);
  __pyx_t_2 = __pyx_t_1;
  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
    __pyx_v_i = __pyx_t_3;

    /* "_cotton2k/simulation.pyx":826
 *     def _simulate(self):
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)             # <<<<<<<<<<<<<<
 *             if i < self._sim.day_finish - self._sim.day_start:
 *                 CopyState(self._sim, i)
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_simulate_this_day); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyInt_From_long(__pyx_v_i); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 826, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_7 = NULL;
    __pyx_t_8 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_8 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 826, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":827
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 *             if i < self._sim.day_finish - self._sim.day_start:             # <<<<<<<<<<<<<<
 *                 CopyState(self._sim, i)
 * 
 */
    __pyx_t_9 = ((__pyx_v_i < (__pyx_v_self->_sim.day_finish - __pyx_v_self->_sim.day_start)) != 0);
    if (__pyx_t_9) {

      /* "_cotton2k/simulation.pyx":828
 *             self._simulate_this_day(i)
 *             if i < self._sim.day_finish - self._sim.day_start:
 *                 CopyState(self._sim, i)             # <<<<<<<<<<<<<<
 * 
 *     def _calc_light_interception(self, u):
 */
      __pyx_t_4 = __pyx_f_9_cotton2k_10simulation_CopyState(__pyx_v_self->_sim, __pyx_v_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 828, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

      /* "_cotton2k/simulation.pyx":827
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 *             if i < self._sim.day_finish - self._sim.day_start:             # <<<<<<<<<<<<<<
 *                 CopyState(self._sim, i)
 * 
 */
    }
  }

  /* "_cotton2k/simulation.pyx":824
 *         self._sim.states[0] = state0
 * 
 *     def _simulate(self):             # <<<<<<<<<<<<<<
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._simulate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":830
 *                 CopyState(self._sim, i)
 * 
 *     def _calc_light_interception(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_13_calc_light_interception(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_13_calc_light_interception = {"_calc_light_interception", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_13_calc_light_interception, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_13_calc_light_interception(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_calc_light_interception (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 830, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_calc_light_interception") < 0)) __PYX_ERR(0, 830, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_calc_light_interception", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 830, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._calc_light_interception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_12_calc_light_interception(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_12_calc_light_interception(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  State __pyx_v_state;
  PyObject *__pyx_v_zint = NULL;
  double __pyx_v_lfint;
  PyObject *__pyx_v_light_interception = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_calc_light_interception", 0);

  /* "_cotton2k/simulation.pyx":831
 * 
 *     def _calc_light_interception(self, u):
 *         cdef cState state = self._sim.states[u]             # <<<<<<<<<<<<<<
 *         if self.version < 0x0500:
 *             if state.leaf_area_index > self.max_leaf_area_index:
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 831, __pyx_L1_error)
  __pyx_v_state = (__pyx_v_self->_sim.states[__pyx_t_1]);

  /* "_cotton2k/simulation.pyx":832
 *     def _calc_light_interception(self, u):
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:             # <<<<<<<<<<<<<<
 *             if state.leaf_area_index > self.max_leaf_area_index:
 *                 self.max_leaf_area_index = state.leaf_area_index
 */
  __pyx_t_2 = ((__pyx_v_self->version < 0x0500) != 0);
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":833
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 *             if state.leaf_area_index > self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                 self.max_leaf_area_index = state.leaf_area_index
 *             zint = 1.0756 * state.plant_height / self.row_space
 */
    __pyx_t_2 = ((__pyx_v_state.leaf_area_index > __pyx_v_self->max_leaf_area_index) != 0);
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":834
 *         if self.version < 0x0500:
 *             if state.leaf_area_index > self.max_leaf_area_index:
 *                 self.max_leaf_area_index = state.leaf_area_index             # <<<<<<<<<<<<<<
 *             zint = 1.0756 * state.plant_height / self.row_space
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(
 */
      __pyx_t_3 = __pyx_v_state.leaf_area_index;
      __pyx_v_self->max_leaf_area_index = __pyx_t_3;

      /* "_cotton2k/simulation.pyx":833
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 *             if state.leaf_area_index > self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                 self.max_leaf_area_index = state.leaf_area_index
 *             zint = 1.0756 * state.plant_height / self.row_space
 */
    }

    /* "_cotton2k/simulation.pyx":835
 *             if state.leaf_area_index > self.max_leaf_area_index:
 *                 self.max_leaf_area_index = state.leaf_area_index
 *             zint = 1.0756 * state.plant_height / self.row_space             # <<<<<<<<<<<<<<
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(
 *                 0.07 - 1.16 * state.leaf_area_index)
 */
    __pyx_t_4 = PyFloat_FromDouble((1.0756 * __pyx_v_state.plant_height)); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 835, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_zint = __pyx_t_6;
    __pyx_t_6 = 0;

    /* "_cotton2k/simulation.pyx":836
 *                 self.max_leaf_area_index = state.leaf_area_index
 *             zint = 1.0756 * state.plant_height / self.row_space
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(             # <<<<<<<<<<<<<<
 *                 0.07 - 1.16 * state.leaf_area_index)
 *             if lfint > zint:
 */
    if (((__pyx_v_state.leaf_area_index <= 0.5) != 0)) {
      __pyx_t_3 = (0.80 * __pyx_v_state.leaf_area_index);
    } else {

      /* "_cotton2k/simulation.pyx":837
 *             zint = 1.0756 * state.plant_height / self.row_space
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(
 *                 0.07 - 1.16 * state.leaf_area_index)             # <<<<<<<<<<<<<<
 *             if lfint > zint:
 *                 light_interception = (zint + lfint) / 2
 */
      __pyx_t_3 = (1.0 - exp((0.07 - (1.16 * __pyx_v_state.leaf_area_index))));
    }
    __pyx_v_lfint = __pyx_t_3;

    /* "_cotton2k/simulation.pyx":838
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(
 *                 0.07 - 1.16 * state.leaf_area_index)
 *             if lfint > zint:             # <<<<<<<<<<<<<<
 *                 light_interception = (zint + lfint) / 2
 *             elif state.leaf_area_index < self.max_leaf_area_index:
 */
    __pyx_t_6 = PyFloat_FromDouble(__pyx_v_lfint); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_5 = PyObject_RichCompare(__pyx_t_6, __pyx_v_zint, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 838, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":839
 *                 0.07 - 1.16 * state.leaf_area_index)
 *             if lfint > zint:
 *                 light_interception = (zint + lfint) / 2             # <<<<<<<<<<<<<<
 *             elif state.leaf_area_index < self.max_leaf_area_index:
 *                 light_interception = lfint
 */
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_lfint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_6 = PyNumber_Add(__pyx_v_zint, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_5 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_6, __pyx_int_2, 2, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 839, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
      __pyx_v_light_interception = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "_cotton2k/simulation.pyx":838
 *             lfint = 0.80 * state.leaf_area_index if state.leaf_area_index <= 0.5 else 1 - exp(
 *                 0.07 - 1.16 * state.leaf_area_index)
 *             if lfint > zint:             # <<<<<<<<<<<<<<
 *                 light_interception = (zint + lfint) / 2
 *             elif state.leaf_area_index < self.max_leaf_area_index:
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":840
 *             if lfint > zint:
 *                 light_interception = (zint + lfint) / 2
 *             elif state.leaf_area_index < self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                 light_interception = lfint
 *             else:
 */
    __pyx_t_2 = ((__pyx_v_state.leaf_area_index < __pyx_v_self->max_leaf_area_index) != 0);
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":841
 *                 light_interception = (zint + lfint) / 2
 *             elif state.leaf_area_index < self.max_leaf_area_index:
 *                 light_interception = lfint             # <<<<<<<<<<<<<<
 *             else:
 *                 light_interception = zint
 */
      __pyx_t_5 = PyFloat_FromDouble(__pyx_v_lfint); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 841, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_v_light_interception = __pyx_t_5;
      __pyx_t_5 = 0;

      /* "_cotton2k/simulation.pyx":840
 *             if lfint > zint:
 *                 light_interception = (zint + lfint) / 2
 *             elif state.leaf_area_index < self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                 light_interception = lfint
 *             else:
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":843
 *                 light_interception = lfint
 *             else:
 *                 light_interception = zint             # <<<<<<<<<<<<<<
 *             if light_interception > 1:
 *                 light_interception = 1
 */
    /*else*/ {
      __Pyx_INCREF(__pyx_v_zint);
      __pyx_v_light_interception = __pyx_v_zint;
    }
    __pyx_L5:;

    /* "_cotton2k/simulation.pyx":844
 *             else:
 *                 light_interception = zint
 *             if light_interception > 1:             # <<<<<<<<<<<<<<
 *                 light_interception = 1
 *             if light_interception < 0:
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_light_interception, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 844, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 844, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":845
 *                 light_interception = zint
 *             if light_interception > 1:
 *                 light_interception = 1             # <<<<<<<<<<<<<<
 *             if light_interception < 0:
 *                 light_interception = 0
 */
      __Pyx_INCREF(__pyx_int_1);
      __Pyx_DECREF_SET(__pyx_v_light_interception, __pyx_int_1);

      /* "_cotton2k/simulation.pyx":844
 *             else:
 *                 light_interception = zint
 *             if light_interception > 1:             # <<<<<<<<<<<<<<
 *                 light_interception = 1
 *             if light_interception < 0:
 */
    }

    /* "_cotton2k/simulation.pyx":846
 *             if light_interception > 1:
 *                 light_interception = 1
 *             if light_interception < 0:             # <<<<<<<<<<<<<<
 *                 light_interception = 0
 *             self._sim.states[u].light_interception = light_interception
 */
    __pyx_t_5 = PyObject_RichCompare(__pyx_v_light_interception, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 846, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 846, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":847
 *                 light_interception = 1
 *             if light_interception < 0:
 *                 light_interception = 0             # <<<<<<<<<<<<<<
 *             self._sim.states[u].light_interception = light_interception
 *         else:
 */
      __Pyx_INCREF(__pyx_int_0);
      __Pyx_DECREF_SET(__pyx_v_light_interception, __pyx_int_0);

      /* "_cotton2k/simulation.pyx":846
 *             if light_interception > 1:
 *                 light_interception = 1
 *             if light_interception < 0:             # <<<<<<<<<<<<<<
 *                 light_interception = 0
 *             self._sim.states[u].light_interception = light_interception
 */
    }

    /* "_cotton2k/simulation.pyx":848
 *             if light_interception < 0:
 *                 light_interception = 0
 *             self._sim.states[u].light_interception = light_interception             # <<<<<<<<<<<<<<
 *         else:
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)
 */
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_v_light_interception); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L1_error)
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 848, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_1]).light_interception = __pyx_t_3;

    /* "_cotton2k/simulation.pyx":832
 *     def _calc_light_interception(self, u):
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:             # <<<<<<<<<<<<<<
 *             if state.leaf_area_index > self.max_leaf_area_index:
 *                 self.max_leaf_area_index = state.leaf_area_index
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":850
 *             self._sim.states[u].light_interception = light_interception
 *         else:
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)             # <<<<<<<<<<<<<<
 * 
 *     def _column_shading(self, u):
 */
  /*else*/ {
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 850, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_1]).light_interception = (1.0 - exp((-1.16 * __pyx_v_state.leaf_area_index)));
  }
  __pyx_L3:;

  /* "_cotton2k/simulation.pyx":830
 *                 CopyState(self._sim, i)
 * 
 *     def _calc_light_interception(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._calc_light_interception", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_zint);
  __Pyx_XDECREF(__pyx_v_light_interception);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":852
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)
 * 
 *     def _column_shading(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_15_column_shading(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_15_column_shading = {"_column_shading", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_15_column_shading, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_15_column_shading(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_column_shading (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 852, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_column_shading") < 0)) __PYX_ERR(0, 852, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_column_shading", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 852, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._column_shading", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_14_column_shading(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_14_column_shading(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  State __pyx_v_state;
  PyObject *__pyx_v_zint = NULL;
  PyObject *__pyx_v_sw = NULL;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_sw0 = NULL;
  PyObject *__pyx_v_sw1 = NULL;
  PyObject *__pyx_v_k0 = NULL;
  PyObject *__pyx_v_shade = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *(*__pyx_t_5)(PyObject *);
  int __pyx_t_6;
  unsigned int __pyx_t_7;
  double __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_column_shading", 0);

  /* "_cotton2k/simulation.pyx":853
 * 
 *     def _column_shading(self, u):
 *         cdef cState state = self._sim.states[u]             # <<<<<<<<<<<<<<
 *         zint = 1.0756 * state.plant_height / self.row_space
 *         sw = 0
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 853, __pyx_L1_error)
  __pyx_v_state = (__pyx_v_self->_sim.states[__pyx_t_1]);

  /* "_cotton2k/simulation.pyx":854
 *     def _column_shading(self, u):
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space             # <<<<<<<<<<<<<<
 *         sw = 0
 *         for k in range(nk):
 */
  __pyx_t_2 = PyFloat_FromDouble((1.0756 * __pyx_v_state.plant_height)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 854, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_zint = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":855
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space
 *         sw = 0             # <<<<<<<<<<<<<<
 *         for k in range(nk):
 *             if k <= self._sim.plant_row_column:
 */
  __Pyx_INCREF(__pyx_int_0);
  __pyx_v_sw = __pyx_int_0;

  /* "_cotton2k/simulation.pyx":856
 *         zint = 1.0756 * state.plant_height / self.row_space
 *         sw = 0
 *         for k in range(nk):             # <<<<<<<<<<<<<<
 *             if k <= self._sim.plant_row_column:
 *                 j = self._sim.plant_row_column - k
 */
  __pyx_t_4 = __Pyx_PyInt_From_int(nk); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_4 = __pyx_t_3; __Pyx_INCREF(__pyx_t_4); __pyx_t_1 = 0;
    __pyx_t_5 = NULL;
  } else {
    __pyx_t_1 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 856, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_5 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 856, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_5)) {
      if (likely(PyList_CheckExact(__pyx_t_4))) {
        if (__pyx_t_1 >= PyList_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 856, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely((0 < 0))) __PYX_ERR(0, 856, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_4, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 856, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_5(__pyx_t_4);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 856, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":857
 *         sw = 0
 *         for k in range(nk):
 *             if k <= self._sim.plant_row_column:             # <<<<<<<<<<<<<<
 *                 j = self._sim.plant_row_column - k
 *                 sw += wk(j, self.row_space)
 */
    __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.plant_row_column); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_v_k, __pyx_t_3, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 857, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_6) {

      /* "_cotton2k/simulation.pyx":858
 *         for k in range(nk):
 *             if k <= self._sim.plant_row_column:
 *                 j = self._sim.plant_row_column - k             # <<<<<<<<<<<<<<
 *                 sw += wk(j, self.row_space)
 *                 sw0 = sw
 */
      __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.plant_row_column); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_t_2, __pyx_v_k); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 858, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "_cotton2k/simulation.pyx":859
 *             if k <= self._sim.plant_row_column:
 *                 j = self._sim.plant_row_column - k
 *                 sw += wk(j, self.row_space)             # <<<<<<<<<<<<<<
 *                 sw0 = sw
 *                 sw1 = sw - wk(j, self.row_space) / 2
 */
      __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_j); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyFloat_FromDouble(wk(__pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sw, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 859, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_sw, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "_cotton2k/simulation.pyx":860
 *                 j = self._sim.plant_row_column - k
 *                 sw += wk(j, self.row_space)
 *                 sw0 = sw             # <<<<<<<<<<<<<<
 *                 sw1 = sw - wk(j, self.row_space) / 2
 *                 k0 = j
 */
      __Pyx_INCREF(__pyx_v_sw);
      __Pyx_XDECREF_SET(__pyx_v_sw0, __pyx_v_sw);

      /* "_cotton2k/simulation.pyx":861
 *                 sw += wk(j, self.row_space)
 *                 sw0 = sw
 *                 sw1 = sw - wk(j, self.row_space) / 2             # <<<<<<<<<<<<<<
 *                 k0 = j
 *             else:
 */
      __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_j); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = PyFloat_FromDouble((wk(__pyx_t_7, __pyx_t_8) / 2.0)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyNumber_Subtract(__pyx_v_sw, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 861, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sw1, __pyx_t_3);
      __pyx_t_3 = 0;

      /* "_cotton2k/simulation.pyx":862
 *                 sw0 = sw
 *                 sw1 = sw - wk(j, self.row_space) / 2
 *                 k0 = j             # <<<<<<<<<<<<<<
 *             else:
 *                 sw += wk(k, self.row_space)
 */
      __Pyx_INCREF(__pyx_v_j);
      __Pyx_XDECREF_SET(__pyx_v_k0, __pyx_v_j);

      /* "_cotton2k/simulation.pyx":857
 *         sw = 0
 *         for k in range(nk):
 *             if k <= self._sim.plant_row_column:             # <<<<<<<<<<<<<<
 *                 j = self._sim.plant_row_column - k
 *                 sw += wk(j, self.row_space)
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":864
 *                 k0 = j
 *             else:
 *                 sw += wk(k, self.row_space)             # <<<<<<<<<<<<<<
 *                 sw1 = sw - sw0 - wk(k, self.row_space) / 2
 *                 k0 = k
 */
    /*else*/ {
      __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_k); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 864, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyFloat_FromDouble(wk(__pyx_t_7, __pyx_t_8)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_sw, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 864, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_sw, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "_cotton2k/simulation.pyx":865
 *             else:
 *                 sw += wk(k, self.row_space)
 *                 sw1 = sw - sw0 - wk(k, self.row_space) / 2             # <<<<<<<<<<<<<<
 *                 k0 = k
 *             shade = 0
 */
      if (unlikely(!__pyx_v_sw0)) { __Pyx_RaiseUnboundLocalError("sw0"); __PYX_ERR(0, 865, __pyx_L1_error) }
      __pyx_t_2 = PyNumber_Subtract(__pyx_v_sw, __pyx_v_sw0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_7 = __Pyx_PyInt_As_unsigned_int(__pyx_v_k); if (unlikely((__pyx_t_7 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error)
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 865, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyFloat_FromDouble((wk(__pyx_t_7, __pyx_t_8) / 2.0)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 865, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_XDECREF_SET(__pyx_v_sw1, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "_cotton2k/simulation.pyx":866
 *                 sw += wk(k, self.row_space)
 *                 sw1 = sw - sw0 - wk(k, self.row_space) / 2
 *                 k0 = k             # <<<<<<<<<<<<<<
 *             shade = 0
 *             if sw1 < state.plant_height:
 */
      __Pyx_INCREF(__pyx_v_k);
      __Pyx_XDECREF_SET(__pyx_v_k0, __pyx_v_k);
    }
    __pyx_L5:;

    /* "_cotton2k/simulation.pyx":867
 *                 sw1 = sw - sw0 - wk(k, self.row_space) / 2
 *                 k0 = k
 *             shade = 0             # <<<<<<<<<<<<<<
 *             if sw1 < state.plant_height:
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 */
    __Pyx_INCREF(__pyx_int_0);
    __Pyx_XDECREF_SET(__pyx_v_shade, __pyx_int_0);

    /* "_cotton2k/simulation.pyx":868
 *                 k0 = k
 *             shade = 0
 *             if sw1 < state.plant_height:             # <<<<<<<<<<<<<<
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:
 */
    __pyx_t_9 = PyFloat_FromDouble(__pyx_v_state.plant_height); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __pyx_t_3 = PyObject_RichCompare(__pyx_v_sw1, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 868, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (__pyx_t_6) {

      /* "_cotton2k/simulation.pyx":869
 *             shade = 0
 *             if sw1 < state.plant_height:
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)             # <<<<<<<<<<<<<<
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:
 *                     shade *= state.light_interception / zint
 */
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_state.plant_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_9 = __Pyx_PyNumber_Divide(__pyx_v_sw1, __pyx_t_3); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyFloat_FromDouble(__pyx_v_state.plant_height); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_v_sw1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __pyx_t_3 = PyNumber_Multiply(__pyx_t_9, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 869, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      __Pyx_DECREF_SET(__pyx_v_shade, __pyx_t_2);
      __pyx_t_2 = 0;

      /* "_cotton2k/simulation.pyx":870
 *             if sw1 < state.plant_height:
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                     shade *= state.light_interception / zint
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 */
      __pyx_t_2 = PyFloat_FromDouble(__pyx_v_state.light_interception); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 870, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_v_zint, Py_LT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
      __pyx_t_10 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_10 < 0))) __PYX_ERR(0, 870, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (__pyx_t_10) {
      } else {
        __pyx_t_6 = __pyx_t_10;
        goto __pyx_L8_bool_binop_done;
      }
      __pyx_t_10 = ((__pyx_v_state.leaf_area_index < __pyx_v_self->max_leaf_area_index) != 0);
      __pyx_t_6 = __pyx_t_10;
      __pyx_L8_bool_binop_done:;
      if (__pyx_t_6) {

        /* "_cotton2k/simulation.pyx":871
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:
 *                     shade *= state.light_interception / zint             # <<<<<<<<<<<<<<
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 *             if self.relative_radiation_received_by_a_soil_column[k0] < 0.05:
 */
        __pyx_t_3 = PyFloat_FromDouble(__pyx_v_state.light_interception); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_zint); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 871, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
        __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_v_shade, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 871, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
        __Pyx_DECREF_SET(__pyx_v_shade, __pyx_t_3);
        __pyx_t_3 = 0;

        /* "_cotton2k/simulation.pyx":870
 *             if sw1 < state.plant_height:
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:             # <<<<<<<<<<<<<<
 *                     shade *= state.light_interception / zint
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 */
      }

      /* "_cotton2k/simulation.pyx":868
 *                 k0 = k
 *             shade = 0
 *             if sw1 < state.plant_height:             # <<<<<<<<<<<<<<
 *                 shade = 1 - (sw1 / state.plant_height) * (sw1 / state.plant_height)
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:
 */
    }

    /* "_cotton2k/simulation.pyx":872
 *                 if state.light_interception < zint and state.leaf_area_index < self.max_leaf_area_index:
 *                     shade *= state.light_interception / zint
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade             # <<<<<<<<<<<<<<
 *             if self.relative_radiation_received_by_a_soil_column[k0] < 0.05:
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 */
    __pyx_t_3 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_v_shade, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k0); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 872, __pyx_L1_error)
    (__pyx_v_self->relative_radiation_received_by_a_soil_column[__pyx_t_11]) = __pyx_t_8;

    /* "_cotton2k/simulation.pyx":873
 *                     shade *= state.light_interception / zint
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 *             if self.relative_radiation_received_by_a_soil_column[k0] < 0.05:             # <<<<<<<<<<<<<<
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 */
    __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k0); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 873, __pyx_L1_error)
    __pyx_t_6 = (((__pyx_v_self->relative_radiation_received_by_a_soil_column[__pyx_t_11]) < 0.05) != 0);
    if (__pyx_t_6) {

      /* "_cotton2k/simulation.pyx":874
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 *             if self.relative_radiation_received_by_a_soil_column[k0] < 0.05:
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05             # <<<<<<<<<<<<<<
 * 
 *     def _daily_climate(self, u):
 */
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k0); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 874, __pyx_L1_error)
      (__pyx_v_self->relative_radiation_received_by_a_soil_column[__pyx_t_11]) = 0.05;

      /* "_cotton2k/simulation.pyx":873
 *                     shade *= state.light_interception / zint
 *             self.relative_radiation_received_by_a_soil_column[k0] = 1 - shade
 *             if self.relative_radiation_received_by_a_soil_column[k0] < 0.05:             # <<<<<<<<<<<<<<
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 */
    }

    /* "_cotton2k/simulation.pyx":856
 *         zint = 1.0756 * state.plant_height / self.row_space
 *         sw = 0
 *         for k in range(nk):             # <<<<<<<<<<<<<<
 *             if k <= self._sim.plant_row_column:
 *                 j = self._sim.plant_row_column - k
 */
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":852
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)
 * 
 *     def _column_shading(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._column_shading", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_zint);
  __Pyx_XDECREF(__pyx_v_sw);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_sw0);
  __Pyx_XDECREF(__pyx_v_sw1);
  __Pyx_XDECREF(__pyx_v_k0);
  __Pyx_XDECREF(__pyx_v_shade);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":876
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 *     def _daily_climate(self, u):             # <<<<<<<<<<<<<<
 *         cdef double declination  # daily declination angle, in radians
 *         cdef double sunr  # time of sunrise, hours.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_17_daily_climate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_17_daily_climate = {"_daily_climate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_17_daily_climate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_17_daily_climate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_daily_climate (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 876, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_daily_climate") < 0)) __PYX_ERR(0, 876, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_daily_climate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 876, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._daily_climate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_16_daily_climate(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_16_daily_climate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  double __pyx_v_declination;
  double __pyx_v_sunr;
  double __pyx_v_suns;
  double __pyx_v_tmpisr;
  PyObject *__pyx_v_hour = NULL;
  PyObject *__pyx_v_result = NULL;
  PyObject *__pyx_v_zero = NULL;
  double __pyx_v_xlat;
  double __pyx_v_cd;
  double __pyx_v_sd;
  double __pyx_v_c11;
  double __pyx_v_radsum;
  PyObject *__pyx_v_dsbe = NULL;
  double __pyx_v_rainToday;
  double __pyx_v_runoffToday;
  double __pyx_v_t1;
  double __pyx_v_t2;
  double __pyx_v_t3;
  double __pyx_v_wnytf;
  PyObject *__pyx_v_ihr = NULL;
  PyObject *__pyx_v_ti = NULL;
  PyObject *__pyx_v_sinb = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  int __pyx_t_9;
  double __pyx_t_10;
  int __pyx_t_11;
  uint32_t __pyx_t_12;
  long __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  Py_ssize_t __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_daily_climate", 0);

  /* "_cotton2k/simulation.pyx":881
 *         cdef double suns  # time of sunset, hours.
 *         cdef double tmpisr  # extraterrestrial radiation, \frac{W}{m^2}
 *         hour = timedelta(hours=1)             # <<<<<<<<<<<<<<
 *         result = compute_day_length((self.latitude, self.longitude), self._doy2date(self._sim.states[u].daynum))
 *         declination = result["declination"]
 */
  __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_hours, __pyx_int_1) < 0) __PYX_ERR(0, 881, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_empty_tuple, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 881, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_hour = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":882
 *         cdef double tmpisr  # extraterrestrial radiation, \frac{W}{m^2}
 *         hour = timedelta(hours=1)
 *         result = compute_day_length((self.latitude, self.longitude), self._doy2date(self._sim.states[u].daynum))             # <<<<<<<<<<<<<<
 *         declination = result["declination"]
 *         zero = result["sunr"].replace(hour=0, minute=0, second=0, microsecond=0)
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_compute_day_length); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_latitude); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_longitude); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyTuple_New(2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_GIVEREF(__pyx_t_1);
  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_1);
  __Pyx_GIVEREF(__pyx_t_4);
  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_4);
  __pyx_t_1 = 0;
  __pyx_t_4 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_doy2date); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 882, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_sim.states[__pyx_t_6]).daynum); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 882, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
    __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_1);
    if (likely(__pyx_t_8)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
      __Pyx_INCREF(__pyx_t_8);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_1, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_8, __pyx_t_7};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  }
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[3] = {__pyx_t_1, __pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 2+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 882, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_result = __pyx_t_3;
  __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":883
 *         hour = timedelta(hours=1)
 *         result = compute_day_length((self.latitude, self.longitude), self._doy2date(self._sim.states[u].daynum))
 *         declination = result["declination"]             # <<<<<<<<<<<<<<
 *         zero = result["sunr"].replace(hour=0, minute=0, second=0, microsecond=0)
 *         sunr = (result["sunr"] - zero) / hour
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_declination); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 883, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_declination = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":884
 *         result = compute_day_length((self.latitude, self.longitude), self._doy2date(self._sim.states[u].daynum))
 *         declination = result["declination"]
 *         zero = result["sunr"].replace(hour=0, minute=0, second=0, microsecond=0)             # <<<<<<<<<<<<<<
 *         sunr = (result["sunr"] - zero) / hour
 *         suns = (result["suns"] - zero) / hour
 */
  __pyx_t_3 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_sunr); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_3, __pyx_n_s_replace); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyDict_NewPresized(4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_hour, __pyx_int_0) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_minute, __pyx_int_0) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_second, __pyx_int_0) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_microsecond, __pyx_int_0) < 0) __PYX_ERR(0, 884, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_empty_tuple, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 884, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_zero = __pyx_t_4;
  __pyx_t_4 = 0;

  /* "_cotton2k/simulation.pyx":885
 *         declination = result["declination"]
 *         zero = result["sunr"].replace(hour=0, minute=0, second=0, microsecond=0)
 *         sunr = (result["sunr"] - zero) / hour             # <<<<<<<<<<<<<<
 *         suns = (result["suns"] - zero) / hour
 *         tmpisr = result["tmpisr"]
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_sunr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_v_zero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 885, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_sunr = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":886
 *         zero = result["sunr"].replace(hour=0, minute=0, second=0, microsecond=0)
 *         sunr = (result["sunr"] - zero) / hour
 *         suns = (result["suns"] - zero) / hour             # <<<<<<<<<<<<<<
 *         tmpisr = result["tmpisr"]
 *         self._sim.states[u].solar_noon = (result["solar_noon"] - zero) / hour
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_suns); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_v_zero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 886, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_suns = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":887
 *         sunr = (result["sunr"] - zero) / hour
 *         suns = (result["suns"] - zero) / hour
 *         tmpisr = result["tmpisr"]             # <<<<<<<<<<<<<<
 *         self._sim.states[u].solar_noon = (result["solar_noon"] - zero) / hour
 *         self._sim.states[u].day_length = result["day_length"] / hour
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_tmpisr); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 887, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_tmpisr = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":888
 *         suns = (result["suns"] - zero) / hour
 *         tmpisr = result["tmpisr"]
 *         self._sim.states[u].solar_noon = (result["solar_noon"] - zero) / hour             # <<<<<<<<<<<<<<
 *         self._sim.states[u].day_length = result["day_length"] / hour
 * 
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_solar_noon); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = PyNumber_Subtract(__pyx_t_4, __pyx_v_zero); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_hour); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 888, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_6]).solar_noon = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":889
 *         tmpisr = result["tmpisr"]
 *         self._sim.states[u].solar_noon = (result["solar_noon"] - zero) / hour
 *         self._sim.states[u].day_length = result["day_length"] / hour             # <<<<<<<<<<<<<<
 * 
 *         cdef double xlat = self.latitude * pi / 180  # latitude converted to radians.
 */
  __pyx_t_4 = __Pyx_PyObject_Dict_GetItem(__pyx_v_result, __pyx_n_u_day_length); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_4, __pyx_v_hour); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 889, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_6]).day_length = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":891
 *         self._sim.states[u].day_length = result["day_length"] / hour
 * 
 *         cdef double xlat = self.latitude * pi / 180  # latitude converted to radians.             # <<<<<<<<<<<<<<
 *         cdef double cd = cos(xlat) * cos(declination)  # amplitude of the sine of the solar height.
 *         cdef double sd = sin(xlat) * sin(declination)  # seasonal offset of the sine of the solar height.
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_latitude); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_4 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_2, __pyx_int_180, 0xB4, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 891, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_xlat = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":892
 * 
 *         cdef double xlat = self.latitude * pi / 180  # latitude converted to radians.
 *         cdef double cd = cos(xlat) * cos(declination)  # amplitude of the sine of the solar height.             # <<<<<<<<<<<<<<
 *         cdef double sd = sin(xlat) * sin(declination)  # seasonal offset of the sine of the solar height.
 *         # The computation of the daily integral of global radiation (from sunrise to sunset) is based on Spitters et al. (1986).
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyFloat_FromDouble(__pyx_v_xlat); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_cos); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_declination); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 892, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_4, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 892, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_cd = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":893
 *         cdef double xlat = self.latitude * pi / 180  # latitude converted to radians.
 *         cdef double cd = cos(xlat) * cos(declination)  # amplitude of the sine of the solar height.
 *         cdef double sd = sin(xlat) * sin(declination)  # seasonal offset of the sine of the solar height.             # <<<<<<<<<<<<<<
 *         # The computation of the daily integral of global radiation (from sunrise to sunset) is based on Spitters et al. (1986).
 *         cdef double c11 = 0.4  # constant parameter
 */
  __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_4 = PyFloat_FromDouble(__pyx_v_xlat); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_5)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_5);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_4};
    __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_sin); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = PyFloat_FromDouble(__pyx_v_declination); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  __pyx_t_9 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_4);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_4, function);
      __pyx_t_9 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_t_5};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_4, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 893, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  }
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 893, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_sd = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":895
 *         cdef double sd = sin(xlat) * sin(declination)  # seasonal offset of the sine of the solar height.
 *         # The computation of the daily integral of global radiation (from sunrise to sunset) is based on Spitters et al. (1986).
 *         cdef double c11 = 0.4  # constant parameter             # <<<<<<<<<<<<<<
 *         cdef double radsum
 *         if abs(sd / cd) >= 1:
 */
  __pyx_v_c11 = 0.4;

  /* "_cotton2k/simulation.pyx":897
 *         cdef double c11 = 0.4  # constant parameter
 *         cdef double radsum
 *         if abs(sd / cd) >= 1:             # <<<<<<<<<<<<<<
 *             radsum = 0
 *         else:
 */
  if (unlikely(__pyx_v_cd == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 897, __pyx_L1_error)
  }
  __pyx_t_11 = ((fabs((__pyx_v_sd / __pyx_v_cd)) >= 1.0) != 0);
  if (__pyx_t_11) {

    /* "_cotton2k/simulation.pyx":898
 *         cdef double radsum
 *         if abs(sd / cd) >= 1:
 *             radsum = 0             # <<<<<<<<<<<<<<
 *         else:
 *             # dsbe is the integral of sinb * (1 + c11 * sinb) from sunrise to sunset.
 */
    __pyx_v_radsum = 0.0;

    /* "_cotton2k/simulation.pyx":897
 *         cdef double c11 = 0.4  # constant parameter
 *         cdef double radsum
 *         if abs(sd / cd) >= 1:             # <<<<<<<<<<<<<<
 *             radsum = 0
 *         else:
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":901
 *         else:
 *             # dsbe is the integral of sinb * (1 + c11 * sinb) from sunrise to sunset.
 *             dsbe = acos(-sd / cd) * 24 / pi * (sd + c11 * sd * sd + 0.5 * c11 * cd * cd) + 12 * (             # <<<<<<<<<<<<<<
 *                     cd * (2 + 3 * c11 * sd)) * sqrt(1 - (sd / cd) * (sd / cd)) / pi
 *             # The daily radiation integral is computed for later use in function Radiation.
 */
  /*else*/ {
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_acos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_10 = (-__pyx_v_sd);
    if (unlikely(__pyx_v_cd == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 901, __pyx_L1_error)
    }
    __pyx_t_3 = PyFloat_FromDouble((__pyx_t_10 / __pyx_v_cd)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_5)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_5);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_5, __pyx_t_3};
      __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __pyx_t_2 = __Pyx_PyInt_MultiplyObjC(__pyx_t_4, __pyx_int_24, 24, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_pi); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_t_4 = PyFloat_FromDouble(((__pyx_v_sd + ((__pyx_v_c11 * __pyx_v_sd) * __pyx_v_sd)) + (((0.5 * __pyx_v_c11) * __pyx_v_cd) * __pyx_v_cd))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_2 = PyNumber_Multiply(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":902
 *             # dsbe is the integral of sinb * (1 + c11 * sinb) from sunrise to sunset.
 *             dsbe = acos(-sd / cd) * 24 / pi * (sd + c11 * sd * sd + 0.5 * c11 * cd * cd) + 12 * (
 *                     cd * (2 + 3 * c11 * sd)) * sqrt(1 - (sd / cd) * (sd / cd)) / pi             # <<<<<<<<<<<<<<
 *             # The daily radiation integral is computed for later use in function Radiation.
 *             # Daily radiation intedral is converted from langleys to Watt m - 2, and divided by dsbe.
 */
    __pyx_t_4 = PyFloat_FromDouble((12.0 * (__pyx_v_cd * (2.0 + ((3.0 * __pyx_v_c11) * __pyx_v_sd))))); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    if (unlikely(__pyx_v_cd == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 902, __pyx_L1_error)
    }
    if (unlikely(__pyx_v_cd == 0)) {
      PyErr_SetString(PyExc_ZeroDivisionError, "float division");
      __PYX_ERR(0, 902, __pyx_L1_error)
    }
    __pyx_t_1 = PyFloat_FromDouble((1.0 - ((__pyx_v_sd / __pyx_v_cd) * (__pyx_v_sd / __pyx_v_cd)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_1};
      __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_GetModuleGlobalName(__pyx_t_3, __pyx_n_s_pi); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_5, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 902, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":901
 *         else:
 *             # dsbe is the integral of sinb * (1 + c11 * sinb) from sunrise to sunset.
 *             dsbe = acos(-sd / cd) * 24 / pi * (sd + c11 * sd * sd + 0.5 * c11 * cd * cd) + 12 * (             # <<<<<<<<<<<<<<
 *                     cd * (2 + 3 * c11 * sd)) * sqrt(1 - (sd / cd) * (sd / cd)) / pi
 *             # The daily radiation integral is computed for later use in function Radiation.
 */
    __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 901, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_dsbe = __pyx_t_3;
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":906
 *             # Daily radiation intedral is converted from langleys to Watt m - 2, and divided by dsbe.
 *             # 11.630287 = 1000000 / 3600 / 23.884
 *             radsum = self._sim.climate[u].Rad * 11.630287 / dsbe             # <<<<<<<<<<<<<<
 *         cdef double rainToday
 *         rainToday = self._sim.climate[u].Rain  # the amount of rain today, mm
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error)
    __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_self->_sim.climate[__pyx_t_6]).Rad * 11.630287)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_4 = __Pyx_PyNumber_Divide(__pyx_t_3, __pyx_v_dsbe); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 906, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __pyx_v_radsum = __pyx_t_10;
  }
  __pyx_L3:;

  /* "_cotton2k/simulation.pyx":908
 *             radsum = self._sim.climate[u].Rad * 11.630287 / dsbe
 *         cdef double rainToday
 *         rainToday = self._sim.climate[u].Rain  # the amount of rain today, mm             # <<<<<<<<<<<<<<
 *         # Set 'pollination switch' for rainy days (as in GOSSYM).
 *         self._sim.states[u].pollination_switch = rainToday < 2.5
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 908, __pyx_L1_error)
  __pyx_t_10 = (__pyx_v_self->_sim.climate[__pyx_t_6]).Rain;
  __pyx_v_rainToday = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":910
 *         rainToday = self._sim.climate[u].Rain  # the amount of rain today, mm
 *         # Set 'pollination switch' for rainy days (as in GOSSYM).
 *         self._sim.states[u].pollination_switch = rainToday < 2.5             # <<<<<<<<<<<<<<
 *         # Call SimulateRunoff() only if the daily rainfall is more than 2 mm.
 *         # Note: this is modified from the original GOSSYM - RRUNOFF routine. It is called here for rainfall only, but it is not activated when irrigation is applied.
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 910, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_6]).pollination_switch = (__pyx_v_rainToday < 2.5);

  /* "_cotton2k/simulation.pyx":913
 *         # Call SimulateRunoff() only if the daily rainfall is more than 2 mm.
 *         # Note: this is modified from the original GOSSYM - RRUNOFF routine. It is called here for rainfall only, but it is not activated when irrigation is applied.
 *         cdef double runoffToday = 0  # amount of runoff today, mm             # <<<<<<<<<<<<<<
 *         if rainToday >= 2.0:
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 */
  __pyx_v_runoffToday = 0.0;

  /* "_cotton2k/simulation.pyx":914
 *         # Note: this is modified from the original GOSSYM - RRUNOFF routine. It is called here for rainfall only, but it is not activated when irrigation is applied.
 *         cdef double runoffToday = 0  # amount of runoff today, mm
 *         if rainToday >= 2.0:             # <<<<<<<<<<<<<<
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 *             if runoffToday < rainToday:
 */
  __pyx_t_11 = ((__pyx_v_rainToday >= 2.0) != 0);
  if (__pyx_t_11) {

    /* "_cotton2k/simulation.pyx":915
 *         cdef double runoffToday = 0  # amount of runoff today, mm
 *         if rainToday >= 2.0:
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)             # <<<<<<<<<<<<<<
 *             if runoffToday < rainToday:
 *                 rainToday -= runoffToday
 */
    __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 915, __pyx_L1_error)
    __pyx_v_runoffToday = SimulateRunoff(__pyx_v_self->_sim, __pyx_t_12, (SandVolumeFraction[0]), (ClayVolumeFraction[0]), NumIrrigations);

    /* "_cotton2k/simulation.pyx":916
 *         if rainToday >= 2.0:
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 *             if runoffToday < rainToday:             # <<<<<<<<<<<<<<
 *                 rainToday -= runoffToday
 *             else:
 */
    __pyx_t_11 = ((__pyx_v_runoffToday < __pyx_v_rainToday) != 0);
    if (__pyx_t_11) {

      /* "_cotton2k/simulation.pyx":917
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 *             if runoffToday < rainToday:
 *                 rainToday -= runoffToday             # <<<<<<<<<<<<<<
 *             else:
 *                 rainToday = 0
 */
      __pyx_v_rainToday = (__pyx_v_rainToday - __pyx_v_runoffToday);

      /* "_cotton2k/simulation.pyx":916
 *         if rainToday >= 2.0:
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 *             if runoffToday < rainToday:             # <<<<<<<<<<<<<<
 *                 rainToday -= runoffToday
 *             else:
 */
      goto __pyx_L5;
    }

    /* "_cotton2k/simulation.pyx":919
 *                 rainToday -= runoffToday
 *             else:
 *                 rainToday = 0             # <<<<<<<<<<<<<<
 *             self._sim.climate[u].Rain = rainToday
 *         self._sim.states[u].runoff = runoffToday
 */
    /*else*/ {
      __pyx_v_rainToday = 0.0;
    }
    __pyx_L5:;

    /* "_cotton2k/simulation.pyx":920
 *             else:
 *                 rainToday = 0
 *             self._sim.climate[u].Rain = rainToday             # <<<<<<<<<<<<<<
 *         self._sim.states[u].runoff = runoffToday
 *         # Parameters for the daily wind function are now computed:
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 920, __pyx_L1_error)
    (__pyx_v_self->_sim.climate[__pyx_t_6]).Rain = __pyx_v_rainToday;

    /* "_cotton2k/simulation.pyx":914
 *         # Note: this is modified from the original GOSSYM - RRUNOFF routine. It is called here for rainfall only, but it is not activated when irrigation is applied.
 *         cdef double runoffToday = 0  # amount of runoff today, mm
 *         if rainToday >= 2.0:             # <<<<<<<<<<<<<<
 *             runoffToday = SimulateRunoff(self._sim, u, SandVolumeFraction[0], ClayVolumeFraction[0], NumIrrigations)
 *             if runoffToday < rainToday:
 */
  }

  /* "_cotton2k/simulation.pyx":921
 *                 rainToday = 0
 *             self._sim.climate[u].Rain = rainToday
 *         self._sim.states[u].runoff = runoffToday             # <<<<<<<<<<<<<<
 *         # Parameters for the daily wind function are now computed:
 *         cdef double t1 = sunr + SitePar[1]  # the hour at which wind begins to blow (SitePar(1) hours after sunrise).
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 921, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_6]).runoff = __pyx_v_runoffToday;

  /* "_cotton2k/simulation.pyx":923
 *         self._sim.states[u].runoff = runoffToday
 *         # Parameters for the daily wind function are now computed:
 *         cdef double t1 = sunr + SitePar[1]  # the hour at which wind begins to blow (SitePar(1) hours after sunrise).             # <<<<<<<<<<<<<<
 *         cdef double t2 = self._sim.states[u].solar_noon + SitePar[
 *             2]  # the hour at which wind speed is maximum (SitePar(2) hours after solar noon).
 */
  __pyx_v_t1 = (__pyx_v_sunr + (SitePar[1]));

  /* "_cotton2k/simulation.pyx":924
 *         # Parameters for the daily wind function are now computed:
 *         cdef double t1 = sunr + SitePar[1]  # the hour at which wind begins to blow (SitePar(1) hours after sunrise).
 *         cdef double t2 = self._sim.states[u].solar_noon + SitePar[             # <<<<<<<<<<<<<<
 *             2]  # the hour at which wind speed is maximum (SitePar(2) hours after solar noon).
 *         cdef double t3 = suns + SitePar[3]  # the hour at which wind stops to blow (SitePar(3) hours after sunset).
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 924, __pyx_L1_error)
  __pyx_v_t2 = ((__pyx_v_self->_sim.states[__pyx_t_6]).solar_noon + (SitePar[2]));

  /* "_cotton2k/simulation.pyx":926
 *         cdef double t2 = self._sim.states[u].solar_noon + SitePar[
 *             2]  # the hour at which wind speed is maximum (SitePar(2) hours after solar noon).
 *         cdef double t3 = suns + SitePar[3]  # the hour at which wind stops to blow (SitePar(3) hours after sunset).             # <<<<<<<<<<<<<<
 *         cdef double wnytf = SitePar[4]  # used for estimating night time wind (from time t3 to time t1 next day).
 * 
 */
  __pyx_v_t3 = (__pyx_v_suns + (SitePar[3]));

  /* "_cotton2k/simulation.pyx":927
 *             2]  # the hour at which wind speed is maximum (SitePar(2) hours after solar noon).
 *         cdef double t3 = suns + SitePar[3]  # the hour at which wind stops to blow (SitePar(3) hours after sunset).
 *         cdef double wnytf = SitePar[4]  # used for estimating night time wind (from time t3 to time t1 next day).             # <<<<<<<<<<<<<<
 * 
 *         for ihr in range(24):
 */
  __pyx_v_wnytf = (SitePar[4]);

  /* "_cotton2k/simulation.pyx":929
 *         cdef double wnytf = SitePar[4]  # used for estimating night time wind (from time t3 to time t1 next day).
 * 
 *         for ihr in range(24):             # <<<<<<<<<<<<<<
 *             ti = ihr + 0.5
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)
 */
  for (__pyx_t_13 = 0; __pyx_t_13 < 24; __pyx_t_13+=1) {
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_13); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 929, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_ihr, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":930
 * 
 *         for ihr in range(24):
 *             ti = ihr + 0.5             # <<<<<<<<<<<<<<
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)
 */
    __pyx_t_4 = __Pyx_PyFloat_AddObjC(__pyx_v_ihr, __pyx_float_0_5, 0.5, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 930, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_ti, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":931
 *         for ihr in range(24):
 *             ti = ihr + 0.5
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)             # <<<<<<<<<<<<<<
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,
 */
    __pyx_t_4 = PyFloat_FromDouble(__pyx_v_sd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_3 = PyFloat_FromDouble(__pyx_v_cd); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_cos); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_GetModuleGlobalName(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 931, __pyx_L1_error)
    __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->_sim.states[__pyx_t_6]).solar_noon); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = PyNumber_Subtract(__pyx_v_ti, __pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = PyNumber_Multiply(__pyx_t_1, __pyx_t_8); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    __pyx_t_8 = __Pyx_PyInt_TrueDivideObjC(__pyx_t_7, __pyx_int_12, 12, 0, 0); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    __pyx_t_7 = NULL;
    __pyx_t_9 = 0;
    if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_7)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_7);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_9 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_8};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_9, 1+__pyx_t_9);
      __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __pyx_t_5 = PyNumber_Multiply(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = PyNumber_Add(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 931, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF_SET(__pyx_v_sinb, __pyx_t_2);
    __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":932
 *             ti = ihr + 0.5
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)             # <<<<<<<<<<<<<<
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,
 *                                                                 suns)
 */
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_ti); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
    __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_sinb); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 932, __pyx_L1_error)
    ((__pyx_v_self->_sim.states[__pyx_t_6]).hours[__pyx_t_15]).radiation = dayrad(__pyx_t_10, __pyx_v_radsum, __pyx_t_14, __pyx_v_c11);

    /* "_cotton2k/simulation.pyx":933
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,             # <<<<<<<<<<<<<<
 *                                                                 suns)
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,
 */
    __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L1_error)
    __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_ti); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":934
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,
 *                                                                 suns)             # <<<<<<<<<<<<<<
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,
 *                                                                 self._sim.states[u].hours[ihr].temperature, sunr,
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":933
 *             sinb = sd + cd * cos(pi * (ti - self._sim.states[u].solar_noon) / 12)
 *             self._sim.states[u].hours[ihr].radiation = dayrad(ti, radsum, sinb, c11)
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,             # <<<<<<<<<<<<<<
 *                                                                 suns)
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 933, __pyx_L1_error)
    ((__pyx_v_self->_sim.states[__pyx_t_15]).hours[__pyx_t_6]).temperature = daytmp(__pyx_v_self->_sim, __pyx_t_12, __pyx_t_14, (SitePar[8]), LastDayWeatherData, __pyx_v_sunr, __pyx_v_suns);

    /* "_cotton2k/simulation.pyx":935
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,
 *                                                                 suns)
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,             # <<<<<<<<<<<<<<
 *                                                                 self._sim.states[u].hours[ihr].temperature, sunr,
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],
 */
    __pyx_t_12 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_12 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
    __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_ti); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":936
 *                                                                 suns)
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,
 *                                                                 self._sim.states[u].hours[ihr].temperature, sunr,             # <<<<<<<<<<<<<<
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],
 *                                                                 SitePar[13], SitePar[14])
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L1_error)
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 936, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":937
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,
 *                                                                 self._sim.states[u].hours[ihr].temperature, sunr,
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],             # <<<<<<<<<<<<<<
 *                                                                 SitePar[13], SitePar[14])
 *             self._sim.states[u].hours[ihr].humidity = dayrh(self._sim.states[u].hours[ihr].temperature,
 */
    __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 937, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":935
 *             self._sim.states[u].hours[ihr].temperature = daytmp(self._sim, u, ti, SitePar[8], LastDayWeatherData, sunr,
 *                                                                 suns)
 *             self._sim.states[u].hours[ihr].dew_point = tdewhour(self._sim, u, LastDayWeatherData, ti,             # <<<<<<<<<<<<<<
 *                                                                 self._sim.states[u].hours[ihr].temperature, sunr,
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],
 */
    __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 935, __pyx_L1_error)
    ((__pyx_v_self->_sim.states[__pyx_t_17]).hours[__pyx_t_18]).dew_point = tdewhour(__pyx_v_self->_sim, __pyx_t_12, LastDayWeatherData, __pyx_t_14, ((__pyx_v_self->_sim.states[__pyx_t_6]).hours[__pyx_t_15]).temperature, __pyx_v_sunr, (__pyx_v_self->_sim.states[__pyx_t_16]).solar_noon, (SitePar[8]), (SitePar[12]), (SitePar[13]), (SitePar[14]));

    /* "_cotton2k/simulation.pyx":939
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],
 *                                                                 SitePar[13], SitePar[14])
 *             self._sim.states[u].hours[ihr].humidity = dayrh(self._sim.states[u].hours[ihr].temperature,             # <<<<<<<<<<<<<<
 *                                                             self._sim.states[u].hours[ihr].dew_point)
 *             self._sim.states[u].hours[ihr].wind_speed = daywnd(ti, self._sim.climate[u].Wind, t1, t2, t3, wnytf)
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L1_error)
    __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":940
 *                                                                 SitePar[13], SitePar[14])
 *             self._sim.states[u].hours[ihr].humidity = dayrh(self._sim.states[u].hours[ihr].temperature,
 *                                                             self._sim.states[u].hours[ihr].dew_point)             # <<<<<<<<<<<<<<
 *             self._sim.states[u].hours[ihr].wind_speed = daywnd(ti, self._sim.climate[u].Wind, t1, t2, t3, wnytf)
 *         # Compute average daily temperature, using function AverageAirTemperatures.
 */
    __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L1_error)
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 940, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":939
 *                                                                 self._sim.states[u].solar_noon, SitePar[8], SitePar[12],
 *                                                                 SitePar[13], SitePar[14])
 *             self._sim.states[u].hours[ihr].humidity = dayrh(self._sim.states[u].hours[ihr].temperature,             # <<<<<<<<<<<<<<
 *                                                             self._sim.states[u].hours[ihr].dew_point)
 *             self._sim.states[u].hours[ihr].wind_speed = daywnd(ti, self._sim.climate[u].Wind, t1, t2, t3, wnytf)
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L1_error)
    __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 939, __pyx_L1_error)
    ((__pyx_v_self->_sim.states[__pyx_t_6]).hours[__pyx_t_19]).humidity = dayrh(((__pyx_v_self->_sim.states[__pyx_t_18]).hours[__pyx_t_17]).temperature, ((__pyx_v_self->_sim.states[__pyx_t_16]).hours[__pyx_t_15]).dew_point);

    /* "_cotton2k/simulation.pyx":941
 *             self._sim.states[u].hours[ihr].humidity = dayrh(self._sim.states[u].hours[ihr].temperature,
 *                                                             self._sim.states[u].hours[ihr].dew_point)
 *             self._sim.states[u].hours[ihr].wind_speed = daywnd(ti, self._sim.climate[u].Wind, t1, t2, t3, wnytf)             # <<<<<<<<<<<<<<
 *         # Compute average daily temperature, using function AverageAirTemperatures.
 *         AverageAirTemperatures(self._sim.states[u].hours, self._sim.states[u].average_temperature, DayTimeTemp,
 */
    __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_v_ti); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
    __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_ihr); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 941, __pyx_L1_error)
    ((__pyx_v_self->_sim.states[__pyx_t_6]).hours[__pyx_t_15]).wind_speed = daywnd(__pyx_t_14, (__pyx_v_self->_sim.climate[__pyx_t_19]).Wind, __pyx_v_t1, __pyx_v_t2, __pyx_v_t3, __pyx_v_wnytf);
  }

  /* "_cotton2k/simulation.pyx":943
 *             self._sim.states[u].hours[ihr].wind_speed = daywnd(ti, self._sim.climate[u].Wind, t1, t2, t3, wnytf)
 *         # Compute average daily temperature, using function AverageAirTemperatures.
 *         AverageAirTemperatures(self._sim.states[u].hours, self._sim.states[u].average_temperature, DayTimeTemp,             # <<<<<<<<<<<<<<
 *                                NightTimeTemp)
 *         # Compute potential evapotranspiration.
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 943, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":944
 *         # Compute average daily temperature, using function AverageAirTemperatures.
 *         AverageAirTemperatures(self._sim.states[u].hours, self._sim.states[u].average_temperature, DayTimeTemp,
 *                                NightTimeTemp)             # <<<<<<<<<<<<<<
 *         # Compute potential evapotranspiration.
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])
 */
  AverageAirTemperatures((__pyx_v_self->_sim.states[__pyx_t_15]).hours, (__pyx_v_self->_sim.states[__pyx_t_6]).average_temperature, DayTimeTemp, NightTimeTemp);

  /* "_cotton2k/simulation.pyx":946
 *                                NightTimeTemp)
 *         # Compute potential evapotranspiration.
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])             # <<<<<<<<<<<<<<
 * 
 *     def _stress(self, u):
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_latitude); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_elevation); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 946, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  EvapoTranspiration((__pyx_v_self->_sim.states[__pyx_t_6]), __pyx_t_14, __pyx_t_10, __pyx_v_declination, __pyx_v_tmpisr, (SitePar[7]));

  /* "_cotton2k/simulation.pyx":876
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 *     def _daily_climate(self, u):             # <<<<<<<<<<<<<<
 *         cdef double declination  # daily declination angle, in radians
 *         cdef double sunr  # time of sunrise, hours.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._daily_climate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_hour);
  __Pyx_XDECREF(__pyx_v_result);
  __Pyx_XDECREF(__pyx_v_zero);
  __Pyx_XDECREF(__pyx_v_dsbe);
  __Pyx_XDECREF(__pyx_v_ihr);
  __Pyx_XDECREF(__pyx_v_ti);
  __Pyx_XDECREF(__pyx_v_sinb);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":948
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])
 * 
 *     def _stress(self, u):             # <<<<<<<<<<<<<<
 *         global AverageLwpMin, AverageLwp, LwpMin, LwpMax
 *         # The following constant parameters are used:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_19_stress(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_19_stress = {"_stress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_19_stress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_19_stress(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_stress (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 948, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_stress") < 0)) __PYX_ERR(0, 948, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_stress", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 948, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._stress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_18_stress(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_18_stress(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  double __pyx_v_vstrs[9];
  PyObject *__pyx_v_i = NULL;
  double __pyx_v_psilim;
  double __pyx_v_WaterStress;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1[9];
  Py_ssize_t __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  double __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_stress", 0);

  /* "_cotton2k/simulation.pyx":951
 *         global AverageLwpMin, AverageLwp, LwpMin, LwpMax
 *         # The following constant parameters are used:
 *         cdef double[9] vstrs = [-3.0, 3.229, 1.907, 0.321, -0.10, 1.230, 0.340, 0.30, 0.05]             # <<<<<<<<<<<<<<
 *         # Call LeafWaterPotential() to compute leaf water potentials.
 *         LeafWaterPotential(self._sim.states[u], self.row_space)
 */
  __pyx_t_1[0] = -3.0;
  __pyx_t_1[1] = 3.229;
  __pyx_t_1[2] = 1.907;
  __pyx_t_1[3] = 0.321;
  __pyx_t_1[4] = -0.10;
  __pyx_t_1[5] = 1.230;
  __pyx_t_1[6] = 0.340;
  __pyx_t_1[7] = 0.30;
  __pyx_t_1[8] = 0.05;
  memcpy(&(__pyx_v_vstrs[0]), __pyx_t_1, sizeof(__pyx_v_vstrs[0]) * (9));

  /* "_cotton2k/simulation.pyx":953
 *         cdef double[9] vstrs = [-3.0, 3.229, 1.907, 0.321, -0.10, 1.230, 0.340, 0.30, 0.05]
 *         # Call LeafWaterPotential() to compute leaf water potentials.
 *         LeafWaterPotential(self._sim.states[u], self.row_space)             # <<<<<<<<<<<<<<
 *         # The running averages, for the last three days, are computed:
 *         # AverageLwpMin is the average of LwpMin, and AverageLwp of LwpMin + LwpMax.
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_4 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 953, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  LeafWaterPotential((__pyx_v_self->_sim.states[__pyx_t_2]), __pyx_t_4);

  /* "_cotton2k/simulation.pyx":956
 *         # The running averages, for the last three days, are computed:
 *         # AverageLwpMin is the average of LwpMin, and AverageLwp of LwpMin + LwpMax.
 *         AverageLwpMin += (LwpMin - LwpMinX[2]) / 3             # <<<<<<<<<<<<<<
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3
 *         for i in (2, 1):
 */
  AverageLwpMin = (AverageLwpMin + ((LwpMin - (LwpMinX[2])) / 3.0));

  /* "_cotton2k/simulation.pyx":957
 *         # AverageLwpMin is the average of LwpMin, and AverageLwp of LwpMin + LwpMax.
 *         AverageLwpMin += (LwpMin - LwpMinX[2]) / 3
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3             # <<<<<<<<<<<<<<
 *         for i in (2, 1):
 *             LwpMinX[i] = LwpMinX[i - 1]
 */
  AverageLwp = (AverageLwp + (((LwpMin + LwpMax) - (LwpX[2])) / 3.0));

  /* "_cotton2k/simulation.pyx":958
 *         AverageLwpMin += (LwpMin - LwpMinX[2]) / 3
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3
 *         for i in (2, 1):             # <<<<<<<<<<<<<<
 *             LwpMinX[i] = LwpMinX[i - 1]
 *             LwpX[i] = LwpX[i - 1]
 */
  __pyx_t_3 = __pyx_tuple__9; __Pyx_INCREF(__pyx_t_3); __pyx_t_2 = 0;
  for (;;) {
    if (__pyx_t_2 >= 2) break;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_2); __Pyx_INCREF(__pyx_t_5); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 958, __pyx_L1_error)
    #else
    __pyx_t_5 = PySequence_ITEM(__pyx_t_3, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 958, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    #endif
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":959
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3
 *         for i in (2, 1):
 *             LwpMinX[i] = LwpMinX[i - 1]             # <<<<<<<<<<<<<<
 *             LwpX[i] = LwpX[i - 1]
 *         LwpMinX[0] = LwpMin
 */
    __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 959, __pyx_L1_error)
    (LwpMinX[__pyx_t_7]) = (LwpMinX[__pyx_t_6]);

    /* "_cotton2k/simulation.pyx":960
 *         for i in (2, 1):
 *             LwpMinX[i] = LwpMinX[i - 1]
 *             LwpX[i] = LwpX[i - 1]             # <<<<<<<<<<<<<<
 *         LwpMinX[0] = LwpMin
 *         LwpX[0] = LwpMin + LwpMax
 */
    __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_t_5); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 960, __pyx_L1_error)
    (LwpX[__pyx_t_7]) = (LwpX[__pyx_t_6]);

    /* "_cotton2k/simulation.pyx":958
 *         AverageLwpMin += (LwpMin - LwpMinX[2]) / 3
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3
 *         for i in (2, 1):             # <<<<<<<<<<<<<<
 *             LwpMinX[i] = LwpMinX[i - 1]
 *             LwpX[i] = LwpX[i - 1]
 */
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":961
 *             LwpMinX[i] = LwpMinX[i - 1]
 *             LwpX[i] = LwpX[i - 1]
 *         LwpMinX[0] = LwpMin             # <<<<<<<<<<<<<<
 *         LwpX[0] = LwpMin + LwpMax
 *         if self._sim.states[u].kday < 5:
 */
  (LwpMinX[0]) = LwpMin;

  /* "_cotton2k/simulation.pyx":962
 *             LwpX[i] = LwpX[i - 1]
 *         LwpMinX[0] = LwpMin
 *         LwpX[0] = LwpMin + LwpMax             # <<<<<<<<<<<<<<
 *         if self._sim.states[u].kday < 5:
 *             self.ptsred = 1
 */
  (LwpX[0]) = (LwpMin + LwpMax);

  /* "_cotton2k/simulation.pyx":963
 *         LwpMinX[0] = LwpMin
 *         LwpX[0] = LwpMin + LwpMax
 *         if self._sim.states[u].kday < 5:             # <<<<<<<<<<<<<<
 *             self.ptsred = 1
 *             self._sim.states[u].water_stress_stem = 1
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 963, __pyx_L1_error)
  __pyx_t_8 = (((__pyx_v_self->_sim.states[__pyx_t_2]).kday < 5) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":964
 *         LwpX[0] = LwpMin + LwpMax
 *         if self._sim.states[u].kday < 5:
 *             self.ptsred = 1             # <<<<<<<<<<<<<<
 *             self._sim.states[u].water_stress_stem = 1
 *             return
 */
    __pyx_v_self->ptsred = 1.0;

    /* "_cotton2k/simulation.pyx":965
 *         if self._sim.states[u].kday < 5:
 *             self.ptsred = 1
 *             self._sim.states[u].water_stress_stem = 1             # <<<<<<<<<<<<<<
 *             return
 *         # The computation of ptsred, the effect of moisture stress on the photosynthetic rate, is based on the following work:
 */
    __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 965, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_2]).water_stress_stem = 1.0;

    /* "_cotton2k/simulation.pyx":966
 *             self.ptsred = 1
 *             self._sim.states[u].water_stress_stem = 1
 *             return             # <<<<<<<<<<<<<<
 *         # The computation of ptsred, the effect of moisture stress on the photosynthetic rate, is based on the following work:
 *         # Ephrath, J.E., Marani, A., Bravdo, B.A., 1990. Effects of moisture stress on stomatal resistance and photosynthetic rate in cotton (Gossypium hirsutum) 1. Controlled levels of stress. Field Crops Res.23:117-131.
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":963
 *         LwpMinX[0] = LwpMin
 *         LwpX[0] = LwpMin + LwpMax
 *         if self._sim.states[u].kday < 5:             # <<<<<<<<<<<<<<
 *             self.ptsred = 1
 *             self._sim.states[u].water_stress_stem = 1
 */
  }

  /* "_cotton2k/simulation.pyx":970
 *         # Ephrath, J.E., Marani, A., Bravdo, B.A., 1990. Effects of moisture stress on stomatal resistance and photosynthetic rate in cotton (Gossypium hirsutum) 1. Controlled levels of stress. Field Crops Res.23:117-131.
 *         # It is a function of AverageLwpMin (average LwpMin for the last three days).
 *         if AverageLwpMin < vstrs[0]:             # <<<<<<<<<<<<<<
 *             AverageLwpMin = vstrs[0]
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 */
  __pyx_t_8 = ((AverageLwpMin < (__pyx_v_vstrs[0])) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":971
 *         # It is a function of AverageLwpMin (average LwpMin for the last three days).
 *         if AverageLwpMin < vstrs[0]:
 *             AverageLwpMin = vstrs[0]             # <<<<<<<<<<<<<<
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 *         if self.ptsred > 1:
 */
    AverageLwpMin = (__pyx_v_vstrs[0]);

    /* "_cotton2k/simulation.pyx":970
 *         # Ephrath, J.E., Marani, A., Bravdo, B.A., 1990. Effects of moisture stress on stomatal resistance and photosynthetic rate in cotton (Gossypium hirsutum) 1. Controlled levels of stress. Field Crops Res.23:117-131.
 *         # It is a function of AverageLwpMin (average LwpMin for the last three days).
 *         if AverageLwpMin < vstrs[0]:             # <<<<<<<<<<<<<<
 *             AverageLwpMin = vstrs[0]
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 */
  }

  /* "_cotton2k/simulation.pyx":972
 *         if AverageLwpMin < vstrs[0]:
 *             AverageLwpMin = vstrs[0]
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)             # <<<<<<<<<<<<<<
 *         if self.ptsred > 1:
 *             self.ptsred = 1
 */
  __pyx_v_self->ptsred = ((__pyx_v_vstrs[1]) + (AverageLwpMin * ((__pyx_v_vstrs[2]) + ((__pyx_v_vstrs[3]) * AverageLwpMin))));

  /* "_cotton2k/simulation.pyx":973
 *             AverageLwpMin = vstrs[0]
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 *         if self.ptsred > 1:             # <<<<<<<<<<<<<<
 *             self.ptsred = 1
 *         # The general moisture stress factor (WaterStress) is computed as an empirical function of AverageLwp. psilim, the value of AverageLwp at the maximum value of the function, is used for truncating it.
 */
  __pyx_t_8 = ((__pyx_v_self->ptsred > 1.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":974
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 *         if self.ptsred > 1:
 *             self.ptsred = 1             # <<<<<<<<<<<<<<
 *         # The general moisture stress factor (WaterStress) is computed as an empirical function of AverageLwp. psilim, the value of AverageLwp at the maximum value of the function, is used for truncating it.
 *         # The minimum value of WaterStress is 0.05, and the maximum is 1.
 */
    __pyx_v_self->ptsred = 1.0;

    /* "_cotton2k/simulation.pyx":973
 *             AverageLwpMin = vstrs[0]
 *         self.ptsred = vstrs[1] + AverageLwpMin * (vstrs[2] + vstrs[3] * AverageLwpMin)
 *         if self.ptsred > 1:             # <<<<<<<<<<<<<<
 *             self.ptsred = 1
 *         # The general moisture stress factor (WaterStress) is computed as an empirical function of AverageLwp. psilim, the value of AverageLwp at the maximum value of the function, is used for truncating it.
 */
  }

  /* "_cotton2k/simulation.pyx":979
 *         cdef double psilim  # limiting value of AverageLwp.
 *         cdef double WaterStress
 *         psilim = -0.5 * vstrs[5] / vstrs[6]             # <<<<<<<<<<<<<<
 *         if AverageLwp > psilim:
 *             WaterStress = 1
 */
  __pyx_t_4 = (-0.5 * (__pyx_v_vstrs[5]));
  if (unlikely((__pyx_v_vstrs[6]) == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 979, __pyx_L1_error)
  }
  __pyx_v_psilim = (__pyx_t_4 / (__pyx_v_vstrs[6]));

  /* "_cotton2k/simulation.pyx":980
 *         cdef double WaterStress
 *         psilim = -0.5 * vstrs[5] / vstrs[6]
 *         if AverageLwp > psilim:             # <<<<<<<<<<<<<<
 *             WaterStress = 1
 *         else:
 */
  __pyx_t_8 = ((AverageLwp > __pyx_v_psilim) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":981
 *         psilim = -0.5 * vstrs[5] / vstrs[6]
 *         if AverageLwp > psilim:
 *             WaterStress = 1             # <<<<<<<<<<<<<<
 *         else:
 *             WaterStress = vstrs[4] - AverageLwp * (vstrs[5] + vstrs[6] * AverageLwp)
 */
    __pyx_v_WaterStress = 1.0;

    /* "_cotton2k/simulation.pyx":980
 *         cdef double WaterStress
 *         psilim = -0.5 * vstrs[5] / vstrs[6]
 *         if AverageLwp > psilim:             # <<<<<<<<<<<<<<
 *             WaterStress = 1
 *         else:
 */
    goto __pyx_L8;
  }

  /* "_cotton2k/simulation.pyx":983
 *             WaterStress = 1
 *         else:
 *             WaterStress = vstrs[4] - AverageLwp * (vstrs[5] + vstrs[6] * AverageLwp)             # <<<<<<<<<<<<<<
 *             if WaterStress > 1:
 *                 WaterStress = 1
 */
  /*else*/ {
    __pyx_v_WaterStress = ((__pyx_v_vstrs[4]) - (AverageLwp * ((__pyx_v_vstrs[5]) + ((__pyx_v_vstrs[6]) * AverageLwp))));

    /* "_cotton2k/simulation.pyx":984
 *         else:
 *             WaterStress = vstrs[4] - AverageLwp * (vstrs[5] + vstrs[6] * AverageLwp)
 *             if WaterStress > 1:             # <<<<<<<<<<<<<<
 *                 WaterStress = 1
 *             if WaterStress < 0.05:
 */
    __pyx_t_8 = ((__pyx_v_WaterStress > 1.0) != 0);
    if (__pyx_t_8) {

      /* "_cotton2k/simulation.pyx":985
 *             WaterStress = vstrs[4] - AverageLwp * (vstrs[5] + vstrs[6] * AverageLwp)
 *             if WaterStress > 1:
 *                 WaterStress = 1             # <<<<<<<<<<<<<<
 *             if WaterStress < 0.05:
 *                 WaterStress = 0.05
 */
      __pyx_v_WaterStress = 1.0;

      /* "_cotton2k/simulation.pyx":984
 *         else:
 *             WaterStress = vstrs[4] - AverageLwp * (vstrs[5] + vstrs[6] * AverageLwp)
 *             if WaterStress > 1:             # <<<<<<<<<<<<<<
 *                 WaterStress = 1
 *             if WaterStress < 0.05:
 */
    }

    /* "_cotton2k/simulation.pyx":986
 *             if WaterStress > 1:
 *                 WaterStress = 1
 *             if WaterStress < 0.05:             # <<<<<<<<<<<<<<
 *                 WaterStress = 0.05
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 */
    __pyx_t_8 = ((__pyx_v_WaterStress < 0.05) != 0);
    if (__pyx_t_8) {

      /* "_cotton2k/simulation.pyx":987
 *                 WaterStress = 1
 *             if WaterStress < 0.05:
 *                 WaterStress = 0.05             # <<<<<<<<<<<<<<
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 *         self._sim.states[u].water_stress_stem = WaterStress * (1 + vstrs[7] * (2 - WaterStress)) - vstrs[7]
 */
      __pyx_v_WaterStress = 0.05;

      /* "_cotton2k/simulation.pyx":986
 *             if WaterStress > 1:
 *                 WaterStress = 1
 *             if WaterStress < 0.05:             # <<<<<<<<<<<<<<
 *                 WaterStress = 0.05
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 */
    }
  }
  __pyx_L8:;

  /* "_cotton2k/simulation.pyx":989
 *                 WaterStress = 0.05
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 *         self._sim.states[u].water_stress_stem = WaterStress * (1 + vstrs[7] * (2 - WaterStress)) - vstrs[7]             # <<<<<<<<<<<<<<
 *         if self._sim.states[u].water_stress_stem < vstrs[8]:
 *             self._sim.states[u].water_stress_stem = vstrs[8]
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 989, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_2]).water_stress_stem = ((__pyx_v_WaterStress * (1.0 + ((__pyx_v_vstrs[7]) * (2.0 - __pyx_v_WaterStress)))) - (__pyx_v_vstrs[7]));

  /* "_cotton2k/simulation.pyx":990
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 *         self._sim.states[u].water_stress_stem = WaterStress * (1 + vstrs[7] * (2 - WaterStress)) - vstrs[7]
 *         if self._sim.states[u].water_stress_stem < vstrs[8]:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].water_stress_stem = vstrs[8]
 *         self._sim.states[u].water_stress = WaterStress
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 990, __pyx_L1_error)
  __pyx_t_8 = (((__pyx_v_self->_sim.states[__pyx_t_2]).water_stress_stem < (__pyx_v_vstrs[8])) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":991
 *         self._sim.states[u].water_stress_stem = WaterStress * (1 + vstrs[7] * (2 - WaterStress)) - vstrs[7]
 *         if self._sim.states[u].water_stress_stem < vstrs[8]:
 *             self._sim.states[u].water_stress_stem = vstrs[8]             # <<<<<<<<<<<<<<
 *         self._sim.states[u].water_stress = WaterStress
 * 
 */
    __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 991, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_2]).water_stress_stem = (__pyx_v_vstrs[8]);

    /* "_cotton2k/simulation.pyx":990
 *         # Water stress affecting plant height and stem growth(WaterStressStem) is assumed to be more severe than WaterStress, especially at low WaterStress values.
 *         self._sim.states[u].water_stress_stem = WaterStress * (1 + vstrs[7] * (2 - WaterStress)) - vstrs[7]
 *         if self._sim.states[u].water_stress_stem < vstrs[8]:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].water_stress_stem = vstrs[8]
 *         self._sim.states[u].water_stress = WaterStress
 */
  }

  /* "_cotton2k/simulation.pyx":992
 *         if self._sim.states[u].water_stress_stem < vstrs[8]:
 *             self._sim.states[u].water_stress_stem = vstrs[8]
 *         self._sim.states[u].water_stress = WaterStress             # <<<<<<<<<<<<<<
 * 
 *     def _get_net_photosynthesis(self, u):
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 992, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_2]).water_stress = __pyx_v_WaterStress;

  /* "_cotton2k/simulation.pyx":948
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])
 * 
 *     def _stress(self, u):             # <<<<<<<<<<<<<<
 *         global AverageLwpMin, AverageLwp, LwpMin, LwpMax
 *         # The following constant parameters are used:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._stress", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":994
 *         self._sim.states[u].water_stress = WaterStress
 * 
 *     def _get_net_photosynthesis(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         References:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis, "\n        References:\n        Baker et. al. (1972). Simulation of Growth and Yield in Cotton: I. Gross photosynthesis, respiration and growth. Crop Sci. 12:431-435.\n        Harper et. al. (1973) Carbon dioxide and the photosynthesis of field crops.  A metered carbon dioxide release in cotton under field conditions.  Agron. J. 65:7-11.\n        Baker (1965)  Effects of certain environmental factors on net assimilation in cotton.  Crop Sci. 5:53-56 (Fig 5).\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis = {"_get_net_photosynthesis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_get_net_photosynthesis (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 994, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_get_net_photosynthesis") < 0)) __PYX_ERR(0, 994, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_get_net_photosynthesis", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 994, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._get_net_photosynthesis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  State __pyx_v_state;
  double __pyx_v_gsubr;
  double __pyx_v_rsubo;
  double __pyx_v_vpnet[4];
  double __pyx_v_pnetcor;
  double __pyx_v_ptnfac;
  double __pyx_v_wattsm;
  double __pyx_v_pstand;
  double __pyx_v_pplant;
  double __pyx_v_rsubl;
  double __pyx_v_lytres;
  PyObject *__pyx_v_oldstmwt = 0;
  int __pyx_v_voldstm;
  int __pyx_v_kkday;
  double __pyx_v_bmain;
  double __pyx_v_pts;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  double __pyx_t_2[4];
  int __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_t_8;
  double __pyx_t_9;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_get_net_photosynthesis", 0);

  /* "_cotton2k/simulation.pyx":1002
 *         """
 *         global NetPhotosynthesis, CumNetPhotosynth
 *         cdef cState state = self._sim.states[u]             # <<<<<<<<<<<<<<
 *         # constants
 *         cdef double gsubr = 0.375  # the growth respiration factor.
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1002, __pyx_L1_error)
  __pyx_v_state = (__pyx_v_self->_sim.states[__pyx_t_1]);

  /* "_cotton2k/simulation.pyx":1004
 *         cdef cState state = self._sim.states[u]
 *         # constants
 *         cdef double gsubr = 0.375  # the growth respiration factor.             # <<<<<<<<<<<<<<
 *         cdef double rsubo = 0.0032  # maintenance respiration factor.
 *         cdef double[4] vpnet = [1.30, 0.034, 0.010, 0.32]
 */
  __pyx_v_gsubr = 0.375;

  /* "_cotton2k/simulation.pyx":1005
 *         # constants
 *         cdef double gsubr = 0.375  # the growth respiration factor.
 *         cdef double rsubo = 0.0032  # maintenance respiration factor.             # <<<<<<<<<<<<<<
 *         cdef double[4] vpnet = [1.30, 0.034, 0.010, 0.32]
 *         # Note: co2parm is for icrease in ambient CO2 concentration changes from 1959 (308 ppm).
 */
  __pyx_v_rsubo = 0.0032;

  /* "_cotton2k/simulation.pyx":1006
 *         cdef double gsubr = 0.375  # the growth respiration factor.
 *         cdef double rsubo = 0.0032  # maintenance respiration factor.
 *         cdef double[4] vpnet = [1.30, 0.034, 0.010, 0.32]             # <<<<<<<<<<<<<<
 *         # Note: co2parm is for icrease in ambient CO2 concentration changes from 1959 (308 ppm).
 *         # The first 28 values (up to 1987) are from GOSSYM. The other values (up to 2004) are derived from data of the Carbon Dioxide Information Analysis Center (CDIAC).
 */
  __pyx_t_2[0] = 1.30;
  __pyx_t_2[1] = 0.034;
  __pyx_t_2[2] = 0.010;
  __pyx_t_2[3] = 0.32;
  memcpy(&(__pyx_v_vpnet[0]), __pyx_t_2, sizeof(__pyx_v_vpnet[0]) * (4));

  /* "_cotton2k/simulation.pyx":1011
 * 
 *         # Exit the function and end simulation if there are no leaves
 *         if state.leaf_area_index <= 0:             # <<<<<<<<<<<<<<
 *             raise SimulationEnd
 *         # Get the CO2 correction factor (pnetcor) for photosynthesis, using ambient_co2_factor and a factor that may be variety specific (vpnet[0]).
 */
  __pyx_t_3 = ((__pyx_v_state.leaf_area_index <= 0.0) != 0);
  if (unlikely(__pyx_t_3)) {

    /* "_cotton2k/simulation.pyx":1012
 *         # Exit the function and end simulation if there are no leaves
 *         if state.leaf_area_index <= 0:
 *             raise SimulationEnd             # <<<<<<<<<<<<<<
 *         # Get the CO2 correction factor (pnetcor) for photosynthesis, using ambient_co2_factor and a factor that may be variety specific (vpnet[0]).
 *         cdef double pnetcor = ambient_co2_factor(self.year) * vpnet[0]  # correction factor for gross photosynthesis
 */
    __Pyx_GetModuleGlobalName(__pyx_t_4, __pyx_n_s_SimulationEnd); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1012, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_Raise(__pyx_t_4, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    __PYX_ERR(0, 1012, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1011
 * 
 *         # Exit the function and end simulation if there are no leaves
 *         if state.leaf_area_index <= 0:             # <<<<<<<<<<<<<<
 *             raise SimulationEnd
 *         # Get the CO2 correction factor (pnetcor) for photosynthesis, using ambient_co2_factor and a factor that may be variety specific (vpnet[0]).
 */
  }

  /* "_cotton2k/simulation.pyx":1014
 *             raise SimulationEnd
 *         # Get the CO2 correction factor (pnetcor) for photosynthesis, using ambient_co2_factor and a factor that may be variety specific (vpnet[0]).
 *         cdef double pnetcor = ambient_co2_factor(self.year) * vpnet[0]  # correction factor for gross photosynthesis             # <<<<<<<<<<<<<<
 *         # Compute ptnfac, the effect of leaf N concentration on photosynthesis, using an empirical relationship.
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (
 */
  __Pyx_GetModuleGlobalName(__pyx_t_5, __pyx_n_s_ambient_co2_factor); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_year); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = NULL;
  __pyx_t_8 = 0;
  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_7)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_7);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_8 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_7, __pyx_t_6};
    __pyx_t_4 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_8, 1+__pyx_t_8);
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
    if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1014, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __pyx_t_5 = PyFloat_FromDouble((__pyx_v_vpnet[0])); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_6 = PyNumber_Multiply(__pyx_t_4, __pyx_t_5); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_6); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1014, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_v_pnetcor = __pyx_t_9;

  /* "_cotton2k/simulation.pyx":1016
 *         cdef double pnetcor = ambient_co2_factor(self.year) * vpnet[0]  # correction factor for gross photosynthesis
 *         # Compute ptnfac, the effect of leaf N concentration on photosynthesis, using an empirical relationship.
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (             # <<<<<<<<<<<<<<
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.
 *         if ptnfac > 1:
 */
  __pyx_t_9 = ((__pyx_v_state.leaf_nitrogen_concentration - (__pyx_v_vpnet[2])) * (1.0 - (__pyx_v_vpnet[3])));

  /* "_cotton2k/simulation.pyx":1017
 *         # Compute ptnfac, the effect of leaf N concentration on photosynthesis, using an empirical relationship.
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.             # <<<<<<<<<<<<<<
 *         if ptnfac > 1:
 *             ptnfac = 1
 */
  __pyx_t_10 = ((__pyx_v_vpnet[1]) - (__pyx_v_vpnet[2]));

  /* "_cotton2k/simulation.pyx":1016
 *         cdef double pnetcor = ambient_co2_factor(self.year) * vpnet[0]  # correction factor for gross photosynthesis
 *         # Compute ptnfac, the effect of leaf N concentration on photosynthesis, using an empirical relationship.
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (             # <<<<<<<<<<<<<<
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.
 *         if ptnfac > 1:
 */
  if (unlikely(__pyx_t_10 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1016, __pyx_L1_error)
  }
  __pyx_v_ptnfac = ((__pyx_v_vpnet[3]) + (__pyx_t_9 / __pyx_t_10));

  /* "_cotton2k/simulation.pyx":1018
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.
 *         if ptnfac > 1:             # <<<<<<<<<<<<<<
 *             ptnfac = 1
 *         if ptnfac < vpnet[3]:
 */
  __pyx_t_3 = ((__pyx_v_ptnfac > 1.0) != 0);
  if (__pyx_t_3) {

    /* "_cotton2k/simulation.pyx":1019
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.
 *         if ptnfac > 1:
 *             ptnfac = 1             # <<<<<<<<<<<<<<
 *         if ptnfac < vpnet[3]:
 *             ptnfac = vpnet[3]
 */
    __pyx_v_ptnfac = 1.0;

    /* "_cotton2k/simulation.pyx":1018
 *         cdef double ptnfac = vpnet[3] + (state.leaf_nitrogen_concentration - vpnet[2]) * (1 - vpnet[3]) / (
 *                 vpnet[1] - vpnet[2])  # correction factor for low nitrogen content in leaves.
 *         if ptnfac > 1:             # <<<<<<<<<<<<<<
 *             ptnfac = 1
 *         if ptnfac < vpnet[3]:
 */
  }

  /* "_cotton2k/simulation.pyx":1020
 *         if ptnfac > 1:
 *             ptnfac = 1
 *         if ptnfac < vpnet[3]:             # <<<<<<<<<<<<<<
 *             ptnfac = vpnet[3]
 * 
 */
  __pyx_t_3 = ((__pyx_v_ptnfac < (__pyx_v_vpnet[3])) != 0);
  if (__pyx_t_3) {

    /* "_cotton2k/simulation.pyx":1021
 *             ptnfac = 1
 *         if ptnfac < vpnet[3]:
 *             ptnfac = vpnet[3]             # <<<<<<<<<<<<<<
 * 
 *         # Convert the average daily short wave radiation from langley per day, to Watts per square meter (wattsm).
 */
    __pyx_v_ptnfac = (__pyx_v_vpnet[3]);

    /* "_cotton2k/simulation.pyx":1020
 *         if ptnfac > 1:
 *             ptnfac = 1
 *         if ptnfac < vpnet[3]:             # <<<<<<<<<<<<<<
 *             ptnfac = vpnet[3]
 * 
 */
  }

  /* "_cotton2k/simulation.pyx":1024
 * 
 *         # Convert the average daily short wave radiation from langley per day, to Watts per square meter (wattsm).
 *         cdef double wattsm = self._sim.climate[u].Rad * 697.45 / (             # <<<<<<<<<<<<<<
 *                 state.day_length * 60)  # average daily global radiation, W m^{-2}
 *         # Compute pstand as an empirical function of wattsm (based on Baker et al., 1972)
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1024, __pyx_L1_error)
  __pyx_t_10 = ((__pyx_v_self->_sim.climate[__pyx_t_1]).Rad * 697.45);

  /* "_cotton2k/simulation.pyx":1025
 *         # Convert the average daily short wave radiation from langley per day, to Watts per square meter (wattsm).
 *         cdef double wattsm = self._sim.climate[u].Rad * 697.45 / (
 *                 state.day_length * 60)  # average daily global radiation, W m^{-2}             # <<<<<<<<<<<<<<
 *         # Compute pstand as an empirical function of wattsm (based on Baker et al., 1972)
 *         cdef double pstand  # gross photosynthesis for a non-stressed full canopy
 */
  __pyx_t_9 = (__pyx_v_state.day_length * 60.0);

  /* "_cotton2k/simulation.pyx":1024
 * 
 *         # Convert the average daily short wave radiation from langley per day, to Watts per square meter (wattsm).
 *         cdef double wattsm = self._sim.climate[u].Rad * 697.45 / (             # <<<<<<<<<<<<<<
 *                 state.day_length * 60)  # average daily global radiation, W m^{-2}
 *         # Compute pstand as an empirical function of wattsm (based on Baker et al., 1972)
 */
  if (unlikely(__pyx_t_9 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1024, __pyx_L1_error)
  }
  __pyx_v_wattsm = (__pyx_t_10 / __pyx_t_9);

  /* "_cotton2k/simulation.pyx":1028
 *         # Compute pstand as an empirical function of wattsm (based on Baker et al., 1972)
 *         cdef double pstand  # gross photosynthesis for a non-stressed full canopy
 *         pstand = 2.3908 + wattsm * (1.37379 - wattsm * 0.00054136)             # <<<<<<<<<<<<<<
 *         # Convert it to gross photosynthesis per plant (pplant), using per_plant_area and corrections for light interception by canopy, ambient CO2 concentration, water stress and low N in the leaves.
 *         cdef double pplant  # actual gross photosynthetic rate, g per plant per day.
 */
  __pyx_v_pstand = (2.3908 + (__pyx_v_wattsm * (1.37379 - (__pyx_v_wattsm * 0.00054136))));

  /* "_cotton2k/simulation.pyx":1031
 *         # Convert it to gross photosynthesis per plant (pplant), using per_plant_area and corrections for light interception by canopy, ambient CO2 concentration, water stress and low N in the leaves.
 *         cdef double pplant  # actual gross photosynthetic rate, g per plant per day.
 *         pplant = 0.001 * pstand * state.light_interception * self._sim.per_plant_area * self.ptsred * pnetcor * ptnfac             # <<<<<<<<<<<<<<
 *         # Compute the photorespiration factor (rsubl) as a linear function of average day time temperature.
 *         cdef double rsubl = 0.0032125 + 0.0066875 * DayTimeTemp  # photorespiration factor
 */
  __pyx_v_pplant = ((((((0.001 * __pyx_v_pstand) * __pyx_v_state.light_interception) * __pyx_v_self->_sim.per_plant_area) * __pyx_v_self->ptsred) * __pyx_v_pnetcor) * __pyx_v_ptnfac);

  /* "_cotton2k/simulation.pyx":1033
 *         pplant = 0.001 * pstand * state.light_interception * self._sim.per_plant_area * self.ptsred * pnetcor * ptnfac
 *         # Compute the photorespiration factor (rsubl) as a linear function of average day time temperature.
 *         cdef double rsubl = 0.0032125 + 0.0066875 * DayTimeTemp  # photorespiration factor             # <<<<<<<<<<<<<<
 *         # Photorespiration (lytres) is computed as a proportion of gross photosynthetic rate.
 *         cdef double lytres  # rate of photorespiration, g per plant per day.
 */
  __pyx_v_rsubl = (0.0032125 + (0.0066875 * DayTimeTemp));

  /* "_cotton2k/simulation.pyx":1036
 *         # Photorespiration (lytres) is computed as a proportion of gross photosynthetic rate.
 *         cdef double lytres  # rate of photorespiration, g per plant per day.
 *         lytres = rsubl * pplant             # <<<<<<<<<<<<<<
 *         # Old stems are those more than voldstm = 32 calendar days old.
 *         # Maintenance respiration is computed on the basis of plant dry weight, minus the old stems and the dry tissue of opened bolls.
 */
  __pyx_v_lytres = (__pyx_v_rsubl * __pyx_v_pplant);

  /* "_cotton2k/simulation.pyx":1040
 *         # Maintenance respiration is computed on the basis of plant dry weight, minus the old stems and the dry tissue of opened bolls.
 *         cdef oldstmwt  # weight of old stems
 *         cdef int voldstm = 32             # <<<<<<<<<<<<<<
 *         cdef int kkday = state.kday - voldstm  # day of least recent actively growing stems.
 *         if kkday < 1:
 */
  __pyx_v_voldstm = 32;

  /* "_cotton2k/simulation.pyx":1041
 *         cdef oldstmwt  # weight of old stems
 *         cdef int voldstm = 32
 *         cdef int kkday = state.kday - voldstm  # day of least recent actively growing stems.             # <<<<<<<<<<<<<<
 *         if kkday < 1:
 *             oldstmwt = 0
 */
  __pyx_v_kkday = (__pyx_v_state.kday - __pyx_v_voldstm);

  /* "_cotton2k/simulation.pyx":1042
 *         cdef int voldstm = 32
 *         cdef int kkday = state.kday - voldstm  # day of least recent actively growing stems.
 *         if kkday < 1:             # <<<<<<<<<<<<<<
 *             oldstmwt = 0
 *         else:
 */
  __pyx_t_3 = ((__pyx_v_kkday < 1) != 0);
  if (__pyx_t_3) {

    /* "_cotton2k/simulation.pyx":1043
 *         cdef int kkday = state.kday - voldstm  # day of least recent actively growing stems.
 *         if kkday < 1:
 *             oldstmwt = 0             # <<<<<<<<<<<<<<
 *         else:
 *             oldstmwt = StemWeight[kkday]
 */
    __Pyx_INCREF(__pyx_int_0);
    __pyx_v_oldstmwt = __pyx_int_0;

    /* "_cotton2k/simulation.pyx":1042
 *         cdef int voldstm = 32
 *         cdef int kkday = state.kday - voldstm  # day of least recent actively growing stems.
 *         if kkday < 1:             # <<<<<<<<<<<<<<
 *             oldstmwt = 0
 *         else:
 */
    goto __pyx_L6;
  }

  /* "_cotton2k/simulation.pyx":1045
 *             oldstmwt = 0
 *         else:
 *             oldstmwt = StemWeight[kkday]             # <<<<<<<<<<<<<<
 *         cdef double bmain  # maintenance respiration, g per plant per day.
 *         bmain = (state.plant_height - state.open_bolls_weight - state.open_bolls_burr_weight - oldstmwt) * rsubo
 */
  /*else*/ {
    __pyx_t_6 = PyFloat_FromDouble((StemWeight[__pyx_v_kkday])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1045, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_v_oldstmwt = __pyx_t_6;
    __pyx_t_6 = 0;
  }
  __pyx_L6:;

  /* "_cotton2k/simulation.pyx":1047
 *             oldstmwt = StemWeight[kkday]
 *         cdef double bmain  # maintenance respiration, g per plant per day.
 *         bmain = (state.plant_height - state.open_bolls_weight - state.open_bolls_burr_weight - oldstmwt) * rsubo             # <<<<<<<<<<<<<<
 *         # Net photosynthesis is computed by subtracting photo-respiration and maintenance respiration from the gross rate of photosynthesis.
 *         # To avoid computational problem, make sure that pts is positive and non-zero.
 */
  __pyx_t_6 = PyFloat_FromDouble(((__pyx_v_state.plant_height - __pyx_v_state.open_bolls_weight) - __pyx_v_state.open_bolls_burr_weight)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_5 = PyNumber_Subtract(__pyx_t_6, __pyx_v_oldstmwt); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_6 = PyFloat_FromDouble(__pyx_v_rsubo); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_4 = PyNumber_Multiply(__pyx_t_5, __pyx_t_6); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1047, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_bmain = __pyx_t_9;

  /* "_cotton2k/simulation.pyx":1051
 *         # To avoid computational problem, make sure that pts is positive and non-zero.
 *         cdef double pts  # intermediate computation of NetPhotosynthesis.
 *         pts = pplant - lytres - bmain             # <<<<<<<<<<<<<<
 *         if pts < 0.00001:
 *             pts = 0.00001
 */
  __pyx_v_pts = ((__pyx_v_pplant - __pyx_v_lytres) - __pyx_v_bmain);

  /* "_cotton2k/simulation.pyx":1052
 *         cdef double pts  # intermediate computation of NetPhotosynthesis.
 *         pts = pplant - lytres - bmain
 *         if pts < 0.00001:             # <<<<<<<<<<<<<<
 *             pts = 0.00001
 *         # the growth respiration (gsubr) supplies energy for converting the supplied carbohydrates to plant tissue dry matter.
 */
  __pyx_t_3 = ((__pyx_v_pts < 0.00001) != 0);
  if (__pyx_t_3) {

    /* "_cotton2k/simulation.pyx":1053
 *         pts = pplant - lytres - bmain
 *         if pts < 0.00001:
 *             pts = 0.00001             # <<<<<<<<<<<<<<
 *         # the growth respiration (gsubr) supplies energy for converting the supplied carbohydrates to plant tissue dry matter.
 *         # 0.68182 converts CO2 to CH2O. NetPhotosynthesis is the computed net photosynthesis, in g per plant per day.
 */
    __pyx_v_pts = 0.00001;

    /* "_cotton2k/simulation.pyx":1052
 *         cdef double pts  # intermediate computation of NetPhotosynthesis.
 *         pts = pplant - lytres - bmain
 *         if pts < 0.00001:             # <<<<<<<<<<<<<<
 *             pts = 0.00001
 *         # the growth respiration (gsubr) supplies energy for converting the supplied carbohydrates to plant tissue dry matter.
 */
  }

  /* "_cotton2k/simulation.pyx":1056
 *         # the growth respiration (gsubr) supplies energy for converting the supplied carbohydrates to plant tissue dry matter.
 *         # 0.68182 converts CO2 to CH2O. NetPhotosynthesis is the computed net photosynthesis, in g per plant per day.
 *         NetPhotosynthesis = pts / (1 + gsubr) * 0.68182             # <<<<<<<<<<<<<<
 *         # CumNetPhotosynth is the cumulative value of NetPhotosynthesis, from day of emergence.
 *         CumNetPhotosynth += NetPhotosynthesis
 */
  __pyx_t_9 = (1.0 + __pyx_v_gsubr);
  if (unlikely(__pyx_t_9 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1056, __pyx_L1_error)
  }
  NetPhotosynthesis = ((__pyx_v_pts / __pyx_t_9) * 0.68182);

  /* "_cotton2k/simulation.pyx":1058
 *         NetPhotosynthesis = pts / (1 + gsubr) * 0.68182
 *         # CumNetPhotosynth is the cumulative value of NetPhotosynthesis, from day of emergence.
 *         CumNetPhotosynth += NetPhotosynthesis             # <<<<<<<<<<<<<<
 * 
 *     def _potential_fruit_growth(self, u):
 */
  CumNetPhotosynth = (CumNetPhotosynth + NetPhotosynthesis);

  /* "_cotton2k/simulation.pyx":994
 *         self._sim.states[u].water_stress = WaterStress
 * 
 *     def _get_net_photosynthesis(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         References:
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._get_net_photosynthesis", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_oldstmwt);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1060
 *         CumNetPhotosynth += NetPhotosynthesis
 * 
 *     def _potential_fruit_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of fruiting sites of cotton plants. It is called from PlantGrowth(). It calls TemperatureOnFruitGrowthRate()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth, "\n        This function simulates the potential growth of fruiting sites of cotton plants. It is called from PlantGrowth(). It calls TemperatureOnFruitGrowthRate()\n\n        The following global variables are set here:\n            PotGroAllBolls, PotGroAllBurrs, PotGroAllSquares.\n\n        References:\n        Marani, A. 1979. Growth rate of cotton bolls and their components. Field Crops Res. 2:169-175.\n        Marani, A., Phene, C.J. and Cardon, G.E. 1992. CALGOS, a version of GOSSYM adapted for irrigated cotton.  III. leaf and boll growth routines. Beltwide Cotton Grow, Res. Conf. 1992:1361-1363.\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth = {"_potential_fruit_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_potential_fruit_growth (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1060, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_potential_fruit_growth") < 0)) __PYX_ERR(0, 1060, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_potential_fruit_growth", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1060, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._potential_fruit_growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  double __pyx_v_vpotfrt[5];
  double __pyx_v_tfrt;
  double __pyx_v_agemax;
  double __pyx_v_rbmax;
  double __pyx_v_wbmax;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_m = NULL;
  double __pyx_v_ratesqr;
  double __pyx_v_pex;
  double __pyx_v_ratebol;
  PyObject *__pyx_v_wfdb = NULL;
  PyObject *__pyx_v_ratebur = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1[5];
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  double __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  Py_ssize_t __pyx_t_8;
  PyObject *__pyx_t_9 = NULL;
  PyObject *(*__pyx_t_10)(PyObject *);
  Py_ssize_t __pyx_t_11;
  Py_ssize_t __pyx_t_12;
  PyObject *__pyx_t_13 = NULL;
  PyObject *(*__pyx_t_14)(PyObject *);
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  int __pyx_t_22;
  double __pyx_t_23;
  PyObject *__pyx_t_24 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_potential_fruit_growth", 0);

  /* "_cotton2k/simulation.pyx":1073
 *         global PotGroAllSquares, PotGroAllBolls, PotGroAllBurrs
 *         # The constant parameters used:
 *         cdef double[5] vpotfrt = [0.72, 0.30, 3.875, 0.125, 0.17]             # <<<<<<<<<<<<<<
 *         # Compute tfrt for the effect of temperature on boll and burr growth rates. Function TemperatureOnFruitGrowthRate() is used (with parameters derived from GOSSYM), for day time and night time temperatures, weighted by day and night lengths.
 *         cdef double tfrt  # the effect of temperature on rate of boll, burr or square growth.
 */
  __pyx_t_1[0] = 0.72;
  __pyx_t_1[1] = 0.30;
  __pyx_t_1[2] = 3.875;
  __pyx_t_1[3] = 0.125;
  __pyx_t_1[4] = 0.17;
  memcpy(&(__pyx_v_vpotfrt[0]), __pyx_t_1, sizeof(__pyx_v_vpotfrt[0]) * (5));

  /* "_cotton2k/simulation.pyx":1076
 *         # Compute tfrt for the effect of temperature on boll and burr growth rates. Function TemperatureOnFruitGrowthRate() is used (with parameters derived from GOSSYM), for day time and night time temperatures, weighted by day and night lengths.
 *         cdef double tfrt  # the effect of temperature on rate of boll, burr or square growth.
 *         tfrt = (self._sim.states[u].day_length * TemperatureOnFruitGrowthRate(DayTimeTemp) + (24 - self._sim.states[u].day_length) * TemperatureOnFruitGrowthRate(NightTimeTemp)) / 24             # <<<<<<<<<<<<<<
 *         # Assign zero to sums of potential growth of squares, bolls and burrs.
 *         PotGroAllSquares = 0
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1076, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1076, __pyx_L1_error)
  __pyx_v_tfrt = ((((__pyx_v_self->_sim.states[__pyx_t_2]).day_length * TemperatureOnFruitGrowthRate(DayTimeTemp)) + ((24.0 - (__pyx_v_self->_sim.states[__pyx_t_3]).day_length) * TemperatureOnFruitGrowthRate(NightTimeTemp))) / 24.0);

  /* "_cotton2k/simulation.pyx":1078
 *         tfrt = (self._sim.states[u].day_length * TemperatureOnFruitGrowthRate(DayTimeTemp) + (24 - self._sim.states[u].day_length) * TemperatureOnFruitGrowthRate(NightTimeTemp)) / 24
 *         # Assign zero to sums of potential growth of squares, bolls and burrs.
 *         PotGroAllSquares = 0             # <<<<<<<<<<<<<<
 *         PotGroAllBolls = 0
 *         PotGroAllBurrs = 0
 */
  PotGroAllSquares = 0.0;

  /* "_cotton2k/simulation.pyx":1079
 *         # Assign zero to sums of potential growth of squares, bolls and burrs.
 *         PotGroAllSquares = 0
 *         PotGroAllBolls = 0             # <<<<<<<<<<<<<<
 *         PotGroAllBurrs = 0
 *         # Assign values for the boll growth equation parameters. These are cultivar - specific.
 */
  PotGroAllBolls = 0.0;

  /* "_cotton2k/simulation.pyx":1080
 *         PotGroAllSquares = 0
 *         PotGroAllBolls = 0
 *         PotGroAllBurrs = 0             # <<<<<<<<<<<<<<
 *         # Assign values for the boll growth equation parameters. These are cultivar - specific.
 *         cdef double agemax = self.cultivar_parameters[9]  # maximum boll growth period (physiological days).
 */
  PotGroAllBurrs = 0.0;

  /* "_cotton2k/simulation.pyx":1082
 *         PotGroAllBurrs = 0
 *         # Assign values for the boll growth equation parameters. These are cultivar - specific.
 *         cdef double agemax = self.cultivar_parameters[9]  # maximum boll growth period (physiological days).             # <<<<<<<<<<<<<<
 *         cdef double rbmax = self.cultivar_parameters[10]  # maximum rate of boll (seed and lint) growth, g per boll per physiological day.
 *         cdef double wbmax = self.cultivar_parameters[11]  # maximum possible boll (seed and lint) weight, g per boll.
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 9, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1082, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_agemax = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":1083
 *         # Assign values for the boll growth equation parameters. These are cultivar - specific.
 *         cdef double agemax = self.cultivar_parameters[9]  # maximum boll growth period (physiological days).
 *         cdef double rbmax = self.cultivar_parameters[10]  # maximum rate of boll (seed and lint) growth, g per boll per physiological day.             # <<<<<<<<<<<<<<
 *         cdef double wbmax = self.cultivar_parameters[11]  # maximum possible boll (seed and lint) weight, g per boll.
 *         # Loop for all vegetative stems.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_GetItemInt(__pyx_t_5, 10, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_4); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1083, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_v_rbmax = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":1084
 *         cdef double agemax = self.cultivar_parameters[9]  # maximum boll growth period (physiological days).
 *         cdef double rbmax = self.cultivar_parameters[10]  # maximum rate of boll (seed and lint) growth, g per boll per physiological day.
 *         cdef double wbmax = self.cultivar_parameters[11]  # maximum possible boll (seed and lint) weight, g per boll.             # <<<<<<<<<<<<<<
 *         # Loop for all vegetative stems.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems
 */
  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __pyx_t_5 = __Pyx_GetItemInt(__pyx_t_4, 11, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1084, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_wbmax = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":1086
 *         cdef double wbmax = self.cultivar_parameters[11]  # maximum possible boll (seed and lint) weight, g per boll.
 *         # Loop for all vegetative stems.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems             # <<<<<<<<<<<<<<
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1086, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_sim.states[__pyx_t_3]).number_of_vegetative_branches); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_5); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (likely(PyList_CheckExact(__pyx_t_4)) || PyTuple_CheckExact(__pyx_t_4)) {
    __pyx_t_5 = __pyx_t_4; __Pyx_INCREF(__pyx_t_5); __pyx_t_3 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_5 = PyObject_GetIter(__pyx_t_4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1086, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_5); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1086, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_5))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyList_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_4 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_3); __Pyx_INCREF(__pyx_t_4); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1086, __pyx_L1_error)
        #else
        __pyx_t_4 = PySequence_ITEM(__pyx_t_5, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1086, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        #endif
      }
    } else {
      __pyx_t_4 = __pyx_t_7(__pyx_t_5);
      if (unlikely(!__pyx_t_4)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1086, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_4);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":1087
 *         # Loop for all vegetative stems.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches             # <<<<<<<<<<<<<<
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch
 *                     # Calculate potential square growth for node (k,l,m).
 */
    __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error)
    __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1087, __pyx_L1_error)
    __pyx_t_4 = __Pyx_PyInt_From_unsigned_int(((__pyx_v_self->_sim.states[__pyx_t_2]).vegetative_branches[__pyx_t_8]).number_of_fruiting_branches); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __pyx_t_9 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_4); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1087, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_9);
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_t_9)) || PyTuple_CheckExact(__pyx_t_9)) {
      __pyx_t_4 = __pyx_t_9; __Pyx_INCREF(__pyx_t_4); __pyx_t_8 = 0;
      __pyx_t_10 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_t_9); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1087, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_10 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_4); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1087, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
    for (;;) {
      if (likely(!__pyx_t_10)) {
        if (likely(PyList_CheckExact(__pyx_t_4))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1087, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_8); __Pyx_INCREF(__pyx_t_9); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(0, 1087, __pyx_L1_error)
          #else
          __pyx_t_9 = PySequence_ITEM(__pyx_t_4, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1087, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_9);
          #endif
        }
      } else {
        __pyx_t_9 = __pyx_t_10(__pyx_t_4);
        if (unlikely(!__pyx_t_9)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1087, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_9);
      }
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_9);
      __pyx_t_9 = 0;

      /* "_cotton2k/simulation.pyx":1088
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch             # <<<<<<<<<<<<<<
 *                     # Calculate potential square growth for node (k,l,m).
 *                     # Sum potential growth rates of squares as PotGroAllSquares.
 */
      __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
      __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1088, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyInt_From_unsigned_int((((__pyx_v_self->_sim.states[__pyx_t_2]).vegetative_branches[__pyx_t_11]).fruiting_branches[__pyx_t_12]).number_of_fruiting_nodes); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1088, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_9);
      __pyx_t_13 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_9); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1088, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_13);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      if (likely(PyList_CheckExact(__pyx_t_13)) || PyTuple_CheckExact(__pyx_t_13)) {
        __pyx_t_9 = __pyx_t_13; __Pyx_INCREF(__pyx_t_9); __pyx_t_12 = 0;
        __pyx_t_14 = NULL;
      } else {
        __pyx_t_12 = -1; __pyx_t_9 = PyObject_GetIter(__pyx_t_13); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1088, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_9);
        __pyx_t_14 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_9); if (unlikely(!__pyx_t_14)) __PYX_ERR(0, 1088, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
      for (;;) {
        if (likely(!__pyx_t_14)) {
          if (likely(PyList_CheckExact(__pyx_t_9))) {
            if (__pyx_t_12 >= PyList_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyList_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_13); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1088, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          } else {
            if (__pyx_t_12 >= PyTuple_GET_SIZE(__pyx_t_9)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_13 = PyTuple_GET_ITEM(__pyx_t_9, __pyx_t_12); __Pyx_INCREF(__pyx_t_13); __pyx_t_12++; if (unlikely((0 < 0))) __PYX_ERR(0, 1088, __pyx_L1_error)
            #else
            __pyx_t_13 = PySequence_ITEM(__pyx_t_9, __pyx_t_12); __pyx_t_12++; if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1088, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            #endif
          }
        } else {
          __pyx_t_13 = __pyx_t_14(__pyx_t_9);
          if (unlikely(!__pyx_t_13)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1088, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_13);
        }
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_13);
        __pyx_t_13 = 0;

        /* "_cotton2k/simulation.pyx":1091
 *                     # Calculate potential square growth for node (k,l,m).
 *                     # Sum potential growth rates of squares as PotGroAllSquares.
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.Square:             # <<<<<<<<<<<<<<
 *                         # ratesqr is the rate of square growth, g per square per day.
 *                         # The routine for this is derived from GOSSYM, and so are the parameters used.
 */
        __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error)
        __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1091, __pyx_L1_error)
        __pyx_t_17 = ((((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[__pyx_t_2]).fruiting_branches[__pyx_t_15]).nodes[__pyx_t_16]).stage == Square) != 0);
        if (__pyx_t_17) {

          /* "_cotton2k/simulation.pyx":1094
 *                         # ratesqr is the rate of square growth, g per square per day.
 *                         # The routine for this is derived from GOSSYM, and so are the parameters used.
 *                         ratesqr = tfrt * vpotfrt[3] * exp(-vpotfrt[2] + vpotfrt[3] * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].age)             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth = ratesqr * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 *                         PotGroAllSquares += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth
 */
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1094, __pyx_L1_error)
          __pyx_v_ratesqr = ((__pyx_v_tfrt * (__pyx_v_vpotfrt[3])) * exp(((-(__pyx_v_vpotfrt[2])) + ((__pyx_v_vpotfrt[3]) * ((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_2]).nodes[__pyx_t_11]).age))));

          /* "_cotton2k/simulation.pyx":1095
 *                         # The routine for this is derived from GOSSYM, and so are the parameters used.
 *                         ratesqr = tfrt * vpotfrt[3] * exp(-vpotfrt[2] + vpotfrt[3] * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].age)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth = ratesqr * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction             # <<<<<<<<<<<<<<
 *                         PotGroAllSquares += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth
 *                     # Growth of seedcotton is simulated separately from the growth of burrs. The logistic function is used to simulate growth of seedcotton. The constants of this function for cultivar 'Acala-SJ2', are based on the data of Marani (1979); they are derived from calibration for other cultivars
 */
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1095, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_20]).nodes[__pyx_t_21]).square.potential_growth = (__pyx_v_ratesqr * ((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[__pyx_t_2]).fruiting_branches[__pyx_t_15]).nodes[__pyx_t_16]).fraction);

          /* "_cotton2k/simulation.pyx":1096
 *                         ratesqr = tfrt * vpotfrt[3] * exp(-vpotfrt[2] + vpotfrt[3] * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].age)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth = ratesqr * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 *                         PotGroAllSquares += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].square.potential_growth             # <<<<<<<<<<<<<<
 *                     # Growth of seedcotton is simulated separately from the growth of burrs. The logistic function is used to simulate growth of seedcotton. The constants of this function for cultivar 'Acala-SJ2', are based on the data of Marani (1979); they are derived from calibration for other cultivars
 *                     # agemax is the age of the boll (in physiological days after bloom) at the time when the boll growth rate is maximal.
 */
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error)
          __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1096, __pyx_L1_error)
          PotGroAllSquares = (PotGroAllSquares + ((((__pyx_v_self->_sim.states[__pyx_t_21]).vegetative_branches[__pyx_t_20]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_18]).square.potential_growth);

          /* "_cotton2k/simulation.pyx":1091
 *                     # Calculate potential square growth for node (k,l,m).
 *                     # Sum potential growth rates of squares as PotGroAllSquares.
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.Square:             # <<<<<<<<<<<<<<
 *                         # ratesqr is the rate of square growth, g per square per day.
 *                         # The routine for this is derived from GOSSYM, and so are the parameters used.
 */
          goto __pyx_L9;
        }

        /* "_cotton2k/simulation.pyx":1108
 *                     # and the potential boll growth rate at this age will be the derivative of this function:
 *                     #    ratebol = 4 * rbmax * pex / (1. + pex)**2
 *                     elif self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.YoungGreenBoll or self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.GreenBoll:             # <<<<<<<<<<<<<<
 *                         # pex is an intermediate variable to compute boll growth.
 *                         pex = exp(-4 * rbmax * (self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age - agemax) / wbmax)
 */
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_22 = ((((((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_20]).nodes[__pyx_t_21]).stage == YoungGreenBoll) != 0);
        if (!__pyx_t_22) {
        } else {
          __pyx_t_17 = __pyx_t_22;
          goto __pyx_L10_bool_binop_done;
        }
        __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1108, __pyx_L1_error)
        __pyx_t_22 = ((((((__pyx_v_self->_sim.states[__pyx_t_21]).vegetative_branches[__pyx_t_20]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_18]).stage == GreenBoll) != 0);
        __pyx_t_17 = __pyx_t_22;
        __pyx_L10_bool_binop_done:;
        if (__pyx_t_17) {

          /* "_cotton2k/simulation.pyx":1110
 *                     elif self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.YoungGreenBoll or self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.GreenBoll:
 *                         # pex is an intermediate variable to compute boll growth.
 *                         pex = exp(-4 * rbmax * (self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age - agemax) / wbmax)             # <<<<<<<<<<<<<<
 *                         # ratebol is the rate of boll (seed and lint) growth, g per boll per day.
 *                         ratebol = 4 * tfrt * rbmax * pex / (1 + pex) ** 2
 */
          __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1110, __pyx_L1_error)
          __pyx_t_6 = ((-4.0 * __pyx_v_rbmax) * (((((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_20]).nodes[__pyx_t_21]).boll.age - __pyx_v_agemax));
          if (unlikely(__pyx_v_wbmax == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            __PYX_ERR(0, 1110, __pyx_L1_error)
          }
          __pyx_v_pex = exp((__pyx_t_6 / __pyx_v_wbmax));

          /* "_cotton2k/simulation.pyx":1112
 *                         pex = exp(-4 * rbmax * (self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age - agemax) / wbmax)
 *                         # ratebol is the rate of boll (seed and lint) growth, g per boll per day.
 *                         ratebol = 4 * tfrt * rbmax * pex / (1 + pex) ** 2             # <<<<<<<<<<<<<<
 *                         # Potential growth rate of the burrs is assumed to be constant (vpotfrt[4] g dry weight per day) until the boll reaches its final volume. This occurs at the age of 22 physiological days in 'Acala-SJ2'. Both ratebol and ratebur are modified by temperature (tfrt) and ratebur is also affected by water stress (wfdb).
 *                         # Compute wfdb for the effect of water stress on burr growth rate. wfdb is the effect of water stress on rate of burr growth.
 */
          __pyx_t_6 = (((4.0 * __pyx_v_tfrt) * __pyx_v_rbmax) * __pyx_v_pex);
          __pyx_t_23 = pow((1.0 + __pyx_v_pex), 2.0);
          if (unlikely(__pyx_t_23 == 0)) {
            PyErr_SetString(PyExc_ZeroDivisionError, "float division");
            __PYX_ERR(0, 1112, __pyx_L1_error)
          }
          __pyx_v_ratebol = (__pyx_t_6 / __pyx_t_23);

          /* "_cotton2k/simulation.pyx":1115
 *                         # Potential growth rate of the burrs is assumed to be constant (vpotfrt[4] g dry weight per day) until the boll reaches its final volume. This occurs at the age of 22 physiological days in 'Acala-SJ2'. Both ratebol and ratebur are modified by temperature (tfrt) and ratebur is also affected by water stress (wfdb).
 *                         # Compute wfdb for the effect of water stress on burr growth rate. wfdb is the effect of water stress on rate of burr growth.
 *                         wfdb = vpotfrt[0] + vpotfrt[1] * self._sim.states[u].water_stress             # <<<<<<<<<<<<<<
 *                         if wfdb < 0:
 *                             wfdb = 0
 */
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1115, __pyx_L1_error)
          __pyx_t_13 = PyFloat_FromDouble(((__pyx_v_vpotfrt[0]) + ((__pyx_v_vpotfrt[1]) * (__pyx_v_self->_sim.states[__pyx_t_21]).water_stress))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1115, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_XDECREF_SET(__pyx_v_wfdb, __pyx_t_13);
          __pyx_t_13 = 0;

          /* "_cotton2k/simulation.pyx":1116
 *                         # Compute wfdb for the effect of water stress on burr growth rate. wfdb is the effect of water stress on rate of burr growth.
 *                         wfdb = vpotfrt[0] + vpotfrt[1] * self._sim.states[u].water_stress
 *                         if wfdb < 0:             # <<<<<<<<<<<<<<
 *                             wfdb = 0
 *                         if wfdb > 1:
 */
          __pyx_t_13 = PyObject_RichCompare(__pyx_v_wfdb, __pyx_int_0, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1116, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1116, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_17) {

            /* "_cotton2k/simulation.pyx":1117
 *                         wfdb = vpotfrt[0] + vpotfrt[1] * self._sim.states[u].water_stress
 *                         if wfdb < 0:
 *                             wfdb = 0             # <<<<<<<<<<<<<<
 *                         if wfdb > 1:
 *                             wfdb = 1
 */
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_DECREF_SET(__pyx_v_wfdb, __pyx_int_0);

            /* "_cotton2k/simulation.pyx":1116
 *                         # Compute wfdb for the effect of water stress on burr growth rate. wfdb is the effect of water stress on rate of burr growth.
 *                         wfdb = vpotfrt[0] + vpotfrt[1] * self._sim.states[u].water_stress
 *                         if wfdb < 0:             # <<<<<<<<<<<<<<
 *                             wfdb = 0
 *                         if wfdb > 1:
 */
          }

          /* "_cotton2k/simulation.pyx":1118
 *                         if wfdb < 0:
 *                             wfdb = 0
 *                         if wfdb > 1:             # <<<<<<<<<<<<<<
 *                             wfdb = 1
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 */
          __pyx_t_13 = PyObject_RichCompare(__pyx_v_wfdb, __pyx_int_1, Py_GT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1118, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_17 < 0))) __PYX_ERR(0, 1118, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          if (__pyx_t_17) {

            /* "_cotton2k/simulation.pyx":1119
 *                             wfdb = 0
 *                         if wfdb > 1:
 *                             wfdb = 1             # <<<<<<<<<<<<<<
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age >= 22:
 */
            __Pyx_INCREF(__pyx_int_1);
            __Pyx_DECREF_SET(__pyx_v_wfdb, __pyx_int_1);

            /* "_cotton2k/simulation.pyx":1118
 *                         if wfdb < 0:
 *                             wfdb = 0
 *                         if wfdb > 1:             # <<<<<<<<<<<<<<
 *                             wfdb = 1
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 */
          }

          /* "_cotton2k/simulation.pyx":1120
 *                         if wfdb > 1:
 *                             wfdb = 1
 *                         ratebur = None  # rate of burr growth, g per boll per day.             # <<<<<<<<<<<<<<
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age >= 22:
 *                             ratebur = 0
 */
          __Pyx_INCREF(Py_None);
          __Pyx_XDECREF_SET(__pyx_v_ratebur, Py_None);

          /* "_cotton2k/simulation.pyx":1121
 *                             wfdb = 1
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age >= 22:             # <<<<<<<<<<<<<<
 *                             ratebur = 0
 *                         else:
 */
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error)
          __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1121, __pyx_L1_error)
          __pyx_t_17 = ((((((__pyx_v_self->_sim.states[__pyx_t_21]).vegetative_branches[__pyx_t_20]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_18]).boll.age >= 22.0) != 0);
          if (__pyx_t_17) {

            /* "_cotton2k/simulation.pyx":1122
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age >= 22:
 *                             ratebur = 0             # <<<<<<<<<<<<<<
 *                         else:
 *                             ratebur = vpotfrt[4] * tfrt * wfdb
 */
            __Pyx_INCREF(__pyx_int_0);
            __Pyx_DECREF_SET(__pyx_v_ratebur, __pyx_int_0);

            /* "_cotton2k/simulation.pyx":1121
 *                             wfdb = 1
 *                         ratebur = None  # rate of burr growth, g per boll per day.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age >= 22:             # <<<<<<<<<<<<<<
 *                             ratebur = 0
 *                         else:
 */
            goto __pyx_L14;
          }

          /* "_cotton2k/simulation.pyx":1124
 *                             ratebur = 0
 *                         else:
 *                             ratebur = vpotfrt[4] * tfrt * wfdb             # <<<<<<<<<<<<<<
 *                         # Potential boll (seeds and lint) growth rate (ratebol) and potential burr growth rate (ratebur) are multiplied by FruitFraction to compute PotGroBolls and PotGroBurrs for node (k,l,m).
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth = ratebol * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 */
          /*else*/ {
            __pyx_t_13 = PyFloat_FromDouble(((__pyx_v_vpotfrt[4]) * __pyx_v_tfrt)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1124, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_24 = PyNumber_Multiply(__pyx_t_13, __pyx_v_wfdb); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1124, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_24);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF_SET(__pyx_v_ratebur, __pyx_t_24);
            __pyx_t_24 = 0;
          }
          __pyx_L14:;

          /* "_cotton2k/simulation.pyx":1126
 *                             ratebur = vpotfrt[4] * tfrt * wfdb
 *                         # Potential boll (seeds and lint) growth rate (ratebol) and potential burr growth rate (ratebur) are multiplied by FruitFraction to compute PotGroBolls and PotGroBurrs for node (k,l,m).
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth = ratebol * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = ratebur * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 *                         # Sum potential growth rates of bolls and burrs as PotGroAllBolls and PotGroAllBurrs, respectively.
 */
          __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1126, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_2]).nodes[__pyx_t_11]).boll.potential_growth = (__pyx_v_ratebol * ((((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_20]).nodes[__pyx_t_21]).fraction);

          /* "_cotton2k/simulation.pyx":1127
 *                         # Potential boll (seeds and lint) growth rate (ratebol) and potential burr growth rate (ratebur) are multiplied by FruitFraction to compute PotGroBolls and PotGroBurrs for node (k,l,m).
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth = ratebol * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = ratebur * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction             # <<<<<<<<<<<<<<
 *                         # Sum potential growth rates of bolls and burrs as PotGroAllBolls and PotGroAllBurrs, respectively.
 *                         PotGroAllBolls += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth
 */
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_24 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[__pyx_t_2]).fruiting_branches[__pyx_t_15]).nodes[__pyx_t_16]).fraction); if (unlikely(!__pyx_t_24)) __PYX_ERR(0, 1127, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_24);
          __pyx_t_13 = PyNumber_Multiply(__pyx_v_ratebur, __pyx_t_24); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1127, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_24); __pyx_t_24 = 0;
          __pyx_t_23 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_23 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1127, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_2]).nodes[__pyx_t_11]).burr.potential_growth = __pyx_t_23;

          /* "_cotton2k/simulation.pyx":1129
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = ratebur * self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].fraction
 *                         # Sum potential growth rates of bolls and burrs as PotGroAllBolls and PotGroAllBurrs, respectively.
 *                         PotGroAllBolls += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth             # <<<<<<<<<<<<<<
 *                         PotGroAllBurrs += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth
 * 
 */
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L1_error)
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1129, __pyx_L1_error)
          PotGroAllBolls = (PotGroAllBolls + ((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[__pyx_t_2]).fruiting_branches[__pyx_t_15]).nodes[__pyx_t_16]).boll.potential_growth);

          /* "_cotton2k/simulation.pyx":1130
 *                         # Sum potential growth rates of bolls and burrs as PotGroAllBolls and PotGroAllBurrs, respectively.
 *                         PotGroAllBolls += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth
 *                         PotGroAllBurrs += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth             # <<<<<<<<<<<<<<
 * 
 *                     # If these are not green bolls, their potential growth is 0. End loop.
 */
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L1_error)
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1130, __pyx_L1_error)
          PotGroAllBurrs = (PotGroAllBurrs + ((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_2]).nodes[__pyx_t_11]).burr.potential_growth);

          /* "_cotton2k/simulation.pyx":1108
 *                     # and the potential boll growth rate at this age will be the derivative of this function:
 *                     #    ratebol = 4 * rbmax * pex / (1. + pex)**2
 *                     elif self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.YoungGreenBoll or self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].stage == Stage.GreenBoll:             # <<<<<<<<<<<<<<
 *                         # pex is an intermediate variable to compute boll growth.
 *                         pex = exp(-4 * rbmax * (self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.age - agemax) / wbmax)
 */
          goto __pyx_L9;
        }

        /* "_cotton2k/simulation.pyx":1134
 *                     # If these are not green bolls, their potential growth is 0. End loop.
 *                     else:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth = 0             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0
 * 
 */
        /*else*/ {
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1134, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[__pyx_t_2]).fruiting_branches[__pyx_t_15]).nodes[__pyx_t_16]).boll.potential_growth = 0.0;

          /* "_cotton2k/simulation.pyx":1135
 *                     else:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].boll.potential_growth = 0
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0             # <<<<<<<<<<<<<<
 * 
 *     def _potential_leaf_growth(self, u):
 */
          __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
          __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1135, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_2]).nodes[__pyx_t_11]).burr.potential_growth = 0.0;
        }
        __pyx_L9:;

        /* "_cotton2k/simulation.pyx":1088
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch             # <<<<<<<<<<<<<<
 *                     # Calculate potential square growth for node (k,l,m).
 *                     # Sum potential growth rates of squares as PotGroAllSquares.
 */
      }
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;

      /* "_cotton2k/simulation.pyx":1087
 *         # Loop for all vegetative stems.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches             # <<<<<<<<<<<<<<
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch
 *                     # Calculate potential square growth for node (k,l,m).
 */
    }
    __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":1086
 *         cdef double wbmax = self.cultivar_parameters[11]  # maximum possible boll (seed and lint) weight, g per boll.
 *         # Loop for all vegetative stems.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):  # loop of vegetative stems             # <<<<<<<<<<<<<<
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):  # loop of fruiting branches
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):  # loop for nodes on a fruiting branch
 */
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;

  /* "_cotton2k/simulation.pyx":1060
 *         CumNetPhotosynth += NetPhotosynthesis
 * 
 *     def _potential_fruit_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of fruiting sites of cotton plants. It is called from PlantGrowth(). It calls TemperatureOnFruitGrowthRate()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._potential_fruit_growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_wfdb);
  __Pyx_XDECREF(__pyx_v_ratebur);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1137
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0
 * 
 *     def _potential_leaf_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of leaves of cotton plants. It is called from self._growth(). It calls function temperature_on_leaf_growth_rate().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth, "\n        This function simulates the potential growth of leaves of cotton plants. It is called from self._growth(). It calls function temperature_on_leaf_growth_rate().\n\n        The following monomolecular growth function is used :\n            leaf area = smax * (1 - exp(-c * pow(t,p)))\n        where    smax = maximum leaf area.\n            t = time (leaf age).\n            c, p = constant parameters.\n        Note: p is constant for all leaves, whereas smax and c depend on leaf position.\n        The rate per day (the derivative of this function) is :\n            r = smax * c * p * exp(-c * pow(t,p)) * pow(t, (p-1))\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth = {"_potential_leaf_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_potential_leaf_growth (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1137, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_potential_leaf_growth") < 0)) __PYX_ERR(0, 1137, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_potential_leaf_growth", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1137, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._potential_leaf_growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  double __pyx_v_p;
  double __pyx_v_vpotlf[14];
  double __pyx_v_wstrlf;
  double __pyx_v_wtfstrs;
  double __pyx_v_tdday;
  double __pyx_v_c;
  double __pyx_v_smax;
  double __pyx_v_rate;
  PyObject *__pyx_v_j = NULL;
  PyObject *__pyx_v_jp1 = NULL;
  double __pyx_v_denfac;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_lp1 = NULL;
  double __pyx_v_smaxx;
  double __pyx_v_cc;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_v_mp1 = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1[14];
  Py_ssize_t __pyx_t_2;
  Py_ssize_t __pyx_t_3;
  int __pyx_t_4;
  double __pyx_t_5;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *(*__pyx_t_8)(PyObject *);
  Py_ssize_t __pyx_t_9;
  PyObject *__pyx_t_10 = NULL;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  PyObject *__pyx_t_13 = NULL;
  int __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  PyObject *(*__pyx_t_16)(PyObject *);
  Py_ssize_t __pyx_t_17;
  PyObject *__pyx_t_18 = NULL;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  PyObject *(*__pyx_t_23)(PyObject *);
  PyObject *__pyx_t_24 = NULL;
  Py_ssize_t __pyx_t_25;
  Py_ssize_t __pyx_t_26;
  Py_ssize_t __pyx_t_27;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_potential_leaf_growth", 0);

  /* "_cotton2k/simulation.pyx":1152
 *         global PotGroAllLeaves, PotGroAllPetioles
 *         # The following constant parameters. are used in this function:
 *         cdef double p = 1.6  # parameter of the leaf growth rate equation.             # <<<<<<<<<<<<<<
 *         cdef double[14] vpotlf = [3.0, 0.95, 1.2, 13.5, -0.62143, 0.109365, 0.00137566, 0.025, 0.00005, 30., 0.02, 0.001, 2.50, 0.18]
 *         # Calculate water stress reduction factor for leaf growth rate (wstrlf). This has been empirically calibrated in COTTON2K.
 */
  __pyx_v_p = 1.6;

  /* "_cotton2k/simulation.pyx":1153
 *         # The following constant parameters. are used in this function:
 *         cdef double p = 1.6  # parameter of the leaf growth rate equation.
 *         cdef double[14] vpotlf = [3.0, 0.95, 1.2, 13.5, -0.62143, 0.109365, 0.00137566, 0.025, 0.00005, 30., 0.02, 0.001, 2.50, 0.18]             # <<<<<<<<<<<<<<
 *         # Calculate water stress reduction factor for leaf growth rate (wstrlf). This has been empirically calibrated in COTTON2K.
 *         cdef double wstrlf = self._sim.states[u].water_stress * (1 + vpotlf[0] * (2 - self._sim.states[u].water_stress)) - vpotlf[0]
 */
  __pyx_t_1[0] = 3.0;
  __pyx_t_1[1] = 0.95;
  __pyx_t_1[2] = 1.2;
  __pyx_t_1[3] = 13.5;
  __pyx_t_1[4] = -0.62143;
  __pyx_t_1[5] = 0.109365;
  __pyx_t_1[6] = 0.00137566;
  __pyx_t_1[7] = 0.025;
  __pyx_t_1[8] = 0.00005;
  __pyx_t_1[9] = 30.;
  __pyx_t_1[10] = 0.02;
  __pyx_t_1[11] = 0.001;
  __pyx_t_1[12] = 2.50;
  __pyx_t_1[13] = 0.18;
  memcpy(&(__pyx_v_vpotlf[0]), __pyx_t_1, sizeof(__pyx_v_vpotlf[0]) * (14));

  /* "_cotton2k/simulation.pyx":1155
 *         cdef double[14] vpotlf = [3.0, 0.95, 1.2, 13.5, -0.62143, 0.109365, 0.00137566, 0.025, 0.00005, 30., 0.02, 0.001, 2.50, 0.18]
 *         # Calculate water stress reduction factor for leaf growth rate (wstrlf). This has been empirically calibrated in COTTON2K.
 *         cdef double wstrlf = self._sim.states[u].water_stress * (1 + vpotlf[0] * (2 - self._sim.states[u].water_stress)) - vpotlf[0]             # <<<<<<<<<<<<<<
 *         if wstrlf < 0.05:
 *             wstrlf = 0.05
 */
  __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1155, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1155, __pyx_L1_error)
  __pyx_v_wstrlf = (((__pyx_v_self->_sim.states[__pyx_t_2]).water_stress * (1.0 + ((__pyx_v_vpotlf[0]) * (2.0 - (__pyx_v_self->_sim.states[__pyx_t_3]).water_stress)))) - (__pyx_v_vpotlf[0]));

  /* "_cotton2k/simulation.pyx":1156
 *         # Calculate water stress reduction factor for leaf growth rate (wstrlf). This has been empirically calibrated in COTTON2K.
 *         cdef double wstrlf = self._sim.states[u].water_stress * (1 + vpotlf[0] * (2 - self._sim.states[u].water_stress)) - vpotlf[0]
 *         if wstrlf < 0.05:             # <<<<<<<<<<<<<<
 *             wstrlf = 0.05
 *         # Calculate wtfstrs, the effect of leaf water stress on state.leaf_weight_area_ratio (the ratio of leaf dry weight to leaf area). This has also been empirically calibrated in COTTON2K.
 */
  __pyx_t_4 = ((__pyx_v_wstrlf < 0.05) != 0);
  if (__pyx_t_4) {

    /* "_cotton2k/simulation.pyx":1157
 *         cdef double wstrlf = self._sim.states[u].water_stress * (1 + vpotlf[0] * (2 - self._sim.states[u].water_stress)) - vpotlf[0]
 *         if wstrlf < 0.05:
 *             wstrlf = 0.05             # <<<<<<<<<<<<<<
 *         # Calculate wtfstrs, the effect of leaf water stress on state.leaf_weight_area_ratio (the ratio of leaf dry weight to leaf area). This has also been empirically calibrated in COTTON2K.
 *         cdef double wtfstrs = vpotlf[1] + vpotlf[2] * (1 - wstrlf)
 */
    __pyx_v_wstrlf = 0.05;

    /* "_cotton2k/simulation.pyx":1156
 *         # Calculate water stress reduction factor for leaf growth rate (wstrlf). This has been empirically calibrated in COTTON2K.
 *         cdef double wstrlf = self._sim.states[u].water_stress * (1 + vpotlf[0] * (2 - self._sim.states[u].water_stress)) - vpotlf[0]
 *         if wstrlf < 0.05:             # <<<<<<<<<<<<<<
 *             wstrlf = 0.05
 *         # Calculate wtfstrs, the effect of leaf water stress on state.leaf_weight_area_ratio (the ratio of leaf dry weight to leaf area). This has also been empirically calibrated in COTTON2K.
 */
  }

  /* "_cotton2k/simulation.pyx":1159
 *             wstrlf = 0.05
 *         # Calculate wtfstrs, the effect of leaf water stress on state.leaf_weight_area_ratio (the ratio of leaf dry weight to leaf area). This has also been empirically calibrated in COTTON2K.
 *         cdef double wtfstrs = vpotlf[1] + vpotlf[2] * (1 - wstrlf)             # <<<<<<<<<<<<<<
 *         # Compute the ratio of leaf dry weight increment to leaf area increment (g per dm2), as a function of average daily temperature and water stress. Parameters for the effect of temperature are adapted from GOSSYM.
 *         cdef double tdday = self._sim.states[u].average_temperature  # limited value of today's average temperature.
 */
  __pyx_v_wtfstrs = ((__pyx_v_vpotlf[1]) + ((__pyx_v_vpotlf[2]) * (1.0 - __pyx_v_wstrlf)));

  /* "_cotton2k/simulation.pyx":1161
 *         cdef double wtfstrs = vpotlf[1] + vpotlf[2] * (1 - wstrlf)
 *         # Compute the ratio of leaf dry weight increment to leaf area increment (g per dm2), as a function of average daily temperature and water stress. Parameters for the effect of temperature are adapted from GOSSYM.
 *         cdef double tdday = self._sim.states[u].average_temperature  # limited value of today's average temperature.             # <<<<<<<<<<<<<<
 *         if tdday < vpotlf[3]:
 *             tdday = vpotlf[3]
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1161, __pyx_L1_error)
  __pyx_t_5 = (__pyx_v_self->_sim.states[__pyx_t_3]).average_temperature;
  __pyx_v_tdday = __pyx_t_5;

  /* "_cotton2k/simulation.pyx":1162
 *         # Compute the ratio of leaf dry weight increment to leaf area increment (g per dm2), as a function of average daily temperature and water stress. Parameters for the effect of temperature are adapted from GOSSYM.
 *         cdef double tdday = self._sim.states[u].average_temperature  # limited value of today's average temperature.
 *         if tdday < vpotlf[3]:             # <<<<<<<<<<<<<<
 *             tdday = vpotlf[3]
 *         self._sim.states[u].leaf_weight_area_ratio = wtfstrs / (vpotlf[4] + tdday * (vpotlf[5] - tdday * vpotlf[6]))
 */
  __pyx_t_4 = ((__pyx_v_tdday < (__pyx_v_vpotlf[3])) != 0);
  if (__pyx_t_4) {

    /* "_cotton2k/simulation.pyx":1163
 *         cdef double tdday = self._sim.states[u].average_temperature  # limited value of today's average temperature.
 *         if tdday < vpotlf[3]:
 *             tdday = vpotlf[3]             # <<<<<<<<<<<<<<
 *         self._sim.states[u].leaf_weight_area_ratio = wtfstrs / (vpotlf[4] + tdday * (vpotlf[5] - tdday * vpotlf[6]))
 *         # Assign zero to total potential growth of leaf and petiole.
 */
    __pyx_v_tdday = (__pyx_v_vpotlf[3]);

    /* "_cotton2k/simulation.pyx":1162
 *         # Compute the ratio of leaf dry weight increment to leaf area increment (g per dm2), as a function of average daily temperature and water stress. Parameters for the effect of temperature are adapted from GOSSYM.
 *         cdef double tdday = self._sim.states[u].average_temperature  # limited value of today's average temperature.
 *         if tdday < vpotlf[3]:             # <<<<<<<<<<<<<<
 *             tdday = vpotlf[3]
 *         self._sim.states[u].leaf_weight_area_ratio = wtfstrs / (vpotlf[4] + tdday * (vpotlf[5] - tdday * vpotlf[6]))
 */
  }

  /* "_cotton2k/simulation.pyx":1164
 *         if tdday < vpotlf[3]:
 *             tdday = vpotlf[3]
 *         self._sim.states[u].leaf_weight_area_ratio = wtfstrs / (vpotlf[4] + tdday * (vpotlf[5] - tdday * vpotlf[6]))             # <<<<<<<<<<<<<<
 *         # Assign zero to total potential growth of leaf and petiole.
 *         PotGroAllLeaves = 0
 */
  __pyx_t_5 = ((__pyx_v_vpotlf[4]) + (__pyx_v_tdday * ((__pyx_v_vpotlf[5]) - (__pyx_v_tdday * (__pyx_v_vpotlf[6])))));
  if (unlikely(__pyx_t_5 == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1164, __pyx_L1_error)
  }
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1164, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_3]).leaf_weight_area_ratio = (__pyx_v_wtfstrs / __pyx_t_5);

  /* "_cotton2k/simulation.pyx":1166
 *         self._sim.states[u].leaf_weight_area_ratio = wtfstrs / (vpotlf[4] + tdday * (vpotlf[5] - tdday * vpotlf[6]))
 *         # Assign zero to total potential growth of leaf and petiole.
 *         PotGroAllLeaves = 0             # <<<<<<<<<<<<<<
 *         PotGroAllPetioles = 0
 *         cdef double c = 0  # parameter of the leaf growth rate equation.
 */
  PotGroAllLeaves = 0.0;

  /* "_cotton2k/simulation.pyx":1167
 *         # Assign zero to total potential growth of leaf and petiole.
 *         PotGroAllLeaves = 0
 *         PotGroAllPetioles = 0             # <<<<<<<<<<<<<<
 *         cdef double c = 0  # parameter of the leaf growth rate equation.
 *         cdef double smax = 0  # maximum possible leaf area, a parameter of the leaf growth rate equation.
 */
  PotGroAllPetioles = 0.0;

  /* "_cotton2k/simulation.pyx":1168
 *         PotGroAllLeaves = 0
 *         PotGroAllPetioles = 0
 *         cdef double c = 0  # parameter of the leaf growth rate equation.             # <<<<<<<<<<<<<<
 *         cdef double smax = 0  # maximum possible leaf area, a parameter of the leaf growth rate equation.
 *         cdef double rate  # growth rate of area of a leaf.
 */
  __pyx_v_c = 0.0;

  /* "_cotton2k/simulation.pyx":1169
 *         PotGroAllPetioles = 0
 *         cdef double c = 0  # parameter of the leaf growth rate equation.
 *         cdef double smax = 0  # maximum possible leaf area, a parameter of the leaf growth rate equation.             # <<<<<<<<<<<<<<
 *         cdef double rate  # growth rate of area of a leaf.
 *         # Compute the potential growth rate of prefruiting leaves. smax and c are functions of prefruiting node number.
 */
  __pyx_v_smax = 0.0;

  /* "_cotton2k/simulation.pyx":1172
 *         cdef double rate  # growth rate of area of a leaf.
 *         # Compute the potential growth rate of prefruiting leaves. smax and c are functions of prefruiting node number.
 *         for j in range(self._sim.states[u].number_of_pre_fruiting_nodes):             # <<<<<<<<<<<<<<
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:
 *                 PotGroLeafAreaPreFru[j] = 0
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1172, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->_sim.states[__pyx_t_3]).number_of_pre_fruiting_nodes); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1172, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
    __pyx_t_6 = __pyx_t_7; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1172, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1172, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_7); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1172, __pyx_L1_error)
        #else
        __pyx_t_7 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1172, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        #endif
      }
    } else {
      __pyx_t_7 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_7)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1172, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_7);
    }
    __Pyx_XDECREF_SET(__pyx_v_j, __pyx_t_7);
    __pyx_t_7 = 0;

    /* "_cotton2k/simulation.pyx":1173
 *         # Compute the potential growth rate of prefruiting leaves. smax and c are functions of prefruiting node number.
 *         for j in range(self._sim.states[u].number_of_pre_fruiting_nodes):
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:             # <<<<<<<<<<<<<<
 *                 PotGroLeafAreaPreFru[j] = 0
 *                 PotGroLeafWeightPreFru[j] = 0
 */
    __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error)
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1173, __pyx_L1_error)
    __pyx_t_4 = ((((__pyx_v_self->_sim.states[__pyx_t_2]).leaf_area_pre_fruiting[__pyx_t_9]) <= 0.0) != 0);
    if (__pyx_t_4) {

      /* "_cotton2k/simulation.pyx":1174
 *         for j in range(self._sim.states[u].number_of_pre_fruiting_nodes):
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:
 *                 PotGroLeafAreaPreFru[j] = 0             # <<<<<<<<<<<<<<
 *                 PotGroLeafWeightPreFru[j] = 0
 *                 PotGroPetioleWeightPreFru[j] = 0
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1174, __pyx_L1_error)
      (PotGroLeafAreaPreFru[__pyx_t_9]) = 0.0;

      /* "_cotton2k/simulation.pyx":1175
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:
 *                 PotGroLeafAreaPreFru[j] = 0
 *                 PotGroLeafWeightPreFru[j] = 0             # <<<<<<<<<<<<<<
 *                 PotGroPetioleWeightPreFru[j] = 0
 *             else:
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1175, __pyx_L1_error)
      (PotGroLeafWeightPreFru[__pyx_t_9]) = 0.0;

      /* "_cotton2k/simulation.pyx":1176
 *                 PotGroLeafAreaPreFru[j] = 0
 *                 PotGroLeafWeightPreFru[j] = 0
 *                 PotGroPetioleWeightPreFru[j] = 0             # <<<<<<<<<<<<<<
 *             else:
 *                 jp1 = j + 1
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1176, __pyx_L1_error)
      (PotGroPetioleWeightPreFru[__pyx_t_9]) = 0.0;

      /* "_cotton2k/simulation.pyx":1173
 *         # Compute the potential growth rate of prefruiting leaves. smax and c are functions of prefruiting node number.
 *         for j in range(self._sim.states[u].number_of_pre_fruiting_nodes):
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:             # <<<<<<<<<<<<<<
 *                 PotGroLeafAreaPreFru[j] = 0
 *                 PotGroLeafWeightPreFru[j] = 0
 */
      goto __pyx_L7;
    }

    /* "_cotton2k/simulation.pyx":1178
 *                 PotGroPetioleWeightPreFru[j] = 0
 *             else:
 *                 jp1 = j + 1             # <<<<<<<<<<<<<<
 *                 smax = jp1 * (self.cultivar_parameters[2] - self.cultivar_parameters[3] * jp1)
 *                 if smax < self.cultivar_parameters[4]:
 */
    /*else*/ {
      __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_j, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1178, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_XDECREF_SET(__pyx_v_jp1, __pyx_t_7);
      __pyx_t_7 = 0;

      /* "_cotton2k/simulation.pyx":1179
 *             else:
 *                 jp1 = j + 1
 *                 smax = jp1 * (self.cultivar_parameters[2] - self.cultivar_parameters[3] * jp1)             # <<<<<<<<<<<<<<
 *                 if smax < self.cultivar_parameters[4]:
 *                     smax = self.cultivar_parameters[4]
 */
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_7, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_7, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_v_jp1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyNumber_Subtract(__pyx_t_10, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_7 = PyNumber_Multiply(__pyx_v_jp1, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1179, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_v_smax = __pyx_t_5;

      /* "_cotton2k/simulation.pyx":1180
 *                 jp1 = j + 1
 *                 smax = jp1 * (self.cultivar_parameters[2] - self.cultivar_parameters[3] * jp1)
 *                 if smax < self.cultivar_parameters[4]:             # <<<<<<<<<<<<<<
 *                     smax = self.cultivar_parameters[4]
 *                 c = vpotlf[7] + vpotlf[8] * jp1 * (jp1 - vpotlf[9])
 */
      __pyx_t_7 = PyFloat_FromDouble(__pyx_v_smax); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyObject_RichCompare(__pyx_t_7, __pyx_t_10, Py_LT); __Pyx_XGOTREF(__pyx_t_11); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_11); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1180, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      if (__pyx_t_4) {

        /* "_cotton2k/simulation.pyx":1181
 *                 smax = jp1 * (self.cultivar_parameters[2] - self.cultivar_parameters[3] * jp1)
 *                 if smax < self.cultivar_parameters[4]:
 *                     smax = self.cultivar_parameters[4]             # <<<<<<<<<<<<<<
 *                 c = vpotlf[7] + vpotlf[8] * jp1 * (jp1 - vpotlf[9])
 *                 rate = smax * c * p * exp(-c * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], p)) * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], (p - 1))
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_10 = __Pyx_GetItemInt(__pyx_t_11, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1181, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_v_smax = __pyx_t_5;

        /* "_cotton2k/simulation.pyx":1180
 *                 jp1 = j + 1
 *                 smax = jp1 * (self.cultivar_parameters[2] - self.cultivar_parameters[3] * jp1)
 *                 if smax < self.cultivar_parameters[4]:             # <<<<<<<<<<<<<<
 *                     smax = self.cultivar_parameters[4]
 *                 c = vpotlf[7] + vpotlf[8] * jp1 * (jp1 - vpotlf[9])
 */
      }

      /* "_cotton2k/simulation.pyx":1182
 *                 if smax < self.cultivar_parameters[4]:
 *                     smax = self.cultivar_parameters[4]
 *                 c = vpotlf[7] + vpotlf[8] * jp1 * (jp1 - vpotlf[9])             # <<<<<<<<<<<<<<
 *                 rate = smax * c * p * exp(-c * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], p)) * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], (p - 1))
 *                 # Growth rate is modified by water stress and a function of average temperature.
 */
      __pyx_t_10 = PyFloat_FromDouble((__pyx_v_vpotlf[7])); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_11 = PyFloat_FromDouble((__pyx_v_vpotlf[8])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_7 = PyNumber_Multiply(__pyx_t_11, __pyx_v_jp1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyFloat_FromDouble((__pyx_v_vpotlf[9])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = PyNumber_Subtract(__pyx_v_jp1, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Add(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1182, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_c = __pyx_t_5;

      /* "_cotton2k/simulation.pyx":1183
 *                     smax = self.cultivar_parameters[4]
 *                 c = vpotlf[7] + vpotlf[8] * jp1 * (jp1 - vpotlf[9])
 *                 rate = smax * c * p * exp(-c * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], p)) * pow(self._sim.states[u].age_of_pre_fruiting_nodes[j], (p - 1))             # <<<<<<<<<<<<<<
 *                 # Growth rate is modified by water stress and a function of average temperature.
 *                 # Compute potential growth of leaf area, leaf weight and petiole weight for leaf on node j. Add leaf weight potential growth to PotGroAllLeaves.
 */
      __pyx_t_12 = PyFloat_FromDouble((-__pyx_v_c)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __pyx_t_11 = PyFloat_FromDouble(((__pyx_v_self->_sim.states[__pyx_t_9]).age_of_pre_fruiting_nodes[__pyx_t_2])); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_10 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_7 = __Pyx_PyNumber_Power2(__pyx_t_11, __pyx_t_10); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyNumber_Multiply(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __pyx_t_10 = PyFloat_FromDouble((((__pyx_v_smax * __pyx_v_c) * __pyx_v_p) * exp(__pyx_t_5))); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __pyx_t_7 = PyFloat_FromDouble(((__pyx_v_self->_sim.states[__pyx_t_2]).age_of_pre_fruiting_nodes[__pyx_t_9])); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_12 = PyFloat_FromDouble((__pyx_v_p - 1.0)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = __Pyx_PyNumber_Power2(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyNumber_Multiply(__pyx_t_10, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1183, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_v_rate = __pyx_t_5;

      /* "_cotton2k/simulation.pyx":1187
 *                 # Compute potential growth of leaf area, leaf weight and petiole weight for leaf on node j. Add leaf weight potential growth to PotGroAllLeaves.
 *                 # Add potential growth of petiole weight to PotGroAllPetioles.
 *                 if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                     PotGroLeafAreaPreFru[j] = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio
 */
      __pyx_t_4 = ((__pyx_v_rate >= 1e-12) != 0);
      if (__pyx_t_4) {

        /* "_cotton2k/simulation.pyx":1188
 *                 # Add potential growth of petiole weight to PotGroAllPetioles.
 *                 if rate >= 1e-12:
 *                     PotGroLeafAreaPreFru[j] = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)             # <<<<<<<<<<<<<<
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio
 *                     PotGroPetioleWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 */
        __pyx_t_12 = PyFloat_FromDouble((__pyx_v_rate * __pyx_v_wstrlf)); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_GetModuleGlobalName(__pyx_t_10, __pyx_n_s_temperature_on_leaf_growth_rate); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1188, __pyx_L1_error)
        __pyx_t_7 = PyFloat_FromDouble((__pyx_v_self->_sim.states[__pyx_t_9]).average_temperature); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = NULL;
        __pyx_t_14 = 0;
        if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_10))) {
          __pyx_t_13 = PyMethod_GET_SELF(__pyx_t_10);
          if (likely(__pyx_t_13)) {
            PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_10);
            __Pyx_INCREF(__pyx_t_13);
            __Pyx_INCREF(function);
            __Pyx_DECREF_SET(__pyx_t_10, function);
            __pyx_t_14 = 1;
          }
        }
        {
          PyObject *__pyx_callargs[2] = {__pyx_t_13, __pyx_t_7};
          __pyx_t_11 = __Pyx_PyObject_FastCall(__pyx_t_10, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
          __Pyx_XDECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1188, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        }
        __pyx_t_10 = PyNumber_Multiply(__pyx_t_12, __pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_10); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1188, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1188, __pyx_L1_error)
        (PotGroLeafAreaPreFru[__pyx_t_9]) = __pyx_t_5;

        /* "_cotton2k/simulation.pyx":1189
 *                 if rate >= 1e-12:
 *                     PotGroLeafAreaPreFru[j] = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *                     PotGroPetioleWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                     PotGroAllLeaves += PotGroLeafWeightPreFru[j]
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L1_error)
        __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1189, __pyx_L1_error)
        (PotGroLeafWeightPreFru[__pyx_t_15]) = ((PotGroLeafAreaPreFru[__pyx_t_9]) * (__pyx_v_self->_sim.states[__pyx_t_2]).leaf_weight_area_ratio);

        /* "_cotton2k/simulation.pyx":1190
 *                     PotGroLeafAreaPreFru[j] = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio
 *                     PotGroPetioleWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]             # <<<<<<<<<<<<<<
 *                     PotGroAllLeaves += PotGroLeafWeightPreFru[j]
 *                     PotGroAllPetioles += PotGroPetioleWeightPreFru[j]
 */
        __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1190, __pyx_L1_error)
        (PotGroPetioleWeightPreFru[__pyx_t_15]) = (((PotGroLeafAreaPreFru[__pyx_t_2]) * (__pyx_v_self->_sim.states[__pyx_t_9]).leaf_weight_area_ratio) * (__pyx_v_vpotlf[13]));

        /* "_cotton2k/simulation.pyx":1191
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio
 *                     PotGroPetioleWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                     PotGroAllLeaves += PotGroLeafWeightPreFru[j]             # <<<<<<<<<<<<<<
 *                     PotGroAllPetioles += PotGroPetioleWeightPreFru[j]
 *         # denfac is the effect of plant density on leaf growth rate.
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1191, __pyx_L1_error)
        PotGroAllLeaves = (PotGroAllLeaves + (PotGroLeafWeightPreFru[__pyx_t_9]));

        /* "_cotton2k/simulation.pyx":1192
 *                     PotGroPetioleWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                     PotGroAllLeaves += PotGroLeafWeightPreFru[j]
 *                     PotGroAllPetioles += PotGroPetioleWeightPreFru[j]             # <<<<<<<<<<<<<<
 *         # denfac is the effect of plant density on leaf growth rate.
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_j); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1192, __pyx_L1_error)
        PotGroAllPetioles = (PotGroAllPetioles + (PotGroPetioleWeightPreFru[__pyx_t_9]));

        /* "_cotton2k/simulation.pyx":1187
 *                 # Compute potential growth of leaf area, leaf weight and petiole weight for leaf on node j. Add leaf weight potential growth to PotGroAllLeaves.
 *                 # Add potential growth of petiole weight to PotGroAllPetioles.
 *                 if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                     PotGroLeafAreaPreFru[j] = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                     PotGroLeafWeightPreFru[j] = PotGroLeafAreaPreFru[j] * self._sim.states[u].leaf_weight_area_ratio
 */
      }
    }
    __pyx_L7:;

    /* "_cotton2k/simulation.pyx":1172
 *         cdef double rate  # growth rate of area of a leaf.
 *         # Compute the potential growth rate of prefruiting leaves. smax and c are functions of prefruiting node number.
 *         for j in range(self._sim.states[u].number_of_pre_fruiting_nodes):             # <<<<<<<<<<<<<<
 *             if self._sim.states[u].leaf_area_pre_fruiting[j] <= 0:
 *                 PotGroLeafAreaPreFru[j] = 0
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_cotton2k/simulation.pyx":1194
 *                     PotGroAllPetioles += PotGroPetioleWeightPreFru[j]
 *         # denfac is the effect of plant density on leaf growth rate.
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)             # <<<<<<<<<<<<<<
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 */
  __pyx_v_denfac = (1.0 - ((__pyx_v_vpotlf[12]) * (1.0 - __pyx_v_self->_sim.density_factor)));

  /* "_cotton2k/simulation.pyx":1195
 *         # denfac is the effect of plant density on leaf growth rate.
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):             # <<<<<<<<<<<<<<
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 *                 # smax and c are  functions of fruiting branch number.
 */
  __pyx_t_3 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_3 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1195, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_sim.states[__pyx_t_3]).number_of_vegetative_branches); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_6);
  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_6); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_10);
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
  if (likely(PyList_CheckExact(__pyx_t_10)) || PyTuple_CheckExact(__pyx_t_10)) {
    __pyx_t_6 = __pyx_t_10; __Pyx_INCREF(__pyx_t_6); __pyx_t_3 = 0;
    __pyx_t_8 = NULL;
  } else {
    __pyx_t_3 = -1; __pyx_t_6 = PyObject_GetIter(__pyx_t_10); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1195, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_6);
    __pyx_t_8 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_6); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1195, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
  for (;;) {
    if (likely(!__pyx_t_8)) {
      if (likely(PyList_CheckExact(__pyx_t_6))) {
        if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyList_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      } else {
        if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_6)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_6, __pyx_t_3); __Pyx_INCREF(__pyx_t_10); __pyx_t_3++; if (unlikely((0 < 0))) __PYX_ERR(0, 1195, __pyx_L1_error)
        #else
        __pyx_t_10 = PySequence_ITEM(__pyx_t_6, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1195, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_10);
        #endif
      }
    } else {
      __pyx_t_10 = __pyx_t_8(__pyx_t_6);
      if (unlikely(!__pyx_t_10)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1195, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_10);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_10);
    __pyx_t_10 = 0;

    /* "_cotton2k/simulation.pyx":1196
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):             # <<<<<<<<<<<<<<
 *                 # smax and c are  functions of fruiting branch number.
 *                 # smax is modified by plant density, using the density factor denfac.
 */
    __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error)
    __pyx_t_2 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_2 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1196, __pyx_L1_error)
    __pyx_t_10 = __Pyx_PyInt_From_unsigned_int(((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_2]).number_of_fruiting_branches); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_10);
    __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_10); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1196, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
    if (likely(PyList_CheckExact(__pyx_t_11)) || PyTuple_CheckExact(__pyx_t_11)) {
      __pyx_t_10 = __pyx_t_11; __Pyx_INCREF(__pyx_t_10); __pyx_t_2 = 0;
      __pyx_t_16 = NULL;
    } else {
      __pyx_t_2 = -1; __pyx_t_10 = PyObject_GetIter(__pyx_t_11); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 1196, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_10);
      __pyx_t_16 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_10); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1196, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
    for (;;) {
      if (likely(!__pyx_t_16)) {
        if (likely(PyList_CheckExact(__pyx_t_10))) {
          if (__pyx_t_2 >= PyList_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = PyList_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_11); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1196, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        } else {
          if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_10)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_11 = PyTuple_GET_ITEM(__pyx_t_10, __pyx_t_2); __Pyx_INCREF(__pyx_t_11); __pyx_t_2++; if (unlikely((0 < 0))) __PYX_ERR(0, 1196, __pyx_L1_error)
          #else
          __pyx_t_11 = PySequence_ITEM(__pyx_t_10, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1196, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          #endif
        }
      } else {
        __pyx_t_11 = __pyx_t_16(__pyx_t_10);
        if (unlikely(!__pyx_t_11)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1196, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_11);
      }
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_11);
      __pyx_t_11 = 0;

      /* "_cotton2k/simulation.pyx":1200
 *                 # smax is modified by plant density, using the density factor denfac.
 *                 # Compute potential main stem leaf growth, assuming that the main stem leaf is initiated at the same time as leaf (k,l,0).
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.leaf_area <= 0:             # <<<<<<<<<<<<<<
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = 0
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L1_error)
      __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L1_error)
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1200, __pyx_L1_error)
      __pyx_t_4 = (((((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).main_stem_leaf.leaf_area <= 0.0) != 0);
      if (__pyx_t_4) {

        /* "_cotton2k/simulation.pyx":1201
 *                 # Compute potential main stem leaf growth, assuming that the main stem leaf is initiated at the same time as leaf (k,l,0).
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.leaf_area <= 0:
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = 0             # <<<<<<<<<<<<<<
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = 0
 */
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1201, __pyx_L1_error)
        (((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).main_stem_leaf.potential_growth_for_leaf_area = 0.0;

        /* "_cotton2k/simulation.pyx":1202
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.leaf_area <= 0:
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = 0             # <<<<<<<<<<<<<<
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = 0
 *                 else:
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1202, __pyx_L1_error)
        (((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).main_stem_leaf.potential_growth_for_leaf_weight = 0.0;

        /* "_cotton2k/simulation.pyx":1203
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = 0             # <<<<<<<<<<<<<<
 *                 else:
 *                     lp1 = l + 1
 */
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1203, __pyx_L1_error)
        (((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).main_stem_leaf.potential_growth_for_petiole_weight = 0.0;

        /* "_cotton2k/simulation.pyx":1200
 *                 # smax is modified by plant density, using the density factor denfac.
 *                 # Compute potential main stem leaf growth, assuming that the main stem leaf is initiated at the same time as leaf (k,l,0).
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.leaf_area <= 0:             # <<<<<<<<<<<<<<
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = 0
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = 0
 */
        goto __pyx_L14;
      }

      /* "_cotton2k/simulation.pyx":1205
 *                     self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = 0
 *                 else:
 *                     lp1 = l + 1             # <<<<<<<<<<<<<<
 *                     smax = self.cultivar_parameters[5] + self.cultivar_parameters[6] * lp1 * (self.cultivar_parameters[7] - lp1)
 *                     smax = smax * denfac
 */
      /*else*/ {
        __pyx_t_11 = __Pyx_PyInt_AddObjC(__pyx_v_l, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1205, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_XDECREF_SET(__pyx_v_lp1, __pyx_t_11);
        __pyx_t_11 = 0;

        /* "_cotton2k/simulation.pyx":1206
 *                 else:
 *                     lp1 = l + 1
 *                     smax = self.cultivar_parameters[5] + self.cultivar_parameters[6] * lp1 * (self.cultivar_parameters[7] - lp1)             # <<<<<<<<<<<<<<
 *                     smax = smax * denfac
 *                     if smax < self.cultivar_parameters[4]:
 */
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_v_lp1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_11);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_GetItemInt(__pyx_t_7, 7, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Subtract(__pyx_t_13, __pyx_v_lp1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_7 = PyNumber_Add(__pyx_t_12, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1206, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_v_smax = __pyx_t_5;

        /* "_cotton2k/simulation.pyx":1207
 *                     lp1 = l + 1
 *                     smax = self.cultivar_parameters[5] + self.cultivar_parameters[6] * lp1 * (self.cultivar_parameters[7] - lp1)
 *                     smax = smax * denfac             # <<<<<<<<<<<<<<
 *                     if smax < self.cultivar_parameters[4]:
 *                         smax = self.cultivar_parameters[4]
 */
        __pyx_v_smax = (__pyx_v_smax * __pyx_v_denfac);

        /* "_cotton2k/simulation.pyx":1208
 *                     smax = self.cultivar_parameters[5] + self.cultivar_parameters[6] * lp1 * (self.cultivar_parameters[7] - lp1)
 *                     smax = smax * denfac
 *                     if smax < self.cultivar_parameters[4]:             # <<<<<<<<<<<<<<
 *                         smax = self.cultivar_parameters[4]
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 */
        __pyx_t_7 = PyFloat_FromDouble(__pyx_v_smax); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_13, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyObject_RichCompare(__pyx_t_7, __pyx_t_12, Py_LT); __Pyx_XGOTREF(__pyx_t_13); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_13); if (unlikely((__pyx_t_4 < 0))) __PYX_ERR(0, 1208, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        if (__pyx_t_4) {

          /* "_cotton2k/simulation.pyx":1209
 *                     smax = smax * denfac
 *                     if smax < self.cultivar_parameters[4]:
 *                         smax = self.cultivar_parameters[4]             # <<<<<<<<<<<<<<
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age > 70:
 */
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1209, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_13, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1209, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1209, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_v_smax = __pyx_t_5;

          /* "_cotton2k/simulation.pyx":1208
 *                     smax = self.cultivar_parameters[5] + self.cultivar_parameters[6] * lp1 * (self.cultivar_parameters[7] - lp1)
 *                     smax = smax * denfac
 *                     if smax < self.cultivar_parameters[4]:             # <<<<<<<<<<<<<<
 *                         smax = self.cultivar_parameters[4]
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 */
        }

        /* "_cotton2k/simulation.pyx":1210
 *                     if smax < self.cultivar_parameters[4]:
 *                         smax = self.cultivar_parameters[4]
 *                     c = vpotlf[10] + lp1 * vpotlf[11]             # <<<<<<<<<<<<<<
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age > 70:
 *                         rate = 0
 */
        __pyx_t_12 = PyFloat_FromDouble((__pyx_v_vpotlf[10])); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_13 = PyFloat_FromDouble((__pyx_v_vpotlf[11])); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __pyx_t_7 = PyNumber_Multiply(__pyx_v_lp1, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_7);
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_t_13 = PyNumber_Add(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1210, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_13);
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1210, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
        __pyx_v_c = __pyx_t_5;

        /* "_cotton2k/simulation.pyx":1211
 *                         smax = self.cultivar_parameters[4]
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age > 70:             # <<<<<<<<<<<<<<
 *                         rate = 0
 *                     else:
 */
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1211, __pyx_L1_error)
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1211, __pyx_L1_error)
        __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1211, __pyx_L1_error)
        __pyx_t_4 = ((((((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).nodes[0]).leaf.age > 70.0) != 0);
        if (__pyx_t_4) {

          /* "_cotton2k/simulation.pyx":1212
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age > 70:
 *                         rate = 0             # <<<<<<<<<<<<<<
 *                     else:
 *                         rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, (p - 1))
 */
          __pyx_v_rate = 0.0;

          /* "_cotton2k/simulation.pyx":1211
 *                         smax = self.cultivar_parameters[4]
 *                     c = vpotlf[10] + lp1 * vpotlf[11]
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age > 70:             # <<<<<<<<<<<<<<
 *                         rate = 0
 *                     else:
 */
          goto __pyx_L16;
        }

        /* "_cotton2k/simulation.pyx":1214
 *                         rate = 0
 *                     else:
 *                         rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, (p - 1))             # <<<<<<<<<<<<<<
 *                     # Add leaf and petiole weight potential growth to SPDWL and SPDWP.
 *                     if rate >= 1e-12:
 */
        /*else*/ {
          __pyx_t_13 = PyFloat_FromDouble((-__pyx_v_c)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_7 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).nodes[0]).leaf.age); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_12 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_11 = __Pyx_PyNumber_Power2(__pyx_t_7, __pyx_t_12); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyNumber_Multiply(__pyx_t_13, __pyx_t_11); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_12 = PyFloat_FromDouble((((__pyx_v_smax * __pyx_v_c) * __pyx_v_p) * exp(__pyx_t_5))); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __pyx_t_11 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).nodes[0]).leaf.age); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_13 = PyFloat_FromDouble((__pyx_v_p - 1.0)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_7 = __Pyx_PyNumber_Power2(__pyx_t_11, __pyx_t_13); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyNumber_Multiply(__pyx_t_12, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1214, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_rate = __pyx_t_5;
        }
        __pyx_L16:;

        /* "_cotton2k/simulation.pyx":1216
 *                         rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, (p - 1))
 *                     # Add leaf and petiole weight potential growth to SPDWL and SPDWP.
 *                     if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio
 */
        __pyx_t_4 = ((__pyx_v_rate >= 1e-12) != 0);
        if (__pyx_t_4) {

          /* "_cotton2k/simulation.pyx":1217
 *                     # Add leaf and petiole weight potential growth to SPDWL and SPDWP.
 *                     if rate >= 1e-12:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 */
          __pyx_t_13 = PyFloat_FromDouble((__pyx_v_rate * __pyx_v_wstrlf)); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_GetModuleGlobalName(__pyx_t_12, __pyx_n_s_temperature_on_leaf_growth_rate); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
          __pyx_t_11 = PyFloat_FromDouble((__pyx_v_self->_sim.states[__pyx_t_17]).average_temperature); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_18 = NULL;
          __pyx_t_14 = 0;
          if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_12))) {
            __pyx_t_18 = PyMethod_GET_SELF(__pyx_t_12);
            if (likely(__pyx_t_18)) {
              PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_12);
              __Pyx_INCREF(__pyx_t_18);
              __Pyx_INCREF(function);
              __Pyx_DECREF_SET(__pyx_t_12, function);
              __pyx_t_14 = 1;
            }
          }
          {
            PyObject *__pyx_callargs[2] = {__pyx_t_18, __pyx_t_11};
            __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_12, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
            __Pyx_XDECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1217, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          }
          __pyx_t_12 = PyNumber_Multiply(__pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1217, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_12);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_12); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1217, __pyx_L1_error)
          (((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).main_stem_leaf.potential_growth_for_leaf_area = __pyx_t_5;

          /* "_cotton2k/simulation.pyx":1218
 *                     if rate >= 1e-12:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                         PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight
 */
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1218, __pyx_L1_error)
          (((__pyx_v_self->_sim.states[__pyx_t_20]).vegetative_branches[__pyx_t_21]).fruiting_branches[__pyx_t_22]).main_stem_leaf.potential_growth_for_leaf_weight = ((((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).main_stem_leaf.potential_growth_for_leaf_area * (__pyx_v_self->_sim.states[__pyx_t_19]).leaf_weight_area_ratio);

          /* "_cotton2k/simulation.pyx":1219
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]             # <<<<<<<<<<<<<<
 *                         PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight
 *                         PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight
 */
          __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1219, __pyx_L1_error)
          (((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).main_stem_leaf.potential_growth_for_petiole_weight = (((((__pyx_v_self->_sim.states[__pyx_t_22]).vegetative_branches[__pyx_t_21]).fruiting_branches[__pyx_t_20]).main_stem_leaf.potential_growth_for_leaf_area * (__pyx_v_self->_sim.states[__pyx_t_19]).leaf_weight_area_ratio) * (__pyx_v_vpotlf[13]));

          /* "_cotton2k/simulation.pyx":1220
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                         PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight             # <<<<<<<<<<<<<<
 *                         PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight
 *                 # Assign smax value of this main stem leaf to smaxx, c to cc.
 */
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L1_error)
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1220, __pyx_L1_error)
          PotGroAllLeaves = (PotGroAllLeaves + (((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).main_stem_leaf.potential_growth_for_leaf_weight);

          /* "_cotton2k/simulation.pyx":1221
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                         PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight
 *                         PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_petiole_weight             # <<<<<<<<<<<<<<
 *                 # Assign smax value of this main stem leaf to smaxx, c to cc.
 *                 # Loop over the nodes of this fruiting branch.
 */
          __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1221, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1221, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1221, __pyx_L1_error)
          PotGroAllPetioles = (PotGroAllPetioles + (((__pyx_v_self->_sim.states[__pyx_t_17]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_9]).main_stem_leaf.potential_growth_for_petiole_weight);

          /* "_cotton2k/simulation.pyx":1216
 *                         rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[0].leaf.age, (p - 1))
 *                     # Add leaf and petiole weight potential growth to SPDWL and SPDWP.
 *                     if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_weight = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].main_stem_leaf.potential_growth_for_leaf_area * self._sim.states[u].leaf_weight_area_ratio
 */
        }
      }
      __pyx_L14:;

      /* "_cotton2k/simulation.pyx":1224
 *                 # Assign smax value of this main stem leaf to smaxx, c to cc.
 *                 # Loop over the nodes of this fruiting branch.
 *                 smaxx = smax  # value of smax for the corresponding main stem leaf.             # <<<<<<<<<<<<<<
 *                 cc = c  # value of c for the corresponding main stem leaf.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 */
      __pyx_v_smaxx = __pyx_v_smax;

      /* "_cotton2k/simulation.pyx":1225
 *                 # Loop over the nodes of this fruiting branch.
 *                 smaxx = smax  # value of smax for the corresponding main stem leaf.
 *                 cc = c  # value of c for the corresponding main stem leaf.             # <<<<<<<<<<<<<<
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:
 */
      __pyx_v_cc = __pyx_v_c;

      /* "_cotton2k/simulation.pyx":1226
 *                 smaxx = smax  # value of smax for the corresponding main stem leaf.
 *                 cc = c  # value of c for the corresponding main stem leaf.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):             # <<<<<<<<<<<<<<
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0
 */
      __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error)
      __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error)
      __pyx_t_17 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_17 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1226, __pyx_L1_error)
      __pyx_t_12 = __Pyx_PyInt_From_unsigned_int((((__pyx_v_self->_sim.states[__pyx_t_9]).vegetative_branches[__pyx_t_15]).fruiting_branches[__pyx_t_17]).number_of_fruiting_nodes); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_7 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_12); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (likely(PyList_CheckExact(__pyx_t_7)) || PyTuple_CheckExact(__pyx_t_7)) {
        __pyx_t_12 = __pyx_t_7; __Pyx_INCREF(__pyx_t_12); __pyx_t_17 = 0;
        __pyx_t_23 = NULL;
      } else {
        __pyx_t_17 = -1; __pyx_t_12 = PyObject_GetIter(__pyx_t_7); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1226, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_12); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1226, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      for (;;) {
        if (likely(!__pyx_t_23)) {
          if (likely(PyList_CheckExact(__pyx_t_12))) {
            if (__pyx_t_17 >= PyList_GET_SIZE(__pyx_t_12)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyList_GET_ITEM(__pyx_t_12, __pyx_t_17); __Pyx_INCREF(__pyx_t_7); __pyx_t_17++; if (unlikely((0 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          } else {
            if (__pyx_t_17 >= PyTuple_GET_SIZE(__pyx_t_12)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_12, __pyx_t_17); __Pyx_INCREF(__pyx_t_7); __pyx_t_17++; if (unlikely((0 < 0))) __PYX_ERR(0, 1226, __pyx_L1_error)
            #else
            __pyx_t_7 = PySequence_ITEM(__pyx_t_12, __pyx_t_17); __pyx_t_17++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1226, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            #endif
          }
        } else {
          __pyx_t_7 = __pyx_t_23(__pyx_t_12);
          if (unlikely(!__pyx_t_7)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1226, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_7);
        }
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_7);
        __pyx_t_7 = 0;

        /* "_cotton2k/simulation.pyx":1227
 *                 cc = c  # value of c for the corresponding main stem leaf.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = 0
 */
        __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
        __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
        __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
        __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1227, __pyx_L1_error)
        __pyx_t_4 = ((((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[__pyx_t_9]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_20]).leaf.area <= 0.0) != 0);
        if (__pyx_t_4) {

          /* "_cotton2k/simulation.pyx":1228
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = 0
 *                     # Compute potential growth of leaf area and leaf weight for leaf on fruiting branch node (k,l,m).
 */
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1228, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_20]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_9]).nodes[__pyx_t_15]).leaf.potential_growth = 0.0;

          /* "_cotton2k/simulation.pyx":1229
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = 0             # <<<<<<<<<<<<<<
 *                     # Compute potential growth of leaf area and leaf weight for leaf on fruiting branch node (k,l,m).
 *                     # Add leaf and petiole weight potential growth to spdwl and spdwp.
 */
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1229, __pyx_L1_error)
          ((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[__pyx_t_9]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_20]).petiole.potential_growth = 0.0;

          /* "_cotton2k/simulation.pyx":1227
 *                 cc = c  # value of c for the corresponding main stem leaf.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:             # <<<<<<<<<<<<<<
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = 0
 */
          goto __pyx_L20;
        }

        /* "_cotton2k/simulation.pyx":1233
 *                     # Add leaf and petiole weight potential growth to spdwl and spdwp.
 *                     else:
 *                         mp1 = m + 1             # <<<<<<<<<<<<<<
 *                         # smax and c are reduced as a function of node number on this fruiting branch.
 *                         smax = smaxx * (1 - self.cultivar_parameters[8] * mp1)
 */
        /*else*/ {
          __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_v_m, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1233, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_XDECREF_SET(__pyx_v_mp1, __pyx_t_7);
          __pyx_t_7 = 0;

          /* "_cotton2k/simulation.pyx":1235
 *                         mp1 = m + 1
 *                         # smax and c are reduced as a function of node number on this fruiting branch.
 *                         smax = smaxx * (1 - self.cultivar_parameters[8] * mp1)             # <<<<<<<<<<<<<<
 *                         c = cc * (1 - self.cultivar_parameters[8] * mp1)
 *                         # Compute potential growth for the leaves on fruiting branches.
 */
          __pyx_t_7 = PyFloat_FromDouble(__pyx_v_smaxx); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __pyx_t_13 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_11 = __Pyx_GetItemInt(__pyx_t_13, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_v_mp1); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_13, 1, 0, 0); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_t_13 = PyNumber_Multiply(__pyx_t_7, __pyx_t_11); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1235, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __pyx_v_smax = __pyx_t_5;

          /* "_cotton2k/simulation.pyx":1236
 *                         # smax and c are reduced as a function of node number on this fruiting branch.
 *                         smax = smaxx * (1 - self.cultivar_parameters[8] * mp1)
 *                         c = cc * (1 - self.cultivar_parameters[8] * mp1)             # <<<<<<<<<<<<<<
 *                         # Compute potential growth for the leaves on fruiting branches.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age > 70:
 */
          __pyx_t_13 = PyFloat_FromDouble(__pyx_v_cc); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_13);
          __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_11, 8, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = PyNumber_Multiply(__pyx_t_7, __pyx_v_mp1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_7 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_11, 1, 0, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_7);
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_t_11 = PyNumber_Multiply(__pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_11);
          __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
          __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
          __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1236, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
          __pyx_v_c = __pyx_t_5;

          /* "_cotton2k/simulation.pyx":1238
 *                         c = cc * (1 - self.cultivar_parameters[8] * mp1)
 *                         # Compute potential growth for the leaves on fruiting branches.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age > 70:             # <<<<<<<<<<<<<<
 *                             rate = 0
 *                         else:
 */
          __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L1_error)
          __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L1_error)
          __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L1_error)
          __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1238, __pyx_L1_error)
          __pyx_t_4 = ((((((__pyx_v_self->_sim.states[__pyx_t_20]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_9]).nodes[__pyx_t_15]).leaf.age > 70.0) != 0);
          if (__pyx_t_4) {

            /* "_cotton2k/simulation.pyx":1239
 *                         # Compute potential growth for the leaves on fruiting branches.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age > 70:
 *                             rate = 0             # <<<<<<<<<<<<<<
 *                         else:
 *                             rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, (p - 1))
 */
            __pyx_v_rate = 0.0;

            /* "_cotton2k/simulation.pyx":1238
 *                         c = cc * (1 - self.cultivar_parameters[8] * mp1)
 *                         # Compute potential growth for the leaves on fruiting branches.
 *                         if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age > 70:             # <<<<<<<<<<<<<<
 *                             rate = 0
 *                         else:
 */
            goto __pyx_L21;
          }

          /* "_cotton2k/simulation.pyx":1241
 *                             rate = 0
 *                         else:
 *                             rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, (p - 1))             # <<<<<<<<<<<<<<
 *                         if rate >= 1e-12:
 *                             # Growth rate is modified by water stress. Potential growth is computed as a function of average temperature.
 */
          /*else*/ {
            __pyx_t_11 = PyFloat_FromDouble((-__pyx_v_c)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_7 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[__pyx_t_9]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_20]).leaf.age); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __pyx_t_13 = PyFloat_FromDouble(__pyx_v_p); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_18 = __Pyx_PyNumber_Power2(__pyx_t_7, __pyx_t_13); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_t_18); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_13 = PyFloat_FromDouble((((__pyx_v_smax * __pyx_v_c) * __pyx_v_p) * exp(__pyx_t_5))); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __pyx_t_18 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_20]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_9]).nodes[__pyx_t_15]).leaf.age); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_11 = PyFloat_FromDouble((__pyx_v_p - 1.0)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __pyx_t_7 = __Pyx_PyNumber_Power2(__pyx_t_18, __pyx_t_11); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_7);
            __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_t_11 = PyNumber_Multiply(__pyx_t_13, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_11); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1241, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __pyx_v_rate = __pyx_t_5;
          }
          __pyx_L21:;

          /* "_cotton2k/simulation.pyx":1242
 *                         else:
 *                             rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, (p - 1))
 *                         if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                             # Growth rate is modified by water stress. Potential growth is computed as a function of average temperature.
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 */
          __pyx_t_4 = ((__pyx_v_rate >= 1e-12) != 0);
          if (__pyx_t_4) {

            /* "_cotton2k/simulation.pyx":1244
 *                         if rate >= 1e-12:
 *                             # Growth rate is modified by water stress. Potential growth is computed as a function of average temperature.
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)             # <<<<<<<<<<<<<<
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                             PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio
 */
            __pyx_t_11 = PyFloat_FromDouble((__pyx_v_rate * __pyx_v_wstrlf)); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1244, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_11);
            __Pyx_GetModuleGlobalName(__pyx_t_13, __pyx_n_s_temperature_on_leaf_growth_rate); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            __pyx_t_18 = PyFloat_FromDouble((__pyx_v_self->_sim.states[__pyx_t_15]).average_temperature); if (unlikely(!__pyx_t_18)) __PYX_ERR(0, 1244, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_18);
            __pyx_t_24 = NULL;
            __pyx_t_14 = 0;
            if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_13))) {
              __pyx_t_24 = PyMethod_GET_SELF(__pyx_t_13);
              if (likely(__pyx_t_24)) {
                PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_13);
                __Pyx_INCREF(__pyx_t_24);
                __Pyx_INCREF(function);
                __Pyx_DECREF_SET(__pyx_t_13, function);
                __pyx_t_14 = 1;
              }
            }
            {
              PyObject *__pyx_callargs[2] = {__pyx_t_24, __pyx_t_18};
              __pyx_t_7 = __Pyx_PyObject_FastCall(__pyx_t_13, __pyx_callargs+1-__pyx_t_14, 1+__pyx_t_14);
              __Pyx_XDECREF(__pyx_t_24); __pyx_t_24 = 0;
              __Pyx_DECREF(__pyx_t_18); __pyx_t_18 = 0;
              if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1244, __pyx_L1_error)
              __Pyx_GOTREF(__pyx_t_7);
              __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            }
            __pyx_t_13 = PyNumber_Multiply(__pyx_t_11, __pyx_t_7); if (unlikely(!__pyx_t_13)) __PYX_ERR(0, 1244, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_13);
            __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
            __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
            __pyx_t_5 = __pyx_PyFloat_AsDouble(__pyx_t_13); if (unlikely((__pyx_t_5 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_13); __pyx_t_13 = 0;
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1244, __pyx_L1_error)
            ((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[__pyx_t_9]).fruiting_branches[__pyx_t_19]).nodes[__pyx_t_20]).leaf.potential_growth = __pyx_t_5;

            /* "_cotton2k/simulation.pyx":1245
 *                             # Growth rate is modified by water stress. Potential growth is computed as a function of average temperature.
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]             # <<<<<<<<<<<<<<
 *                             PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 */
            __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_26 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_26 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1245, __pyx_L1_error)
            ((((__pyx_v_self->_sim.states[__pyx_t_22]).vegetative_branches[__pyx_t_25]).fruiting_branches[__pyx_t_26]).nodes[__pyx_t_27]).petiole.potential_growth = ((((((__pyx_v_self->_sim.states[__pyx_t_20]).vegetative_branches[__pyx_t_19]).fruiting_branches[__pyx_t_9]).nodes[__pyx_t_15]).leaf.potential_growth * (__pyx_v_self->_sim.states[__pyx_t_21]).leaf_weight_area_ratio) * (__pyx_v_vpotlf[13]));

            /* "_cotton2k/simulation.pyx":1246
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                             PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 * 
 */
            __pyx_t_27 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_27 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
            __pyx_t_26 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_26 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
            __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
            __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
            __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1246, __pyx_L1_error)
            PotGroAllLeaves = (PotGroAllLeaves + (((((__pyx_v_self->_sim.states[__pyx_t_27]).vegetative_branches[__pyx_t_26]).fruiting_branches[__pyx_t_25]).nodes[__pyx_t_22]).leaf.potential_growth * (__pyx_v_self->_sim.states[__pyx_t_21]).leaf_weight_area_ratio));

            /* "_cotton2k/simulation.pyx":1247
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth = self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio * vpotlf[13]
 *                             PotGroAllLeaves += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth * self._sim.states[u].leaf_weight_area_ratio
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth             # <<<<<<<<<<<<<<
 * 
 *     def _growth(self, u):
 */
            __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L1_error)
            __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L1_error)
            __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L1_error)
            __pyx_t_26 = __Pyx_PyIndex_AsSsize_t(__pyx_v_m); if (unlikely((__pyx_t_26 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1247, __pyx_L1_error)
            PotGroAllPetioles = (PotGroAllPetioles + ((((__pyx_v_self->_sim.states[__pyx_t_21]).vegetative_branches[__pyx_t_22]).fruiting_branches[__pyx_t_25]).nodes[__pyx_t_26]).petiole.potential_growth);

            /* "_cotton2k/simulation.pyx":1242
 *                         else:
 *                             rate = smax * c * p * exp(-c * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, p)) * pow(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.age, (p - 1))
 *                         if rate >= 1e-12:             # <<<<<<<<<<<<<<
 *                             # Growth rate is modified by water stress. Potential growth is computed as a function of average temperature.
 *                             self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = rate * wstrlf * temperature_on_leaf_growth_rate(self._sim.states[u].average_temperature)
 */
          }
        }
        __pyx_L20:;

        /* "_cotton2k/simulation.pyx":1226
 *                 smaxx = smax  # value of smax for the corresponding main stem leaf.
 *                 cc = c  # value of c for the corresponding main stem leaf.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):             # <<<<<<<<<<<<<<
 *                     if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.area <= 0:
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].leaf.potential_growth = 0
 */
      }
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;

      /* "_cotton2k/simulation.pyx":1196
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):             # <<<<<<<<<<<<<<
 *                 # smax and c are  functions of fruiting branch number.
 *                 # smax is modified by plant density, using the density factor denfac.
 */
    }
    __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;

    /* "_cotton2k/simulation.pyx":1195
 *         # denfac is the effect of plant density on leaf growth rate.
 *         cdef double denfac = 1 - vpotlf[12] * (1 - self._sim.density_factor)
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):             # <<<<<<<<<<<<<<
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 *                 # smax and c are  functions of fruiting branch number.
 */
  }
  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;

  /* "_cotton2k/simulation.pyx":1137
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0
 * 
 *     def _potential_leaf_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of leaves of cotton plants. It is called from self._growth(). It calls function temperature_on_leaf_growth_rate().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_13);
  __Pyx_XDECREF(__pyx_t_18);
  __Pyx_XDECREF(__pyx_t_24);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._potential_leaf_growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_j);
  __Pyx_XDECREF(__pyx_v_jp1);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_lp1);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XDECREF(__pyx_v_mp1);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1249
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 * 
 *     def _growth(self, u):             # <<<<<<<<<<<<<<
 *         global PotGroStem, PotGroAllRoots, TotalPetioleWeight
 *         # Call self._potential_leaf_growth(u) to compute potential growth rate of leaves.
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_27_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_27_growth = {"_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_27_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_27_growth(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_growth (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1249, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_growth") < 0)) __PYX_ERR(0, 1249, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_growth", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1249, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_26_growth(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_26_growth(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  int __pyx_v_voldstm;
  int __pyx_v_kkday;
  double __pyx_v_stemnew;
  double __pyx_v_maxstmgr;
  double __pyx_v_sumpdr;
  double __pyx_v_maxrtgr;
  double __pyx_v_cdstem;
  double __pyx_v_cdleaf;
  double __pyx_v_cdpet;
  double __pyx_v_cdroot;
  double __pyx_v_cotylwt;
  double __pyx_v_htdenf;
  double __pyx_v_z1;
  double __pyx_v_denf2;
  int __pyx_v_l;
  int __pyx_v_l1;
  int __pyx_v_l2;
  double __pyx_v_agetop;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  int __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  double __pyx_t_8;
  double __pyx_t_9;
  double __pyx_t_10;
  double __pyx_t_11;
  double __pyx_t_12;
  double __pyx_t_13;
  double __pyx_t_14;
  Py_ssize_t __pyx_t_15;
  Py_ssize_t __pyx_t_16;
  int __pyx_t_17;
  Py_ssize_t __pyx_t_18;
  Py_ssize_t __pyx_t_19;
  Py_ssize_t __pyx_t_20;
  Py_ssize_t __pyx_t_21;
  Py_ssize_t __pyx_t_22;
  Py_ssize_t __pyx_t_23;
  Py_ssize_t __pyx_t_24;
  double __pyx_t_25;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_growth", 0);

  /* "_cotton2k/simulation.pyx":1252
 *         global PotGroStem, PotGroAllRoots, TotalPetioleWeight
 *         # Call self._potential_leaf_growth(u) to compute potential growth rate of leaves.
 *         self._potential_leaf_growth(u)             # <<<<<<<<<<<<<<
 *         # If it is after first square, call self._potential_fruit_growth(u) to compute potential growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_potential_leaf_growth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1252, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_u};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1252, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1254
 *         self._potential_leaf_growth(u)
 *         # If it is after first square, call self._potential_fruit_growth(u) to compute potential growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:             # <<<<<<<<<<<<<<
 *             self._potential_fruit_growth(u)
 *         # Active stem tissue(stemnew) is the difference between state.stem_weight and the value of StemWeight(kkday).
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1254, __pyx_L1_error)
  __pyx_t_6 = ((((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[0]).fruiting_branches[0]).nodes[0]).stage != NotYetFormed) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1255
 *         # If it is after first square, call self._potential_fruit_growth(u) to compute potential growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:
 *             self._potential_fruit_growth(u)             # <<<<<<<<<<<<<<
 *         # Active stem tissue(stemnew) is the difference between state.stem_weight and the value of StemWeight(kkday).
 *         cdef int voldstm = 32  # constant parameter(days for stem tissue to become "old")
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_potential_fruit_growth); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1255, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_3 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
      __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
      if (likely(__pyx_t_3)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
        __Pyx_INCREF(__pyx_t_3);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_2, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1255, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1254
 *         self._potential_leaf_growth(u)
 *         # If it is after first square, call self._potential_fruit_growth(u) to compute potential growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:             # <<<<<<<<<<<<<<
 *             self._potential_fruit_growth(u)
 *         # Active stem tissue(stemnew) is the difference between state.stem_weight and the value of StemWeight(kkday).
 */
  }

  /* "_cotton2k/simulation.pyx":1257
 *             self._potential_fruit_growth(u)
 *         # Active stem tissue(stemnew) is the difference between state.stem_weight and the value of StemWeight(kkday).
 *         cdef int voldstm = 32  # constant parameter(days for stem tissue to become "old")             # <<<<<<<<<<<<<<
 *         cdef int kkday = self._sim.states[u].kday - voldstm  # age of young stem tissue
 *         if kkday < 1:
 */
  __pyx_v_voldstm = 32;

  /* "_cotton2k/simulation.pyx":1258
 *         # Active stem tissue(stemnew) is the difference between state.stem_weight and the value of StemWeight(kkday).
 *         cdef int voldstm = 32  # constant parameter(days for stem tissue to become "old")
 *         cdef int kkday = self._sim.states[u].kday - voldstm  # age of young stem tissue             # <<<<<<<<<<<<<<
 *         if kkday < 1:
 *             kkday = 1
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1258, __pyx_L1_error)
  __pyx_v_kkday = ((__pyx_v_self->_sim.states[__pyx_t_5]).kday - __pyx_v_voldstm);

  /* "_cotton2k/simulation.pyx":1259
 *         cdef int voldstm = 32  # constant parameter(days for stem tissue to become "old")
 *         cdef int kkday = self._sim.states[u].kday - voldstm  # age of young stem tissue
 *         if kkday < 1:             # <<<<<<<<<<<<<<
 *             kkday = 1
 *         cdef double stemnew = self._sim.states[u].stem_weight - StemWeight[kkday]  # dry weight of active stem tissue.
 */
  __pyx_t_6 = ((__pyx_v_kkday < 1) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1260
 *         cdef int kkday = self._sim.states[u].kday - voldstm  # age of young stem tissue
 *         if kkday < 1:
 *             kkday = 1             # <<<<<<<<<<<<<<
 *         cdef double stemnew = self._sim.states[u].stem_weight - StemWeight[kkday]  # dry weight of active stem tissue.
 *         # Call PotentialStemGrowth() to compute PotGroStem, potential growth rate of stems.
 */
    __pyx_v_kkday = 1;

    /* "_cotton2k/simulation.pyx":1259
 *         cdef int voldstm = 32  # constant parameter(days for stem tissue to become "old")
 *         cdef int kkday = self._sim.states[u].kday - voldstm  # age of young stem tissue
 *         if kkday < 1:             # <<<<<<<<<<<<<<
 *             kkday = 1
 *         cdef double stemnew = self._sim.states[u].stem_weight - StemWeight[kkday]  # dry weight of active stem tissue.
 */
  }

  /* "_cotton2k/simulation.pyx":1261
 *         if kkday < 1:
 *             kkday = 1
 *         cdef double stemnew = self._sim.states[u].stem_weight - StemWeight[kkday]  # dry weight of active stem tissue.             # <<<<<<<<<<<<<<
 *         # Call PotentialStemGrowth() to compute PotGroStem, potential growth rate of stems.
 *         # The effect of temperature is introduced, by multiplying potential growth rate by DayInc.
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1261, __pyx_L1_error)
  __pyx_v_stemnew = ((__pyx_v_self->_sim.states[__pyx_t_5]).stem_weight - (StemWeight[__pyx_v_kkday]));

  /* "_cotton2k/simulation.pyx":1265
 *         # The effect of temperature is introduced, by multiplying potential growth rate by DayInc.
 *         # Stem growth is also affected by water stress(WaterStressStem).PotGroStem is limited by (maxstmgr * per_plant_area) g per plant per day.
 *         PotGroStem = PotentialStemGrowth(stemnew, self._sim.states[u].kday,             # <<<<<<<<<<<<<<
 *                                      self._sim.states[u].vegetative_branches[0].fruiting_branches[2].nodes[0].stage, self._sim.density_factor,
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1265, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1266
 *         # Stem growth is also affected by water stress(WaterStressStem).PotGroStem is limited by (maxstmgr * per_plant_area) g per plant per day.
 *         PotGroStem = PotentialStemGrowth(stemnew, self._sim.states[u].kday,
 *                                      self._sim.states[u].vegetative_branches[0].fruiting_branches[2].nodes[0].stage, self._sim.density_factor,             # <<<<<<<<<<<<<<
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1266, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1267
 *         PotGroStem = PotentialStemGrowth(stemnew, self._sim.states[u].kday,
 *                                      self._sim.states[u].vegetative_branches[0].fruiting_branches[2].nodes[0].stage, self._sim.density_factor,
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],             # <<<<<<<<<<<<<<
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 12, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 13, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 14, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1267, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":1268
 *                                      self._sim.states[u].vegetative_branches[0].fruiting_branches[2].nodes[0].stage, self._sim.density_factor,
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],             # <<<<<<<<<<<<<<
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 15, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 16, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_2, 17, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1268, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1269
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem             # <<<<<<<<<<<<<<
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 18, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":1265
 *         # The effect of temperature is introduced, by multiplying potential growth rate by DayInc.
 *         # Stem growth is also affected by water stress(WaterStressStem).PotGroStem is limited by (maxstmgr * per_plant_area) g per plant per day.
 *         PotGroStem = PotentialStemGrowth(stemnew, self._sim.states[u].kday,             # <<<<<<<<<<<<<<
 *                                      self._sim.states[u].vegetative_branches[0].fruiting_branches[2].nodes[0].stage, self._sim.density_factor,
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1269
 *                                      self.cultivar_parameters[12], self.cultivar_parameters[13], self.cultivar_parameters[14],
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem             # <<<<<<<<<<<<<<
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1269, __pyx_L1_error)
  PotGroStem = ((PotentialStemGrowth(__pyx_v_stemnew, (__pyx_v_self->_sim.states[__pyx_t_5]).kday, ((((__pyx_v_self->_sim.states[__pyx_t_7]).vegetative_branches[0]).fruiting_branches[2]).nodes[0]).stage, __pyx_v_self->_sim.density_factor, __pyx_t_8, __pyx_t_9, __pyx_t_10, __pyx_t_11, __pyx_t_12, __pyx_t_13, __pyx_t_14) * (__pyx_v_self->_sim.states[__pyx_t_15]).day_inc) * (__pyx_v_self->_sim.states[__pyx_t_16]).water_stress_stem);

  /* "_cotton2k/simulation.pyx":1270
 *                                      self.cultivar_parameters[15], self.cultivar_parameters[16], self.cultivar_parameters[17],
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.             # <<<<<<<<<<<<<<
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:
 *             PotGroStem = maxstmgr * self._sim.per_plant_area
 */
  __pyx_v_maxstmgr = 0.067;

  /* "_cotton2k/simulation.pyx":1271
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:             # <<<<<<<<<<<<<<
 *             PotGroStem = maxstmgr * self._sim.per_plant_area
 *         # Call PotentialRootGrowth() to compute potential growth rate on roots.
 */
  __pyx_t_6 = ((PotGroStem > (__pyx_v_maxstmgr * __pyx_v_self->_sim.per_plant_area)) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1272
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:
 *             PotGroStem = maxstmgr * self._sim.per_plant_area             # <<<<<<<<<<<<<<
 *         # Call PotentialRootGrowth() to compute potential growth rate on roots.
 *         cdef double sumpdr  # total potential growth rate of roots in g per slab.this is computed in PotentialRootGrowth() and used in ActualRootGrowth().
 */
    PotGroStem = (__pyx_v_maxstmgr * __pyx_v_self->_sim.per_plant_area);

    /* "_cotton2k/simulation.pyx":1271
 *                                      self.cultivar_parameters[18]) * self._sim.states[u].day_inc * self._sim.states[u].water_stress_stem
 *         cdef double maxstmgr = 0.067  # maximum posible potential stem growth, g dm - 2 day - 1.
 *         if PotGroStem > maxstmgr * self._sim.per_plant_area:             # <<<<<<<<<<<<<<
 *             PotGroStem = maxstmgr * self._sim.per_plant_area
 *         # Call PotentialRootGrowth() to compute potential growth rate on roots.
 */
  }

  /* "_cotton2k/simulation.pyx":1275
 *         # Call PotentialRootGrowth() to compute potential growth rate on roots.
 *         cdef double sumpdr  # total potential growth rate of roots in g per slab.this is computed in PotentialRootGrowth() and used in ActualRootGrowth().
 *         sumpdr = PotentialRootGrowth(self._sim.states[u].soil.cells, 3, self._sim.states[u].soil.number_of_layers_with_root,             # <<<<<<<<<<<<<<
 *                                  self._sim.per_plant_area)
 *         # Total potential growth rate of roots is converted from g per slab(sumpdr) to g per plant(PotGroAllRoots).
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L1_error)
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1275, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1276
 *         cdef double sumpdr  # total potential growth rate of roots in g per slab.this is computed in PotentialRootGrowth() and used in ActualRootGrowth().
 *         sumpdr = PotentialRootGrowth(self._sim.states[u].soil.cells, 3, self._sim.states[u].soil.number_of_layers_with_root,
 *                                  self._sim.per_plant_area)             # <<<<<<<<<<<<<<
 *         # Total potential growth rate of roots is converted from g per slab(sumpdr) to g per plant(PotGroAllRoots).
 *         PotGroAllRoots = sumpdr * 100 * self._sim.per_plant_area / self.row_space
 */
  __pyx_v_sumpdr = PotentialRootGrowth((__pyx_v_self->_sim.states[__pyx_t_16]).soil.cells, 3, (__pyx_v_self->_sim.states[__pyx_t_15]).soil.number_of_layers_with_root, __pyx_v_self->_sim.per_plant_area);

  /* "_cotton2k/simulation.pyx":1278
 *                                  self._sim.per_plant_area)
 *         # Total potential growth rate of roots is converted from g per slab(sumpdr) to g per plant(PotGroAllRoots).
 *         PotGroAllRoots = sumpdr * 100 * self._sim.per_plant_area / self.row_space             # <<<<<<<<<<<<<<
 *         # Limit PotGroAllRoots to(maxrtgr * per_plant_area) g per plant per day.
 *         cdef double maxrtgr = 0.045  # maximum possible potential root growth, g dm - 2 day - 1.
 */
  __pyx_t_2 = PyFloat_FromDouble(((__pyx_v_sumpdr * 100.0) * __pyx_v_self->_sim.per_plant_area)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = __Pyx_PyNumber_Divide(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1278, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  PotGroAllRoots = __pyx_t_14;

  /* "_cotton2k/simulation.pyx":1280
 *         PotGroAllRoots = sumpdr * 100 * self._sim.per_plant_area / self.row_space
 *         # Limit PotGroAllRoots to(maxrtgr * per_plant_area) g per plant per day.
 *         cdef double maxrtgr = 0.045  # maximum possible potential root growth, g dm - 2 day - 1.             # <<<<<<<<<<<<<<
 *         if PotGroAllRoots > maxrtgr * self._sim.per_plant_area:
 *             PotGroAllRoots = maxrtgr * self._sim.per_plant_area
 */
  __pyx_v_maxrtgr = 0.045;

  /* "_cotton2k/simulation.pyx":1281
 *         # Limit PotGroAllRoots to(maxrtgr * per_plant_area) g per plant per day.
 *         cdef double maxrtgr = 0.045  # maximum possible potential root growth, g dm - 2 day - 1.
 *         if PotGroAllRoots > maxrtgr * self._sim.per_plant_area:             # <<<<<<<<<<<<<<
 *             PotGroAllRoots = maxrtgr * self._sim.per_plant_area
 *         # Call DryMatterBalance() to compute carbon balance, allocation of carbon to plant parts, and carbon stress.DryMatterBalance() also computes and returns the values of the following arguments:
 */
  __pyx_t_6 = ((PotGroAllRoots > (__pyx_v_maxrtgr * __pyx_v_self->_sim.per_plant_area)) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1282
 *         cdef double maxrtgr = 0.045  # maximum possible potential root growth, g dm - 2 day - 1.
 *         if PotGroAllRoots > maxrtgr * self._sim.per_plant_area:
 *             PotGroAllRoots = maxrtgr * self._sim.per_plant_area             # <<<<<<<<<<<<<<
 *         # Call DryMatterBalance() to compute carbon balance, allocation of carbon to plant parts, and carbon stress.DryMatterBalance() also computes and returns the values of the following arguments:
 *         # cdleaf is carbohydrate requirement for leaf growth, g per plant per day.
 */
    PotGroAllRoots = (__pyx_v_maxrtgr * __pyx_v_self->_sim.per_plant_area);

    /* "_cotton2k/simulation.pyx":1281
 *         # Limit PotGroAllRoots to(maxrtgr * per_plant_area) g per plant per day.
 *         cdef double maxrtgr = 0.045  # maximum possible potential root growth, g dm - 2 day - 1.
 *         if PotGroAllRoots > maxrtgr * self._sim.per_plant_area:             # <<<<<<<<<<<<<<
 *             PotGroAllRoots = maxrtgr * self._sim.per_plant_area
 *         # Call DryMatterBalance() to compute carbon balance, allocation of carbon to plant parts, and carbon stress.DryMatterBalance() also computes and returns the values of the following arguments:
 */
  }

  /* "_cotton2k/simulation.pyx":1289
 *         # cdstem is carbohydrate requirement for stem growth, g per plant per day.
 *         cdef double cdstem, cdleaf, cdpet, cdroot
 *         DryMatterBalance(self._sim.states[u], cdstem, cdleaf, cdpet, cdroot, self._sim.per_plant_area)             # <<<<<<<<<<<<<<
 *         # If it is after first square, call ActualFruitGrowth() to compute actual
 *         # growth rate of squares and bolls.
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1289, __pyx_L1_error)
  DryMatterBalance((__pyx_v_self->_sim.states[__pyx_t_15]), __pyx_v_cdstem, __pyx_v_cdleaf, __pyx_v_cdpet, __pyx_v_cdroot, __pyx_v_self->_sim.per_plant_area);

  /* "_cotton2k/simulation.pyx":1292
 *         # If it is after first square, call ActualFruitGrowth() to compute actual
 *         # growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:             # <<<<<<<<<<<<<<
 *             ActualFruitGrowth(self._sim.states[u])
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1292, __pyx_L1_error)
  __pyx_t_6 = ((((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[0]).fruiting_branches[0]).nodes[0]).stage != NotYetFormed) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1293
 *         # growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:
 *             ActualFruitGrowth(self._sim.states[u])             # <<<<<<<<<<<<<<
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 *         if self._sim.first_square > 0:
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1293, __pyx_L1_error)
    ActualFruitGrowth((__pyx_v_self->_sim.states[__pyx_t_15]));

    /* "_cotton2k/simulation.pyx":1292
 *         # If it is after first square, call ActualFruitGrowth() to compute actual
 *         # growth rate of squares and bolls.
 *         if self._sim.states[u].vegetative_branches[0].fruiting_branches[0].nodes[0].stage != Stage.NotYetFormed:             # <<<<<<<<<<<<<<
 *             ActualFruitGrowth(self._sim.states[u])
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 */
  }

  /* "_cotton2k/simulation.pyx":1295
 *             ActualFruitGrowth(self._sim.states[u])
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 *         if self._sim.first_square > 0:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].leaf_weight = 0
 *             self._sim.states[u].leaf_area = 0
 */
  __pyx_t_6 = ((__pyx_v_self->_sim.first_square > 0) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1296
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 *         if self._sim.first_square > 0:
 *             self._sim.states[u].leaf_weight = 0             # <<<<<<<<<<<<<<
 *             self._sim.states[u].leaf_area = 0
 *         else:
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1296, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_15]).leaf_weight = 0.0;

    /* "_cotton2k/simulation.pyx":1297
 *         if self._sim.first_square > 0:
 *             self._sim.states[u].leaf_weight = 0
 *             self._sim.states[u].leaf_area = 0             # <<<<<<<<<<<<<<
 *         else:
 *             cotylwt = 0.20  # weight of cotyledons dry matter.
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1297, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_15]).leaf_area = 0.0;

    /* "_cotton2k/simulation.pyx":1295
 *             ActualFruitGrowth(self._sim.states[u])
 *         # Initialize state.leaf_weight.It is assumed that cotyledons fall off at time of first square.Also initialize state.leaf_area and TotalPetioleWeight.
 *         if self._sim.first_square > 0:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].leaf_weight = 0
 *             self._sim.states[u].leaf_area = 0
 */
    goto __pyx_L8;
  }

  /* "_cotton2k/simulation.pyx":1299
 *             self._sim.states[u].leaf_area = 0
 *         else:
 *             cotylwt = 0.20  # weight of cotyledons dry matter.             # <<<<<<<<<<<<<<
 *             self._sim.states[u].leaf_weight = cotylwt
 *             self._sim.states[u].leaf_area = 0.6 * cotylwt
 */
  /*else*/ {
    __pyx_v_cotylwt = 0.20;

    /* "_cotton2k/simulation.pyx":1300
 *         else:
 *             cotylwt = 0.20  # weight of cotyledons dry matter.
 *             self._sim.states[u].leaf_weight = cotylwt             # <<<<<<<<<<<<<<
 *             self._sim.states[u].leaf_area = 0.6 * cotylwt
 *         TotalPetioleWeight = 0
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1300, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_15]).leaf_weight = __pyx_v_cotylwt;

    /* "_cotton2k/simulation.pyx":1301
 *             cotylwt = 0.20  # weight of cotyledons dry matter.
 *             self._sim.states[u].leaf_weight = cotylwt
 *             self._sim.states[u].leaf_area = 0.6 * cotylwt             # <<<<<<<<<<<<<<
 *         TotalPetioleWeight = 0
 *         # Call ActualLeafGrowth to compute actual growth rate of leaves and compute leaf area index.
 */
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1301, __pyx_L1_error)
    (__pyx_v_self->_sim.states[__pyx_t_15]).leaf_area = (0.6 * __pyx_v_cotylwt);
  }
  __pyx_L8:;

  /* "_cotton2k/simulation.pyx":1302
 *             self._sim.states[u].leaf_weight = cotylwt
 *             self._sim.states[u].leaf_area = 0.6 * cotylwt
 *         TotalPetioleWeight = 0             # <<<<<<<<<<<<<<
 *         # Call ActualLeafGrowth to compute actual growth rate of leaves and compute leaf area index.
 *         ActualLeafGrowth(self._sim.states[u])
 */
  TotalPetioleWeight = 0.0;

  /* "_cotton2k/simulation.pyx":1304
 *         TotalPetioleWeight = 0
 *         # Call ActualLeafGrowth to compute actual growth rate of leaves and compute leaf area index.
 *         ActualLeafGrowth(self._sim.states[u])             # <<<<<<<<<<<<<<
 *         self._sim.states[u].leaf_area_index = self._sim.states[u].leaf_area / self._sim.per_plant_area
 *         # Add ActualStemGrowth to state.stem_weight, and define StemWeight(Kday) for this day.
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1304, __pyx_L1_error)
  ActualLeafGrowth((__pyx_v_self->_sim.states[__pyx_t_15]));

  /* "_cotton2k/simulation.pyx":1305
 *         # Call ActualLeafGrowth to compute actual growth rate of leaves and compute leaf area index.
 *         ActualLeafGrowth(self._sim.states[u])
 *         self._sim.states[u].leaf_area_index = self._sim.states[u].leaf_area / self._sim.per_plant_area             # <<<<<<<<<<<<<<
 *         # Add ActualStemGrowth to state.stem_weight, and define StemWeight(Kday) for this day.
 *         self._sim.states[u].stem_weight += ActualStemGrowth
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L1_error)
  if (unlikely(__pyx_v_self->_sim.per_plant_area == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1305, __pyx_L1_error)
  }
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1305, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_16]).leaf_area_index = ((__pyx_v_self->_sim.states[__pyx_t_15]).leaf_area / __pyx_v_self->_sim.per_plant_area);

  /* "_cotton2k/simulation.pyx":1307
 *         self._sim.states[u].leaf_area_index = self._sim.states[u].leaf_area / self._sim.per_plant_area
 *         # Add ActualStemGrowth to state.stem_weight, and define StemWeight(Kday) for this day.
 *         self._sim.states[u].stem_weight += ActualStemGrowth             # <<<<<<<<<<<<<<
 *         StemWeight[self._sim.states[u].kday] = self._sim.states[u].stem_weight
 *         # Plant density affects growth in height of tall plants.
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1307, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_16]).stem_weight = ((__pyx_v_self->_sim.states[__pyx_t_16]).stem_weight + ActualStemGrowth);

  /* "_cotton2k/simulation.pyx":1308
 *         # Add ActualStemGrowth to state.stem_weight, and define StemWeight(Kday) for this day.
 *         self._sim.states[u].stem_weight += ActualStemGrowth
 *         StemWeight[self._sim.states[u].kday] = self._sim.states[u].stem_weight             # <<<<<<<<<<<<<<
 *         # Plant density affects growth in height of tall plants.
 *         cdef double htdenf = 55  # minimum plant height for plant density affecting growth in height.
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1308, __pyx_L1_error)
  __pyx_t_14 = (__pyx_v_self->_sim.states[__pyx_t_16]).stem_weight;
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1308, __pyx_L1_error)
  (StemWeight[(__pyx_v_self->_sim.states[__pyx_t_16]).kday]) = __pyx_t_14;

  /* "_cotton2k/simulation.pyx":1310
 *         StemWeight[self._sim.states[u].kday] = self._sim.states[u].stem_weight
 *         # Plant density affects growth in height of tall plants.
 *         cdef double htdenf = 55  # minimum plant height for plant density affecting growth in height.             # <<<<<<<<<<<<<<
 *         cdef double z1  # intermediate variable to compute denf2.
 *         z1 = (self._sim.states[u].plant_height - htdenf) / htdenf
 */
  __pyx_v_htdenf = 55.0;

  /* "_cotton2k/simulation.pyx":1312
 *         cdef double htdenf = 55  # minimum plant height for plant density affecting growth in height.
 *         cdef double z1  # intermediate variable to compute denf2.
 *         z1 = (self._sim.states[u].plant_height - htdenf) / htdenf             # <<<<<<<<<<<<<<
 *         if z1 < 0:
 *             z1 = 0
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1312, __pyx_L1_error)
  __pyx_t_14 = ((__pyx_v_self->_sim.states[__pyx_t_16]).plant_height - __pyx_v_htdenf);
  if (unlikely(__pyx_v_htdenf == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1312, __pyx_L1_error)
  }
  __pyx_v_z1 = (__pyx_t_14 / __pyx_v_htdenf);

  /* "_cotton2k/simulation.pyx":1313
 *         cdef double z1  # intermediate variable to compute denf2.
 *         z1 = (self._sim.states[u].plant_height - htdenf) / htdenf
 *         if z1 < 0:             # <<<<<<<<<<<<<<
 *             z1 = 0
 *         if z1 > 1:
 */
  __pyx_t_6 = ((__pyx_v_z1 < 0.0) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1314
 *         z1 = (self._sim.states[u].plant_height - htdenf) / htdenf
 *         if z1 < 0:
 *             z1 = 0             # <<<<<<<<<<<<<<
 *         if z1 > 1:
 *             z1 = 1
 */
    __pyx_v_z1 = 0.0;

    /* "_cotton2k/simulation.pyx":1313
 *         cdef double z1  # intermediate variable to compute denf2.
 *         z1 = (self._sim.states[u].plant_height - htdenf) / htdenf
 *         if z1 < 0:             # <<<<<<<<<<<<<<
 *             z1 = 0
 *         if z1 > 1:
 */
  }

  /* "_cotton2k/simulation.pyx":1315
 *         if z1 < 0:
 *             z1 = 0
 *         if z1 > 1:             # <<<<<<<<<<<<<<
 *             z1 = 1
 *         cdef double denf2  # effect of plant density on plant growth in height.
 */
  __pyx_t_6 = ((__pyx_v_z1 > 1.0) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1316
 *             z1 = 0
 *         if z1 > 1:
 *             z1 = 1             # <<<<<<<<<<<<<<
 *         cdef double denf2  # effect of plant density on plant growth in height.
 *         denf2 = 1 + z1 * (self._sim.density_factor - 1)
 */
    __pyx_v_z1 = 1.0;

    /* "_cotton2k/simulation.pyx":1315
 *         if z1 < 0:
 *             z1 = 0
 *         if z1 > 1:             # <<<<<<<<<<<<<<
 *             z1 = 1
 *         cdef double denf2  # effect of plant density on plant growth in height.
 */
  }

  /* "_cotton2k/simulation.pyx":1318
 *             z1 = 1
 *         cdef double denf2  # effect of plant density on plant growth in height.
 *         denf2 = 1 + z1 * (self._sim.density_factor - 1)             # <<<<<<<<<<<<<<
 *         # Call AddPlantHeight to compute PlantHeight.
 *         cdef int l, l1, l2  # node numbers of top three nodes.
 */
  __pyx_v_denf2 = (1.0 + (__pyx_v_z1 * (__pyx_v_self->_sim.density_factor - 1.0)));

  /* "_cotton2k/simulation.pyx":1321
 *         # Call AddPlantHeight to compute PlantHeight.
 *         cdef int l, l1, l2  # node numbers of top three nodes.
 *         l = self._sim.states[u].vegetative_branches[0].number_of_fruiting_branches - 1             # <<<<<<<<<<<<<<
 *         l1 = l - 1
 *         if l < 1:
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1321, __pyx_L1_error)
  __pyx_v_l = (((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[0]).number_of_fruiting_branches - 1);

  /* "_cotton2k/simulation.pyx":1322
 *         cdef int l, l1, l2  # node numbers of top three nodes.
 *         l = self._sim.states[u].vegetative_branches[0].number_of_fruiting_branches - 1
 *         l1 = l - 1             # <<<<<<<<<<<<<<
 *         if l < 1:
 *             l1 = 0
 */
  __pyx_v_l1 = (__pyx_v_l - 1);

  /* "_cotton2k/simulation.pyx":1323
 *         l = self._sim.states[u].vegetative_branches[0].number_of_fruiting_branches - 1
 *         l1 = l - 1
 *         if l < 1:             # <<<<<<<<<<<<<<
 *             l1 = 0
 *         l2 = l - 2
 */
  __pyx_t_6 = ((__pyx_v_l < 1) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1324
 *         l1 = l - 1
 *         if l < 1:
 *             l1 = 0             # <<<<<<<<<<<<<<
 *         l2 = l - 2
 *         if l < 2:
 */
    __pyx_v_l1 = 0;

    /* "_cotton2k/simulation.pyx":1323
 *         l = self._sim.states[u].vegetative_branches[0].number_of_fruiting_branches - 1
 *         l1 = l - 1
 *         if l < 1:             # <<<<<<<<<<<<<<
 *             l1 = 0
 *         l2 = l - 2
 */
  }

  /* "_cotton2k/simulation.pyx":1325
 *         if l < 1:
 *             l1 = 0
 *         l2 = l - 2             # <<<<<<<<<<<<<<
 *         if l < 2:
 *             l2 = 0
 */
  __pyx_v_l2 = (__pyx_v_l - 2);

  /* "_cotton2k/simulation.pyx":1326
 *             l1 = 0
 *         l2 = l - 2
 *         if l < 2:             # <<<<<<<<<<<<<<
 *             l2 = 0
 *         cdef double agetop  # average physiological age of top three nodes.
 */
  __pyx_t_6 = ((__pyx_v_l < 2) != 0);
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1327
 *         l2 = l - 2
 *         if l < 2:
 *             l2 = 0             # <<<<<<<<<<<<<<
 *         cdef double agetop  # average physiological age of top three nodes.
 *         agetop = (self._sim.states[u].vegetative_branches[0].fruiting_branches[l].nodes[0].age +
 */
    __pyx_v_l2 = 0;

    /* "_cotton2k/simulation.pyx":1326
 *             l1 = 0
 *         l2 = l - 2
 *         if l < 2:             # <<<<<<<<<<<<<<
 *             l2 = 0
 *         cdef double agetop  # average physiological age of top three nodes.
 */
  }

  /* "_cotton2k/simulation.pyx":1329
 *             l2 = 0
 *         cdef double agetop  # average physiological age of top three nodes.
 *         agetop = (self._sim.states[u].vegetative_branches[0].fruiting_branches[l].nodes[0].age +             # <<<<<<<<<<<<<<
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 */
  __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1329, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1330
 *         cdef double agetop  # average physiological age of top three nodes.
 *         agetop = (self._sim.states[u].vegetative_branches[0].fruiting_branches[l].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +             # <<<<<<<<<<<<<<
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 */
  __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1330, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1331
 *         agetop = (self._sim.states[u].vegetative_branches[0].fruiting_branches[l].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3             # <<<<<<<<<<<<<<
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1331, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1330
 *         cdef double agetop  # average physiological age of top three nodes.
 *         agetop = (self._sim.states[u].vegetative_branches[0].fruiting_branches[l].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +             # <<<<<<<<<<<<<<
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 */
  __pyx_v_agetop = (((((((__pyx_v_self->_sim.states[__pyx_t_16]).vegetative_branches[0]).fruiting_branches[__pyx_v_l]).nodes[0]).age + ((((__pyx_v_self->_sim.states[__pyx_t_15]).vegetative_branches[0]).fruiting_branches[__pyx_v_l1]).nodes[0]).age) + ((((__pyx_v_self->_sim.states[__pyx_t_7]).vegetative_branches[0]).fruiting_branches[__pyx_v_l2]).nodes[0]).age) / 3.0);

  /* "_cotton2k/simulation.pyx":1332
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 */
  __pyx_t_17 = ((__pyx_v_self->_sim.day_topping <= 0) != 0);
  if (!__pyx_t_17) {
  } else {
    __pyx_t_6 = __pyx_t_17;
    goto __pyx_L14_bool_binop_done;
  }
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1332, __pyx_L1_error)
  __pyx_t_17 = (((__pyx_v_self->_sim.states[__pyx_t_7]).daynum < __pyx_v_self->_sim.day_topping) != 0);
  __pyx_t_6 = __pyx_t_17;
  __pyx_L14_bool_binop_done:;
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1333
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L1_error)
    __pyx_t_15 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_15 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L1_error)
    __pyx_t_16 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_16 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1333, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1334
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 1],
 */
    __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1334, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1335
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[             # <<<<<<<<<<<<<<
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 1],
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1335, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1336
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 1],             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 2], agetop,
 */
    __pyx_t_19 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_19 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1336, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1337
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 1],
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[             # <<<<<<<<<<<<<<
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 2], agetop,
 *                                                  self._sim.states[u].water_stress_stem, self._sim.states[u].carbon_stress,
 */
    __pyx_t_20 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_20 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1337, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1338
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 1],
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 2], agetop,             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].water_stress_stem, self._sim.states[u].carbon_stress,
 *                                                  self._sim.states[u].nitrogen_stress_vegetative, self.cultivar_parameters[19],
 */
    __pyx_t_21 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_21 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1338, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1339
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 2], agetop,
 *                                                  self._sim.states[u].water_stress_stem, self._sim.states[u].carbon_stress,             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].nitrogen_stress_vegetative, self.cultivar_parameters[19],
 *                                                  self.cultivar_parameters[20], self.cultivar_parameters[21],
 */
    __pyx_t_22 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_22 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L1_error)
    __pyx_t_23 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_23 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1339, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1340
 *                                                      self._sim.states[u].number_of_pre_fruiting_nodes - 2], agetop,
 *                                                  self._sim.states[u].water_stress_stem, self._sim.states[u].carbon_stress,
 *                                                  self._sim.states[u].nitrogen_stress_vegetative, self.cultivar_parameters[19],             # <<<<<<<<<<<<<<
 *                                                  self.cultivar_parameters[20], self.cultivar_parameters[21],
 *                                                  self.cultivar_parameters[22], self.cultivar_parameters[23],
 */
    __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 19, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1340, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_14 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_14 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1340, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1341
 *                                                  self._sim.states[u].water_stress_stem, self._sim.states[u].carbon_stress,
 *                                                  self._sim.states[u].nitrogen_stress_vegetative, self.cultivar_parameters[19],
 *                                                  self.cultivar_parameters[20], self.cultivar_parameters[21],             # <<<<<<<<<<<<<<
 *                                                  self.cultivar_parameters[22], self.cultivar_parameters[23],
 *                                                  self.cultivar_parameters[24], self.cultivar_parameters[25],
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 20, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_13 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_13 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 21, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_12 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_12 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1341, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1342
 *                                                  self._sim.states[u].nitrogen_stress_vegetative, self.cultivar_parameters[19],
 *                                                  self.cultivar_parameters[20], self.cultivar_parameters[21],
 *                                                  self.cultivar_parameters[22], self.cultivar_parameters[23],             # <<<<<<<<<<<<<<
 *                                                  self.cultivar_parameters[24], self.cultivar_parameters[25],
 *                                                  self.cultivar_parameters[26])
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 22, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 23, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1342, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1343
 *                                                  self.cultivar_parameters[20], self.cultivar_parameters[21],
 *                                                  self.cultivar_parameters[22], self.cultivar_parameters[23],
 *                                                  self.cultivar_parameters[24], self.cultivar_parameters[25],             # <<<<<<<<<<<<<<
 *                                                  self.cultivar_parameters[26])
 *         # Call ActualRootGrowth() to compute actual root growth.
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 24, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 25, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_8 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1343, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1344
 *                                                  self.cultivar_parameters[22], self.cultivar_parameters[23],
 *                                                  self.cultivar_parameters[24], self.cultivar_parameters[25],
 *                                                  self.cultivar_parameters[26])             # <<<<<<<<<<<<<<
 *         # Call ActualRootGrowth() to compute actual root growth.
 *         ComputeActualRootGrowth(self._sim.states[u], sumpdr, self.row_space, self._sim.per_plant_area, 3, self._sim.day_emerge,
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_GetItemInt(__pyx_t_1, 26, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_25 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1344, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":1333
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,             # <<<<<<<<<<<<<<
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 *                                                  self._sim.states[u].age_of_pre_fruiting_nodes[
 */
    (__pyx_v_self->_sim.states[__pyx_t_7]).plant_height = ((__pyx_v_self->_sim.states[__pyx_t_7]).plant_height + AddPlantHeight(__pyx_v_denf2, (__pyx_v_self->_sim.states[__pyx_t_15]).day_inc, (__pyx_v_self->_sim.states[__pyx_t_16]).number_of_pre_fruiting_nodes, ((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[0]).fruiting_branches[1]).nodes[0]).stage, ((__pyx_v_self->_sim.states[__pyx_t_18]).age_of_pre_fruiting_nodes[((__pyx_v_self->_sim.states[__pyx_t_19]).number_of_pre_fruiting_nodes - 1)]), ((__pyx_v_self->_sim.states[__pyx_t_20]).age_of_pre_fruiting_nodes[((__pyx_v_self->_sim.states[__pyx_t_21]).number_of_pre_fruiting_nodes - 2)]), __pyx_v_agetop, (__pyx_v_self->_sim.states[__pyx_t_22]).water_stress_stem, (__pyx_v_self->_sim.states[__pyx_t_23]).carbon_stress, (__pyx_v_self->_sim.states[__pyx_t_24]).nitrogen_stress_vegetative, __pyx_t_14, __pyx_t_13, __pyx_t_12, __pyx_t_11, __pyx_t_10, __pyx_t_9, __pyx_t_8, __pyx_t_25));

    /* "_cotton2k/simulation.pyx":1332
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l1].nodes[0].age +
 *                   self._sim.states[u].vegetative_branches[0].fruiting_branches[l2].nodes[0].age) / 3
 *         if self._sim.day_topping <= 0 or self._sim.states[u].daynum < self._sim.day_topping:             # <<<<<<<<<<<<<<
 *             self._sim.states[u].plant_height += AddPlantHeight(denf2, self._sim.states[u].day_inc, self._sim.states[u].number_of_pre_fruiting_nodes,
 *                                                  self._sim.states[u].vegetative_branches[0].fruiting_branches[1].nodes[0].stage,
 */
  }

  /* "_cotton2k/simulation.pyx":1346
 *                                                  self.cultivar_parameters[26])
 *         # Call ActualRootGrowth() to compute actual root growth.
 *         ComputeActualRootGrowth(self._sim.states[u], sumpdr, self.row_space, self._sim.per_plant_area, 3, self._sim.day_emerge,             # <<<<<<<<<<<<<<
 *                                 self._sim.plant_row_column)
 * 
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1346, __pyx_L1_error)
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_25 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_25 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1346, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

  /* "_cotton2k/simulation.pyx":1347
 *         # Call ActualRootGrowth() to compute actual root growth.
 *         ComputeActualRootGrowth(self._sim.states[u], sumpdr, self.row_space, self._sim.per_plant_area, 3, self._sim.day_emerge,
 *                                 self._sim.plant_row_column)             # <<<<<<<<<<<<<<
 * 
 *     def _days_to_first_square(self, u):
 */
  ComputeActualRootGrowth((__pyx_v_self->_sim.states[__pyx_t_7]), __pyx_v_sumpdr, __pyx_t_25, __pyx_v_self->_sim.per_plant_area, 3, __pyx_v_self->_sim.day_emerge, __pyx_v_self->_sim.plant_row_column);

  /* "_cotton2k/simulation.pyx":1249
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 * 
 *     def _growth(self, u):             # <<<<<<<<<<<<<<
 *         global PotGroStem, PotGroAllRoots, TotalPetioleWeight
 *         # Call self._potential_leaf_growth(u) to compute potential growth rate of leaves.
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._growth", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1349
 *                                 self._sim.plant_row_column)
 * 
 *     def _days_to_first_square(self, u):             # <<<<<<<<<<<<<<
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_29_days_to_first_square(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_29_days_to_first_square = {"_days_to_first_square", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_29_days_to_first_square, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_29_days_to_first_square(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_days_to_first_square (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1349, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_days_to_first_square") < 0)) __PYX_ERR(0, 1349, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_days_to_first_square", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1349, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._days_to_first_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_28_days_to_first_square(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_28_days_to_first_square(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  int __pyx_t_5;
  double __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_days_to_first_square", 0);

  /* "_cotton2k/simulation.pyx":1350
 * 
 *     def _days_to_first_square(self, u):
 *         state = self.state(u)             # <<<<<<<<<<<<<<
 *         if state.daynum <= self._sim.day_emerge:
 *             self.avtemp = state.average_temperature
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_u};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1350, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1351
 *     def _days_to_first_square(self, u):
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:             # <<<<<<<<<<<<<<
 *             self.avtemp = state.average_temperature
 *             self.sumstrs = 0
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_daynum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_1, __pyx_t_2, Py_LE); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1351, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_5) {

    /* "_cotton2k/simulation.pyx":1352
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:
 *             self.avtemp = state.average_temperature             # <<<<<<<<<<<<<<
 *             self.sumstrs = 0
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1352, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1352, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_v_self->avtemp = __pyx_t_6;

    /* "_cotton2k/simulation.pyx":1353
 *         if state.daynum <= self._sim.day_emerge:
 *             self.avtemp = state.average_temperature
 *             self.sumstrs = 0             # <<<<<<<<<<<<<<
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)
 *         if self.avtemp > 34:
 */
    __pyx_v_self->sumstrs = 0.0;

    /* "_cotton2k/simulation.pyx":1351
 *     def _days_to_first_square(self, u):
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:             # <<<<<<<<<<<<<<
 *             self.avtemp = state.average_temperature
 *             self.sumstrs = 0
 */
  }

  /* "_cotton2k/simulation.pyx":1354
 *             self.avtemp = state.average_temperature
 *             self.sumstrs = 0
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)             # <<<<<<<<<<<<<<
 *         if self.avtemp > 34:
 *             self.avtemp = 34
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_daynum); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Subtract(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_self->avtemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_1 = PyNumber_Add(__pyx_t_3, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_daynum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = PyNumber_Subtract(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyInt_AddObjC(__pyx_t_7, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1354, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_self->avtemp = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":1355
 *             self.sumstrs = 0
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)
 *         if self.avtemp > 34:             # <<<<<<<<<<<<<<
 *             self.avtemp = 34
 *         self.sumstrs += 0.08 * (1 - state.water_stress) * 0.3 * (1 - state.nitrogen_stress_vegetative)
 */
  __pyx_t_5 = ((__pyx_v_self->avtemp > 34.0) != 0);
  if (__pyx_t_5) {

    /* "_cotton2k/simulation.pyx":1356
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)
 *         if self.avtemp > 34:
 *             self.avtemp = 34             # <<<<<<<<<<<<<<
 *         self.sumstrs += 0.08 * (1 - state.water_stress) * 0.3 * (1 - state.nitrogen_stress_vegetative)
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 */
    __pyx_v_self->avtemp = 34.0;

    /* "_cotton2k/simulation.pyx":1355
 *             self.sumstrs = 0
 *         self.avtemp = ((state.daynum - self._sim.day_emerge) * self.avtemp + state.average_temperature) / (state.daynum - self._sim.day_emerge + 1)
 *         if self.avtemp > 34:             # <<<<<<<<<<<<<<
 *             self.avtemp = 34
 *         self.sumstrs += 0.08 * (1 - state.water_stress) * 0.3 * (1 - state.nitrogen_stress_vegetative)
 */
  }

  /* "_cotton2k/simulation.pyx":1357
 *         if self.avtemp > 34:
 *             self.avtemp = 34
 *         self.sumstrs += 0.08 * (1 - state.water_stress) * 0.3 * (1 - state.nitrogen_stress_vegetative)             # <<<<<<<<<<<<<<
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 * 
 */
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->sumstrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_water_stress); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_float_0_08, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_3, __pyx_float_0_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_nitrogen_stress_vegetative); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = __Pyx_PyInt_SubtractCObj(__pyx_int_1, __pyx_t_3, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_t_7, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_6 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1357, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_self->sumstrs = __pyx_t_6;

  /* "_cotton2k/simulation.pyx":1358
 *             self.avtemp = 34
 *         self.sumstrs += 0.08 * (1 - state.water_stress) * 0.3 * (1 - state.nitrogen_stress_vegetative)
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs             # <<<<<<<<<<<<<<
 * 
 *     def _add_vegetative_branch(self, u, delayVegByCStress, stemNRatio, DaysTo1stSqare, PhenDelayByNStress):
 */
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_2 = PyFloat_FromDouble((132.2 + (__pyx_v_self->avtemp * (-7.0 + (__pyx_v_self->avtemp * 0.125))))); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_7 = __Pyx_GetItemInt(__pyx_t_3, 30, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyNumber_Multiply(__pyx_t_2, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_7 = PyFloat_FromDouble(__pyx_v_self->sumstrs); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_2 = PyNumber_Subtract(__pyx_t_3, __pyx_t_7); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1358, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_r = __pyx_t_2;
  __pyx_t_2 = 0;
  goto __pyx_L0;

  /* "_cotton2k/simulation.pyx":1349
 *                                 self._sim.plant_row_column)
 * 
 *     def _days_to_first_square(self, u):             # <<<<<<<<<<<<<<
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._days_to_first_square", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1360
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 * 
 *     def _add_vegetative_branch(self, u, delayVegByCStress, stemNRatio, DaysTo1stSqare, PhenDelayByNStress):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch, "\n        This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch = {"_add_vegetative_branch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  PyObject *__pyx_v_delayVegByCStress = 0;
  PyObject *__pyx_v_stemNRatio = 0;
  PyObject *__pyx_v_DaysTo1stSqare = 0;
  PyObject *__pyx_v_PhenDelayByNStress = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_add_vegetative_branch (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_delayVegByCStress,&__pyx_n_s_stemNRatio,&__pyx_n_s_DaysTo1stSqare,&__pyx_n_s_PhenDelayByNStress,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,&__pyx_n_s_delayVegByCStress,&__pyx_n_s_stemNRatio,&__pyx_n_s_DaysTo1stSqare,&__pyx_n_s_PhenDelayByNStress,0};
    #endif
    PyObject* values[5] = {0,0,0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  5: values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
        CYTHON_FALLTHROUGH;
        case  4: values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
        CYTHON_FALLTHROUGH;
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_delayVegByCStress)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_add_vegetative_branch", 1, 5, 5, 1); __PYX_ERR(0, 1360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_stemNRatio)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_add_vegetative_branch", 1, 5, 5, 2); __PYX_ERR(0, 1360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  3:
        if (likely((values[3] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_DaysTo1stSqare)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_add_vegetative_branch", 1, 5, 5, 3); __PYX_ERR(0, 1360, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  4:
        if (likely((values[4] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_PhenDelayByNStress)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1360, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("_add_vegetative_branch", 1, 5, 5, 4); __PYX_ERR(0, 1360, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_add_vegetative_branch") < 0)) __PYX_ERR(0, 1360, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 5)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
      values[3] = __Pyx_Arg_FASTCALL(__pyx_args, 3);
      values[4] = __Pyx_Arg_FASTCALL(__pyx_args, 4);
    }
    __pyx_v_u = values[0];
    __pyx_v_delayVegByCStress = values[1];
    __pyx_v_stemNRatio = values[2];
    __pyx_v_DaysTo1stSqare = values[3];
    __pyx_v_PhenDelayByNStress = values[4];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_add_vegetative_branch", 1, 5, 5, __pyx_nargs); __PYX_ERR(0, 1360, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._add_vegetative_branch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u, __pyx_v_delayVegByCStress, __pyx_v_stemNRatio, __pyx_v_DaysTo1stSqare, __pyx_v_PhenDelayByNStress);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u, PyObject *__pyx_v_delayVegByCStress, PyObject *__pyx_v_stemNRatio, PyObject *__pyx_v_DaysTo1stSqare, PyObject *__pyx_v_PhenDelayByNStress) {
  double __pyx_v_vpvegb[3];
  double __pyx_v_TimeToNextVegBranch;
  double __pyx_v_addlfn;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  double __pyx_t_3[3];
  Py_ssize_t __pyx_t_4;
  Py_ssize_t __pyx_t_5;
  Py_ssize_t __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  Py_ssize_t __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_add_vegetative_branch", 0);

  /* "_cotton2k/simulation.pyx":1364
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 *         """
 *         if self._sim.states[u].number_of_vegetative_branches == 3:             # <<<<<<<<<<<<<<
 *             return
 *         # The following constant parameters are used:
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1364, __pyx_L1_error)
  __pyx_t_2 = (((__pyx_v_self->_sim.states[__pyx_t_1]).number_of_vegetative_branches == 3) != 0);
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":1365
 *         """
 *         if self._sim.states[u].number_of_vegetative_branches == 3:
 *             return             # <<<<<<<<<<<<<<
 *         # The following constant parameters are used:
 *         cdef double[3] vpvegb = [13.39, -0.696, 0.012]
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":1364
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 *         """
 *         if self._sim.states[u].number_of_vegetative_branches == 3:             # <<<<<<<<<<<<<<
 *             return
 *         # The following constant parameters are used:
 */
  }

  /* "_cotton2k/simulation.pyx":1367
 *             return
 *         # The following constant parameters are used:
 *         cdef double[3] vpvegb = [13.39, -0.696, 0.012]             # <<<<<<<<<<<<<<
 *         # TimeToNextVegBranch is computed as a function of this average temperature.
 *         cdef double TimeToNextVegBranch  # time, in physiological days, for the next vegetative branch to be formed.
 */
  __pyx_t_3[0] = 13.39;
  __pyx_t_3[1] = -0.696;
  __pyx_t_3[2] = 0.012;
  memcpy(&(__pyx_v_vpvegb[0]), __pyx_t_3, sizeof(__pyx_v_vpvegb[0]) * (3));

  /* "_cotton2k/simulation.pyx":1370
 *         # TimeToNextVegBranch is computed as a function of this average temperature.
 *         cdef double TimeToNextVegBranch  # time, in physiological days, for the next vegetative branch to be formed.
 *         TimeToNextVegBranch = vpvegb[0] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * (vpvegb[1] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * vpvegb[2])             # <<<<<<<<<<<<<<
 *         # Compare the age of the first fruiting site of the last formed vegetative branch with TimeToNextVegBranch plus DaysTo1stSqare and the delays caused by stresses, in order to decide if a new vegetative branch is to be formed.
 *         if self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].age < TimeToNextVegBranch + delayVegByCStress + PhenDelayByNStress + DaysTo1stSqare:
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1370, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1370, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1370, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1370, __pyx_L1_error)
  __pyx_v_TimeToNextVegBranch = ((__pyx_v_vpvegb[0]) + (((((__pyx_v_self->_sim.states[__pyx_t_1]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_4]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).average_temperature * ((__pyx_v_vpvegb[1]) + (((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_6]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).average_temperature * (__pyx_v_vpvegb[2])))));

  /* "_cotton2k/simulation.pyx":1372
 *         TimeToNextVegBranch = vpvegb[0] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * (vpvegb[1] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * vpvegb[2])
 *         # Compare the age of the first fruiting site of the last formed vegetative branch with TimeToNextVegBranch plus DaysTo1stSqare and the delays caused by stresses, in order to decide if a new vegetative branch is to be formed.
 *         if self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].age < TimeToNextVegBranch + delayVegByCStress + PhenDelayByNStress + DaysTo1stSqare:             # <<<<<<<<<<<<<<
 *             return
 *         # When a new vegetative branch is formed, increase NumVegBranches by 1.
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1372, __pyx_L1_error)
  __pyx_t_7 = PyFloat_FromDouble(((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).age); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_8 = PyFloat_FromDouble(__pyx_v_TimeToNextVegBranch); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_delayVegByCStress); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyNumber_Add(__pyx_t_9, __pyx_v_PhenDelayByNStress); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_9 = PyNumber_Add(__pyx_t_8, __pyx_v_DaysTo1stSqare); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_8 = PyObject_RichCompare(__pyx_t_7, __pyx_t_9, Py_LT); __Pyx_XGOTREF(__pyx_t_8); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_8); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1372, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":1373
 *         # Compare the age of the first fruiting site of the last formed vegetative branch with TimeToNextVegBranch plus DaysTo1stSqare and the delays caused by stresses, in order to decide if a new vegetative branch is to be formed.
 *         if self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].age < TimeToNextVegBranch + delayVegByCStress + PhenDelayByNStress + DaysTo1stSqare:
 *             return             # <<<<<<<<<<<<<<
 *         # When a new vegetative branch is formed, increase NumVegBranches by 1.
 *         self._sim.states[u].number_of_vegetative_branches += 1
 */
    __Pyx_XDECREF(__pyx_r);
    __pyx_r = Py_None; __Pyx_INCREF(Py_None);
    goto __pyx_L0;

    /* "_cotton2k/simulation.pyx":1372
 *         TimeToNextVegBranch = vpvegb[0] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * (vpvegb[1] + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature * vpvegb[2])
 *         # Compare the age of the first fruiting site of the last formed vegetative branch with TimeToNextVegBranch plus DaysTo1stSqare and the delays caused by stresses, in order to decide if a new vegetative branch is to be formed.
 *         if self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].age < TimeToNextVegBranch + delayVegByCStress + PhenDelayByNStress + DaysTo1stSqare:             # <<<<<<<<<<<<<<
 *             return
 *         # When a new vegetative branch is formed, increase NumVegBranches by 1.
 */
  }

  /* "_cotton2k/simulation.pyx":1375
 *             return
 *         # When a new vegetative branch is formed, increase NumVegBranches by 1.
 *         self._sim.states[u].number_of_vegetative_branches += 1             # <<<<<<<<<<<<<<
 *         # Assign 1 to FruitFraction and FruitingCode of the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].fraction = 1
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1375, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches = ((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches + 1);

  /* "_cotton2k/simulation.pyx":1377
 *         self._sim.states[u].number_of_vegetative_branches += 1
 *         # Assign 1 to FruitFraction and FruitingCode of the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].fraction = 1             # <<<<<<<<<<<<<<
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].stage = Stage.Square
 *         # Add a new leaf to the first site of this branch.
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1377, __pyx_L1_error)
  ((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_6]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).fraction = 1.0;

  /* "_cotton2k/simulation.pyx":1378
 *         # Assign 1 to FruitFraction and FruitingCode of the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].fraction = 1
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].stage = Stage.Square             # <<<<<<<<<<<<<<
 *         # Add a new leaf to the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.area = self.cultivar_parameters[34]
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1378, __pyx_L1_error)
  ((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).stage = Square;

  /* "_cotton2k/simulation.pyx":1380
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].stage = Stage.Square
 *         # Add a new leaf to the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.area = self.cultivar_parameters[34]             # <<<<<<<<<<<<<<
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight = self.cultivar_parameters[34] * self._sim.states[u].leaf_weight_area_ratio
 *         # Add a new mainstem leaf to the first node of this branch.
 */
  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_8, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1380, __pyx_L1_error)
  ((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_6]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).leaf.area = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":1381
 *         # Add a new leaf to the first site of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.area = self.cultivar_parameters[34]
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight = self.cultivar_parameters[34] * self._sim.states[u].leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *         # Add a new mainstem leaf to the first node of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area = self.cultivar_parameters[34]
 */
  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_8 = __Pyx_GetItemInt(__pyx_t_9, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_8);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_t_9 = PyFloat_FromDouble((__pyx_v_self->_sim.states[__pyx_t_6]).leaf_weight_area_ratio); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_8, __pyx_t_9); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1381, __pyx_L1_error)
  ((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).leaf.weight = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":1383
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight = self.cultivar_parameters[34] * self._sim.states[u].leaf_weight_area_ratio
 *         # Add a new mainstem leaf to the first node of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area = self.cultivar_parameters[34]             # <<<<<<<<<<<<<<
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight = self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area * self._sim.states[u].leaf_weight_area_ratio
 *         # The initial mass and nitrogen in the new leaves are substracted from the stem.
 */
  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __pyx_t_9 = __Pyx_GetItemInt(__pyx_t_7, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_9); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1383, __pyx_L1_error)
  (((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_6]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_area = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":1384
 *         # Add a new mainstem leaf to the first node of this branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area = self.cultivar_parameters[34]
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight = self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area * self._sim.states[u].leaf_weight_area_ratio             # <<<<<<<<<<<<<<
 *         # The initial mass and nitrogen in the new leaves are substracted from the stem.
 *         self._sim.states[u].stem_weight -= self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1384, __pyx_L1_error)
  (((__pyx_v_self->_sim.states[__pyx_t_1]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_11]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_weight = ((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_area * (__pyx_v_self->_sim.states[__pyx_t_4]).leaf_weight_area_ratio);

  /* "_cotton2k/simulation.pyx":1386
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight = self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_area * self._sim.states[u].leaf_weight_area_ratio
 *         # The initial mass and nitrogen in the new leaves are substracted from the stem.
 *         self._sim.states[u].stem_weight -= self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight             # <<<<<<<<<<<<<<
 *         self._sim.states[u].leaf_weight += self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight
 *         cdef double addlfn  # nitrogen moved to new leaves from stem.
 */
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1386, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_11]).stem_weight = ((__pyx_v_self->_sim.states[__pyx_t_11]).stem_weight - (((((__pyx_v_self->_sim.states[__pyx_t_1]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_4]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).leaf.weight + (((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_6]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_weight));

  /* "_cotton2k/simulation.pyx":1387
 *         # The initial mass and nitrogen in the new leaves are substracted from the stem.
 *         self._sim.states[u].stem_weight -= self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight
 *         self._sim.states[u].leaf_weight += self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight             # <<<<<<<<<<<<<<
 *         cdef double addlfn  # nitrogen moved to new leaves from stem.
 *         addlfn = (self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight) * stemNRatio
 */
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1387, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_11]).leaf_weight = ((__pyx_v_self->_sim.states[__pyx_t_11]).leaf_weight + (((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).leaf.weight + (((__pyx_v_self->_sim.states[__pyx_t_4]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_1]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_weight));

  /* "_cotton2k/simulation.pyx":1389
 *         self._sim.states[u].leaf_weight += self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight
 *         cdef double addlfn  # nitrogen moved to new leaves from stem.
 *         addlfn = (self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight) * stemNRatio             # <<<<<<<<<<<<<<
 *         self._sim.states[u].leaf_nitrogen += addlfn
 *         self._sim.states[u].stem_nitrogen -= addlfn
 */
  __pyx_t_11 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_11 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1389, __pyx_L1_error)
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1389, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1389, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1389, __pyx_L1_error)
  __pyx_t_9 = PyFloat_FromDouble((((((__pyx_v_self->_sim.states[__pyx_t_11]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_1]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).leaf.weight + (((__pyx_v_self->_sim.states[__pyx_t_4]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).main_stem_leaf.leaf_weight)); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_9);
  __pyx_t_7 = PyNumber_Multiply(__pyx_t_9, __pyx_v_stemNRatio); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_t_7); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1389, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
  __pyx_v_addlfn = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":1390
 *         cdef double addlfn  # nitrogen moved to new leaves from stem.
 *         addlfn = (self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight) * stemNRatio
 *         self._sim.states[u].leaf_nitrogen += addlfn             # <<<<<<<<<<<<<<
 *         self._sim.states[u].stem_nitrogen -= addlfn
 *         # Assign the initial value of the average temperature of the first site.
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1390, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_5]).leaf_nitrogen = ((__pyx_v_self->_sim.states[__pyx_t_5]).leaf_nitrogen + __pyx_v_addlfn);

  /* "_cotton2k/simulation.pyx":1391
 *         addlfn = (self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].leaf.weight + self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].main_stem_leaf.leaf_weight) * stemNRatio
 *         self._sim.states[u].leaf_nitrogen += addlfn
 *         self._sim.states[u].stem_nitrogen -= addlfn             # <<<<<<<<<<<<<<
 *         # Assign the initial value of the average temperature of the first site.
 *         # Define initial NumFruitBranches and NumNodes for the new vegetative branch.
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1391, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_5]).stem_nitrogen = ((__pyx_v_self->_sim.states[__pyx_t_5]).stem_nitrogen - __pyx_v_addlfn);

  /* "_cotton2k/simulation.pyx":1394
 *         # Assign the initial value of the average temperature of the first site.
 *         # Define initial NumFruitBranches and NumNodes for the new vegetative branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature = self._sim.states[u].average_temperature             # <<<<<<<<<<<<<<
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].number_of_fruiting_branches = 1
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L1_error)
  __pyx_t_10 = (__pyx_v_self->_sim.states[__pyx_t_5]).average_temperature;
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1394, __pyx_L1_error)
  ((((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_4]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).nodes[0]).average_temperature = __pyx_t_10;

  /* "_cotton2k/simulation.pyx":1395
 *         # Define initial NumFruitBranches and NumNodes for the new vegetative branch.
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature = self._sim.states[u].average_temperature
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].number_of_fruiting_branches = 1             # <<<<<<<<<<<<<<
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 * 
 */
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L1_error)
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1395, __pyx_L1_error)
  ((__pyx_v_self->_sim.states[__pyx_t_4]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_5]).number_of_vegetative_branches - 1)]).number_of_fruiting_branches = 1;

  /* "_cotton2k/simulation.pyx":1396
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].nodes[0].average_temperature = self._sim.states[u].average_temperature
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].number_of_fruiting_branches = 1
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1             # <<<<<<<<<<<<<<
 * 
 *     def _phenology(self, u):
 */
  __pyx_t_5 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_5 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error)
  __pyx_t_4 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_4 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1396, __pyx_L1_error)
  (((__pyx_v_self->_sim.states[__pyx_t_5]).vegetative_branches[((__pyx_v_self->_sim.states[__pyx_t_4]).number_of_vegetative_branches - 1)]).fruiting_branches[0]).number_of_fruiting_nodes = 1;

  /* "_cotton2k/simulation.pyx":1360
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 * 
 *     def _add_vegetative_branch(self, u, delayVegByCStress, stemNRatio, DaysTo1stSqare, PhenDelayByNStress):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._add_vegetative_branch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1398
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 * 
 *     def _phenology(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This is is the main function for simulating events of phenology and abscission in the cotton plant. It is called each day from DailySimulation().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_33_phenology(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_32_phenology, "\n        This is is the main function for simulating events of phenology and abscission in the cotton plant. It is called each day from DailySimulation().\n\n        CottonPhenology() calls PreFruitingNode(), DaysToFirstSquare(), create_first_square(), _add_vegetative_branch(), _add_fruiting_branch(), AddFruitingNode(), SimulateFruitingSite(), LeafAbscission(), FruitingSitesAbscission().\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_33_phenology = {"_phenology", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_33_phenology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_32_phenology};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_33_phenology(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_phenology (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1398, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_phenology") < 0)) __PYX_ERR(0, 1398, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_phenology", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1398, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._phenology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_32_phenology(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_32_phenology(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  PyObject *__pyx_v_state = NULL;
  double __pyx_v_vpheno[8];
  int __pyx_v_nwfl;
  double __pyx_v_stemNRatio;
  double __pyx_v_PhenDelayByNStress;
  double __pyx_v_delayVegByCStress;
  double __pyx_v_delayFrtByCStress;
  int __pyx_v_nidmax;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_v_m = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  double __pyx_t_5[8];
  Py_ssize_t __pyx_t_6;
  Py_ssize_t __pyx_t_7;
  int __pyx_t_8;
  double __pyx_t_9;
  unsigned int __pyx_t_10;
  PyObject *__pyx_t_11 = NULL;
  PyObject *__pyx_t_12 = NULL;
  uint32_t __pyx_t_13;
  int __pyx_t_14;
  PyObject *__pyx_t_15 = NULL;
  PyObject *__pyx_t_16 = NULL;
  PyObject *(*__pyx_t_17)(PyObject *);
  Py_ssize_t __pyx_t_18;
  PyObject *__pyx_t_19 = NULL;
  PyObject *__pyx_t_20 = NULL;
  PyObject *__pyx_t_21 = NULL;
  PyObject *__pyx_t_22 = NULL;
  PyObject *(*__pyx_t_23)(PyObject *);
  Py_ssize_t __pyx_t_24;
  Py_ssize_t __pyx_t_25;
  int __pyx_t_26;
  PyObject *(*__pyx_t_27)(PyObject *);
  int __pyx_t_28;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_phenology", 0);

  /* "_cotton2k/simulation.pyx":1404
 *         CottonPhenology() calls PreFruitingNode(), DaysToFirstSquare(), create_first_square(), _add_vegetative_branch(), _add_fruiting_branch(), AddFruitingNode(), SimulateFruitingSite(), LeafAbscission(), FruitingSitesAbscission().
 *         """
 *         state = self.state(u)             # <<<<<<<<<<<<<<
 *         # The following constant parameters are used:
 *         cdef double[8] vpheno = [0.65, -0.83, -1.67, -0.25, -0.75, 10.0, 15.0, 7.10]
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1404, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_u};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1404, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1406
 *         state = self.state(u)
 *         # The following constant parameters are used:
 *         cdef double[8] vpheno = [0.65, -0.83, -1.67, -0.25, -0.75, 10.0, 15.0, 7.10]             # <<<<<<<<<<<<<<
 * 
 *         cdef int nwfl = 0  # the node of the most recent white flower. Note: this variable is not used. It is kept for compatibility with previous versions, and may be use in future versions.
 */
  __pyx_t_5[0] = 0.65;
  __pyx_t_5[1] = -0.83;
  __pyx_t_5[2] = -1.67;
  __pyx_t_5[3] = -0.25;
  __pyx_t_5[4] = -0.75;
  __pyx_t_5[5] = 10.0;
  __pyx_t_5[6] = 15.0;
  __pyx_t_5[7] = 7.10;
  memcpy(&(__pyx_v_vpheno[0]), __pyx_t_5, sizeof(__pyx_v_vpheno[0]) * (8));

  /* "_cotton2k/simulation.pyx":1408
 *         cdef double[8] vpheno = [0.65, -0.83, -1.67, -0.25, -0.75, 10.0, 15.0, 7.10]
 * 
 *         cdef int nwfl = 0  # the node of the most recent white flower. Note: this variable is not used. It is kept for compatibility with previous versions, and may be use in future versions.             # <<<<<<<<<<<<<<
 *         self._sim.states[u].number_of_fruiting_sites = 0
 *         cdef double stemNRatio  # the ratio of N to dry matter in the stems.
 */
  __pyx_v_nwfl = 0;

  /* "_cotton2k/simulation.pyx":1409
 * 
 *         cdef int nwfl = 0  # the node of the most recent white flower. Note: this variable is not used. It is kept for compatibility with previous versions, and may be use in future versions.
 *         self._sim.states[u].number_of_fruiting_sites = 0             # <<<<<<<<<<<<<<
 *         cdef double stemNRatio  # the ratio of N to dry matter in the stems.
 *         stemNRatio = self._sim.states[u].stem_nitrogen / self._sim.states[u].stem_weight
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1409, __pyx_L1_error)
  (__pyx_v_self->_sim.states[__pyx_t_6]).number_of_fruiting_sites = 0;

  /* "_cotton2k/simulation.pyx":1411
 *         self._sim.states[u].number_of_fruiting_sites = 0
 *         cdef double stemNRatio  # the ratio of N to dry matter in the stems.
 *         stemNRatio = self._sim.states[u].stem_nitrogen / self._sim.states[u].stem_weight             # <<<<<<<<<<<<<<
 *         # Compute the phenological delays:
 *         # PhenDelayByNStress, the delay caused by nitrogen stress, is assumed to be a function of the vegetative nitrogen stress.
 */
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1411, __pyx_L1_error)
  if (unlikely((__pyx_v_self->_sim.states[__pyx_t_7]).stem_weight == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1411, __pyx_L1_error)
  }
  __pyx_v_stemNRatio = ((__pyx_v_self->_sim.states[__pyx_t_6]).stem_nitrogen / (__pyx_v_self->_sim.states[__pyx_t_7]).stem_weight);

  /* "_cotton2k/simulation.pyx":1414
 *         # Compute the phenological delays:
 *         # PhenDelayByNStress, the delay caused by nitrogen stress, is assumed to be a function of the vegetative nitrogen stress.
 *         cdef double PhenDelayByNStress = vpheno[0] * (1 - self._sim.states[u].nitrogen_stress_vegetative)  # phenological delay caused by vegetative nitrogen stress.             # <<<<<<<<<<<<<<
 *         if PhenDelayByNStress > 1:
 *             PhenDelayByNStress = 1
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1414, __pyx_L1_error)
  __pyx_v_PhenDelayByNStress = ((__pyx_v_vpheno[0]) * (1.0 - (__pyx_v_self->_sim.states[__pyx_t_7]).nitrogen_stress_vegetative));

  /* "_cotton2k/simulation.pyx":1415
 *         # PhenDelayByNStress, the delay caused by nitrogen stress, is assumed to be a function of the vegetative nitrogen stress.
 *         cdef double PhenDelayByNStress = vpheno[0] * (1 - self._sim.states[u].nitrogen_stress_vegetative)  # phenological delay caused by vegetative nitrogen stress.
 *         if PhenDelayByNStress > 1:             # <<<<<<<<<<<<<<
 *             PhenDelayByNStress = 1
 *         elif PhenDelayByNStress < 0:
 */
  __pyx_t_8 = ((__pyx_v_PhenDelayByNStress > 1.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1416
 *         cdef double PhenDelayByNStress = vpheno[0] * (1 - self._sim.states[u].nitrogen_stress_vegetative)  # phenological delay caused by vegetative nitrogen stress.
 *         if PhenDelayByNStress > 1:
 *             PhenDelayByNStress = 1             # <<<<<<<<<<<<<<
 *         elif PhenDelayByNStress < 0:
 *             PhenDelayByNStress = 0
 */
    __pyx_v_PhenDelayByNStress = 1.0;

    /* "_cotton2k/simulation.pyx":1415
 *         # PhenDelayByNStress, the delay caused by nitrogen stress, is assumed to be a function of the vegetative nitrogen stress.
 *         cdef double PhenDelayByNStress = vpheno[0] * (1 - self._sim.states[u].nitrogen_stress_vegetative)  # phenological delay caused by vegetative nitrogen stress.
 *         if PhenDelayByNStress > 1:             # <<<<<<<<<<<<<<
 *             PhenDelayByNStress = 1
 *         elif PhenDelayByNStress < 0:
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":1417
 *         if PhenDelayByNStress > 1:
 *             PhenDelayByNStress = 1
 *         elif PhenDelayByNStress < 0:             # <<<<<<<<<<<<<<
 *             PhenDelayByNStress = 0
 * 
 */
  __pyx_t_8 = ((__pyx_v_PhenDelayByNStress < 0.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1418
 *             PhenDelayByNStress = 1
 *         elif PhenDelayByNStress < 0:
 *             PhenDelayByNStress = 0             # <<<<<<<<<<<<<<
 * 
 *         cdef double delayVegByCStress  # delay in formation of new fruiting branches caused by carbon stress.
 */
    __pyx_v_PhenDelayByNStress = 0.0;

    /* "_cotton2k/simulation.pyx":1417
 *         if PhenDelayByNStress > 1:
 *             PhenDelayByNStress = 1
 *         elif PhenDelayByNStress < 0:             # <<<<<<<<<<<<<<
 *             PhenDelayByNStress = 0
 * 
 */
  }
  __pyx_L3:;

  /* "_cotton2k/simulation.pyx":1421
 * 
 *         cdef double delayVegByCStress  # delay in formation of new fruiting branches caused by carbon stress.
 *         delayVegByCStress = self.cultivar_parameters[27] + self._sim.states[u].carbon_stress * (vpheno[3] + vpheno[4] * self._sim.states[u].carbon_stress)             # <<<<<<<<<<<<<<
 *         if delayVegByCStress > 1:
 *             delayVegByCStress = 1
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_1, 27, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L1_error)
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L1_error)
  __pyx_t_1 = PyFloat_FromDouble(((__pyx_v_self->_sim.states[__pyx_t_7]).carbon_stress * ((__pyx_v_vpheno[3]) + ((__pyx_v_vpheno[4]) * (__pyx_v_self->_sim.states[__pyx_t_6]).carbon_stress)))); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_3 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_3); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1421, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_v_delayVegByCStress = __pyx_t_9;

  /* "_cotton2k/simulation.pyx":1422
 *         cdef double delayVegByCStress  # delay in formation of new fruiting branches caused by carbon stress.
 *         delayVegByCStress = self.cultivar_parameters[27] + self._sim.states[u].carbon_stress * (vpheno[3] + vpheno[4] * self._sim.states[u].carbon_stress)
 *         if delayVegByCStress > 1:             # <<<<<<<<<<<<<<
 *             delayVegByCStress = 1
 *         elif delayVegByCStress < 0:
 */
  __pyx_t_8 = ((__pyx_v_delayVegByCStress > 1.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1423
 *         delayVegByCStress = self.cultivar_parameters[27] + self._sim.states[u].carbon_stress * (vpheno[3] + vpheno[4] * self._sim.states[u].carbon_stress)
 *         if delayVegByCStress > 1:
 *             delayVegByCStress = 1             # <<<<<<<<<<<<<<
 *         elif delayVegByCStress < 0:
 *             delayVegByCStress = 0
 */
    __pyx_v_delayVegByCStress = 1.0;

    /* "_cotton2k/simulation.pyx":1422
 *         cdef double delayVegByCStress  # delay in formation of new fruiting branches caused by carbon stress.
 *         delayVegByCStress = self.cultivar_parameters[27] + self._sim.states[u].carbon_stress * (vpheno[3] + vpheno[4] * self._sim.states[u].carbon_stress)
 *         if delayVegByCStress > 1:             # <<<<<<<<<<<<<<
 *             delayVegByCStress = 1
 *         elif delayVegByCStress < 0:
 */
    goto __pyx_L4;
  }

  /* "_cotton2k/simulation.pyx":1424
 *         if delayVegByCStress > 1:
 *             delayVegByCStress = 1
 *         elif delayVegByCStress < 0:             # <<<<<<<<<<<<<<
 *             delayVegByCStress = 0
 * 
 */
  __pyx_t_8 = ((__pyx_v_delayVegByCStress < 0.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1425
 *             delayVegByCStress = 1
 *         elif delayVegByCStress < 0:
 *             delayVegByCStress = 0             # <<<<<<<<<<<<<<
 * 
 *         cdef double delayFrtByCStress  # delay in formation of new fruiting sites caused by carbon stress.
 */
    __pyx_v_delayVegByCStress = 0.0;

    /* "_cotton2k/simulation.pyx":1424
 *         if delayVegByCStress > 1:
 *             delayVegByCStress = 1
 *         elif delayVegByCStress < 0:             # <<<<<<<<<<<<<<
 *             delayVegByCStress = 0
 * 
 */
  }
  __pyx_L4:;

  /* "_cotton2k/simulation.pyx":1428
 * 
 *         cdef double delayFrtByCStress  # delay in formation of new fruiting sites caused by carbon stress.
 *         delayFrtByCStress = self.cultivar_parameters[28] + self._sim.states[u].carbon_stress * (vpheno[1] + vpheno[2] * self._sim.states[u].carbon_stress)             # <<<<<<<<<<<<<<
 *         if delayFrtByCStress > self.cultivar_parameters[29]:
 *             delayFrtByCStress = self.cultivar_parameters[29]
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 28, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L1_error)
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L1_error)
  __pyx_t_3 = PyFloat_FromDouble(((__pyx_v_self->_sim.states[__pyx_t_6]).carbon_stress * ((__pyx_v_vpheno[1]) + ((__pyx_v_vpheno[2]) * (__pyx_v_self->_sim.states[__pyx_t_7]).carbon_stress)))); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_2 = PyNumber_Add(__pyx_t_1, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1428, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_v_delayFrtByCStress = __pyx_t_9;

  /* "_cotton2k/simulation.pyx":1429
 *         cdef double delayFrtByCStress  # delay in formation of new fruiting sites caused by carbon stress.
 *         delayFrtByCStress = self.cultivar_parameters[28] + self._sim.states[u].carbon_stress * (vpheno[1] + vpheno[2] * self._sim.states[u].carbon_stress)
 *         if delayFrtByCStress > self.cultivar_parameters[29]:             # <<<<<<<<<<<<<<
 *             delayFrtByCStress = self.cultivar_parameters[29]
 *         if delayFrtByCStress < 0:
 */
  __pyx_t_2 = PyFloat_FromDouble(__pyx_v_delayFrtByCStress); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __pyx_t_3 = PyObject_RichCompare(__pyx_t_2, __pyx_t_1, Py_GT); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1429, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1430
 *         delayFrtByCStress = self.cultivar_parameters[28] + self._sim.states[u].carbon_stress * (vpheno[1] + vpheno[2] * self._sim.states[u].carbon_stress)
 *         if delayFrtByCStress > self.cultivar_parameters[29]:
 *             delayFrtByCStress = self.cultivar_parameters[29]             # <<<<<<<<<<<<<<
 *         if delayFrtByCStress < 0:
 *             delayFrtByCStress = 0
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_GetItemInt(__pyx_t_3, 29, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1430, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1430, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_delayFrtByCStress = __pyx_t_9;

    /* "_cotton2k/simulation.pyx":1429
 *         cdef double delayFrtByCStress  # delay in formation of new fruiting sites caused by carbon stress.
 *         delayFrtByCStress = self.cultivar_parameters[28] + self._sim.states[u].carbon_stress * (vpheno[1] + vpheno[2] * self._sim.states[u].carbon_stress)
 *         if delayFrtByCStress > self.cultivar_parameters[29]:             # <<<<<<<<<<<<<<
 *             delayFrtByCStress = self.cultivar_parameters[29]
 *         if delayFrtByCStress < 0:
 */
  }

  /* "_cotton2k/simulation.pyx":1431
 *         if delayFrtByCStress > self.cultivar_parameters[29]:
 *             delayFrtByCStress = self.cultivar_parameters[29]
 *         if delayFrtByCStress < 0:             # <<<<<<<<<<<<<<
 *             delayFrtByCStress = 0
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 */
  __pyx_t_8 = ((__pyx_v_delayFrtByCStress < 0.0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1432
 *             delayFrtByCStress = self.cultivar_parameters[29]
 *         if delayFrtByCStress < 0:
 *             delayFrtByCStress = 0             # <<<<<<<<<<<<<<
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 *         if self._sim.first_square <= 0:
 */
    __pyx_v_delayFrtByCStress = 0.0;

    /* "_cotton2k/simulation.pyx":1431
 *         if delayFrtByCStress > self.cultivar_parameters[29]:
 *             delayFrtByCStress = self.cultivar_parameters[29]
 *         if delayFrtByCStress < 0:             # <<<<<<<<<<<<<<
 *             delayFrtByCStress = 0
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 */
  }

  /* "_cotton2k/simulation.pyx":1434
 *             delayFrtByCStress = 0
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 *         if self._sim.first_square <= 0:             # <<<<<<<<<<<<<<
 *             self.DaysTo1stSqare = self._days_to_first_square(u)
 *             PreFruitingNode(self._sim.states[u], stemNRatio, self._sim.cultivar_parameters)
 */
  __pyx_t_8 = ((__pyx_v_self->_sim.first_square <= 0) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1435
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 *         if self._sim.first_square <= 0:
 *             self.DaysTo1stSqare = self._days_to_first_square(u)             # <<<<<<<<<<<<<<
 *             PreFruitingNode(self._sim.states[u], stemNRatio, self._sim.cultivar_parameters)
 *             # When first square is formed, FirstSquare is assigned the day of year.
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_days_to_first_square); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1435, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1435, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __pyx_t_9 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_9 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1435, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __pyx_v_self->DaysTo1stSqare = __pyx_t_9;

    /* "_cotton2k/simulation.pyx":1436
 *         if self._sim.first_square <= 0:
 *             self.DaysTo1stSqare = self._days_to_first_square(u)
 *             PreFruitingNode(self._sim.states[u], stemNRatio, self._sim.cultivar_parameters)             # <<<<<<<<<<<<<<
 *             # When first square is formed, FirstSquare is assigned the day of year.
 *             # Function create_first_square() is called for formation of first square.
 */
    __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1436, __pyx_L1_error)
    PreFruitingNode((__pyx_v_self->_sim.states[__pyx_t_7]), __pyx_v_stemNRatio, __pyx_v_self->_sim.cultivar_parameters);

    /* "_cotton2k/simulation.pyx":1439
 *             # When first square is formed, FirstSquare is assigned the day of year.
 *             # Function create_first_square() is called for formation of first square.
 *             if state.kday >= <int>self.DaysTo1stSqare:             # <<<<<<<<<<<<<<
 *                 self._sim.first_square = self._sim.states[u].daynum
 *                 state.create_first_square(stemNRatio, self.cultivar_parameters[34])
 */
    __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_kday); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_3 = __Pyx_PyInt_From_int(((int)__pyx_v_self->DaysTo1stSqare)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_3, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_8 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_8 < 0))) __PYX_ERR(0, 1439, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    if (__pyx_t_8) {

      /* "_cotton2k/simulation.pyx":1440
 *             # Function create_first_square() is called for formation of first square.
 *             if state.kday >= <int>self.DaysTo1stSqare:
 *                 self._sim.first_square = self._sim.states[u].daynum             # <<<<<<<<<<<<<<
 *                 state.create_first_square(stemNRatio, self.cultivar_parameters[34])
 *             # if a first square has not been formed, call LeafAbscission() and exit.
 */
      __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1440, __pyx_L1_error)
      __pyx_t_10 = (__pyx_v_self->_sim.states[__pyx_t_7]).daynum;
      __pyx_v_self->_sim.first_square = __pyx_t_10;

      /* "_cotton2k/simulation.pyx":1441
 *             if state.kday >= <int>self.DaysTo1stSqare:
 *                 self._sim.first_square = self._sim.states[u].daynum
 *                 state.create_first_square(stemNRatio, self.cultivar_parameters[34])             # <<<<<<<<<<<<<<
 *             # if a first square has not been formed, call LeafAbscission() and exit.
 *             else:
 */
      __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_create_first_square); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_1 = PyFloat_FromDouble(__pyx_v_stemNRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_12 = __Pyx_GetItemInt(__pyx_t_11, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1441, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __pyx_t_11 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_3);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_3, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[3] = {__pyx_t_11, __pyx_t_1, __pyx_t_12};
        __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 2+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1441, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_2);
        __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
      }
      __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

      /* "_cotton2k/simulation.pyx":1439
 *             # When first square is formed, FirstSquare is assigned the day of year.
 *             # Function create_first_square() is called for formation of first square.
 *             if state.kday >= <int>self.DaysTo1stSqare:             # <<<<<<<<<<<<<<
 *                 self._sim.first_square = self._sim.states[u].daynum
 *                 state.create_first_square(stemNRatio, self.cultivar_parameters[34])
 */
      goto __pyx_L8;
    }

    /* "_cotton2k/simulation.pyx":1444
 *             # if a first square has not been formed, call LeafAbscission() and exit.
 *             else:
 *                 LeafAbscission(self._sim, u)             # <<<<<<<<<<<<<<
 *                 return
 *         # The following is executed after the appearance of the first square.
 */
    /*else*/ {
      __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1444, __pyx_L1_error)
      LeafAbscission(__pyx_v_self->_sim, __pyx_t_13);

      /* "_cotton2k/simulation.pyx":1445
 *             else:
 *                 LeafAbscission(self._sim, u)
 *                 return             # <<<<<<<<<<<<<<
 *         # The following is executed after the appearance of the first square.
 *         # If there are only one or two vegetative branches, and if plant population allows it, call _add_vegetative_branch() to decide if a new vegetative branch is to be added. Note that dense plant populations (large per_plant_area) prevent new vegetative branch formation.
 */
      __Pyx_XDECREF(__pyx_r);
      __pyx_r = Py_None; __Pyx_INCREF(Py_None);
      goto __pyx_L0;
    }
    __pyx_L8:;

    /* "_cotton2k/simulation.pyx":1434
 *             delayFrtByCStress = 0
 *         # The following section is executed if the first square has not yet been formed. Function DaysToFirstSquare() is called to compute the  number of days to 1st square, and function PreFruitingNode() is called to simulate the formation of prefruiting nodes.
 *         if self._sim.first_square <= 0:             # <<<<<<<<<<<<<<
 *             self.DaysTo1stSqare = self._days_to_first_square(u)
 *             PreFruitingNode(self._sim.states[u], stemNRatio, self._sim.cultivar_parameters)
 */
  }

  /* "_cotton2k/simulation.pyx":1448
 *         # The following is executed after the appearance of the first square.
 *         # If there are only one or two vegetative branches, and if plant population allows it, call _add_vegetative_branch() to decide if a new vegetative branch is to be added. Note that dense plant populations (large per_plant_area) prevent new vegetative branch formation.
 *         if self._sim.states[u].number_of_vegetative_branches == 1 and self._sim.per_plant_area >= vpheno[5]:             # <<<<<<<<<<<<<<
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1448, __pyx_L1_error)
  __pyx_t_14 = (((__pyx_v_self->_sim.states[__pyx_t_7]).number_of_vegetative_branches == 1) != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_8 = __pyx_t_14;
    goto __pyx_L10_bool_binop_done;
  }
  __pyx_t_14 = ((__pyx_v_self->_sim.per_plant_area >= (__pyx_v_vpheno[5])) != 0);
  __pyx_t_8 = __pyx_t_14;
  __pyx_L10_bool_binop_done:;
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1449
 *         # If there are only one or two vegetative branches, and if plant population allows it, call _add_vegetative_branch() to decide if a new vegetative branch is to be added. Note that dense plant populations (large per_plant_area) prevent new vegetative branch formation.
 *         if self._sim.states[u].number_of_vegetative_branches == 1 and self._sim.per_plant_area >= vpheno[5]:
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)             # <<<<<<<<<<<<<<
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_vegetative_branch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_12 = PyFloat_FromDouble(__pyx_v_delayVegByCStress); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_stemNRatio); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_11 = PyFloat_FromDouble(__pyx_v_self->DaysTo1stSqare); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_15 = PyFloat_FromDouble(__pyx_v_PhenDelayByNStress); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1449, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_16 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_16)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_16, __pyx_v_u, __pyx_t_12, __pyx_t_1, __pyx_t_11, __pyx_t_15};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1449, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":1448
 *         # The following is executed after the appearance of the first square.
 *         # If there are only one or two vegetative branches, and if plant population allows it, call _add_vegetative_branch() to decide if a new vegetative branch is to be added. Note that dense plant populations (large per_plant_area) prevent new vegetative branch formation.
 *         if self._sim.states[u].number_of_vegetative_branches == 1 and self._sim.per_plant_area >= vpheno[5]:             # <<<<<<<<<<<<<<
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:
 */
  }

  /* "_cotton2k/simulation.pyx":1450
 *         if self._sim.states[u].number_of_vegetative_branches == 1 and self._sim.per_plant_area >= vpheno[5]:
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:             # <<<<<<<<<<<<<<
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         # The maximum number of nodes per fruiting branch (nidmax) is affected by plant density. It is computed as a function of density_factor.
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1450, __pyx_L1_error)
  __pyx_t_14 = (((__pyx_v_self->_sim.states[__pyx_t_7]).number_of_vegetative_branches == 2) != 0);
  if (__pyx_t_14) {
  } else {
    __pyx_t_8 = __pyx_t_14;
    goto __pyx_L13_bool_binop_done;
  }
  __pyx_t_14 = ((__pyx_v_self->_sim.per_plant_area >= (__pyx_v_vpheno[6])) != 0);
  __pyx_t_8 = __pyx_t_14;
  __pyx_L13_bool_binop_done:;
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1451
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)             # <<<<<<<<<<<<<<
 *         # The maximum number of nodes per fruiting branch (nidmax) is affected by plant density. It is computed as a function of density_factor.
 *         cdef int nidmax  # maximum number of nodes per fruiting branch.
 */
    __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_add_vegetative_branch); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_15 = PyFloat_FromDouble(__pyx_v_delayVegByCStress); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_15);
    __pyx_t_11 = PyFloat_FromDouble(__pyx_v_stemNRatio); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_11);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->DaysTo1stSqare); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_12 = PyFloat_FromDouble(__pyx_v_PhenDelayByNStress); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1451, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_12);
    __pyx_t_16 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
      __pyx_t_16 = PyMethod_GET_SELF(__pyx_t_3);
      if (likely(__pyx_t_16)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
        __Pyx_INCREF(__pyx_t_16);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_3, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[6] = {__pyx_t_16, __pyx_v_u, __pyx_t_15, __pyx_t_11, __pyx_t_1, __pyx_t_12};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_4, 5+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_16); __pyx_t_16 = 0;
      __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
      __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1451, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":1450
 *         if self._sim.states[u].number_of_vegetative_branches == 1 and self._sim.per_plant_area >= vpheno[5]:
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         if self._sim.states[u].number_of_vegetative_branches == 2 and self._sim.per_plant_area >= vpheno[6]:             # <<<<<<<<<<<<<<
 *             self._add_vegetative_branch(u, delayVegByCStress, stemNRatio, self.DaysTo1stSqare, PhenDelayByNStress)
 *         # The maximum number of nodes per fruiting branch (nidmax) is affected by plant density. It is computed as a function of density_factor.
 */
  }

  /* "_cotton2k/simulation.pyx":1454
 *         # The maximum number of nodes per fruiting branch (nidmax) is affected by plant density. It is computed as a function of density_factor.
 *         cdef int nidmax  # maximum number of nodes per fruiting branch.
 *         nidmax = <int>(vpheno[7] * self._sim.density_factor + 0.5)             # <<<<<<<<<<<<<<
 *         if nidmax > 5:
 *             nidmax = 5
 */
  __pyx_v_nidmax = ((int)(((__pyx_v_vpheno[7]) * __pyx_v_self->_sim.density_factor) + 0.5));

  /* "_cotton2k/simulation.pyx":1455
 *         cdef int nidmax  # maximum number of nodes per fruiting branch.
 *         nidmax = <int>(vpheno[7] * self._sim.density_factor + 0.5)
 *         if nidmax > 5:             # <<<<<<<<<<<<<<
 *             nidmax = 5
 *         # Start loop over all existing vegetative branches.
 */
  __pyx_t_8 = ((__pyx_v_nidmax > 5) != 0);
  if (__pyx_t_8) {

    /* "_cotton2k/simulation.pyx":1456
 *         nidmax = <int>(vpheno[7] * self._sim.density_factor + 0.5)
 *         if nidmax > 5:
 *             nidmax = 5             # <<<<<<<<<<<<<<
 *         # Start loop over all existing vegetative branches.
 *         # Call AddFruitingBranch() to decide if a new node (and a new fruiting branch) is to be added on this stem.
 */
    __pyx_v_nidmax = 5;

    /* "_cotton2k/simulation.pyx":1455
 *         cdef int nidmax  # maximum number of nodes per fruiting branch.
 *         nidmax = <int>(vpheno[7] * self._sim.density_factor + 0.5)
 *         if nidmax > 5:             # <<<<<<<<<<<<<<
 *             nidmax = 5
 *         # Start loop over all existing vegetative branches.
 */
  }

  /* "_cotton2k/simulation.pyx":1459
 *         # Start loop over all existing vegetative branches.
 *         # Call AddFruitingBranch() to decide if a new node (and a new fruiting branch) is to be added on this stem.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):             # <<<<<<<<<<<<<<
 *             if self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches < 30:
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 */
  __pyx_t_7 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_7 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1459, __pyx_L1_error)
  __pyx_t_2 = __Pyx_PyInt_From_unsigned_int((__pyx_v_self->_sim.states[__pyx_t_7]).number_of_vegetative_branches); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (likely(PyList_CheckExact(__pyx_t_3)) || PyTuple_CheckExact(__pyx_t_3)) {
    __pyx_t_2 = __pyx_t_3; __Pyx_INCREF(__pyx_t_2); __pyx_t_7 = 0;
    __pyx_t_17 = NULL;
  } else {
    __pyx_t_7 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1459, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_17 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_2); if (unlikely(!__pyx_t_17)) __PYX_ERR(0, 1459, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  for (;;) {
    if (likely(!__pyx_t_17)) {
      if (likely(PyList_CheckExact(__pyx_t_2))) {
        if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1459, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      } else {
        if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_7); __Pyx_INCREF(__pyx_t_3); __pyx_t_7++; if (unlikely((0 < 0))) __PYX_ERR(0, 1459, __pyx_L1_error)
        #else
        __pyx_t_3 = PySequence_ITEM(__pyx_t_2, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1459, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        #endif
      }
    } else {
      __pyx_t_3 = __pyx_t_17(__pyx_t_2);
      if (unlikely(!__pyx_t_3)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1459, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_3);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_3);
    __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":1460
 *         # Call AddFruitingBranch() to decide if a new node (and a new fruiting branch) is to be added on this stem.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             if self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches < 30:             # <<<<<<<<<<<<<<
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 */
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L1_error)
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1460, __pyx_L1_error)
    __pyx_t_8 = ((((__pyx_v_self->_sim.states[__pyx_t_6]).vegetative_branches[__pyx_t_18]).number_of_fruiting_branches < 30) != 0);
    if (__pyx_t_8) {

      /* "_cotton2k/simulation.pyx":1461
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             if self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches < 30:
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])             # <<<<<<<<<<<<<<
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 */
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_11 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_11 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_11)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_11);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[2] = {__pyx_t_11, __pyx_v_u};
        __pyx_t_12 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_11); __pyx_t_11 = 0;
        if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1461, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_12);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_12, __pyx_n_s_add_fruiting_branch); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
      __pyx_t_12 = PyFloat_FromDouble(__pyx_v_self->_sim.density_factor); if (unlikely(!__pyx_t_12)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_12);
      __pyx_t_11 = PyFloat_FromDouble(__pyx_v_delayVegByCStress); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_11);
      __pyx_t_15 = PyFloat_FromDouble(__pyx_v_delayFrtByCStress); if (unlikely(!__pyx_t_15)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_15);
      __pyx_t_16 = PyFloat_FromDouble(__pyx_v_stemNRatio); if (unlikely(!__pyx_t_16)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_16);
      __pyx_t_19 = PyFloat_FromDouble(__pyx_v_PhenDelayByNStress); if (unlikely(!__pyx_t_19)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_19);
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_21 = __Pyx_GetItemInt(__pyx_t_20, 35, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_21)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_21);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_20)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_20);
      __pyx_t_22 = __Pyx_GetItemInt(__pyx_t_20, 34, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1461, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_20); __pyx_t_20 = 0;
      __pyx_t_20 = NULL;
      __pyx_t_4 = 0;
      if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_1))) {
        __pyx_t_20 = PyMethod_GET_SELF(__pyx_t_1);
        if (likely(__pyx_t_20)) {
          PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_1);
          __Pyx_INCREF(__pyx_t_20);
          __Pyx_INCREF(function);
          __Pyx_DECREF_SET(__pyx_t_1, function);
          __pyx_t_4 = 1;
        }
      }
      {
        PyObject *__pyx_callargs[9] = {__pyx_t_20, __pyx_v_k, __pyx_t_12, __pyx_t_11, __pyx_t_15, __pyx_t_16, __pyx_t_19, __pyx_t_21, __pyx_t_22};
        __pyx_t_3 = __Pyx_PyObject_FastCall(__pyx_t_1, __pyx_callargs+1-__pyx_t_4, 8+__pyx_t_4);
        __Pyx_XDECREF(__pyx_t_20); __pyx_t_20 = 0;
        __Pyx_DECREF(__pyx_t_12); __pyx_t_12 = 0;
        __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
        __Pyx_DECREF(__pyx_t_15); __pyx_t_15 = 0;
        __Pyx_DECREF(__pyx_t_16); __pyx_t_16 = 0;
        __Pyx_DECREF(__pyx_t_19); __pyx_t_19 = 0;
        __Pyx_DECREF(__pyx_t_21); __pyx_t_21 = 0;
        __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
        if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1461, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_3);
        __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      }
      __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

      /* "_cotton2k/simulation.pyx":1460
 *         # Call AddFruitingBranch() to decide if a new node (and a new fruiting branch) is to be added on this stem.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):
 *             if self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches < 30:             # <<<<<<<<<<<<<<
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 */
    }

    /* "_cotton2k/simulation.pyx":1463
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):             # <<<<<<<<<<<<<<
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes < nidmax:
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 */
    __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L1_error)
    __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1463, __pyx_L1_error)
    __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_6]).number_of_fruiting_branches); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (likely(PyList_CheckExact(__pyx_t_1)) || PyTuple_CheckExact(__pyx_t_1)) {
      __pyx_t_3 = __pyx_t_1; __Pyx_INCREF(__pyx_t_3); __pyx_t_6 = 0;
      __pyx_t_23 = NULL;
    } else {
      __pyx_t_6 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_t_1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1463, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_3);
      __pyx_t_23 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_3); if (unlikely(!__pyx_t_23)) __PYX_ERR(0, 1463, __pyx_L1_error)
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    for (;;) {
      if (likely(!__pyx_t_23)) {
        if (likely(PyList_CheckExact(__pyx_t_3))) {
          if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        } else {
          if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_1 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_6); __Pyx_INCREF(__pyx_t_1); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1463, __pyx_L1_error)
          #else
          __pyx_t_1 = PySequence_ITEM(__pyx_t_3, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1463, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_1);
          #endif
        }
      } else {
        __pyx_t_1 = __pyx_t_23(__pyx_t_3);
        if (unlikely(!__pyx_t_1)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(0, 1463, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_1);
      }
      __Pyx_XDECREF_SET(__pyx_v_l, __pyx_t_1);
      __pyx_t_1 = 0;

      /* "_cotton2k/simulation.pyx":1464
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes < nidmax:             # <<<<<<<<<<<<<<
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 */
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L1_error)
      __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L1_error)
      __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1464, __pyx_L1_error)
      __pyx_t_8 = (((((__pyx_v_self->_sim.states[__pyx_t_18]).vegetative_branches[__pyx_t_24]).fruiting_branches[__pyx_t_25]).number_of_fruiting_nodes < __pyx_v_nidmax) != 0);
      if (__pyx_t_8) {

        /* "_cotton2k/simulation.pyx":1465
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes < nidmax:
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)             # <<<<<<<<<<<<<<
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 */
        __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L1_error)
        __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_v_l); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1465, __pyx_L1_error)
        AddFruitingNode((__pyx_v_self->_sim.states[__pyx_t_25]), __pyx_t_4, __pyx_t_26, __pyx_v_delayFrtByCStress, __pyx_v_stemNRatio, __pyx_v_self->_sim.density_factor, __pyx_v_self->_sim.cultivar_parameters, __pyx_v_PhenDelayByNStress);

        /* "_cotton2k/simulation.pyx":1464
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes < nidmax:             # <<<<<<<<<<<<<<
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 */
      }

      /* "_cotton2k/simulation.pyx":1467
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):             # <<<<<<<<<<<<<<
 *                     SimulateFruitingSite(self._sim, u, k, l, m, nwfl, self._sim.states[u].water_stress)
 *         # Call FruitingSitesAbscission() to simulate the abscission of fruiting parts.
 */
      __pyx_t_25 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_25 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L1_error)
      __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_k); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L1_error)
      __pyx_t_18 = __Pyx_PyIndex_AsSsize_t(__pyx_v_l); if (unlikely((__pyx_t_18 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1467, __pyx_L1_error)
      __pyx_t_1 = __Pyx_PyInt_From_unsigned_int((((__pyx_v_self->_sim.states[__pyx_t_25]).vegetative_branches[__pyx_t_24]).fruiting_branches[__pyx_t_18]).number_of_fruiting_nodes); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __pyx_t_22 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1467, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_22);
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (likely(PyList_CheckExact(__pyx_t_22)) || PyTuple_CheckExact(__pyx_t_22)) {
        __pyx_t_1 = __pyx_t_22; __Pyx_INCREF(__pyx_t_1); __pyx_t_18 = 0;
        __pyx_t_27 = NULL;
      } else {
        __pyx_t_18 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_22); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1467, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_1);
        __pyx_t_27 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_27)) __PYX_ERR(0, 1467, __pyx_L1_error)
      }
      __Pyx_DECREF(__pyx_t_22); __pyx_t_22 = 0;
      for (;;) {
        if (likely(!__pyx_t_27)) {
          if (likely(PyList_CheckExact(__pyx_t_1))) {
            if (__pyx_t_18 >= PyList_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_22 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_18); __Pyx_INCREF(__pyx_t_22); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1467, __pyx_L1_error)
            #else
            __pyx_t_22 = PySequence_ITEM(__pyx_t_1, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1467, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_22);
            #endif
          } else {
            if (__pyx_t_18 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
            #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
            __pyx_t_22 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_18); __Pyx_INCREF(__pyx_t_22); __pyx_t_18++; if (unlikely((0 < 0))) __PYX_ERR(0, 1467, __pyx_L1_error)
            #else
            __pyx_t_22 = PySequence_ITEM(__pyx_t_1, __pyx_t_18); __pyx_t_18++; if (unlikely(!__pyx_t_22)) __PYX_ERR(0, 1467, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_22);
            #endif
          }
        } else {
          __pyx_t_22 = __pyx_t_27(__pyx_t_1);
          if (unlikely(!__pyx_t_22)) {
            PyObject* exc_type = PyErr_Occurred();
            if (exc_type) {
              if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
              else __PYX_ERR(0, 1467, __pyx_L1_error)
            }
            break;
          }
          __Pyx_GOTREF(__pyx_t_22);
        }
        __Pyx_XDECREF_SET(__pyx_v_m, __pyx_t_22);
        __pyx_t_22 = 0;

        /* "_cotton2k/simulation.pyx":1468
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):
 *                     SimulateFruitingSite(self._sim, u, k, l, m, nwfl, self._sim.states[u].water_stress)             # <<<<<<<<<<<<<<
 *         # Call FruitingSitesAbscission() to simulate the abscission of fruiting parts.
 *         FruitingSitesAbscission(self._sim, u)
 */
        __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
        __pyx_t_26 = __Pyx_PyInt_As_int(__pyx_v_k); if (unlikely((__pyx_t_26 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
        __pyx_t_4 = __Pyx_PyInt_As_int(__pyx_v_l); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
        __pyx_t_28 = __Pyx_PyInt_As_int(__pyx_v_m); if (unlikely((__pyx_t_28 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
        __pyx_t_24 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_24 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1468, __pyx_L1_error)
        SimulateFruitingSite(__pyx_v_self->_sim, __pyx_t_13, __pyx_t_26, __pyx_t_4, __pyx_t_28, __pyx_v_nwfl, (__pyx_v_self->_sim.states[__pyx_t_24]).water_stress);

        /* "_cotton2k/simulation.pyx":1467
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 *                 # Loop over all existing fruiting nodes, and call SimulateFruitingSite() to simulate the condition of each fruiting node.
 *                 for m in range(self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes):             # <<<<<<<<<<<<<<
 *                     SimulateFruitingSite(self._sim, u, k, l, m, nwfl, self._sim.states[u].water_stress)
 *         # Call FruitingSitesAbscission() to simulate the abscission of fruiting parts.
 */
      }
      __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

      /* "_cotton2k/simulation.pyx":1463
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 *             # Loop over all existing fruiting branches, and call AddFruitingNode() to decide if a new node on this fruiting branch is to be added.
 *             for l in range(self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches):             # <<<<<<<<<<<<<<
 *                 if self._sim.states[u].vegetative_branches[k].fruiting_branches[l].number_of_fruiting_nodes < nidmax:
 *                     AddFruitingNode(self._sim.states[u], k, l, delayFrtByCStress, stemNRatio, self._sim.density_factor, self._sim.cultivar_parameters, PhenDelayByNStress)
 */
    }
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "_cotton2k/simulation.pyx":1459
 *         # Start loop over all existing vegetative branches.
 *         # Call AddFruitingBranch() to decide if a new node (and a new fruiting branch) is to be added on this stem.
 *         for k in range(self._sim.states[u].number_of_vegetative_branches):             # <<<<<<<<<<<<<<
 *             if self._sim.states[u].vegetative_branches[k].number_of_fruiting_branches < 30:
 *                 self.state(u).add_fruiting_branch(k, self._sim.density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, self.cultivar_parameters[35], self.cultivar_parameters[34])
 */
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":1470
 *                     SimulateFruitingSite(self._sim, u, k, l, m, nwfl, self._sim.states[u].water_stress)
 *         # Call FruitingSitesAbscission() to simulate the abscission of fruiting parts.
 *         FruitingSitesAbscission(self._sim, u)             # <<<<<<<<<<<<<<
 *         # Call LeafAbscission() to simulate the abscission of leaves.
 *         LeafAbscission(self._sim, u)
 */
  __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1470, __pyx_L1_error)
  FruitingSitesAbscission(__pyx_v_self->_sim, __pyx_t_13);

  /* "_cotton2k/simulation.pyx":1472
 *         FruitingSitesAbscission(self._sim, u)
 *         # Call LeafAbscission() to simulate the abscission of leaves.
 *         LeafAbscission(self._sim, u)             # <<<<<<<<<<<<<<
 * 
 *     def _defoliate(self, u):
 */
  __pyx_t_13 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_13 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1472, __pyx_L1_error)
  LeafAbscission(__pyx_v_self->_sim, __pyx_t_13);

  /* "_cotton2k/simulation.pyx":1398
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 * 
 *     def _phenology(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This is is the main function for simulating events of phenology and abscission in the cotton plant. It is called each day from DailySimulation().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_11);
  __Pyx_XDECREF(__pyx_t_12);
  __Pyx_XDECREF(__pyx_t_15);
  __Pyx_XDECREF(__pyx_t_16);
  __Pyx_XDECREF(__pyx_t_19);
  __Pyx_XDECREF(__pyx_t_20);
  __Pyx_XDECREF(__pyx_t_21);
  __Pyx_XDECREF(__pyx_t_22);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._phenology", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XDECREF(__pyx_v_m);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1474
 *         LeafAbscission(self._sim, u)
 * 
 *     def _defoliate(self, u):             # <<<<<<<<<<<<<<
 *         """This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay()."""
 *         global PercentDefoliation
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_35_defoliate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_34_defoliate, "This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay().");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_35_defoliate = {"_defoliate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_35_defoliate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_34_defoliate};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_35_defoliate(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_defoliate (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1474, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_defoliate") < 0)) __PYX_ERR(0, 1474, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_defoliate", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1474, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._defoliate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_34_defoliate(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_34_defoliate(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  State __pyx_v_state;
  double __pyx_v_p1;
  double __pyx_v_p2;
  double __pyx_v_p3;
  double __pyx_v_p4;
  double __pyx_v_p5;
  double __pyx_v_p6;
  double __pyx_v_p7;
  PyObject *__pyx_v_i = NULL;
  int __pyx_v_OpenRatio;
  double __pyx_v_dum;
  long __pyx_v_perdmax;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  Py_ssize_t __pyx_t_1;
  int __pyx_t_2;
  long __pyx_t_3;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  double __pyx_t_6;
  double __pyx_t_7;
  unsigned int __pyx_t_8;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_defoliate", 0);

  /* "_cotton2k/simulation.pyx":1477
 *         """This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay()."""
 *         global PercentDefoliation
 *         cdef cState state = self._sim.states[u]             # <<<<<<<<<<<<<<
 *         # constant parameters:
 *         cdef double p1 = -50.0
 */
  __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1477, __pyx_L1_error)
  __pyx_v_state = (__pyx_v_self->_sim.states[__pyx_t_1]);

  /* "_cotton2k/simulation.pyx":1479
 *         cdef cState state = self._sim.states[u]
 *         # constant parameters:
 *         cdef double p1 = -50.0             # <<<<<<<<<<<<<<
 *         cdef double p2 = 0.525
 *         cdef double p3 = 7.06
 */
  __pyx_v_p1 = -50.0;

  /* "_cotton2k/simulation.pyx":1480
 *         # constant parameters:
 *         cdef double p1 = -50.0
 *         cdef double p2 = 0.525             # <<<<<<<<<<<<<<
 *         cdef double p3 = 7.06
 *         cdef double p4 = 0.85
 */
  __pyx_v_p2 = 0.525;

  /* "_cotton2k/simulation.pyx":1481
 *         cdef double p1 = -50.0
 *         cdef double p2 = 0.525
 *         cdef double p3 = 7.06             # <<<<<<<<<<<<<<
 *         cdef double p4 = 0.85
 *         cdef double p5 = 2.48
 */
  __pyx_v_p3 = 7.06;

  /* "_cotton2k/simulation.pyx":1482
 *         cdef double p2 = 0.525
 *         cdef double p3 = 7.06
 *         cdef double p4 = 0.85             # <<<<<<<<<<<<<<
 *         cdef double p5 = 2.48
 *         cdef double p6 = 0.0374
 */
  __pyx_v_p4 = 0.85;

  /* "_cotton2k/simulation.pyx":1483
 *         cdef double p3 = 7.06
 *         cdef double p4 = 0.85
 *         cdef double p5 = 2.48             # <<<<<<<<<<<<<<
 *         cdef double p6 = 0.0374
 *         cdef double p7 = 0.0020
 */
  __pyx_v_p5 = 2.48;

  /* "_cotton2k/simulation.pyx":1484
 *         cdef double p4 = 0.85
 *         cdef double p5 = 2.48
 *         cdef double p6 = 0.0374             # <<<<<<<<<<<<<<
 *         cdef double p7 = 0.0020
 * 
 */
  __pyx_v_p6 = 0.0374;

  /* "_cotton2k/simulation.pyx":1485
 *         cdef double p5 = 2.48
 *         cdef double p6 = 0.0374
 *         cdef double p7 = 0.0020             # <<<<<<<<<<<<<<
 * 
 *         # If this is first day set initial values of tdfkgh, defkgh to 0.
 */
  __pyx_v_p7 = 0.0020;

  /* "_cotton2k/simulation.pyx":1488
 * 
 *         # If this is first day set initial values of tdfkgh, defkgh to 0.
 *         if state.daynum <= self._sim.day_emerge:             # <<<<<<<<<<<<<<
 *             self.tdfkgh = 0
 *             self.defkgh = 0
 */
  __pyx_t_2 = ((__pyx_v_state.daynum <= __pyx_v_self->_sim.day_emerge) != 0);
  if (__pyx_t_2) {

    /* "_cotton2k/simulation.pyx":1489
 *         # If this is first day set initial values of tdfkgh, defkgh to 0.
 *         if state.daynum <= self._sim.day_emerge:
 *             self.tdfkgh = 0             # <<<<<<<<<<<<<<
 *             self.defkgh = 0
 *             self.idsw = False
 */
    __pyx_v_self->tdfkgh = 0.0;

    /* "_cotton2k/simulation.pyx":1490
 *         if state.daynum <= self._sim.day_emerge:
 *             self.tdfkgh = 0
 *             self.defkgh = 0             # <<<<<<<<<<<<<<
 *             self.idsw = False
 *         # Start a loop for five possible defoliant applications.
 */
    __pyx_v_self->defkgh = 0.0;

    /* "_cotton2k/simulation.pyx":1491
 *             self.tdfkgh = 0
 *             self.defkgh = 0
 *             self.idsw = False             # <<<<<<<<<<<<<<
 *         # Start a loop for five possible defoliant applications.
 *         for i in range(5):
 */
    __pyx_v_self->idsw = 0;

    /* "_cotton2k/simulation.pyx":1488
 * 
 *         # If this is first day set initial values of tdfkgh, defkgh to 0.
 *         if state.daynum <= self._sim.day_emerge:             # <<<<<<<<<<<<<<
 *             self.tdfkgh = 0
 *             self.defkgh = 0
 */
  }

  /* "_cotton2k/simulation.pyx":1493
 *             self.idsw = False
 *         # Start a loop for five possible defoliant applications.
 *         for i in range(5):             # <<<<<<<<<<<<<<
 *             # If there are open bolls and defoliation prediction has been set, execute the following.
 *             if state.number_of_open_bolls > 0 and DefoliantAppRate[i] <= -99.9:
 */
  for (__pyx_t_3 = 0; __pyx_t_3 < 5; __pyx_t_3+=1) {
    __pyx_t_4 = __Pyx_PyInt_From_long(__pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1493, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_4);
    __Pyx_XDECREF_SET(__pyx_v_i, __pyx_t_4);
    __pyx_t_4 = 0;

    /* "_cotton2k/simulation.pyx":1495
 *         for i in range(5):
 *             # If there are open bolls and defoliation prediction has been set, execute the following.
 *             if state.number_of_open_bolls > 0 and DefoliantAppRate[i] <= -99.9:             # <<<<<<<<<<<<<<
 *                 # percentage of open bolls in total boll number
 *                 OpenRatio = <int>(100 * state.number_of_open_bolls / (state.number_of_open_bolls + state.number_of_green_bolls))
 */
    __pyx_t_5 = ((__pyx_v_state.number_of_open_bolls > 0.0) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1495, __pyx_L1_error)
    __pyx_t_5 = (((DefoliantAppRate[__pyx_t_1]) <= -99.9) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":1497
 *             if state.number_of_open_bolls > 0 and DefoliantAppRate[i] <= -99.9:
 *                 # percentage of open bolls in total boll number
 *                 OpenRatio = <int>(100 * state.number_of_open_bolls / (state.number_of_open_bolls + state.number_of_green_bolls))             # <<<<<<<<<<<<<<
 *                 if i == 0 and not self.idsw:
 *                     # If this is first defoliation - check the percentage of boll opening.
 */
      __pyx_t_6 = (100.0 * __pyx_v_state.number_of_open_bolls);
      __pyx_t_7 = (__pyx_v_state.number_of_open_bolls + __pyx_v_state.number_of_green_bolls);
      if (unlikely(__pyx_t_7 == 0)) {
        PyErr_SetString(PyExc_ZeroDivisionError, "float division");
        __PYX_ERR(0, 1497, __pyx_L1_error)
      }
      __pyx_v_OpenRatio = ((int)(__pyx_t_6 / __pyx_t_7));

      /* "_cotton2k/simulation.pyx":1498
 *                 # percentage of open bolls in total boll number
 *                 OpenRatio = <int>(100 * state.number_of_open_bolls / (state.number_of_open_bolls + state.number_of_green_bolls))
 *                 if i == 0 and not self.idsw:             # <<<<<<<<<<<<<<
 *                     # If this is first defoliation - check the percentage of boll opening.
 *                     # If it is after the defined date, or the percent boll opening is greater than the defined threshold - set defoliation date as this day and set a second prediction.
 */
      __pyx_t_4 = __Pyx_PyInt_EqObjC(__pyx_v_i, __pyx_int_0, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1498, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_4);
      __pyx_t_5 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_5 < 0))) __PYX_ERR(0, 1498, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_5) {
      } else {
        __pyx_t_2 = __pyx_t_5;
        goto __pyx_L10_bool_binop_done;
      }
      __pyx_t_5 = ((!(__pyx_v_self->idsw != 0)) != 0);
      __pyx_t_2 = __pyx_t_5;
      __pyx_L10_bool_binop_done:;
      if (__pyx_t_2) {

        /* "_cotton2k/simulation.pyx":1501
 *                     # If this is first defoliation - check the percentage of boll opening.
 *                     # If it is after the defined date, or the percent boll opening is greater than the defined threshold - set defoliation date as this day and set a second prediction.
 *                     if (state.daynum >= DefoliationDate[0] and DefoliationDate[0] > 0) or OpenRatio > DefoliationMethod[i]:             # <<<<<<<<<<<<<<
 *                         self.idsw = True
 *                         DefoliationDate[0] = state.daynum
 */
        __pyx_t_5 = ((__pyx_v_state.daynum >= (DefoliationDate[0])) != 0);
        if (!__pyx_t_5) {
          goto __pyx_L14_next_or;
        } else {
        }
        __pyx_t_5 = (((DefoliationDate[0]) > 0) != 0);
        if (!__pyx_t_5) {
        } else {
          __pyx_t_2 = __pyx_t_5;
          goto __pyx_L13_bool_binop_done;
        }
        __pyx_L14_next_or:;
        __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1501, __pyx_L1_error)
        __pyx_t_5 = ((__pyx_v_OpenRatio > (DefoliationMethod[__pyx_t_1])) != 0);
        __pyx_t_2 = __pyx_t_5;
        __pyx_L13_bool_binop_done:;
        if (__pyx_t_2) {

          /* "_cotton2k/simulation.pyx":1502
 *                     # If it is after the defined date, or the percent boll opening is greater than the defined threshold - set defoliation date as this day and set a second prediction.
 *                     if (state.daynum >= DefoliationDate[0] and DefoliationDate[0] > 0) or OpenRatio > DefoliationMethod[i]:
 *                         self.idsw = True             # <<<<<<<<<<<<<<
 *                         DefoliationDate[0] = state.daynum
 *                         DefoliantAppRate[1] = -99.9
 */
          __pyx_v_self->idsw = 1;

          /* "_cotton2k/simulation.pyx":1503
 *                     if (state.daynum >= DefoliationDate[0] and DefoliationDate[0] > 0) or OpenRatio > DefoliationMethod[i]:
 *                         self.idsw = True
 *                         DefoliationDate[0] = state.daynum             # <<<<<<<<<<<<<<
 *                         DefoliantAppRate[1] = -99.9
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:
 */
          __pyx_t_8 = __pyx_v_state.daynum;
          (DefoliationDate[0]) = __pyx_t_8;

          /* "_cotton2k/simulation.pyx":1504
 *                         self.idsw = True
 *                         DefoliationDate[0] = state.daynum
 *                         DefoliantAppRate[1] = -99.9             # <<<<<<<<<<<<<<
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:
 *                             self._sim.day_defoliate = state.daynum
 */
          (DefoliantAppRate[1]) = -99.9;

          /* "_cotton2k/simulation.pyx":1505
 *                         DefoliationDate[0] = state.daynum
 *                         DefoliantAppRate[1] = -99.9
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:             # <<<<<<<<<<<<<<
 *                             self._sim.day_defoliate = state.daynum
 *                         DefoliationMethod[0] = 0
 */
          __pyx_t_5 = ((__pyx_v_state.daynum < __pyx_v_self->_sim.day_defoliate) != 0);
          if (!__pyx_t_5) {
          } else {
            __pyx_t_2 = __pyx_t_5;
            goto __pyx_L17_bool_binop_done;
          }
          __pyx_t_5 = ((__pyx_v_self->_sim.day_defoliate <= 0) != 0);
          __pyx_t_2 = __pyx_t_5;
          __pyx_L17_bool_binop_done:;
          if (__pyx_t_2) {

            /* "_cotton2k/simulation.pyx":1506
 *                         DefoliantAppRate[1] = -99.9
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:
 *                             self._sim.day_defoliate = state.daynum             # <<<<<<<<<<<<<<
 *                         DefoliationMethod[0] = 0
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 */
            __pyx_t_8 = __pyx_v_state.daynum;
            __pyx_v_self->_sim.day_defoliate = __pyx_t_8;

            /* "_cotton2k/simulation.pyx":1505
 *                         DefoliationDate[0] = state.daynum
 *                         DefoliantAppRate[1] = -99.9
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:             # <<<<<<<<<<<<<<
 *                             self._sim.day_defoliate = state.daynum
 *                         DefoliationMethod[0] = 0
 */
          }

          /* "_cotton2k/simulation.pyx":1507
 *                         if state.daynum < self._sim.day_defoliate or self._sim.day_defoliate <= 0:
 *                             self._sim.day_defoliate = state.daynum
 *                         DefoliationMethod[0] = 0             # <<<<<<<<<<<<<<
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 *                 if i >= 1:
 */
          (DefoliationMethod[0]) = 0;

          /* "_cotton2k/simulation.pyx":1501
 *                     # If this is first defoliation - check the percentage of boll opening.
 *                     # If it is after the defined date, or the percent boll opening is greater than the defined threshold - set defoliation date as this day and set a second prediction.
 *                     if (state.daynum >= DefoliationDate[0] and DefoliationDate[0] > 0) or OpenRatio > DefoliationMethod[i]:             # <<<<<<<<<<<<<<
 *                         self.idsw = True
 *                         DefoliationDate[0] = state.daynum
 */
        }

        /* "_cotton2k/simulation.pyx":1498
 *                 # percentage of open bolls in total boll number
 *                 OpenRatio = <int>(100 * state.number_of_open_bolls / (state.number_of_open_bolls + state.number_of_green_bolls))
 *                 if i == 0 and not self.idsw:             # <<<<<<<<<<<<<<
 *                     # If this is first defoliation - check the percentage of boll opening.
 *                     # If it is after the defined date, or the percent boll opening is greater than the defined threshold - set defoliation date as this day and set a second prediction.
 */
      }

      /* "_cotton2k/simulation.pyx":1509
 *                         DefoliationMethod[0] = 0
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 *                 if i >= 1:             # <<<<<<<<<<<<<<
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:
 *                         DefoliationDate[i] = state.daynum
 */
      __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_1, Py_GE); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1509, __pyx_L1_error)
      __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1509, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
      if (__pyx_t_2) {

        /* "_cotton2k/simulation.pyx":1510
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 *                 if i >= 1:
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:             # <<<<<<<<<<<<<<
 *                         DefoliationDate[i] = state.daynum
 *                         if i < 4:
 */
        __pyx_t_4 = __Pyx_PyInt_SubtractObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1510, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_4);
        __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1510, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
        __pyx_t_5 = ((__pyx_v_state.daynum == ((DefoliationDate[__pyx_t_1]) + 10)) != 0);
        if (__pyx_t_5) {
        } else {
          __pyx_t_2 = __pyx_t_5;
          goto __pyx_L21_bool_binop_done;
        }
        __pyx_t_5 = ((__pyx_v_state.leaf_area_index >= 0.2) != 0);
        __pyx_t_2 = __pyx_t_5;
        __pyx_L21_bool_binop_done:;
        if (__pyx_t_2) {

          /* "_cotton2k/simulation.pyx":1511
 *                 if i >= 1:
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:
 *                         DefoliationDate[i] = state.daynum             # <<<<<<<<<<<<<<
 *                         if i < 4:
 *                             DefoliantAppRate[i + 1] = -99.9
 */
          __pyx_t_8 = __pyx_v_state.daynum;
          __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1511, __pyx_L1_error)
          (DefoliationDate[__pyx_t_1]) = __pyx_t_8;

          /* "_cotton2k/simulation.pyx":1512
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:
 *                         DefoliationDate[i] = state.daynum
 *                         if i < 4:             # <<<<<<<<<<<<<<
 *                             DefoliantAppRate[i + 1] = -99.9
 *                         DefoliationMethod[i] = 0
 */
          __pyx_t_4 = PyObject_RichCompare(__pyx_v_i, __pyx_int_4, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1512, __pyx_L1_error)
          __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely((__pyx_t_2 < 0))) __PYX_ERR(0, 1512, __pyx_L1_error)
          __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
          if (__pyx_t_2) {

            /* "_cotton2k/simulation.pyx":1513
 *                         DefoliationDate[i] = state.daynum
 *                         if i < 4:
 *                             DefoliantAppRate[i + 1] = -99.9             # <<<<<<<<<<<<<<
 *                         DefoliationMethod[i] = 0
 *             if state.daynum == DefoliationDate[i]:
 */
            __pyx_t_4 = __Pyx_PyInt_AddObjC(__pyx_v_i, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1513, __pyx_L1_error)
            __Pyx_GOTREF(__pyx_t_4);
            __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_t_4); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1513, __pyx_L1_error)
            __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
            (DefoliantAppRate[__pyx_t_1]) = -99.9;

            /* "_cotton2k/simulation.pyx":1512
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:
 *                         DefoliationDate[i] = state.daynum
 *                         if i < 4:             # <<<<<<<<<<<<<<
 *                             DefoliantAppRate[i + 1] = -99.9
 *                         DefoliationMethod[i] = 0
 */
          }

          /* "_cotton2k/simulation.pyx":1514
 *                         if i < 4:
 *                             DefoliantAppRate[i + 1] = -99.9
 *                         DefoliationMethod[i] = 0             # <<<<<<<<<<<<<<
 *             if state.daynum == DefoliationDate[i]:
 *                 # If it is a predicted defoliation, assign tdfkgh as 2.5 .
 */
          __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1514, __pyx_L1_error)
          (DefoliationMethod[__pyx_t_1]) = 0;

          /* "_cotton2k/simulation.pyx":1510
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 *                 if i >= 1:
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:             # <<<<<<<<<<<<<<
 *                         DefoliationDate[i] = state.daynum
 *                         if i < 4:
 */
        }

        /* "_cotton2k/simulation.pyx":1509
 *                         DefoliationMethod[0] = 0
 *                 # If 10 days have passed since the last defoliation, and the leaf area index is still greater than 0.2, set another defoliation.
 *                 if i >= 1:             # <<<<<<<<<<<<<<
 *                     if state.daynum == (DefoliationDate[i - 1] + 10) and state.leaf_area_index >= 0.2:
 *                         DefoliationDate[i] = state.daynum
 */
      }

      /* "_cotton2k/simulation.pyx":1495
 *         for i in range(5):
 *             # If there are open bolls and defoliation prediction has been set, execute the following.
 *             if state.number_of_open_bolls > 0 and DefoliantAppRate[i] <= -99.9:             # <<<<<<<<<<<<<<
 *                 # percentage of open bolls in total boll number
 *                 OpenRatio = <int>(100 * state.number_of_open_bolls / (state.number_of_open_bolls + state.number_of_green_bolls))
 */
    }

    /* "_cotton2k/simulation.pyx":1515
 *                             DefoliantAppRate[i + 1] = -99.9
 *                         DefoliationMethod[i] = 0
 *             if state.daynum == DefoliationDate[i]:             # <<<<<<<<<<<<<<
 *                 # If it is a predicted defoliation, assign tdfkgh as 2.5 .
 *                 # Else, compute the amount intercepted by the plants in kg per ha (defkgh), and add it to tdfkgh.
 */
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1515, __pyx_L1_error)
    __pyx_t_2 = ((__pyx_v_state.daynum == (DefoliationDate[__pyx_t_1])) != 0);
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":1518
 *                 # If it is a predicted defoliation, assign tdfkgh as 2.5 .
 *                 # Else, compute the amount intercepted by the plants in kg per ha (defkgh), and add it to tdfkgh.
 *                 if DefoliantAppRate[i] < -99:             # <<<<<<<<<<<<<<
 *                     self.tdfkgh = 2.5
 *                 else:
 */
      __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1518, __pyx_L1_error)
      __pyx_t_2 = (((DefoliantAppRate[__pyx_t_1]) < -99.0) != 0);
      if (__pyx_t_2) {

        /* "_cotton2k/simulation.pyx":1519
 *                 # Else, compute the amount intercepted by the plants in kg per ha (defkgh), and add it to tdfkgh.
 *                 if DefoliantAppRate[i] < -99:
 *                     self.tdfkgh = 2.5             # <<<<<<<<<<<<<<
 *                 else:
 *                     if DefoliationMethod[i] == 0:
 */
        __pyx_v_self->tdfkgh = 2.5;

        /* "_cotton2k/simulation.pyx":1518
 *                 # If it is a predicted defoliation, assign tdfkgh as 2.5 .
 *                 # Else, compute the amount intercepted by the plants in kg per ha (defkgh), and add it to tdfkgh.
 *                 if DefoliantAppRate[i] < -99:             # <<<<<<<<<<<<<<
 *                     self.tdfkgh = 2.5
 *                 else:
 */
        goto __pyx_L25;
      }

      /* "_cotton2k/simulation.pyx":1521
 *                     self.tdfkgh = 2.5
 *                 else:
 *                     if DefoliationMethod[i] == 0:             # <<<<<<<<<<<<<<
 *                         self.defkgh += DefoliantAppRate[i] * 0.95 * 1.12085 * 0.75
 *                     else:
 */
      /*else*/ {
        __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1521, __pyx_L1_error)
        __pyx_t_2 = (((DefoliationMethod[__pyx_t_1]) == 0) != 0);
        if (__pyx_t_2) {

          /* "_cotton2k/simulation.pyx":1522
 *                 else:
 *                     if DefoliationMethod[i] == 0:
 *                         self.defkgh += DefoliantAppRate[i] * 0.95 * 1.12085 * 0.75             # <<<<<<<<<<<<<<
 *                     else:
 *                         self.defkgh += DefoliantAppRate[i] * state.light_interception * 1.12085 * 0.75
 */
          __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1522, __pyx_L1_error)
          __pyx_v_self->defkgh = (__pyx_v_self->defkgh + ((((DefoliantAppRate[__pyx_t_1]) * 0.95) * 1.12085) * 0.75));

          /* "_cotton2k/simulation.pyx":1521
 *                     self.tdfkgh = 2.5
 *                 else:
 *                     if DefoliationMethod[i] == 0:             # <<<<<<<<<<<<<<
 *                         self.defkgh += DefoliantAppRate[i] * 0.95 * 1.12085 * 0.75
 *                     else:
 */
          goto __pyx_L26;
        }

        /* "_cotton2k/simulation.pyx":1524
 *                         self.defkgh += DefoliantAppRate[i] * 0.95 * 1.12085 * 0.75
 *                     else:
 *                         self.defkgh += DefoliantAppRate[i] * state.light_interception * 1.12085 * 0.75             # <<<<<<<<<<<<<<
 *                     self.tdfkgh += self.defkgh
 *             # If this is after the first day of defoliant application, compute the percent of leaves to be defoliated (PercentDefoliation), as a function of average daily temperature, leaf water potential, days after first defoliation application, and tdfkgh. The regression equation is modified from the equation suggested in GOSSYM.
 */
        /*else*/ {
          __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1524, __pyx_L1_error)
          __pyx_v_self->defkgh = (__pyx_v_self->defkgh + ((((DefoliantAppRate[__pyx_t_1]) * __pyx_v_state.light_interception) * 1.12085) * 0.75));
        }
        __pyx_L26:;

        /* "_cotton2k/simulation.pyx":1525
 *                     else:
 *                         self.defkgh += DefoliantAppRate[i] * state.light_interception * 1.12085 * 0.75
 *                     self.tdfkgh += self.defkgh             # <<<<<<<<<<<<<<
 *             # If this is after the first day of defoliant application, compute the percent of leaves to be defoliated (PercentDefoliation), as a function of average daily temperature, leaf water potential, days after first defoliation application, and tdfkgh. The regression equation is modified from the equation suggested in GOSSYM.
 *             if DefoliationDate[i] > 0 and state.daynum > self._sim.day_defoliate:
 */
        __pyx_v_self->tdfkgh = (__pyx_v_self->tdfkgh + __pyx_v_self->defkgh);
      }
      __pyx_L25:;

      /* "_cotton2k/simulation.pyx":1515
 *                             DefoliantAppRate[i + 1] = -99.9
 *                         DefoliationMethod[i] = 0
 *             if state.daynum == DefoliationDate[i]:             # <<<<<<<<<<<<<<
 *                 # If it is a predicted defoliation, assign tdfkgh as 2.5 .
 *                 # Else, compute the amount intercepted by the plants in kg per ha (defkgh), and add it to tdfkgh.
 */
    }

    /* "_cotton2k/simulation.pyx":1527
 *                     self.tdfkgh += self.defkgh
 *             # If this is after the first day of defoliant application, compute the percent of leaves to be defoliated (PercentDefoliation), as a function of average daily temperature, leaf water potential, days after first defoliation application, and tdfkgh. The regression equation is modified from the equation suggested in GOSSYM.
 *             if DefoliationDate[i] > 0 and state.daynum > self._sim.day_defoliate:             # <<<<<<<<<<<<<<
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 */
    __pyx_t_1 = __Pyx_PyIndex_AsSsize_t(__pyx_v_i); if (unlikely((__pyx_t_1 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1527, __pyx_L1_error)
    __pyx_t_5 = (((DefoliationDate[__pyx_t_1]) > 0) != 0);
    if (__pyx_t_5) {
    } else {
      __pyx_t_2 = __pyx_t_5;
      goto __pyx_L28_bool_binop_done;
    }
    __pyx_t_5 = ((__pyx_v_state.daynum > __pyx_v_self->_sim.day_defoliate) != 0);
    __pyx_t_2 = __pyx_t_5;
    __pyx_L28_bool_binop_done:;
    if (__pyx_t_2) {

      /* "_cotton2k/simulation.pyx":1528
 *             # If this is after the first day of defoliant application, compute the percent of leaves to be defoliated (PercentDefoliation), as a function of average daily temperature, leaf water potential, days after first defoliation application, and tdfkgh. The regression equation is modified from the equation suggested in GOSSYM.
 *             if DefoliationDate[i] > 0 and state.daynum > self._sim.day_defoliate:
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.             # <<<<<<<<<<<<<<
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 *                 if PercentDefoliation < 0:
 */
      __pyx_v_dum = ((-LwpMin) * 10.0);

      /* "_cotton2k/simulation.pyx":1529
 *             if DefoliationDate[i] > 0 and state.daynum > self._sim.day_defoliate:
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum             # <<<<<<<<<<<<<<
 *                 if PercentDefoliation < 0:
 *                     PercentDefoliation = 0
 */
      PercentDefoliation = ((((((__pyx_v_p1 + (__pyx_v_p2 * __pyx_v_state.average_temperature)) + (__pyx_v_p3 * __pyx_v_self->tdfkgh)) + (__pyx_v_p4 * (__pyx_v_state.daynum - __pyx_v_self->_sim.day_defoliate))) + (__pyx_v_p5 * __pyx_v_dum)) - ((__pyx_v_p6 * __pyx_v_dum) * __pyx_v_dum)) + ((((__pyx_v_p7 * __pyx_v_state.average_temperature) * __pyx_v_self->tdfkgh) * (__pyx_v_state.daynum - __pyx_v_self->_sim.day_defoliate)) * __pyx_v_dum));

      /* "_cotton2k/simulation.pyx":1530
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 *                 if PercentDefoliation < 0:             # <<<<<<<<<<<<<<
 *                     PercentDefoliation = 0
 *                 perdmax = 40  # maximum possible percent of defoliation.
 */
      __pyx_t_2 = ((PercentDefoliation < 0.0) != 0);
      if (__pyx_t_2) {

        /* "_cotton2k/simulation.pyx":1531
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 *                 if PercentDefoliation < 0:
 *                     PercentDefoliation = 0             # <<<<<<<<<<<<<<
 *                 perdmax = 40  # maximum possible percent of defoliation.
 *                 if PercentDefoliation > perdmax:
 */
        PercentDefoliation = 0.0;

        /* "_cotton2k/simulation.pyx":1530
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 *                 if PercentDefoliation < 0:             # <<<<<<<<<<<<<<
 *                     PercentDefoliation = 0
 *                 perdmax = 40  # maximum possible percent of defoliation.
 */
      }

      /* "_cotton2k/simulation.pyx":1532
 *                 if PercentDefoliation < 0:
 *                     PercentDefoliation = 0
 *                 perdmax = 40  # maximum possible percent of defoliation.             # <<<<<<<<<<<<<<
 *                 if PercentDefoliation > perdmax:
 *                     PercentDefoliation = perdmax
 */
      __pyx_v_perdmax = 40;

      /* "_cotton2k/simulation.pyx":1533
 *                     PercentDefoliation = 0
 *                 perdmax = 40  # maximum possible percent of defoliation.
 *                 if PercentDefoliation > perdmax:             # <<<<<<<<<<<<<<
 *                     PercentDefoliation = perdmax
 * 
 */
      __pyx_t_2 = ((PercentDefoliation > __pyx_v_perdmax) != 0);
      if (__pyx_t_2) {

        /* "_cotton2k/simulation.pyx":1534
 *                 perdmax = 40  # maximum possible percent of defoliation.
 *                 if PercentDefoliation > perdmax:
 *                     PercentDefoliation = perdmax             # <<<<<<<<<<<<<<
 * 
 * 
 */
        PercentDefoliation = __pyx_v_perdmax;

        /* "_cotton2k/simulation.pyx":1533
 *                     PercentDefoliation = 0
 *                 perdmax = 40  # maximum possible percent of defoliation.
 *                 if PercentDefoliation > perdmax:             # <<<<<<<<<<<<<<
 *                     PercentDefoliation = perdmax
 * 
 */
      }

      /* "_cotton2k/simulation.pyx":1527
 *                     self.tdfkgh += self.defkgh
 *             # If this is after the first day of defoliant application, compute the percent of leaves to be defoliated (PercentDefoliation), as a function of average daily temperature, leaf water potential, days after first defoliation application, and tdfkgh. The regression equation is modified from the equation suggested in GOSSYM.
 *             if DefoliationDate[i] > 0 and state.daynum > self._sim.day_defoliate:             # <<<<<<<<<<<<<<
 *                 dum = -LwpMin * 10  # value of LwpMin in bars.
 *                 PercentDefoliation = p1 + p2 * state.average_temperature + p3 * self.tdfkgh + p4 * (state.daynum - self._sim.day_defoliate) + p5 * dum - p6 * dum * dum + p7 * state.average_temperature * self.tdfkgh * (state.daynum - self._sim.day_defoliate) * dum
 */
    }
  }

  /* "_cotton2k/simulation.pyx":1474
 *         LeafAbscission(self._sim, u)
 * 
 *     def _defoliate(self, u):             # <<<<<<<<<<<<<<
 *         """This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay()."""
 *         global PercentDefoliation
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._defoliate", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_i);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1537
 * 
 * 
 *     def _simulate_this_day(self, u):             # <<<<<<<<<<<<<<
 *         global isw
 *         state = self.state(u)
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_37_simulate_this_day(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_37_simulate_this_day = {"_simulate_this_day", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_37_simulate_this_day, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_37_simulate_this_day(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_u = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_simulate_this_day (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_u,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_u)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1537, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "_simulate_this_day") < 0)) __PYX_ERR(0, 1537, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_u = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("_simulate_this_day", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1537, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._simulate_this_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_36_simulate_this_day(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_u);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_36_simulate_this_day(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_u) {
  PyObject *__pyx_v_state = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  int __pyx_t_6;
  double __pyx_t_7[20];
  uint32_t __pyx_t_8;
  unsigned int __pyx_t_9;
  Py_ssize_t __pyx_t_10;
  int __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_simulate_this_day", 0);

  /* "_cotton2k/simulation.pyx":1539
 *     def _simulate_this_day(self, u):
 *         global isw
 *         state = self.state(u)             # <<<<<<<<<<<<<<
 *         if 0 < self._sim.day_emerge <= self._sim.day_start + u:
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_state); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1539, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_3, __pyx_v_u};
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1539, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __pyx_v_state = __pyx_t_1;
  __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1540
 *         global isw
 *         state = self.state(u)
 *         if 0 < self._sim.day_emerge <= self._sim.day_start + u:             # <<<<<<<<<<<<<<
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1
 *             self._calc_light_interception(u)
 */
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyObject_RichCompare(__pyx_int_0, __pyx_t_1, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error)
  if (__Pyx_PyObject_IsTrue(__pyx_t_2)) {
    __Pyx_DECREF(__pyx_t_2);
    __pyx_t_3 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_start); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_5 = PyNumber_Add(__pyx_t_3, __pyx_v_u); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1540, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_LE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1540, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_6 < 0))) __PYX_ERR(0, 1540, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1541
 *         state = self.state(u)
 *         if 0 < self._sim.day_emerge <= self._sim.day_start + u:
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1             # <<<<<<<<<<<<<<
 *             self._calc_light_interception(u)
 *             self._column_shading(u)
 */
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_start); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyNumber_Add(__pyx_t_2, __pyx_v_u); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_5 = PyNumber_Subtract(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_PyInt_AddObjC(__pyx_t_5, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_state, __pyx_n_s_kday, __pyx_t_2) < 0) __PYX_ERR(0, 1541, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":1542
 *         if 0 < self._sim.day_emerge <= self._sim.day_start + u:
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1
 *             self._calc_light_interception(u)             # <<<<<<<<<<<<<<
 *             self._column_shading(u)
 *         else:
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_calc_light_interception); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1542, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_u};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1542, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":1543
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1
 *             self._calc_light_interception(u)
 *             self._column_shading(u)             # <<<<<<<<<<<<<<
 *         else:
 *             state.kday = 0
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_column_shading); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1543, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_1 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_1)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_1);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_u};
      __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
      if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1543, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_2);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "_cotton2k/simulation.pyx":1540
 *         global isw
 *         state = self.state(u)
 *         if 0 < self._sim.day_emerge <= self._sim.day_start + u:             # <<<<<<<<<<<<<<
 *             state.kday = (self._sim.day_start + u) - self._sim.day_emerge + 1
 *             self._calc_light_interception(u)
 */
    goto __pyx_L3;
  }

  /* "_cotton2k/simulation.pyx":1545
 *             self._column_shading(u)
 *         else:
 *             state.kday = 0             # <<<<<<<<<<<<<<
 *             state.light_interception = 0
 *             self.relative_radiation_received_by_a_soil_column = [1] * 20
 */
  /*else*/ {
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_state, __pyx_n_s_kday, __pyx_int_0) < 0) __PYX_ERR(0, 1545, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1546
 *         else:
 *             state.kday = 0
 *             state.light_interception = 0             # <<<<<<<<<<<<<<
 *             self.relative_radiation_received_by_a_soil_column = [1] * 20
 *         # The following functions are executed each day (also before emergence).
 */
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_state, __pyx_n_s_light_interception, __pyx_int_0) < 0) __PYX_ERR(0, 1546, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1547
 *             state.kday = 0
 *             state.light_interception = 0
 *             self.relative_radiation_received_by_a_soil_column = [1] * 20             # <<<<<<<<<<<<<<
 *         # The following functions are executed each day (also before emergence).
 *         self._daily_climate(u)  # computes climate variables for today.
 */
    {
      Py_ssize_t __pyx_temp;
      for (__pyx_temp = 0; __pyx_temp < 20; __pyx_temp++) {
        __pyx_t_7[0+ (1 * __pyx_temp)] = 1.0;
      }
    }
    memcpy(&(__pyx_v_self->relative_radiation_received_by_a_soil_column[0]), __pyx_t_7, sizeof(__pyx_v_self->relative_radiation_received_by_a_soil_column[0]) * (20));
  }
  __pyx_L3:;

  /* "_cotton2k/simulation.pyx":1549
 *             self.relative_radiation_received_by_a_soil_column = [1] * 20
 *         # The following functions are executed each day (also before emergence).
 *         self._daily_climate(u)  # computes climate variables for today.             # <<<<<<<<<<<<<<
 *         SoilTemperature(self._sim, u,
 *                         self.relative_radiation_received_by_a_soil_column)  # executes all modules of soil and canopy temperature.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_daily_climate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1549, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
    __pyx_t_1 = PyMethod_GET_SELF(__pyx_t_5);
    if (likely(__pyx_t_1)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
      __Pyx_INCREF(__pyx_t_1);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_5, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_1, __pyx_v_u};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1549, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  }
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":1550
 *         # The following functions are executed each day (also before emergence).
 *         self._daily_climate(u)  # computes climate variables for today.
 *         SoilTemperature(self._sim, u,             # <<<<<<<<<<<<<<
 *                         self.relative_radiation_received_by_a_soil_column)  # executes all modules of soil and canopy temperature.
 *         SoilProcedures(self._sim, u)  # executes all other soil processes.
 */
  __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1550, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1551
 *         self._daily_climate(u)  # computes climate variables for today.
 *         SoilTemperature(self._sim, u,
 *                         self.relative_radiation_received_by_a_soil_column)  # executes all modules of soil and canopy temperature.             # <<<<<<<<<<<<<<
 *         SoilProcedures(self._sim, u)  # executes all other soil processes.
 *         SoilNitrogen(self._sim, u)  # computes nitrogen transformations in the soil.
 */
  SoilTemperature(__pyx_v_self->_sim, __pyx_t_8, __pyx_v_self->relative_radiation_received_by_a_soil_column);

  /* "_cotton2k/simulation.pyx":1552
 *         SoilTemperature(self._sim, u,
 *                         self.relative_radiation_received_by_a_soil_column)  # executes all modules of soil and canopy temperature.
 *         SoilProcedures(self._sim, u)  # executes all other soil processes.             # <<<<<<<<<<<<<<
 *         SoilNitrogen(self._sim, u)  # computes nitrogen transformations in the soil.
 *         SoilSum(self._sim.states[u], self._sim.row_space)  # computes totals of water and N in the soil.
 */
  __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1552, __pyx_L1_error)
  SoilProcedures(__pyx_v_self->_sim, __pyx_t_8);

  /* "_cotton2k/simulation.pyx":1553
 *                         self.relative_radiation_received_by_a_soil_column)  # executes all modules of soil and canopy temperature.
 *         SoilProcedures(self._sim, u)  # executes all other soil processes.
 *         SoilNitrogen(self._sim, u)  # computes nitrogen transformations in the soil.             # <<<<<<<<<<<<<<
 *         SoilSum(self._sim.states[u], self._sim.row_space)  # computes totals of water and N in the soil.
 *         # The following is executed each day after plant emergence:
 */
  __pyx_t_9 = __Pyx_PyInt_As_unsigned_int(__pyx_v_u); if (unlikely((__pyx_t_9 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1553, __pyx_L1_error)
  SoilNitrogen(__pyx_v_self->_sim, __pyx_t_9);

  /* "_cotton2k/simulation.pyx":1554
 *         SoilProcedures(self._sim, u)  # executes all other soil processes.
 *         SoilNitrogen(self._sim, u)  # computes nitrogen transformations in the soil.
 *         SoilSum(self._sim.states[u], self._sim.row_space)  # computes totals of water and N in the soil.             # <<<<<<<<<<<<<<
 *         # The following is executed each day after plant emergence:
 *         if state.daynum >= self._sim.day_emerge and isw > 0:
 */
  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1554, __pyx_L1_error)
  SoilSum((__pyx_v_self->_sim.states[__pyx_t_10]), __pyx_v_self->_sim.row_space);

  /* "_cotton2k/simulation.pyx":1556
 *         SoilSum(self._sim.states[u], self._sim.row_space)  # computes totals of water and N in the soil.
 *         # The following is executed each day after plant emergence:
 *         if state.daynum >= self._sim.day_emerge and isw > 0:             # <<<<<<<<<<<<<<
 *             # If this day is after emergence, assign to isw the value of 2.
 *             isw = 2
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_daynum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->_sim.day_emerge); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyObject_RichCompare(__pyx_t_2, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_1); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1556, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (__pyx_t_11) {
  } else {
    __pyx_t_6 = __pyx_t_11;
    goto __pyx_L5_bool_binop_done;
  }
  __pyx_t_11 = ((isw > 0) != 0);
  __pyx_t_6 = __pyx_t_11;
  __pyx_L5_bool_binop_done:;
  if (__pyx_t_6) {

    /* "_cotton2k/simulation.pyx":1558
 *         if state.daynum >= self._sim.day_emerge and isw > 0:
 *             # If this day is after emergence, assign to isw the value of 2.
 *             isw = 2             # <<<<<<<<<<<<<<
 *             state.day_inc = PhysiologicalAge(self._sim.states[u].hours)  # physiological days increment for this day. computes physiological age
 *             self._defoliate(u)  # effects of defoliants applied.
 */
    isw = 2;

    /* "_cotton2k/simulation.pyx":1559
 *             # If this day is after emergence, assign to isw the value of 2.
 *             isw = 2
 *             state.day_inc = PhysiologicalAge(self._sim.states[u].hours)  # physiological days increment for this day. computes physiological age             # <<<<<<<<<<<<<<
 *             self._defoliate(u)  # effects of defoliants applied.
 *             self._stress(u)  # computes water stress factors.
 */
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1559, __pyx_L1_error)
    __pyx_t_1 = PyFloat_FromDouble(PhysiologicalAge((__pyx_v_self->_sim.states[__pyx_t_10]).hours)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    if (__Pyx_PyObject_SetAttrStr(__pyx_v_state, __pyx_n_s_day_inc, __pyx_t_1) < 0) __PYX_ERR(0, 1559, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1560
 *             isw = 2
 *             state.day_inc = PhysiologicalAge(self._sim.states[u].hours)  # physiological days increment for this day. computes physiological age
 *             self._defoliate(u)  # effects of defoliants applied.             # <<<<<<<<<<<<<<
 *             self._stress(u)  # computes water stress factors.
 *             self._get_net_photosynthesis(u)  # computes net photosynthesis.
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_defoliate); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1560, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1560, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1561
 *             state.day_inc = PhysiologicalAge(self._sim.states[u].hours)  # physiological days increment for this day. computes physiological age
 *             self._defoliate(u)  # effects of defoliants applied.
 *             self._stress(u)  # computes water stress factors.             # <<<<<<<<<<<<<<
 *             self._get_net_photosynthesis(u)  # computes net photosynthesis.
 *             self._growth(u)  # executes all modules of plant growth.
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_stress); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1561, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1561, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1562
 *             self._defoliate(u)  # effects of defoliants applied.
 *             self._stress(u)  # computes water stress factors.
 *             self._get_net_photosynthesis(u)  # computes net photosynthesis.             # <<<<<<<<<<<<<<
 *             self._growth(u)  # executes all modules of plant growth.
 *             self._phenology(u)  # executes all modules of plant phenology.
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_get_net_photosynthesis); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1562, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1562, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1563
 *             self._stress(u)  # computes water stress factors.
 *             self._get_net_photosynthesis(u)  # computes net photosynthesis.
 *             self._growth(u)  # executes all modules of plant growth.             # <<<<<<<<<<<<<<
 *             self._phenology(u)  # executes all modules of plant phenology.
 *             PlantNitrogen(self._sim, u)  # computes plant nitrogen allocation.
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_growth); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1563, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1563, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1564
 *             self._get_net_photosynthesis(u)  # computes net photosynthesis.
 *             self._growth(u)  # executes all modules of plant growth.
 *             self._phenology(u)  # executes all modules of plant phenology.             # <<<<<<<<<<<<<<
 *             PlantNitrogen(self._sim, u)  # computes plant nitrogen allocation.
 *             CheckDryMatterBal(self._sim.states[u])  # checks plant dry matter balance.
 */
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_phenology); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1564, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_2 = NULL;
    __pyx_t_4 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
      __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_5);
      if (likely(__pyx_t_2)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
        __Pyx_INCREF(__pyx_t_2);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_5, function);
        __pyx_t_4 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_2, __pyx_v_u};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_5, __pyx_callargs+1-__pyx_t_4, 1+__pyx_t_4);
      __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1564, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1565
 *             self._growth(u)  # executes all modules of plant growth.
 *             self._phenology(u)  # executes all modules of plant phenology.
 *             PlantNitrogen(self._sim, u)  # computes plant nitrogen allocation.             # <<<<<<<<<<<<<<
 *             CheckDryMatterBal(self._sim.states[u])  # checks plant dry matter balance.
 *         # Check if the date to stop simulation has been reached, or if this is the last day with available weather data. Simulation will also stop when no leaves remain on the plant.
 */
    __pyx_t_8 = __Pyx_PyInt_As_uint32_t(__pyx_v_u); if (unlikely((__pyx_t_8 == ((uint32_t)-1)) && PyErr_Occurred())) __PYX_ERR(0, 1565, __pyx_L1_error)
    PlantNitrogen(__pyx_v_self->_sim, __pyx_t_8);

    /* "_cotton2k/simulation.pyx":1566
 *             self._phenology(u)  # executes all modules of plant phenology.
 *             PlantNitrogen(self._sim, u)  # computes plant nitrogen allocation.
 *             CheckDryMatterBal(self._sim.states[u])  # checks plant dry matter balance.             # <<<<<<<<<<<<<<
 *         # Check if the date to stop simulation has been reached, or if this is the last day with available weather data. Simulation will also stop when no leaves remain on the plant.
 *         if state.daynum >= LastDayWeatherData or (state.kday > 10 and state.leaf_area_index < 0.0002):
 */
    __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_u); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1566, __pyx_L1_error)
    CheckDryMatterBal((__pyx_v_self->_sim.states[__pyx_t_10]));

    /* "_cotton2k/simulation.pyx":1556
 *         SoilSum(self._sim.states[u], self._sim.row_space)  # computes totals of water and N in the soil.
 *         # The following is executed each day after plant emergence:
 *         if state.daynum >= self._sim.day_emerge and isw > 0:             # <<<<<<<<<<<<<<
 *             # If this day is after emergence, assign to isw the value of 2.
 *             isw = 2
 */
  }

  /* "_cotton2k/simulation.pyx":1568
 *             CheckDryMatterBal(self._sim.states[u])  # checks plant dry matter balance.
 *         # Check if the date to stop simulation has been reached, or if this is the last day with available weather data. Simulation will also stop when no leaves remain on the plant.
 *         if state.daynum >= LastDayWeatherData or (state.kday > 10 and state.leaf_area_index < 0.0002):             # <<<<<<<<<<<<<<
 *             raise SimulationEnd
 * 
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_daynum); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyInt_From_int(LastDayWeatherData); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_1, __pyx_t_5, Py_GE); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  if (!__pyx_t_11) {
  } else {
    __pyx_t_6 = __pyx_t_11;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_kday); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_5 = PyObject_RichCompare(__pyx_t_2, __pyx_int_10, Py_GT); __Pyx_XGOTREF(__pyx_t_5); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_5); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  if (__pyx_t_11) {
  } else {
    __pyx_t_6 = __pyx_t_11;
    goto __pyx_L8_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_state, __pyx_n_s_leaf_area_index); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = PyObject_RichCompare(__pyx_t_5, __pyx_float_0_0002, Py_LT); __Pyx_XGOTREF(__pyx_t_2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_11 = __Pyx_PyObject_IsTrue(__pyx_t_2); if (unlikely((__pyx_t_11 < 0))) __PYX_ERR(0, 1568, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_6 = __pyx_t_11;
  __pyx_L8_bool_binop_done:;
  if (unlikely(__pyx_t_6)) {

    /* "_cotton2k/simulation.pyx":1569
 *         # Check if the date to stop simulation has been reached, or if this is the last day with available weather data. Simulation will also stop when no leaves remain on the plant.
 *         if state.daynum >= LastDayWeatherData or (state.kday > 10 and state.leaf_area_index < 0.0002):
 *             raise SimulationEnd             # <<<<<<<<<<<<<<
 * 
 *     def _init_grid(self):
 */
    __Pyx_GetModuleGlobalName(__pyx_t_2, __pyx_n_s_SimulationEnd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1569, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_Raise(__pyx_t_2, 0, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(0, 1569, __pyx_L1_error)

    /* "_cotton2k/simulation.pyx":1568
 *             CheckDryMatterBal(self._sim.states[u])  # checks plant dry matter balance.
 *         # Check if the date to stop simulation has been reached, or if this is the last day with available weather data. Simulation will also stop when no leaves remain on the plant.
 *         if state.daynum >= LastDayWeatherData or (state.kday > 10 and state.leaf_area_index < 0.0002):             # <<<<<<<<<<<<<<
 *             raise SimulationEnd
 * 
 */
  }

  /* "_cotton2k/simulation.pyx":1537
 * 
 * 
 *     def _simulate_this_day(self, u):             # <<<<<<<<<<<<<<
 *         global isw
 *         state = self.state(u)
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._simulate_this_day", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_state);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1571
 *             raise SimulationEnd
 * 
 *     def _init_grid(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function initializes the soil grid variables. It is executed once at the beginning of the simulation. It is called from ReadInput().
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_39_init_grid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_38_init_grid, "\n        This function initializes the soil grid variables. It is executed once at the beginning of the simulation. It is called from ReadInput().\n\n        The following global or file-scope variables are set here:\n        nk, nl.\n\n        The following global variables are referenced here:\n        maxk, maxl.\n        ");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_39_init_grid = {"_init_grid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_39_init_grid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_38_init_grid};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_39_init_grid(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("_init_grid (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("_init_grid", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "_init_grid", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_38_init_grid(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_38_init_grid(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  double __pyx_v_sumwk;
  PyObject *__pyx_v_k = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  double __pyx_t_3;
  int __pyx_t_4;
  PyObject *__pyx_t_5 = NULL;
  Py_ssize_t __pyx_t_6;
  PyObject *(*__pyx_t_7)(PyObject *);
  unsigned int __pyx_t_8;
  int __pyx_t_9;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("_init_grid", 0);

  /* "_cotton2k/simulation.pyx":1583
 *         # PlantRowLocation is the distance from edge of slab, cm, of the plant row.
 *         global PlantRowLocation, nl, nk
 *         PlantRowLocation = 0.5 * self.row_space             # <<<<<<<<<<<<<<
 *         if self.skip_row_width > 1:
 *             # If there is a skiprow arrangement, RowSpace and PlantRowLocation are redefined.
 */
  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_2); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1583, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  PlantRowLocation = __pyx_t_3;

  /* "_cotton2k/simulation.pyx":1584
 *         global PlantRowLocation, nl, nk
 *         PlantRowLocation = 0.5 * self.row_space
 *         if self.skip_row_width > 1:             # <<<<<<<<<<<<<<
 *             # If there is a skiprow arrangement, RowSpace and PlantRowLocation are redefined.
 *             self.row_space = 0.5 * (
 */
  __pyx_t_4 = ((__pyx_v_self->skip_row_width > 1.0) != 0);
  if (__pyx_t_4) {

    /* "_cotton2k/simulation.pyx":1587
 *             # If there is a skiprow arrangement, RowSpace and PlantRowLocation are redefined.
 *             self.row_space = 0.5 * (
 *                     self.row_space + self.skip_row_width)  # actual width of the soil slab (cm)             # <<<<<<<<<<<<<<
 *             PlantRowLocation = 0.5 * self.skip_row_width
 *         # Compute sim.plant_population - number of plants per hectar, and per_plant_area - the average surface area per plant, in dm2, and the empirical plant density factor (density_factor). This factor will be used to express the effect of plant density on some plant growth rate functions.
 */
    __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->skip_row_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_5 = PyNumber_Add(__pyx_t_2, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1587, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1586
 *         if self.skip_row_width > 1:
 *             # If there is a skiprow arrangement, RowSpace and PlantRowLocation are redefined.
 *             self.row_space = 0.5 * (             # <<<<<<<<<<<<<<
 *                     self.row_space + self.skip_row_width)  # actual width of the soil slab (cm)
 *             PlantRowLocation = 0.5 * self.skip_row_width
 */
    __pyx_t_1 = PyNumber_Multiply(__pyx_float_0_5, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1586, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    if (__Pyx_PyObject_SetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space, __pyx_t_1) < 0) __PYX_ERR(0, 1586, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "_cotton2k/simulation.pyx":1588
 *             self.row_space = 0.5 * (
 *                     self.row_space + self.skip_row_width)  # actual width of the soil slab (cm)
 *             PlantRowLocation = 0.5 * self.skip_row_width             # <<<<<<<<<<<<<<
 *         # Compute sim.plant_population - number of plants per hectar, and per_plant_area - the average surface area per plant, in dm2, and the empirical plant density factor (density_factor). This factor will be used to express the effect of plant density on some plant growth rate functions.
 *         # NOTE: density_factor = 1 for 5 plants per sq m (or 50000 per ha).
 */
    PlantRowLocation = (0.5 * __pyx_v_self->skip_row_width);

    /* "_cotton2k/simulation.pyx":1584
 *         global PlantRowLocation, nl, nk
 *         PlantRowLocation = 0.5 * self.row_space
 *         if self.skip_row_width > 1:             # <<<<<<<<<<<<<<
 *             # If there is a skiprow arrangement, RowSpace and PlantRowLocation are redefined.
 *             self.row_space = 0.5 * (
 */
  }

  /* "_cotton2k/simulation.pyx":1591
 *         # Compute sim.plant_population - number of plants per hectar, and per_plant_area - the average surface area per plant, in dm2, and the empirical plant density factor (density_factor). This factor will be used to express the effect of plant density on some plant growth rate functions.
 *         # NOTE: density_factor = 1 for 5 plants per sq m (or 50000 per ha).
 *         self._sim.plant_population = self.plants_per_meter / self.row_space * 1000000             # <<<<<<<<<<<<<<
 *         self._sim.per_plant_area = 1000000 / self._sim.plant_population
 *         self._sim.density_factor = exp(self.cultivar_parameters[1] * (5 - self._sim.plant_population / 10000))
 */
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->plants_per_meter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_PyNumber_Divide(__pyx_t_1, __pyx_t_5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = __Pyx_PyInt_MultiplyObjC(__pyx_t_2, __pyx_int_1000000, 0xF4240, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1591, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_v_self->_sim.plant_population = __pyx_t_3;

  /* "_cotton2k/simulation.pyx":1592
 *         # NOTE: density_factor = 1 for 5 plants per sq m (or 50000 per ha).
 *         self._sim.plant_population = self.plants_per_meter / self.row_space * 1000000
 *         self._sim.per_plant_area = 1000000 / self._sim.plant_population             # <<<<<<<<<<<<<<
 *         self._sim.density_factor = exp(self.cultivar_parameters[1] * (5 - self._sim.plant_population / 10000))
 *         # Define the numbers of rows and columns in the soil slab (nl, nk).
 */
  if (unlikely(__pyx_v_self->_sim.plant_population == 0)) {
    PyErr_SetString(PyExc_ZeroDivisionError, "float division");
    __PYX_ERR(0, 1592, __pyx_L1_error)
  }
  __pyx_v_self->_sim.per_plant_area = (1000000.0 / __pyx_v_self->_sim.plant_population);

  /* "_cotton2k/simulation.pyx":1593
 *         self._sim.plant_population = self.plants_per_meter / self.row_space * 1000000
 *         self._sim.per_plant_area = 1000000 / self._sim.plant_population
 *         self._sim.density_factor = exp(self.cultivar_parameters[1] * (5 - self._sim.plant_population / 10000))             # <<<<<<<<<<<<<<
 *         # Define the numbers of rows and columns in the soil slab (nl, nk).
 *         # Define the depth, in cm, of consecutive nl layers.
 */
  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_cultivar_parameters); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_2 = __Pyx_GetItemInt(__pyx_t_5, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_5 = PyFloat_FromDouble((5.0 - (__pyx_v_self->_sim.plant_population / 10000.0))); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __pyx_t_1 = PyNumber_Multiply(__pyx_t_2, __pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_1); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1593, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v_self->_sim.density_factor = exp(__pyx_t_3);

  /* "_cotton2k/simulation.pyx":1597
 *         # Define the depth, in cm, of consecutive nl layers.
 *         # NOTE: maxl and maxk are defined as constants in file "global.h".
 *         nl = maxl             # <<<<<<<<<<<<<<
 *         nk = maxk
 *         # The width of the slab columns is computed by dividing the row spacing by the number of columns. It is assumed that slab width is equal to the average row spacing, and column widths are uniform.
 */
  nl = maxl;

  /* "_cotton2k/simulation.pyx":1598
 *         # NOTE: maxl and maxk are defined as constants in file "global.h".
 *         nl = maxl
 *         nk = maxk             # <<<<<<<<<<<<<<
 *         # The width of the slab columns is computed by dividing the row spacing by the number of columns. It is assumed that slab width is equal to the average row spacing, and column widths are uniform.
 *         # NOTE: wk is an array - to enable the option of non-uniform column widths in the future.
 */
  nk = maxk;

  /* "_cotton2k/simulation.pyx":1602
 *         # NOTE: wk is an array - to enable the option of non-uniform column widths in the future.
 *         # PlantRowColumn (the column including the plant row) is now computed from PlantRowLocation (the distance of the plant row from the edge of the slab).
 *         cdef double sumwk = 0  # sum of column widths             # <<<<<<<<<<<<<<
 *         self._sim.plant_row_column = 0
 *         for k in range(nk):
 */
  __pyx_v_sumwk = 0.0;

  /* "_cotton2k/simulation.pyx":1603
 *         # PlantRowColumn (the column including the plant row) is now computed from PlantRowLocation (the distance of the plant row from the edge of the slab).
 *         cdef double sumwk = 0  # sum of column widths
 *         self._sim.plant_row_column = 0             # <<<<<<<<<<<<<<
 *         for k in range(nk):
 *             sumwk = sumwk + wk(k, self.row_space)
 */
  __pyx_v_self->_sim.plant_row_column = 0;

  /* "_cotton2k/simulation.pyx":1604
 *         cdef double sumwk = 0  # sum of column widths
 *         self._sim.plant_row_column = 0
 *         for k in range(nk):             # <<<<<<<<<<<<<<
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 */
  __pyx_t_1 = __Pyx_PyInt_From_int(nk); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_5 = __Pyx_PyObject_CallOneArg(__pyx_builtin_range, __pyx_t_1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1604, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_5);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  if (likely(PyList_CheckExact(__pyx_t_5)) || PyTuple_CheckExact(__pyx_t_5)) {
    __pyx_t_1 = __pyx_t_5; __Pyx_INCREF(__pyx_t_1); __pyx_t_6 = 0;
    __pyx_t_7 = NULL;
  } else {
    __pyx_t_6 = -1; __pyx_t_1 = PyObject_GetIter(__pyx_t_5); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1604, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __pyx_t_7 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_1); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 1604, __pyx_L1_error)
  }
  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
  for (;;) {
    if (likely(!__pyx_t_7)) {
      if (likely(PyList_CheckExact(__pyx_t_1))) {
        if (__pyx_t_6 >= PyList_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyList_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1604, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      } else {
        if (__pyx_t_6 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
        #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
        __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_6); __Pyx_INCREF(__pyx_t_5); __pyx_t_6++; if (unlikely((0 < 0))) __PYX_ERR(0, 1604, __pyx_L1_error)
        #else
        __pyx_t_5 = PySequence_ITEM(__pyx_t_1, __pyx_t_6); __pyx_t_6++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1604, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        #endif
      }
    } else {
      __pyx_t_5 = __pyx_t_7(__pyx_t_1);
      if (unlikely(!__pyx_t_5)) {
        PyObject* exc_type = PyErr_Occurred();
        if (exc_type) {
          if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
          else __PYX_ERR(0, 1604, __pyx_L1_error)
        }
        break;
      }
      __Pyx_GOTREF(__pyx_t_5);
    }
    __Pyx_XDECREF_SET(__pyx_v_k, __pyx_t_5);
    __pyx_t_5 = 0;

    /* "_cotton2k/simulation.pyx":1605
 *         self._sim.plant_row_column = 0
 *         for k in range(nk):
 *             sumwk = sumwk + wk(k, self.row_space)             # <<<<<<<<<<<<<<
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):
 */
    __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_v_k); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L1_error)
    __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_5);
    __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1605, __pyx_L1_error)
    __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
    __pyx_v_sumwk = (__pyx_v_sumwk + wk(__pyx_t_8, __pyx_t_3));

    /* "_cotton2k/simulation.pyx":1606
 *         for k in range(nk):
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:             # <<<<<<<<<<<<<<
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):
 *                     self._sim.plant_row_column = k - 1
 */
    __pyx_t_9 = ((__pyx_v_self->_sim.plant_row_column == 0) != 0);
    if (__pyx_t_9) {
    } else {
      __pyx_t_4 = __pyx_t_9;
      goto __pyx_L7_bool_binop_done;
    }
    __pyx_t_9 = ((__pyx_v_sumwk > PlantRowLocation) != 0);
    __pyx_t_4 = __pyx_t_9;
    __pyx_L7_bool_binop_done:;
    if (__pyx_t_4) {

      /* "_cotton2k/simulation.pyx":1607
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):             # <<<<<<<<<<<<<<
 *                     self._sim.plant_row_column = k - 1
 *                 else:
 */
      __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_v_k); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L1_error)
      __pyx_t_5 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_row_space); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1607, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_5);
      __pyx_t_3 = __pyx_PyFloat_AsDouble(__pyx_t_5); if (unlikely((__pyx_t_3 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 1607, __pyx_L1_error)
      __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
      __pyx_t_4 = (((__pyx_v_sumwk - PlantRowLocation) > (0.5 * wk(__pyx_t_8, __pyx_t_3))) != 0);
      if (__pyx_t_4) {

        /* "_cotton2k/simulation.pyx":1608
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):
 *                     self._sim.plant_row_column = k - 1             # <<<<<<<<<<<<<<
 *                 else:
 *                     self._sim.plant_row_column = k
 */
        __pyx_t_5 = __Pyx_PyInt_SubtractObjC(__pyx_v_k, __pyx_int_1, 1, 0, 0); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1608, __pyx_L1_error)
        __Pyx_GOTREF(__pyx_t_5);
        __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_t_5); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1608, __pyx_L1_error)
        __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
        __pyx_v_self->_sim.plant_row_column = __pyx_t_8;

        /* "_cotton2k/simulation.pyx":1607
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):             # <<<<<<<<<<<<<<
 *                     self._sim.plant_row_column = k - 1
 *                 else:
 */
        goto __pyx_L9;
      }

      /* "_cotton2k/simulation.pyx":1610
 *                     self._sim.plant_row_column = k - 1
 *                 else:
 *                     self._sim.plant_row_column = k             # <<<<<<<<<<<<<<
 * 
 *     def read_input(self, lyrsol, **kwargs):
 */
      /*else*/ {
        __pyx_t_8 = __Pyx_PyInt_As_unsigned_int(__pyx_v_k); if (unlikely((__pyx_t_8 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1610, __pyx_L1_error)
        __pyx_v_self->_sim.plant_row_column = __pyx_t_8;
      }
      __pyx_L9:;

      /* "_cotton2k/simulation.pyx":1606
 *         for k in range(nk):
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:             # <<<<<<<<<<<<<<
 *                 if (sumwk - PlantRowLocation) > (0.5 * wk(k, self.row_space)):
 *                     self._sim.plant_row_column = k - 1
 */
    }

    /* "_cotton2k/simulation.pyx":1604
 *         cdef double sumwk = 0  # sum of column widths
 *         self._sim.plant_row_column = 0
 *         for k in range(nk):             # <<<<<<<<<<<<<<
 *             sumwk = sumwk + wk(k, self.row_space)
 *             if self._sim.plant_row_column == 0 and sumwk > PlantRowLocation:
 */
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1571
 *             raise SimulationEnd
 * 
 *     def _init_grid(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function initializes the soil grid variables. It is executed once at the beginning of the simulation. It is called from ReadInput().
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_5);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation._init_grid", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_k);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":1612
 *                     self._sim.plant_row_column = k
 * 
 *     def read_input(self, lyrsol, **kwargs):             # <<<<<<<<<<<<<<
 *         """This is the main function for reading input."""
 *         InitializeGlobal()
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_41read_input(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
PyDoc_STRVAR(__pyx_doc_9_cotton2k_10simulation_10Simulation_40read_input, "This is the main function for reading input.");
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_41read_input = {"read_input", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_41read_input, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_40read_input};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_41read_input(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v_lyrsol = 0;
  PyObject *__pyx_v_kwargs = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("read_input (wrapper)", 0);
  __pyx_v_kwargs = PyDict_New(); if (unlikely(!__pyx_v_kwargs)) return NULL;
  __Pyx_GOTREF(__pyx_v_kwargs);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lyrsol,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_lyrsol,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_lyrsol)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 1612, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, __pyx_v_kwargs, values + 0, kwd_pos_args, "read_input") < 0)) __PYX_ERR(0, 1612, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v_lyrsol = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("read_input", 1, 1, 1, __pyx_nargs); __PYX_ERR(0, 1612, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_DECREF(__pyx_v_kwargs); __pyx_v_kwargs = 0;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.read_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_40read_input(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v_lyrsol, __pyx_v_kwargs);

  /* function exit code */
  __Pyx_DECREF(__pyx_v_kwargs);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_40read_input(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_lyrsol, PyObject *__pyx_v_kwargs) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  int __pyx_t_4;
  unsigned int __pyx_t_5;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("read_input", 0);

  /* "_cotton2k/simulation.pyx":1614
 *     def read_input(self, lyrsol, **kwargs):
 *         """This is the main function for reading input."""
 *         InitializeGlobal()             # <<<<<<<<<<<<<<
 *         initialize_switch(self._sim)
 *         self._init_grid()
 */
  InitializeGlobal();

  /* "_cotton2k/simulation.pyx":1615
 *         """This is the main function for reading input."""
 *         InitializeGlobal()
 *         initialize_switch(self._sim)             # <<<<<<<<<<<<<<
 *         self._init_grid()
 *         read_agricultural_input(self._sim, kwargs.get("agricultural_inputs", []))
 */
  __pyx_f_9_cotton2k_10simulation_initialize_switch(__pyx_v_self->_sim);

  /* "_cotton2k/simulation.pyx":1616
 *         InitializeGlobal()
 *         initialize_switch(self._sim)
 *         self._init_grid()             # <<<<<<<<<<<<<<
 *         read_agricultural_input(self._sim, kwargs.get("agricultural_inputs", []))
 *         InitializeSoilData(self._sim, lyrsol)
 */
  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_init_grid); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1616, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = NULL;
  __pyx_t_4 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
    __pyx_t_3 = PyMethod_GET_SELF(__pyx_t_2);
    if (likely(__pyx_t_3)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
      __Pyx_INCREF(__pyx_t_3);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_2, function);
      __pyx_t_4 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[1] = {__pyx_t_3, };
    __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_2, __pyx_callargs+1-__pyx_t_4, 0+__pyx_t_4);
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1616, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  }
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1617
 *         initialize_switch(self._sim)
 *         self._init_grid()
 *         read_agricultural_input(self._sim, kwargs.get("agricultural_inputs", []))             # <<<<<<<<<<<<<<
 *         InitializeSoilData(self._sim, lyrsol)
 *         InitializeSoilTemperature()
 */
  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyDict_GetItemDefault(__pyx_v_kwargs, __pyx_n_u_agricultural_inputs, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __pyx_f_9_cotton2k_10simulation_read_agricultural_input(__pyx_v_self->_sim, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1617, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1618
 *         self._init_grid()
 *         read_agricultural_input(self._sim, kwargs.get("agricultural_inputs", []))
 *         InitializeSoilData(self._sim, lyrsol)             # <<<<<<<<<<<<<<
 *         InitializeSoilTemperature()
 *         InitializeRootData(self._sim)
 */
  __pyx_t_5 = __Pyx_PyInt_As_unsigned_int(__pyx_v_lyrsol); if (unlikely((__pyx_t_5 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 1618, __pyx_L1_error)
  InitializeSoilData(__pyx_v_self->_sim, __pyx_t_5);

  /* "_cotton2k/simulation.pyx":1619
 *         read_agricultural_input(self._sim, kwargs.get("agricultural_inputs", []))
 *         InitializeSoilData(self._sim, lyrsol)
 *         InitializeSoilTemperature()             # <<<<<<<<<<<<<<
 *         InitializeRootData(self._sim)
 */
  InitializeSoilTemperature();

  /* "_cotton2k/simulation.pyx":1620
 *         InitializeSoilData(self._sim, lyrsol)
 *         InitializeSoilTemperature()
 *         InitializeRootData(self._sim)             # <<<<<<<<<<<<<<
 */
  InitializeRootData(__pyx_v_self->_sim);

  /* "_cotton2k/simulation.pyx":1612
 *                     self._sim.plant_row_column = k
 * 
 *     def read_input(self, lyrsol, **kwargs):             # <<<<<<<<<<<<<<
 *         """This is the main function for reading input."""
 *         InitializeGlobal()
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.read_input", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":569
 * cdef class Simulation:
 *     cdef cSimulation _sim
 *     cdef public unsigned int version             # <<<<<<<<<<<<<<
 *     cdef double relative_radiation_received_by_a_soil_column[20]  # the relative radiation received by a soil column, as affected by shading by plant canopy.
 *     cdef double max_leaf_area_index
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7version_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_7version_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_7version___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_7version___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = __Pyx_PyInt_From_unsigned_int(__pyx_v_self->version); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 569, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.version.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_7version_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_7version_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_7version_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_7version_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  unsigned int __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(0, 569, __pyx_L1_error)
  __pyx_v_self->version = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.version.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":579
 *     cdef double tdfkgh  # total cumulative amount of defoliant
 *     cdef bool_t idsw  # switch indicating if predicted defoliation date was defined.
 *     cdef public double skip_row_width  # the smaller distance between skip rows, cm             # <<<<<<<<<<<<<<
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.
 * 
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->skip_row_width); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 579, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.skip_row_width.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_14skip_row_width_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 579, __pyx_L1_error)
  __pyx_v_self->skip_row_width = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.skip_row_width.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "_cotton2k/simulation.pyx":580
 *     cdef bool_t idsw  # switch indicating if predicted defoliation date was defined.
 *     cdef public double skip_row_width  # the smaller distance between skip rows, cm
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.             # <<<<<<<<<<<<<<
 * 
 *     def _doy2date(self, j):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_1__get__(PyObject *__pyx_v_self); /*proto*/
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_1__get__(PyObject *__pyx_v_self) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter___get__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter___get__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__get__", 0);
  __Pyx_XDECREF(__pyx_r);
  __pyx_t_1 = PyFloat_FromDouble(__pyx_v_self->plants_per_meter); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 580, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_r = __pyx_t_1;
  __pyx_t_1 = 0;
  goto __pyx_L0;

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.plants_per_meter.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* Python wrapper */
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
static int __pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_VARARGS(__pyx_args, __pyx_nargs);
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter_2__set__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), ((PyObject *)__pyx_v_value));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __pyx_pf_9_cotton2k_10simulation_10Simulation_16plants_per_meter_2__set__(struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, PyObject *__pyx_v_value) {
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  double __pyx_t_1;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__set__", 0);
  __pyx_t_1 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_1 == (double)-1) && PyErr_Occurred())) __PYX_ERR(0, 580, __pyx_L1_error)
  __pyx_v_self->plants_per_meter = __pyx_t_1;

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.plants_per_meter.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_43__reduce_cython__ = {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_43__reduce_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
  if (unlikely(__pyx_nargs > 0)) {
    __Pyx_RaiseArgtupleInvalid("__reduce_cython__", 1, 0, 0, __pyx_nargs); return NULL;}
  if (unlikely(__pyx_kwds) && __Pyx_NumKwargs_FASTCALL(__pyx_kwds) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__reduce_cython__", 0))) return NULL;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_42__reduce_cython__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self));

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_42__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__reduce_cython__", 0);

  /* "(tree fragment)":2
 * def __reduce_cython__(self):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"             # <<<<<<<<<<<<<<
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0);
  __PYX_ERR(1, 2, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_10Simulation_45__setstate_cython__ = {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_10Simulation_45__setstate_cython__(PyObject *__pyx_v_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  CYTHON_UNUSED PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[1] = {0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 3, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__setstate_cython__") < 0)) __PYX_ERR(1, 3, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 1)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
    }
    __pyx_v___pyx_state = values[0];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__setstate_cython__", 1, 1, 1, __pyx_nargs); __PYX_ERR(1, 3, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation_10Simulation_44__setstate_cython__(((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)__pyx_v_self), __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation_10Simulation_44__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_9_cotton2k_10simulation_Simulation *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__setstate_cython__", 0);

  /* "(tree fragment)":4
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"             # <<<<<<<<<<<<<<
 */
  __Pyx_Raise(__pyx_builtin_TypeError, __pyx_kp_s_Pickling_of_struct_members_such, 0, 0);
  __PYX_ERR(1, 4, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.Simulation.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":1
 * def __pyx_unpickle_SoilInit(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

/* Python wrapper */
static PyObject *__pyx_pw_9_cotton2k_10simulation_1__pyx_unpickle_SoilInit(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
); /*proto*/
static PyMethodDef __pyx_mdef_9_cotton2k_10simulation_1__pyx_unpickle_SoilInit = {"__pyx_unpickle_SoilInit", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_1__pyx_unpickle_SoilInit, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0};
static PyObject *__pyx_pw_9_cotton2k_10simulation_1__pyx_unpickle_SoilInit(PyObject *__pyx_self, 
#if CYTHON_METH_FASTCALL
PyObject *const *__pyx_args, Py_ssize_t __pyx_nargs, PyObject *__pyx_kwds
#else
PyObject *__pyx_args, PyObject *__pyx_kwds
#endif
) {
  PyObject *__pyx_v___pyx_type = 0;
  long __pyx_v___pyx_checksum;
  PyObject *__pyx_v___pyx_state = 0;
  #if !CYTHON_METH_FASTCALL
  CYTHON_UNUSED const Py_ssize_t __pyx_nargs = PyTuple_GET_SIZE(__pyx_args);
  #endif
  CYTHON_UNUSED PyObject *const *__pyx_kwvalues = __Pyx_KwValues_FASTCALL(__pyx_args, __pyx_nargs);
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  PyObject *__pyx_r = 0;
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__pyx_unpickle_SoilInit (wrapper)", 0);
  {
    #if CYTHON_COMPILING_IN_LIMITED_API
    PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    #else
    static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
    #endif
    PyObject* values[3] = {0,0,0};
    if (__pyx_kwds) {
      Py_ssize_t kw_args;
      switch (__pyx_nargs) {
        case  3: values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
        CYTHON_FALLTHROUGH;
        case  2: values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
        CYTHON_FALLTHROUGH;
        case  1: values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
        CYTHON_FALLTHROUGH;
        case  0: break;
        default: goto __pyx_L5_argtuple_error;
      }
      kw_args = __Pyx_NumKwargs_FASTCALL(__pyx_kwds);
      switch (__pyx_nargs) {
        case  0:
        if (likely((values[0] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_type)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else goto __pyx_L5_argtuple_error;
        CYTHON_FALLTHROUGH;
        case  1:
        if (likely((values[1] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SoilInit", 1, 3, 3, 1); __PYX_ERR(1, 1, __pyx_L3_error)
        }
        CYTHON_FALLTHROUGH;
        case  2:
        if (likely((values[2] = __Pyx_GetKwValue_FASTCALL(__pyx_kwds, __pyx_kwvalues, __pyx_n_s_pyx_state)) != 0)) kw_args--;
        else if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
        else {
          __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SoilInit", 1, 3, 3, 2); __PYX_ERR(1, 1, __pyx_L3_error)
        }
      }
      if (unlikely(kw_args > 0)) {
        const Py_ssize_t kwd_pos_args = __pyx_nargs;
        if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_kwvalues, __pyx_pyargnames, 0, values + 0, kwd_pos_args, "__pyx_unpickle_SoilInit") < 0)) __PYX_ERR(1, 1, __pyx_L3_error)
      }
    } else if (unlikely(__pyx_nargs != 3)) {
      goto __pyx_L5_argtuple_error;
    } else {
      values[0] = __Pyx_Arg_FASTCALL(__pyx_args, 0);
      values[1] = __Pyx_Arg_FASTCALL(__pyx_args, 1);
      values[2] = __Pyx_Arg_FASTCALL(__pyx_args, 2);
    }
    __pyx_v___pyx_type = values[0];
    __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(1, 1, __pyx_L3_error)
    __pyx_v___pyx_state = values[2];
  }
  goto __pyx_L4_argument_unpacking_done;
  __pyx_L5_argtuple_error:;
  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_SoilInit", 1, 3, 3, __pyx_nargs); __PYX_ERR(1, 1, __pyx_L3_error)
  __pyx_L3_error:;
  __Pyx_AddTraceback("_cotton2k.simulation.__pyx_unpickle_SoilInit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_RefNannyFinishContext();
  return NULL;
  __pyx_L4_argument_unpacking_done:;
  __pyx_r = __pyx_pf_9_cotton2k_10simulation___pyx_unpickle_SoilInit(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);

  /* function exit code */
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_pf_9_cotton2k_10simulation___pyx_unpickle_SoilInit(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_v___pyx_PickleError = 0;
  PyObject *__pyx_v___pyx_result = 0;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_t_5;
  int __pyx_t_6;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SoilInit", 0);

  /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x84b1e5e:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 */
  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x84b1e5e) != 0);
  if (__pyx_t_1) {

    /* "(tree fragment)":5
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x84b1e5e:
 *         from pickle import PickleError as __pyx_PickleError             # <<<<<<<<<<<<<<
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 *     __pyx_result = SoilInit.__new__(__pyx_type)
 */
    __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_n_s_PickleError);
    __Pyx_GIVEREF(__pyx_n_s_PickleError);
    PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
    __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 5, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_INCREF(__pyx_t_2);
    __pyx_v___pyx_PickleError = __pyx_t_2;
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;

    /* "(tree fragment)":6
 *     if __pyx_checksum != 0x84b1e5e:
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum             # <<<<<<<<<<<<<<
 *     __pyx_result = SoilInit.__new__(__pyx_type)
 *     if __pyx_state is not None:
 */
    __pyx_t_3 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_3);
    __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x84, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 6, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_Raise(__pyx_v___pyx_PickleError, __pyx_t_2, 0, 0);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
    __PYX_ERR(1, 6, __pyx_L1_error)

    /* "(tree fragment)":4
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 *     if __pyx_checksum != 0x84b1e5e:             # <<<<<<<<<<<<<<
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 */
  }

  /* "(tree fragment)":7
 *         from pickle import PickleError as __pyx_PickleError
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 *     __pyx_result = SoilInit.__new__(__pyx_type)             # <<<<<<<<<<<<<<
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 */
  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_9_cotton2k_10simulation_SoilInit), __pyx_n_s_new); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 7, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  __pyx_t_4 = NULL;
  __pyx_t_5 = 0;
  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_3))) {
    __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
    if (likely(__pyx_t_4)) {
      PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
      __Pyx_INCREF(__pyx_t_4);
      __Pyx_INCREF(function);
      __Pyx_DECREF_SET(__pyx_t_3, function);
      __pyx_t_5 = 1;
    }
  }
  {
    PyObject *__pyx_callargs[2] = {__pyx_t_4, __pyx_v___pyx_type};
    __pyx_t_2 = __Pyx_PyObject_FastCall(__pyx_t_3, __pyx_callargs+1-__pyx_t_5, 1+__pyx_t_5);
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 7, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  }
  __pyx_v___pyx_result = __pyx_t_2;
  __pyx_t_2 = 0;

  /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 *     __pyx_result = SoilInit.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
  __pyx_t_6 = (__pyx_t_1 != 0);
  if (__pyx_t_6) {

    /* "(tree fragment)":9
 *     __pyx_result = SoilInit.__new__(__pyx_type)
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)             # <<<<<<<<<<<<<<
 *     return __pyx_result
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):
 */
    if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None) || __Pyx_RaiseUnexpectedTypeError("tuple", __pyx_v___pyx_state))) __PYX_ERR(1, 9, __pyx_L1_error)
    __pyx_t_2 = __pyx_f_9_cotton2k_10simulation___pyx_unpickle_SoilInit__set_state(((struct __pyx_obj_9_cotton2k_10simulation_SoilInit *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 9, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_2);
    __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

    /* "(tree fragment)":8
 *         raise __pyx_PickleError, "Incompatible checksums (%s vs 0x84b1e5e = (number_of_layers))" % __pyx_checksum
 *     __pyx_result = SoilInit.__new__(__pyx_type)
 *     if __pyx_state is not None:             # <<<<<<<<<<<<<<
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 *     return __pyx_result
 */
  }

  /* "(tree fragment)":10
 *     if __pyx_state is not None:
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 *     return __pyx_result             # <<<<<<<<<<<<<<
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):
 *     __pyx_result.number_of_layers = __pyx_state[0]
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v___pyx_result);
  __pyx_r = __pyx_v___pyx_result;
  goto __pyx_L0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SoilInit(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  __Pyx_AddTraceback("_cotton2k.simulation.__pyx_unpickle_SoilInit", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = NULL;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
  __Pyx_XDECREF(__pyx_v___pyx_result);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "(tree fragment)":11
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.number_of_layers = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

static PyObject *__pyx_f_9_cotton2k_10simulation___pyx_unpickle_SoilInit__set_state(struct __pyx_obj_9_cotton2k_10simulation_SoilInit *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  unsigned int __pyx_t_2;
  int __pyx_t_3;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_unpickle_SoilInit__set_state", 0);

  /* "(tree fragment)":12
 *     return __pyx_result
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):
 *     __pyx_result.number_of_layers = __pyx_state[0]             # <<<<<<<<<<<<<<
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
    __PYX_ERR(1, 12, __pyx_L1_error)
  }
  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_PyInt_As_unsigned_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_v___pyx_result->number_of_layers = __pyx_t_2;

  /* "(tree fragment)":13
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):
 *     __pyx_result.number_of_layers = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  if (unlikely(__pyx_v___pyx_state == Py_None)) {
    PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
    __PYX_ERR(1, 13, __pyx_L1_error)
  }
  __pyx_t_4 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_5 = ((__pyx_t_4 > 1) != 0);
  if (__pyx_t_5) {
  } else {
    __pyx_t_3 = __pyx_t_5;
    goto __pyx_L4_bool_binop_done;
  }
  __pyx_t_5 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_5 == ((int)-1))) __PYX_ERR(1, 13, __pyx_L1_error)
  __pyx_t_6 = (__pyx_t_5 != 0);
  __pyx_t_3 = __pyx_t_6;
  __pyx_L4_bool_binop_done:;
  if (__pyx_t_3) {

    /* "(tree fragment)":14
 *     __pyx_result.number_of_layers = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 *         __pyx_result.__dict__.update(__pyx_state[1])             # <<<<<<<<<<<<<<
 */
    __pyx_t_7 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_8 = __Pyx_PyObject_GetAttrStr(__pyx_t_7, __pyx_n_s_update); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_8);
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
    if (unlikely(__pyx_v___pyx_state == Py_None)) {
      PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
      __PYX_ERR(1, 14, __pyx_L1_error)
    }
    __pyx_t_7 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 14, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_7);
    __pyx_t_9 = NULL;
    __pyx_t_10 = 0;
    if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_8))) {
      __pyx_t_9 = PyMethod_GET_SELF(__pyx_t_8);
      if (likely(__pyx_t_9)) {
        PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_8);
        __Pyx_INCREF(__pyx_t_9);
        __Pyx_INCREF(function);
        __Pyx_DECREF_SET(__pyx_t_8, function);
        __pyx_t_10 = 1;
      }
    }
    {
      PyObject *__pyx_callargs[2] = {__pyx_t_9, __pyx_t_7};
      __pyx_t_1 = __Pyx_PyObject_FastCall(__pyx_t_8, __pyx_callargs+1-__pyx_t_10, 1+__pyx_t_10);
      __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
      __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
      if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 14, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_1);
      __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
    }
    __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

    /* "(tree fragment)":13
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):
 *     __pyx_result.number_of_layers = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):             # <<<<<<<<<<<<<<
 *         __pyx_result.__dict__.update(__pyx_state[1])
 */
  }

  /* "(tree fragment)":11
 *         __pyx_unpickle_SoilInit__set_state(<SoilInit> __pyx_result, __pyx_state)
 *     return __pyx_result
 * cdef __pyx_unpickle_SoilInit__set_state(SoilInit __pyx_result, tuple __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_result.number_of_layers = __pyx_state[0]
 *     if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
 */

  /* function exit code */
  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("_cotton2k.simulation.__pyx_unpickle_SoilInit__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_double")
 * cdef inline list __Pyx_carray_to_py_double(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_double(double *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_double", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_double")
 * cdef inline list __Pyx_carray_to_py_double(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_double")
 * cdef inline tuple __Pyx_carray_to_tuple_double(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_double(double *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_double", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = PyFloat_FromDouble((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_double")
 * cdef inline tuple __Pyx_carray_to_tuple_double(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_FruitingSite")
 * cdef inline list __Pyx_carray_to_py_FruitingSite(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_FruitingSite(FruitingSite *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_FruitingSite", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_FruitingSite((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_FruitingSite")
 * cdef inline list __Pyx_carray_to_py_FruitingSite(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_FruitingSite")
 * cdef inline tuple __Pyx_carray_to_tuple_FruitingSite(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_FruitingSite(FruitingSite *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_FruitingSite", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_FruitingSite((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_FruitingSite")
 * cdef inline tuple __Pyx_carray_to_tuple_FruitingSite(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_FruitingBranch")
 * cdef inline list __Pyx_carray_to_py_FruitingBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_FruitingBranch(FruitingBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_FruitingBranch", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_FruitingBranch((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_FruitingBranch")
 * cdef inline list __Pyx_carray_to_py_FruitingBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_FruitingBranch")
 * cdef inline tuple __Pyx_carray_to_tuple_FruitingBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_FruitingBranch(FruitingBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_FruitingBranch", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_FruitingBranch((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_FruitingBranch")
 * cdef inline tuple __Pyx_carray_to_tuple_FruitingBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_VegetativeBranch")
 * cdef inline list __Pyx_carray_to_py_VegetativeBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_VegetativeBranch(VegetativeBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_VegetativeBranch", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_VegetativeBranch((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_VegetativeBranch")
 * cdef inline list __Pyx_carray_to_py_VegetativeBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_VegetativeBranch")
 * cdef inline tuple __Pyx_carray_to_tuple_VegetativeBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_VegetativeBranch(VegetativeBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_VegetativeBranch", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_VegetativeBranch((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_VegetativeBranch")
 * cdef inline tuple __Pyx_carray_to_tuple_VegetativeBranch(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_Hour")
 * cdef inline list __Pyx_carray_to_py_Hour(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_Hour(Hour *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_Hour", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_Hour((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_Hour")
 * cdef inline list __Pyx_carray_to_py_Hour(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_Hour")
 * cdef inline tuple __Pyx_carray_to_tuple_Hour(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_Hour(Hour *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_Hour", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_Hour((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_Hour")
 * cdef inline tuple __Pyx_carray_to_tuple_Hour(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilLayer")
 * cdef inline list __Pyx_carray_to_py_SoilLayer(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilLayer(SoilLayer *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_SoilLayer", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_SoilLayer((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilLayer")
 * cdef inline list __Pyx_carray_to_py_SoilLayer(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilLayer")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilLayer(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilLayer(SoilLayer *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_SoilLayer", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_SoilLayer((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilLayer")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilLayer(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilCell")
 * cdef inline list __Pyx_carray_to_py_SoilCell(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilCell(SoilCell *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_SoilCell", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_SoilCell((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilCell")
 * cdef inline list __Pyx_carray_to_py_SoilCell(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilCell")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilCell(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilCell(SoilCell *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_SoilCell", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_SoilCell((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilCell")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilCell(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilCell___5b_20_5d_")
 * cdef inline list __Pyx_carray_to_py_SoilCell___5b_20_5d_(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_SoilCell___5b_20_5d_(SoilCell (*__pyx_v_v)[20], Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_SoilCell___5b_20_5d_", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __Pyx_carray_to_py_SoilCell((__pyx_v_v[__pyx_v_i]), 20); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_SoilCell___5b_20_5d_")
 * cdef inline list __Pyx_carray_to_py_SoilCell___5b_20_5d_(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_SoilCell___5b_20_5d_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilCell___5b_20_5d_")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilCell___5b_20_5d_(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_SoilCell___5b_20_5d_(SoilCell (*__pyx_v_v)[20], Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_SoilCell___5b_20_5d_", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __Pyx_carray_to_py_SoilCell((__pyx_v_v[__pyx_v_i]), 20); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_SoilCell___5b_20_5d_")
 * cdef inline tuple __Pyx_carray_to_tuple_SoilCell___5b_20_5d_(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_SoilCell___5b_20_5d_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_double")
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_double(PyObject *__pyx_v_o, double *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  double __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_double", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_double")
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_item); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_double")
 * cdef int __Pyx_carray_from_py_double(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_double", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_MainStemLeaf")
 * cdef struct_type __pyx_convert__from_py_MainStemLeaf(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static MainStemLeaf __pyx_convert__from_py_MainStemLeaf(PyObject *__pyx_v_obj) {
  MainStemLeaf __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  MainStemLeaf __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_MainStemLeaf", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_MainStemLeaf(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_MainStemLeaf(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['leaf_area']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_area); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['leaf_area']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['leaf_area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")             # <<<<<<<<<<<<<<
 *     result.leaf_area = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.leaf_area = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.leaf_area = value
 *     try:
 *         value = obj['leaf_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['leaf_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['petiole_weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.leaf_weight = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.leaf_weight = value
 *     try:
 *         value = obj['petiole_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_petiole_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['petiole_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 *     result.petiole_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['petiole_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")             # <<<<<<<<<<<<<<
 *     result.petiole_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 *     result.petiole_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['potential_growth_for_leaf_area']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.petiole_weight = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 *     result.petiole_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.petiole_weight = value
 *     try:
 *         value = obj['potential_growth_for_leaf_area']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth_for_leaf_area); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 *     result.petiole_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 *     result.potential_growth_for_leaf_area = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_leaf_area = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")
 *     result.petiole_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 *     result.potential_growth_for_leaf_area = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['potential_growth_for_leaf_weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.potential_growth_for_leaf_area = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 *     result.potential_growth_for_leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.potential_growth_for_leaf_area = value
 *     try:
 *         value = obj['potential_growth_for_leaf_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth_for_leaf_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 *     result.potential_growth_for_leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 *     result.potential_growth_for_leaf_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_leaf_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")
 *     result.potential_growth_for_leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 *     result.potential_growth_for_leaf_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['potential_growth_for_petiole_weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.potential_growth_for_leaf_weight = __pyx_t_10;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 *     result.potential_growth_for_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.potential_growth_for_leaf_weight = value
 *     try:
 *         value = obj['potential_growth_for_petiole_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth_for_petiole_wei); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 *     result.potential_growth_for_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")
 *     result.potential_growth_for_petiole_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_petiole_weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")
 *     result.potential_growth_for_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")
 *     result.potential_growth_for_petiole_weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_v_result.potential_growth_for_petiole_weight = __pyx_t_10;

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")
 *     result.potential_growth_for_petiole_weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_MainStemLeaf")
 * cdef struct_type __pyx_convert__from_py_MainStemLeaf(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_MainStemLeaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Leaf __pyx_convert__from_py_Leaf(PyObject *__pyx_v_obj) {
  Leaf __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Leaf __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Leaf", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Leaf(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Leaf(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['age']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_age); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['age']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['age']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")             # <<<<<<<<<<<<<<
 *     result.age = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['potential_growth']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.age = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.age = value
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['area']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['area']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.potential_growth = value
 *     try:
 *         value = obj['area']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'area'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_area); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['area']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['area']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'area'")
 *     result.area = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'area'")             # <<<<<<<<<<<<<<
 *     result.area = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['area']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'area'")
 *     result.area = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.area = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'area'")
 *     result.area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.area = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'area'")
 *     result.area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'area'")
 *     result.area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.weight = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Leaf")
 * cdef struct_type __pyx_convert__from_py_Leaf(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Leaf", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static struct SquareStruct __pyx_convert__from_py_struct__SquareStruct(PyObject *__pyx_v_obj) {
  struct SquareStruct __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  struct SquareStruct __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_struct__SquareStruct", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_struct__SquareStruct(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_struct__SquareStruct(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__SquareStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.potential_growth = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__SquareStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.weight = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_struct__SquareStruct")
 * cdef struct_type __pyx_convert__from_py_struct__SquareStruct(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_struct__SquareStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Boll __pyx_convert__from_py_Boll(PyObject *__pyx_v_obj) {
  Boll __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Boll __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Boll", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Boll(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Boll(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['age']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_age); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['age']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Boll", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['age']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")             # <<<<<<<<<<<<<<
 *     result.age = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['potential_growth']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.age = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.age = value
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Boll", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.potential_growth = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Boll", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.weight = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Boll")
 * cdef struct_type __pyx_convert__from_py_Boll(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Boll", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Burr __pyx_convert__from_py_Burr(PyObject *__pyx_v_obj) {
  Burr __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Burr __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Burr", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Burr(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Burr(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Burr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.potential_growth = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Burr", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.weight = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Burr")
 * cdef struct_type __pyx_convert__from_py_Burr(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Burr", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static Petiole __pyx_convert__from_py_Petiole(PyObject *__pyx_v_obj) {
  Petiole __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Petiole __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Petiole", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Petiole(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Petiole(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Petiole", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.potential_growth = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Petiole", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.weight = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Petiole")
 * cdef struct_type __pyx_convert__from_py_Petiole(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Petiole", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static FruitingSite __pyx_convert__from_py_FruitingSite(PyObject *__pyx_v_obj) {
  FruitingSite __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  FruitingSite __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  enum Stage __pyx_t_11;
  Leaf __pyx_t_12;
  struct SquareStruct __pyx_t_13;
  Boll __pyx_t_14;
  Burr __pyx_t_15;
  Petiole __pyx_t_16;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_FruitingSite", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_FruitingSite(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_FruitingSite(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['age']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_age); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['age']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['age']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")             # <<<<<<<<<<<<<<
 *     result.age = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['fraction']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.age = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fraction']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.age = value
 *     try:
 *         value = obj['fraction']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_fraction); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fraction']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['fraction']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 *     result.fraction = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['fraction']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fraction'")             # <<<<<<<<<<<<<<
 *     result.fraction = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fraction']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 *     result.fraction = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['average_temperature']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.fraction = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 *     result.fraction = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.fraction = value
 *     try:
 *         value = obj['average_temperature']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 *     result.fraction = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['average_temperature']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['average_temperature']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")             # <<<<<<<<<<<<<<
 *     result.average_temperature = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fraction'")
 *     result.fraction = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['ginning_percent']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.average_temperature = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.average_temperature = value
 *     try:
 *         value = obj['ginning_percent']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_ginning_percent); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['ginning_percent']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['ginning_percent']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")             # <<<<<<<<<<<<<<
 *     result.ginning_percent = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['stage']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.ginning_percent = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stage']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.ginning_percent = value
 *     try:
 *         value = obj['stage']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stage'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_stage); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stage']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['stage']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'stage'")
 *     result.stage = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['stage']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stage'")             # <<<<<<<<<<<<<<
 *     result.stage = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stage']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stage'")
 *     result.stage = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf']
 */
  __pyx_t_11 = ((enum Stage)__Pyx_PyInt_As_enum__Stage(__pyx_v_value)); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.stage = __pyx_t_11;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'stage'")
 *     result.stage = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.stage = value
 *     try:
 *         value = obj['leaf']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'stage'")
 *     result.stage = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['leaf']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 *     result.leaf = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['leaf']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf'")             # <<<<<<<<<<<<<<
 *     result.leaf = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__24, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'stage'")
 *     result.stage = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 *     result.leaf = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['square']
 */
  __pyx_t_12 = __pyx_convert__from_py_Leaf(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_v_result.leaf = __pyx_t_12;

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 *     result.leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":48
 *     result.leaf = value
 *     try:
 *         value = obj['square']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_square); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L52_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 *     result.leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L57_try_end;
    __pyx_L52_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":49
 *     try:
 *         value = obj['square']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'square'")
 *     result.square = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 49, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":50
 *         value = obj['square']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square'")             # <<<<<<<<<<<<<<
 *     result.square = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 50, __pyx_L54_except_error)
    }
    goto __pyx_L54_except_error;
    __pyx_L54_except_error:;

    /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'leaf'")
 *     result.leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L57_try_end:;
  }

  /* "FromPyStructUtility":51
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square'")
 *     result.square = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['boll']
 */
  __pyx_t_13 = __pyx_convert__from_py_struct__SquareStruct(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_v_result.square = __pyx_t_13;

  /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'square'")
 *     result.square = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['boll']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":53
 *     result.square = value
 *     try:
 *         value = obj['boll']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'boll'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_boll); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 53, __pyx_L60_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'square'")
 *     result.square = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['boll']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L65_try_end;
    __pyx_L60_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":54
 *     try:
 *         value = obj['boll']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'boll'")
 *     result.boll = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 54, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":55
 *         value = obj['boll']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'boll'")             # <<<<<<<<<<<<<<
 *     result.boll = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 55, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 55, __pyx_L62_except_error)
    }
    goto __pyx_L62_except_error;
    __pyx_L62_except_error:;

    /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'square'")
 *     result.square = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['boll']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L65_try_end:;
  }

  /* "FromPyStructUtility":56
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'boll'")
 *     result.boll = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['burr']
 */
  __pyx_t_14 = __pyx_convert__from_py_Boll(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
  __pyx_v_result.boll = __pyx_t_14;

  /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'boll'")
 *     result.boll = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":58
 *     result.boll = value
 *     try:
 *         value = obj['burr']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_burr); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 58, __pyx_L68_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'boll'")
 *     result.boll = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L73_try_end;
    __pyx_L68_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":59
 *     try:
 *         value = obj['burr']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'burr'")
 *     result.burr = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 59, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":60
 *         value = obj['burr']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr'")             # <<<<<<<<<<<<<<
 *     result.burr = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__27, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 60, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 60, __pyx_L70_except_error)
    }
    goto __pyx_L70_except_error;
    __pyx_L70_except_error:;

    /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'boll'")
 *     result.boll = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L73_try_end:;
  }

  /* "FromPyStructUtility":61
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr'")
 *     result.burr = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['petiole']
 */
  __pyx_t_15 = __pyx_convert__from_py_Burr(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
  __pyx_v_result.burr = __pyx_t_15;

  /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'burr'")
 *     result.burr = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":63
 *     result.burr = value
 *     try:
 *         value = obj['petiole']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_petiole); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 63, __pyx_L76_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'burr'")
 *     result.burr = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L81_try_end;
    __pyx_L76_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":64
 *     try:
 *         value = obj['petiole']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'petiole'")
 *     result.petiole = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 64, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":65
 *         value = obj['petiole']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole'")             # <<<<<<<<<<<<<<
 *     result.petiole = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__28, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 65, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 65, __pyx_L78_except_error)
    }
    goto __pyx_L78_except_error;
    __pyx_L78_except_error:;

    /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'burr'")
 *     result.burr = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L81_try_end:;
  }

  /* "FromPyStructUtility":66
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole'")
 *     result.petiole = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_16 = __pyx_convert__from_py_Petiole(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L1_error)
  __pyx_v_result.petiole = __pyx_t_16;

  /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'petiole'")
 *     result.petiole = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_FruitingSite")
 * cdef struct_type __pyx_convert__from_py_FruitingSite(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_FruitingSite")
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_FruitingSite(PyObject *__pyx_v_o, FruitingSite *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  FruitingSite __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_FruitingSite", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_FruitingSite")
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_FruitingSite(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_FruitingSite")
 * cdef int __Pyx_carray_from_py_FruitingSite(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_FruitingSite", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_FruitingBranch")
 * cdef struct_type __pyx_convert__from_py_FruitingBranch(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static FruitingBranch __pyx_convert__from_py_FruitingBranch(PyObject *__pyx_v_obj) {
  FruitingBranch __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  FruitingBranch __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  double __pyx_t_11;
  MainStemLeaf __pyx_t_12;
  FruitingSite __pyx_t_13[5];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_FruitingBranch", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_FruitingBranch(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_FruitingBranch(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['number_of_fruiting_nodes']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_fruiting_nodes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 *     result.number_of_fruiting_nodes = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_nodes = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__29, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 *     result.number_of_fruiting_nodes = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['delay_for_new_node']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.number_of_fruiting_nodes = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 *     result.number_of_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_node']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.number_of_fruiting_nodes = value
 *     try:
 *         value = obj['delay_for_new_node']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_delay_for_new_node); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 *     result.number_of_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_node']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['delay_for_new_node']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 *     result.delay_for_new_node = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['delay_for_new_node']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_node = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")
 *     result.number_of_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_node']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 *     result.delay_for_new_node = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['main_stem_leaf']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.delay_for_new_node = __pyx_t_11;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 *     result.delay_for_new_node = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['main_stem_leaf']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.delay_for_new_node = value
 *     try:
 *         value = obj['main_stem_leaf']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_main_stem_leaf); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 *     result.delay_for_new_node = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['main_stem_leaf']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['main_stem_leaf']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 *     result.main_stem_leaf = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['main_stem_leaf']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")             # <<<<<<<<<<<<<<
 *     result.main_stem_leaf = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")
 *     result.delay_for_new_node = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['main_stem_leaf']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 *     result.main_stem_leaf = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['nodes']
 */
  __pyx_t_12 = __pyx_convert__from_py_MainStemLeaf(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.main_stem_leaf = __pyx_t_12;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 *     result.main_stem_leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nodes']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.main_stem_leaf = value
 *     try:
 *         value = obj['nodes']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nodes'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nodes); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 *     result.main_stem_leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nodes']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['nodes']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nodes'")
 *     result.nodes = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nodes'")             # <<<<<<<<<<<<<<
 *     result.nodes = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")
 *     result.main_stem_leaf = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nodes']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nodes'")
 *     result.nodes = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely((__Pyx_carray_from_py_FruitingSite(__pyx_v_value, __pyx_t_13, 5) < 0))) __PYX_ERR(1, 36, __pyx_L1_error)
  memcpy(&(__pyx_v_result.nodes[0]), __pyx_t_13, sizeof(__pyx_v_result.nodes[0]) * (5));

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'nodes'")
 *     result.nodes = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_FruitingBranch")
 * cdef struct_type __pyx_convert__from_py_FruitingBranch(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_FruitingBranch")
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_FruitingBranch(PyObject *__pyx_v_o, FruitingBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  FruitingBranch __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_FruitingBranch", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_FruitingBranch")
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_FruitingBranch(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_FruitingBranch")
 * cdef int __Pyx_carray_from_py_FruitingBranch(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_FruitingBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_VegetativeBranch")
 * cdef struct_type __pyx_convert__from_py_VegetativeBranch(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static VegetativeBranch __pyx_convert__from_py_VegetativeBranch(PyObject *__pyx_v_obj) {
  VegetativeBranch __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  VegetativeBranch __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  double __pyx_t_11;
  FruitingBranch __pyx_t_12[30];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_VegetativeBranch", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_VegetativeBranch(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_VegetativeBranch(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['number_of_fruiting_branches']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_fruiting_branches); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 *     result.number_of_fruiting_branches = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_branches = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__33, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 *     result.number_of_fruiting_branches = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['delay_for_new_fruiting_branch']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.number_of_fruiting_branches = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 *     result.number_of_fruiting_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.number_of_fruiting_branches = value
 *     try:
 *         value = obj['delay_for_new_fruiting_branch']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_delay_for_new_fruiting_branch); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 *     result.number_of_fruiting_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 *     result.delay_for_new_fruiting_branch = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_fruiting_branch = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__34, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")
 *     result.number_of_fruiting_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 *     result.delay_for_new_fruiting_branch = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['fruiting_branches']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.delay_for_new_fruiting_branch = __pyx_t_11;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 *     result.delay_for_new_fruiting_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruiting_branches']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.delay_for_new_fruiting_branch = value
 *     try:
 *         value = obj['fruiting_branches']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_fruiting_branches); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 *     result.delay_for_new_fruiting_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruiting_branches']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['fruiting_branches']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")
 *     result.fruiting_branches = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['fruiting_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")             # <<<<<<<<<<<<<<
 *     result.fruiting_branches = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__35, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")
 *     result.delay_for_new_fruiting_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruiting_branches']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")
 *     result.fruiting_branches = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely((__Pyx_carray_from_py_FruitingBranch(__pyx_v_value, __pyx_t_12, 30) < 0))) __PYX_ERR(1, 31, __pyx_L1_error)
  memcpy(&(__pyx_v_result.fruiting_branches[0]), __pyx_t_12, sizeof(__pyx_v_result.fruiting_branches[0]) * (30));

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")
 *     result.fruiting_branches = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_VegetativeBranch")
 * cdef struct_type __pyx_convert__from_py_VegetativeBranch(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_VegetativeBranch")
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_VegetativeBranch(PyObject *__pyx_v_o, VegetativeBranch *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  VegetativeBranch __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_VegetativeBranch", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_VegetativeBranch")
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_VegetativeBranch(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_VegetativeBranch")
 * cdef int __Pyx_carray_from_py_VegetativeBranch(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_VegetativeBranch", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Hour")
 * cdef struct_type __pyx_convert__from_py_Hour(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static Hour __pyx_convert__from_py_Hour(PyObject *__pyx_v_obj) {
  Hour __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Hour __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Hour", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Hour(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Hour(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['temperature']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['temperature']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_temperature); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['temperature']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['temperature']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 *     result.temperature = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['temperature']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'temperature'")             # <<<<<<<<<<<<<<
 *     result.temperature = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__36, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['temperature']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 *     result.temperature = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['radiation']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.temperature = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 *     result.temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['radiation']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.temperature = value
 *     try:
 *         value = obj['radiation']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_radiation); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 *     result.temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['radiation']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['radiation']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 *     result.radiation = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['radiation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'radiation'")             # <<<<<<<<<<<<<<
 *     result.radiation = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__37, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'temperature'")
 *     result.temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['radiation']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 *     result.radiation = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cloud_cov']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.radiation = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 *     result.radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cov']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.radiation = value
 *     try:
 *         value = obj['cloud_cov']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cloud_cov); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 *     result.radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cov']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['cloud_cov']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 *     result.cloud_cov = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['cloud_cov']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")             # <<<<<<<<<<<<<<
 *     result.cloud_cov = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__38, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'radiation'")
 *     result.radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cov']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 *     result.cloud_cov = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cloud_cor']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.cloud_cov = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 *     result.cloud_cov = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cor']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.cloud_cov = value
 *     try:
 *         value = obj['cloud_cor']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cloud_cor); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 *     result.cloud_cov = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cor']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['cloud_cor']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 *     result.cloud_cor = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['cloud_cor']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")             # <<<<<<<<<<<<<<
 *     result.cloud_cor = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__39, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")
 *     result.cloud_cov = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cloud_cor']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 *     result.cloud_cor = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['et1']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.cloud_cor = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 *     result.cloud_cor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et1']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.cloud_cor = value
 *     try:
 *         value = obj['et1']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et1'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_et1); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 *     result.cloud_cor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et1']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['et1']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'et1'")
 *     result.et1 = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['et1']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et1'")             # <<<<<<<<<<<<<<
 *     result.et1 = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__40, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")
 *     result.cloud_cor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et1']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et1'")
 *     result.et1 = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['et2']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.et1 = __pyx_t_10;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'et1'")
 *     result.et1 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et2']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.et1 = value
 *     try:
 *         value = obj['et2']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et2'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_et2); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'et1'")
 *     result.et1 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et2']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['et2']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'et2'")
 *     result.et2 = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['et2']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et2'")             # <<<<<<<<<<<<<<
 *     result.et2 = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__41, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'et1'")
 *     result.et1 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['et2']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et2'")
 *     result.et2 = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['ref_et']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_v_result.et2 = __pyx_t_10;

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'et2'")
 *     result.et2 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ref_et']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":48
 *     result.et2 = value
 *     try:
 *         value = obj['ref_et']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_ref_et); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L52_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'et2'")
 *     result.et2 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ref_et']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L57_try_end;
    __pyx_L52_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":49
 *     try:
 *         value = obj['ref_et']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 *     result.ref_et = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 49, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":50
 *         value = obj['ref_et']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ref_et'")             # <<<<<<<<<<<<<<
 *     result.ref_et = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__42, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 50, __pyx_L54_except_error)
    }
    goto __pyx_L54_except_error;
    __pyx_L54_except_error:;

    /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'et2'")
 *     result.et2 = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ref_et']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L57_try_end:;
  }

  /* "FromPyStructUtility":51
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 *     result.ref_et = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['wind_speed']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_v_result.ref_et = __pyx_t_10;

  /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 *     result.ref_et = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['wind_speed']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":53
 *     result.ref_et = value
 *     try:
 *         value = obj['wind_speed']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_wind_speed); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 53, __pyx_L60_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 *     result.ref_et = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['wind_speed']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L65_try_end;
    __pyx_L60_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":54
 *     try:
 *         value = obj['wind_speed']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 *     result.wind_speed = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 54, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":55
 *         value = obj['wind_speed']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")             # <<<<<<<<<<<<<<
 *     result.wind_speed = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__43, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 55, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 55, __pyx_L62_except_error)
    }
    goto __pyx_L62_except_error;
    __pyx_L62_except_error:;

    /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'ref_et'")
 *     result.ref_et = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['wind_speed']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L65_try_end:;
  }

  /* "FromPyStructUtility":56
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 *     result.wind_speed = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['dew_point']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
  __pyx_v_result.wind_speed = __pyx_t_10;

  /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 *     result.wind_speed = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dew_point']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":58
 *     result.wind_speed = value
 *     try:
 *         value = obj['dew_point']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_dew_point); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 58, __pyx_L68_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 *     result.wind_speed = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dew_point']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L73_try_end;
    __pyx_L68_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":59
 *     try:
 *         value = obj['dew_point']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 *     result.dew_point = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 59, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":60
 *         value = obj['dew_point']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dew_point'")             # <<<<<<<<<<<<<<
 *     result.dew_point = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__44, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 60, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 60, __pyx_L70_except_error)
    }
    goto __pyx_L70_except_error;
    __pyx_L70_except_error:;

    /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")
 *     result.wind_speed = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['dew_point']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L73_try_end:;
  }

  /* "FromPyStructUtility":61
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 *     result.dew_point = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['humidity']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
  __pyx_v_result.dew_point = __pyx_t_10;

  /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 *     result.dew_point = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['humidity']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":63
 *     result.dew_point = value
 *     try:
 *         value = obj['humidity']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_humidity); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 63, __pyx_L76_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 *     result.dew_point = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['humidity']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L81_try_end;
    __pyx_L76_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":64
 *     try:
 *         value = obj['humidity']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 *     result.humidity = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 64, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":65
 *         value = obj['humidity']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'humidity'")             # <<<<<<<<<<<<<<
 *     result.humidity = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__45, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 65, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 65, __pyx_L78_except_error)
    }
    goto __pyx_L78_except_error;
    __pyx_L78_except_error:;

    /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'dew_point'")
 *     result.dew_point = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['humidity']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L81_try_end:;
  }

  /* "FromPyStructUtility":66
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 *     result.humidity = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['albedo']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L1_error)
  __pyx_v_result.humidity = __pyx_t_10;

  /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 *     result.humidity = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['albedo']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":68
 *     result.humidity = value
 *     try:
 *         value = obj['albedo']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'albedo'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_albedo); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 68, __pyx_L84_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 *     result.humidity = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['albedo']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L89_try_end;
    __pyx_L84_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":69
 *     try:
 *         value = obj['albedo']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'albedo'")
 *     result.albedo = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 69, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":70
 *         value = obj['albedo']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'albedo'")             # <<<<<<<<<<<<<<
 *     result.albedo = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__46, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 70, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 70, __pyx_L86_except_error)
    }
    goto __pyx_L86_except_error;
    __pyx_L86_except_error:;

    /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'humidity'")
 *     result.humidity = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['albedo']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L89_try_end:;
  }

  /* "FromPyStructUtility":71
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'albedo'")
 *     result.albedo = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L1_error)
  __pyx_v_result.albedo = __pyx_t_10;

  /* "FromPyStructUtility":72
 *         raise ValueError("No value specified for struct attribute 'albedo'")
 *     result.albedo = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Hour")
 * cdef struct_type __pyx_convert__from_py_Hour(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_Hour")
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_Hour(PyObject *__pyx_v_o, Hour *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  Hour __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_Hour", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_Hour")
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_Hour(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_Hour")
 * cdef int __Pyx_carray_from_py_Hour(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_Hour", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_SoilLayer")
 * cdef struct_type __pyx_convert__from_py_SoilLayer(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static SoilLayer __pyx_convert__from_py_SoilLayer(PyObject *__pyx_v_obj) {
  SoilLayer __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  SoilLayer __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_SoilLayer", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_SoilLayer(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_SoilLayer(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['number_of_left_columns_with_root']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_left_columns_with_root); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 *     result.number_of_left_columns_with_root = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_left_columns_with_root = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__47, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 *     result.number_of_left_columns_with_root = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_right_columns_with_root']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.number_of_left_columns_with_root = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 *     result.number_of_left_columns_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.number_of_left_columns_with_root = value
 *     try:
 *         value = obj['number_of_right_columns_with_root']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_right_columns_with_roo); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 *     result.number_of_left_columns_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")
 *     result.number_of_right_columns_with_root = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_right_columns_with_root = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__48, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")
 *     result.number_of_left_columns_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")
 *     result.number_of_right_columns_with_root = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.number_of_right_columns_with_root = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")
 *     result.number_of_right_columns_with_root = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_SoilLayer")
 * cdef struct_type __pyx_convert__from_py_SoilLayer(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_SoilLayer")
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_SoilLayer(PyObject *__pyx_v_o, SoilLayer *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  SoilLayer __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_SoilLayer", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_SoilLayer")
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_SoilLayer(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_SoilLayer")
 * cdef int __Pyx_carray_from_py_SoilLayer(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_SoilLayer", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Root")
 * cdef struct_type __pyx_convert__from_py_Root(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static Root __pyx_convert__from_py_Root(PyObject *__pyx_v_obj) {
  Root __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Root __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  double __pyx_t_11[3];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Root", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Root(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Root(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['potential_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_potential_growth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['potential_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['potential_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['growth_factor']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.potential_growth = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['growth_factor']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.potential_growth = value
 *     try:
 *         value = obj['growth_factor']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_growth_factor); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['growth_factor']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['growth_factor']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 *     result.growth_factor = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['growth_factor']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")             # <<<<<<<<<<<<<<
 *     result.growth_factor = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__49, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")
 *     result.potential_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['growth_factor']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 *     result.growth_factor = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['actual_growth']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.growth_factor = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 *     result.growth_factor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_growth']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.growth_factor = value
 *     try:
 *         value = obj['actual_growth']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_actual_growth); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 *     result.growth_factor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_growth']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['actual_growth']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 *     result.actual_growth = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['actual_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")             # <<<<<<<<<<<<<<
 *     result.actual_growth = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__50, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'growth_factor'")
 *     result.growth_factor = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_growth']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 *     result.actual_growth = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['age']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.actual_growth = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 *     result.actual_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.actual_growth = value
 *     try:
 *         value = obj['age']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_age); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 *     result.actual_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['age']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['age']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")             # <<<<<<<<<<<<<<
 *     result.age = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")
 *     result.actual_growth = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight_capable_uptake']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.age = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight_capable_uptake']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.age = value
 *     try:
 *         value = obj['weight_capable_uptake']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight_capable_uptake); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight_capable_uptake']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['weight_capable_uptake']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 *     result.weight_capable_uptake = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['weight_capable_uptake']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")             # <<<<<<<<<<<<<<
 *     result.weight_capable_uptake = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__51, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'age'")
 *     result.age = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight_capable_uptake']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 *     result.weight_capable_uptake = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['weight']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.weight_capable_uptake = __pyx_t_10;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 *     result.weight_capable_uptake = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.weight_capable_uptake = value
 *     try:
 *         value = obj['weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 *     result.weight_capable_uptake = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")
 *     result.weight_capable_uptake = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely((__Pyx_carray_from_py_double(__pyx_v_value, __pyx_t_11, 3) < 0))) __PYX_ERR(1, 46, __pyx_L1_error)
  memcpy(&(__pyx_v_result.weight[0]), __pyx_t_11, sizeof(__pyx_v_result.weight[0]) * (3));

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'weight'")
 *     result.weight = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Root")
 * cdef struct_type __pyx_convert__from_py_Root(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Root", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static SoilCell __pyx_convert__from_py_SoilCell(PyObject *__pyx_v_obj) {
  SoilCell __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  SoilCell __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  Root __pyx_t_11;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_SoilCell", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_SoilCell(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_SoilCell(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['nitrate_nitrogen_content']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nitrate_nitrogen_content); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 *     result.nitrate_nitrogen_content = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")             # <<<<<<<<<<<<<<
 *     result.nitrate_nitrogen_content = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__52, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 *     result.nitrate_nitrogen_content = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['fresh_organic_matter']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.nitrate_nitrogen_content = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 *     result.nitrate_nitrogen_content = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fresh_organic_matter']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.nitrate_nitrogen_content = value
 *     try:
 *         value = obj['fresh_organic_matter']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_fresh_organic_matter); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 *     result.nitrate_nitrogen_content = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fresh_organic_matter']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['fresh_organic_matter']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 *     result.fresh_organic_matter = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['fresh_organic_matter']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")             # <<<<<<<<<<<<<<
 *     result.fresh_organic_matter = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")
 *     result.nitrate_nitrogen_content = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fresh_organic_matter']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 *     result.fresh_organic_matter = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['root']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.fresh_organic_matter = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 *     result.fresh_organic_matter = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.fresh_organic_matter = value
 *     try:
 *         value = obj['root']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_root); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 *     result.fresh_organic_matter = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['root']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'root'")
 *     result.root = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root'")             # <<<<<<<<<<<<<<
 *     result.root = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")
 *     result.fresh_organic_matter = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root'")
 *     result.root = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_11 = __pyx_convert__from_py_Root(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.root = __pyx_t_11;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'root'")
 *     result.root = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_SoilCell")
 * cdef struct_type __pyx_convert__from_py_SoilCell(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_SoilCell")
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

static int __Pyx_carray_from_py_SoilCell(PyObject *__pyx_v_o, SoilCell *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  SoilCell __pyx_t_11;
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_SoilCell", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_SoilCell")
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      __pyx_t_11 = __pyx_convert__from_py_SoilCell(__pyx_v_item); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 89, __pyx_L1_error)
      (__pyx_v_v[__pyx_v_i]) = __pyx_t_11;

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_SoilCell")
 * cdef int __Pyx_carray_from_py_SoilCell(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_SoilCell", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static int __Pyx_carray_from_py_SoilCell___5b_20_5d_(PyObject *__pyx_v_o, SoilCell (*__pyx_v_v)[20], Py_ssize_t __pyx_v_length) {
  Py_ssize_t __pyx_v_i;
  PyObject *__pyx_v_item = NULL;
  int __pyx_r;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  Py_ssize_t __pyx_t_4;
  int __pyx_t_5;
  int __pyx_t_6;
  PyObject *__pyx_t_7 = NULL;
  Py_ssize_t __pyx_t_8;
  PyObject *(*__pyx_t_9)(PyObject *);
  PyObject *__pyx_t_10 = NULL;
  SoilCell __pyx_t_11[20];
  char const *__pyx_t_12;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_from_py_SoilCell___5b_20_5d_", 0);

  /* "carray.from_py":80
 * @cname("__Pyx_carray_from_py_SoilCell___5b_20_5d_")
 * cdef int __Pyx_carray_from_py_SoilCell___5b_20_5d_(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length             # <<<<<<<<<<<<<<
 *     try:
 *         i = len(o)
 */
  __pyx_v_i = __pyx_v_length;

  /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell___5b_20_5d_(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_1);
    __Pyx_XGOTREF(__pyx_t_2);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "carray.from_py":82
 *     cdef Py_ssize_t i = length
 *     try:
 *         i = len(o)             # <<<<<<<<<<<<<<
 *     except (TypeError, OverflowError):
 *         pass
 */
      __pyx_t_4 = PyObject_Length(__pyx_v_o); if (unlikely(__pyx_t_4 == ((Py_ssize_t)-1))) __PYX_ERR(1, 82, __pyx_L3_error)
      __pyx_v_i = __pyx_t_4;

      /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell___5b_20_5d_(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    }
    __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
    __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L8_try_end;
    __pyx_L3_error:;

    /* "carray.from_py":83
 *     try:
 *         i = len(o)
 *     except (TypeError, OverflowError):             # <<<<<<<<<<<<<<
 *         pass
 *     if i == length:
 */
    __pyx_t_5 = __Pyx_PyErr_ExceptionMatches2(__pyx_builtin_TypeError, __pyx_builtin_OverflowError);
    if (__pyx_t_5) {
      __Pyx_ErrRestore(0,0,0);
      goto __pyx_L4_exception_handled;
    }
    goto __pyx_L5_except_error;
    __pyx_L5_except_error:;

    /* "carray.from_py":81
 * cdef int __Pyx_carray_from_py_SoilCell___5b_20_5d_(object o, base_type *v, Py_ssize_t length) except -1:
 *     cdef Py_ssize_t i = length
 *     try:             # <<<<<<<<<<<<<<
 *         i = len(o)
 *     except (TypeError, OverflowError):
 */
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L4_exception_handled:;
    __Pyx_XGIVEREF(__pyx_t_1);
    __Pyx_XGIVEREF(__pyx_t_2);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
    __pyx_L8_try_end:;
  }

  /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
  if (__pyx_t_6) {

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_t_4 = 0;
    if (likely(PyList_CheckExact(__pyx_v_o)) || PyTuple_CheckExact(__pyx_v_o)) {
      __pyx_t_7 = __pyx_v_o; __Pyx_INCREF(__pyx_t_7); __pyx_t_8 = 0;
      __pyx_t_9 = NULL;
    } else {
      __pyx_t_8 = -1; __pyx_t_7 = PyObject_GetIter(__pyx_v_o); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 86, __pyx_L1_error)
      __Pyx_GOTREF(__pyx_t_7);
      __pyx_t_9 = __Pyx_PyObject_GetIterNextFunc(__pyx_t_7); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 86, __pyx_L1_error)
    }
    for (;;) {
      if (likely(!__pyx_t_9)) {
        if (likely(PyList_CheckExact(__pyx_t_7))) {
          if (__pyx_t_8 >= PyList_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyList_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        } else {
          if (__pyx_t_8 >= PyTuple_GET_SIZE(__pyx_t_7)) break;
          #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
          __pyx_t_10 = PyTuple_GET_ITEM(__pyx_t_7, __pyx_t_8); __Pyx_INCREF(__pyx_t_10); __pyx_t_8++; if (unlikely((0 < 0))) __PYX_ERR(1, 86, __pyx_L1_error)
          #else
          __pyx_t_10 = PySequence_ITEM(__pyx_t_7, __pyx_t_8); __pyx_t_8++; if (unlikely(!__pyx_t_10)) __PYX_ERR(1, 86, __pyx_L1_error)
          __Pyx_GOTREF(__pyx_t_10);
          #endif
        }
      } else {
        __pyx_t_10 = __pyx_t_9(__pyx_t_7);
        if (unlikely(!__pyx_t_10)) {
          PyObject* exc_type = PyErr_Occurred();
          if (exc_type) {
            if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
            else __PYX_ERR(1, 86, __pyx_L1_error)
          }
          break;
        }
        __Pyx_GOTREF(__pyx_t_10);
      }
      __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_10);
      __pyx_t_10 = 0;
      __pyx_v_i = __pyx_t_4;
      __pyx_t_4 = (__pyx_t_4 + 1);

      /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      __pyx_t_6 = ((__pyx_v_i >= __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":88
 *         for i, item in enumerate(o):
 *             if i >= length:
 *                 break             # <<<<<<<<<<<<<<
 *             v[i] = item
 *         else:
 */
        goto __pyx_L11_break;

        /* "carray.from_py":87
 *     if i == length:
 *         for i, item in enumerate(o):
 *             if i >= length:             # <<<<<<<<<<<<<<
 *                 break
 *             v[i] = item
 */
      }

      /* "carray.from_py":89
 *             if i >= length:
 *                 break
 *             v[i] = item             # <<<<<<<<<<<<<<
 *         else:
 *             i += 1  # convert index to length
 */
      if (unlikely((__Pyx_carray_from_py_SoilCell(__pyx_v_item, __pyx_t_11, 20) < 0))) __PYX_ERR(1, 89, __pyx_L1_error)
      memcpy(&((__pyx_v_v[__pyx_v_i])[0]), __pyx_t_11, sizeof((__pyx_v_v[__pyx_v_i])[0]) * (20));

      /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    }
    /*else*/ {

      /* "carray.from_py":91
 *             v[i] = item
 *         else:
 *             i += 1  # convert index to length             # <<<<<<<<<<<<<<
 *             if i == length:
 *                 return 0
 */
      __pyx_v_i = (__pyx_v_i + 1);

      /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      __pyx_t_6 = ((__pyx_v_i == __pyx_v_length) != 0);
      if (__pyx_t_6) {

        /* "carray.from_py":93
 *             i += 1  # convert index to length
 *             if i == length:
 *                 return 0             # <<<<<<<<<<<<<<
 * 
 *     PyErr_Format(
 */
        __pyx_r = 0;
        __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
        goto __pyx_L0;

        /* "carray.from_py":92
 *         else:
 *             i += 1  # convert index to length
 *             if i == length:             # <<<<<<<<<<<<<<
 *                 return 0
 * 
 */
      }
    }

    /* "carray.from_py":86
 *         pass
 *     if i == length:
 *         for i, item in enumerate(o):             # <<<<<<<<<<<<<<
 *             if i >= length:
 *                 break
 */
    __pyx_L11_break:;
    __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

    /* "carray.from_py":85
 *     except (TypeError, OverflowError):
 *         pass
 *     if i == length:             # <<<<<<<<<<<<<<
 *         for i, item in enumerate(o):
 *             if i >= length:
 */
  }

  /* "carray.from_py":98
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 *          if i >= length else             # <<<<<<<<<<<<<<
 *          "not enough values found during array assignment, expected %zd, got %zd"),
 *         length, i)
 */
  if (((__pyx_v_i >= __pyx_v_length) != 0)) {
    __pyx_t_12 = ((char const *)"too many values found during array assignment, expected %zd");
  } else {
    __pyx_t_12 = ((char const *)"not enough values found during array assignment, expected %zd, got %zd");
  }

  /* "carray.from_py":95
 *                 return 0
 * 
 *     PyErr_Format(             # <<<<<<<<<<<<<<
 *         IndexError,
 *         ("too many values found during array assignment, expected %zd"
 */
  __pyx_t_7 = PyErr_Format(__pyx_builtin_IndexError, __pyx_t_12, __pyx_v_length, __pyx_v_i); if (unlikely(!__pyx_t_7)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_7);
  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;

  /* "carray.from_py":79
 * 
 * @cname("__Pyx_carray_from_py_SoilCell___5b_20_5d_")
 * cdef int __Pyx_carray_from_py_SoilCell___5b_20_5d_(object o, base_type *v, Py_ssize_t length) except -1:             # <<<<<<<<<<<<<<
 *     cdef Py_ssize_t i = length
 *     try:
 */

  /* function exit code */
  __pyx_r = 0;
  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_10);
  __Pyx_AddTraceback("carray.from_py.__Pyx_carray_from_py_SoilCell___5b_20_5d_", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = -1;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_item);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Soil")
 * cdef struct_type __pyx_convert__from_py_Soil(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static Soil __pyx_convert__from_py_Soil(PyObject *__pyx_v_obj) {
  Soil __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  Soil __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  SoilLayer __pyx_t_11[40];
  SoilCell __pyx_t_12[40][20];
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_Soil", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Soil(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_Soil(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['number_of_layers_with_root']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_layers_with_root); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 *     result.number_of_layers_with_root = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Soil", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_layers_with_root = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 *     result.number_of_layers_with_root = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['layers']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.number_of_layers_with_root = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 *     result.number_of_layers_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['layers']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.number_of_layers_with_root = value
 *     try:
 *         value = obj['layers']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'layers'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_layers); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 *     result.number_of_layers_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['layers']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['layers']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'layers'")
 *     result.layers = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Soil", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['layers']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'layers'")             # <<<<<<<<<<<<<<
 *     result.layers = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")
 *     result.number_of_layers_with_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['layers']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'layers'")
 *     result.layers = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cells']
 */
  if (unlikely((__Pyx_carray_from_py_SoilLayer(__pyx_v_value, __pyx_t_11, 40) < 0))) __PYX_ERR(1, 26, __pyx_L1_error)
  memcpy(&(__pyx_v_result.layers[0]), __pyx_t_11, sizeof(__pyx_v_result.layers[0]) * (40));

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'layers'")
 *     result.layers = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cells']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.layers = value
 *     try:
 *         value = obj['cells']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cells'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cells); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'layers'")
 *     result.layers = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cells']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['cells']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cells'")
 *     result.cells = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Soil", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['cells']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cells'")             # <<<<<<<<<<<<<<
 *     result.cells = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'layers'")
 *     result.layers = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cells']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cells'")
 *     result.cells = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  if (unlikely((__Pyx_carray_from_py_SoilCell___5b_20_5d_(__pyx_v_value, __pyx_t_12, 40) < 0))) __PYX_ERR(1, 31, __pyx_L1_error)
  memcpy(&(__pyx_v_result.cells[0]), __pyx_t_12, sizeof(__pyx_v_result.cells[0]) * (40));

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'cells'")
 *     result.cells = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_Soil")
 * cdef struct_type __pyx_convert__from_py_Soil(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_Soil", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static State __pyx_convert__from_py_State(PyObject *__pyx_v_obj) {
  State __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  State __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  unsigned int __pyx_t_10;
  double __pyx_t_11;
  double __pyx_t_12[9];
  bool __pyx_t_13;
  double __pyx_t_14[3];
  VegetativeBranch __pyx_t_15[3];
  Hour __pyx_t_16[24];
  Soil __pyx_t_17;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_State", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_State(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_State(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['daynum']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['daynum']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_daynum); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['daynum']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['daynum']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 *     result.daynum = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['daynum']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'daynum'")             # <<<<<<<<<<<<<<
 *     result.daynum = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__58, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['daynum']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 *     result.daynum = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['kday']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.daynum = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 *     result.daynum = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['kday']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.daynum = value
 *     try:
 *         value = obj['kday']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'kday'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_kday); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 *     result.daynum = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['kday']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['kday']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'kday'")
 *     result.kday = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['kday']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'kday'")             # <<<<<<<<<<<<<<
 *     result.kday = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__59, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'daynum'")
 *     result.daynum = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['kday']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'kday'")
 *     result.kday = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['day_inc']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.kday = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'kday'")
 *     result.kday = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_inc']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.kday = value
 *     try:
 *         value = obj['day_inc']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_day_inc); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'kday'")
 *     result.kday = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_inc']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['day_inc']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 *     result.day_inc = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['day_inc']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_inc'")             # <<<<<<<<<<<<<<
 *     result.day_inc = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__60, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'kday'")
 *     result.kday = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_inc']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 *     result.day_inc = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['lint_yield']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.day_inc = __pyx_t_11;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 *     result.day_inc = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['lint_yield']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.day_inc = value
 *     try:
 *         value = obj['lint_yield']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_lint_yield); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 *     result.day_inc = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['lint_yield']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['lint_yield']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 *     result.lint_yield = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['lint_yield']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")             # <<<<<<<<<<<<<<
 *     result.lint_yield = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__61, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'day_inc'")
 *     result.day_inc = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['lint_yield']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 *     result.lint_yield = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['bloom_weight_loss']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.lint_yield = __pyx_t_11;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 *     result.lint_yield = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['bloom_weight_loss']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.lint_yield = value
 *     try:
 *         value = obj['bloom_weight_loss']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_bloom_weight_loss); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 *     result.lint_yield = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['bloom_weight_loss']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['bloom_weight_loss']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 *     result.bloom_weight_loss = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['bloom_weight_loss']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")             # <<<<<<<<<<<<<<
 *     result.bloom_weight_loss = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__62, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")
 *     result.lint_yield = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['bloom_weight_loss']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 *     result.bloom_weight_loss = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['abscised_fruit_sites']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.bloom_weight_loss = __pyx_t_11;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 *     result.bloom_weight_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.bloom_weight_loss = value
 *     try:
 *         value = obj['abscised_fruit_sites']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_abscised_fruit_sites); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 *     result.bloom_weight_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 *     result.abscised_fruit_sites = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")             # <<<<<<<<<<<<<<
 *     result.abscised_fruit_sites = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__63, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")
 *     result.bloom_weight_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 *     result.abscised_fruit_sites = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['abscised_leaf_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_v_result.abscised_fruit_sites = __pyx_t_11;

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 *     result.abscised_fruit_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":48
 *     result.abscised_fruit_sites = value
 *     try:
 *         value = obj['abscised_leaf_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_abscised_leaf_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 48, __pyx_L52_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 *     result.abscised_fruit_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L57_try_end;
    __pyx_L52_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":49
 *     try:
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 *     result.abscised_leaf_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 49, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":50
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.abscised_leaf_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__64, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 50, __pyx_L54_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 50, __pyx_L54_except_error)
    }
    goto __pyx_L54_except_error;
    __pyx_L54_except_error:;

    /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")
 *     result.abscised_fruit_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L57_try_end:;
  }

  /* "FromPyStructUtility":51
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 *     result.abscised_leaf_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cumulative_nitrogen_loss']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 51, __pyx_L1_error)
  __pyx_v_result.abscised_leaf_weight = __pyx_t_11;

  /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 *     result.abscised_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":53
 *     result.abscised_leaf_weight = value
 *     try:
 *         value = obj['cumulative_nitrogen_loss']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cumulative_nitrogen_loss); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 53, __pyx_L60_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 *     result.abscised_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L65_try_end;
    __pyx_L60_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":54
 *     try:
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 *     result.cumulative_nitrogen_loss = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 54, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":55
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")             # <<<<<<<<<<<<<<
 *     result.cumulative_nitrogen_loss = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__65, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 55, __pyx_L62_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 55, __pyx_L62_except_error)
    }
    goto __pyx_L62_except_error;
    __pyx_L62_except_error:;

    /* "FromPyStructUtility":52
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")
 *     result.abscised_leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L65_try_end:;
  }

  /* "FromPyStructUtility":56
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 *     result.cumulative_nitrogen_loss = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['applied_water']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 56, __pyx_L1_error)
  __pyx_v_result.cumulative_nitrogen_loss = __pyx_t_11;

  /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 *     result.cumulative_nitrogen_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['applied_water']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":58
 *     result.cumulative_nitrogen_loss = value
 *     try:
 *         value = obj['applied_water']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_applied_water); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 58, __pyx_L68_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 *     result.cumulative_nitrogen_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['applied_water']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L73_try_end;
    __pyx_L68_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":59
 *     try:
 *         value = obj['applied_water']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 *     result.applied_water = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 59, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":60
 *         value = obj['applied_water']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'applied_water'")             # <<<<<<<<<<<<<<
 *     result.applied_water = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__66, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 60, __pyx_L70_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 60, __pyx_L70_except_error)
    }
    goto __pyx_L70_except_error;
    __pyx_L70_except_error:;

    /* "FromPyStructUtility":57
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")
 *     result.cumulative_nitrogen_loss = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['applied_water']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L73_try_end:;
  }

  /* "FromPyStructUtility":61
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 *     result.applied_water = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['water_stress']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 61, __pyx_L1_error)
  __pyx_v_result.applied_water = __pyx_t_11;

  /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 *     result.applied_water = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":63
 *     result.applied_water = value
 *     try:
 *         value = obj['water_stress']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_water_stress); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 63, __pyx_L76_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 *     result.applied_water = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L81_try_end;
    __pyx_L76_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":64
 *     try:
 *         value = obj['water_stress']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 *     result.water_stress = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 64, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":65
 *         value = obj['water_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress'")             # <<<<<<<<<<<<<<
 *     result.water_stress = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__67, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 65, __pyx_L78_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 65, __pyx_L78_except_error)
    }
    goto __pyx_L78_except_error;
    __pyx_L78_except_error:;

    /* "FromPyStructUtility":62
 *         raise ValueError("No value specified for struct attribute 'applied_water'")
 *     result.applied_water = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L81_try_end:;
  }

  /* "FromPyStructUtility":66
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 *     result.water_stress = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['water_stress_stem']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 66, __pyx_L1_error)
  __pyx_v_result.water_stress = __pyx_t_11;

  /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 *     result.water_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress_stem']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":68
 *     result.water_stress = value
 *     try:
 *         value = obj['water_stress_stem']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_water_stress_stem); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 68, __pyx_L84_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 *     result.water_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress_stem']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L89_try_end;
    __pyx_L84_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":69
 *     try:
 *         value = obj['water_stress_stem']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 *     result.water_stress_stem = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 69, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":70
 *         value = obj['water_stress_stem']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")             # <<<<<<<<<<<<<<
 *     result.water_stress_stem = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__68, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 70, __pyx_L86_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 70, __pyx_L86_except_error)
    }
    goto __pyx_L86_except_error;
    __pyx_L86_except_error:;

    /* "FromPyStructUtility":67
 *         raise ValueError("No value specified for struct attribute 'water_stress'")
 *     result.water_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['water_stress_stem']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L89_try_end:;
  }

  /* "FromPyStructUtility":71
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 *     result.water_stress_stem = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['carbon_stress']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 71, __pyx_L1_error)
  __pyx_v_result.water_stress_stem = __pyx_t_11;

  /* "FromPyStructUtility":72
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 *     result.water_stress_stem = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['carbon_stress']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":73
 *     result.water_stress_stem = value
 *     try:
 *         value = obj['carbon_stress']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_carbon_stress); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 73, __pyx_L92_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":72
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 *     result.water_stress_stem = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['carbon_stress']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L97_try_end;
    __pyx_L92_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":74
 *     try:
 *         value = obj['carbon_stress']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 *     result.carbon_stress = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 74, __pyx_L94_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":75
 *         value = obj['carbon_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")             # <<<<<<<<<<<<<<
 *     result.carbon_stress = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__69, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 75, __pyx_L94_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 75, __pyx_L94_except_error)
    }
    goto __pyx_L94_except_error;
    __pyx_L94_except_error:;

    /* "FromPyStructUtility":72
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")
 *     result.water_stress_stem = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['carbon_stress']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L97_try_end:;
  }

  /* "FromPyStructUtility":76
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 *     result.carbon_stress = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['extra_carbon']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 76, __pyx_L1_error)
  __pyx_v_result.carbon_stress = __pyx_t_11;

  /* "FromPyStructUtility":77
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 *     result.carbon_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['extra_carbon']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":78
 *     result.carbon_stress = value
 *     try:
 *         value = obj['extra_carbon']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_extra_carbon); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 78, __pyx_L100_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":77
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 *     result.carbon_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['extra_carbon']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L105_try_end;
    __pyx_L100_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":79
 *     try:
 *         value = obj['extra_carbon']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 *     result.extra_carbon = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 79, __pyx_L102_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":80
 *         value = obj['extra_carbon']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")             # <<<<<<<<<<<<<<
 *     result.extra_carbon = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__70, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 80, __pyx_L102_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 80, __pyx_L102_except_error)
    }
    goto __pyx_L102_except_error;
    __pyx_L102_except_error:;

    /* "FromPyStructUtility":77
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")
 *     result.carbon_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['extra_carbon']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L105_try_end:;
  }

  /* "FromPyStructUtility":81
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 *     result.extra_carbon = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['day_length']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 81, __pyx_L1_error)
  __pyx_v_result.extra_carbon = __pyx_t_11;

  /* "FromPyStructUtility":82
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 *     result.extra_carbon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_length']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":83
 *     result.extra_carbon = value
 *     try:
 *         value = obj['day_length']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_day_length); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 83, __pyx_L108_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":82
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 *     result.extra_carbon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_length']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L113_try_end;
    __pyx_L108_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":84
 *     try:
 *         value = obj['day_length']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 *     result.day_length = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 84, __pyx_L110_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":85
 *         value = obj['day_length']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_length'")             # <<<<<<<<<<<<<<
 *     result.day_length = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__71, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 85, __pyx_L110_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 85, __pyx_L110_except_error)
    }
    goto __pyx_L110_except_error;
    __pyx_L110_except_error:;

    /* "FromPyStructUtility":82
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")
 *     result.extra_carbon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['day_length']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L113_try_end:;
  }

  /* "FromPyStructUtility":86
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 *     result.day_length = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['plant_height']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 86, __pyx_L1_error)
  __pyx_v_result.day_length = __pyx_t_11;

  /* "FromPyStructUtility":87
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 *     result.day_length = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_height']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":88
 *     result.day_length = value
 *     try:
 *         value = obj['plant_height']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_plant_height); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 88, __pyx_L116_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":87
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 *     result.day_length = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_height']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L121_try_end;
    __pyx_L116_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":89
 *     try:
 *         value = obj['plant_height']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 *     result.plant_height = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 89, __pyx_L118_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":90
 *         value = obj['plant_height']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_height'")             # <<<<<<<<<<<<<<
 *     result.plant_height = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__72, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 90, __pyx_L118_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 90, __pyx_L118_except_error)
    }
    goto __pyx_L118_except_error;
    __pyx_L118_except_error:;

    /* "FromPyStructUtility":87
 *         raise ValueError("No value specified for struct attribute 'day_length'")
 *     result.day_length = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_height']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L121_try_end:;
  }

  /* "FromPyStructUtility":91
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 *     result.plant_height = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['plant_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 91, __pyx_L1_error)
  __pyx_v_result.plant_height = __pyx_t_11;

  /* "FromPyStructUtility":92
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 *     result.plant_height = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":93
 *     result.plant_height = value
 *     try:
 *         value = obj['plant_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_plant_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 93, __pyx_L124_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":92
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 *     result.plant_height = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L129_try_end;
    __pyx_L124_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":94
 *     try:
 *         value = obj['plant_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 *     result.plant_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 94, __pyx_L126_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":95
 *         value = obj['plant_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")             # <<<<<<<<<<<<<<
 *     result.plant_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__73, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 95, __pyx_L126_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 95, __pyx_L126_except_error)
    }
    goto __pyx_L126_except_error;
    __pyx_L126_except_error:;

    /* "FromPyStructUtility":92
 *         raise ValueError("No value specified for struct attribute 'plant_height'")
 *     result.plant_height = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['plant_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L129_try_end:;
  }

  /* "FromPyStructUtility":96
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 *     result.plant_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['stem_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 96, __pyx_L1_error)
  __pyx_v_result.plant_weight = __pyx_t_11;

  /* "FromPyStructUtility":97
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 *     result.plant_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":98
 *     result.plant_weight = value
 *     try:
 *         value = obj['stem_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_stem_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 98, __pyx_L132_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":97
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 *     result.plant_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L137_try_end;
    __pyx_L132_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":99
 *     try:
 *         value = obj['stem_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 *     result.stem_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 99, __pyx_L134_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":100
 *         value = obj['stem_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")             # <<<<<<<<<<<<<<
 *     result.stem_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__74, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 100, __pyx_L134_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 100, __pyx_L134_except_error)
    }
    goto __pyx_L134_except_error;
    __pyx_L134_except_error:;

    /* "FromPyStructUtility":97
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")
 *     result.plant_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L137_try_end:;
  }

  /* "FromPyStructUtility":101
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 *     result.stem_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['square_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 101, __pyx_L1_error)
  __pyx_v_result.stem_weight = __pyx_t_11;

  /* "FromPyStructUtility":102
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 *     result.stem_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":103
 *     result.stem_weight = value
 *     try:
 *         value = obj['square_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_square_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 103, __pyx_L140_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":102
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 *     result.stem_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L145_try_end;
    __pyx_L140_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":104
 *     try:
 *         value = obj['square_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 *     result.square_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 104, __pyx_L142_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":105
 *         value = obj['square_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_weight'")             # <<<<<<<<<<<<<<
 *     result.square_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__75, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 105, __pyx_L142_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 105, __pyx_L142_except_error)
    }
    goto __pyx_L142_except_error;
    __pyx_L142_except_error:;

    /* "FromPyStructUtility":102
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")
 *     result.stem_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L145_try_end:;
  }

  /* "FromPyStructUtility":106
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 *     result.square_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['green_bolls_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 106, __pyx_L1_error)
  __pyx_v_result.square_weight = __pyx_t_11;

  /* "FromPyStructUtility":107
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 *     result.square_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":108
 *     result.square_weight = value
 *     try:
 *         value = obj['green_bolls_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_green_bolls_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 108, __pyx_L148_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":107
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 *     result.square_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L153_try_end;
    __pyx_L148_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":109
 *     try:
 *         value = obj['green_bolls_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 *     result.green_bolls_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 109, __pyx_L150_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":110
 *         value = obj['green_bolls_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")             # <<<<<<<<<<<<<<
 *     result.green_bolls_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__76, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 110, __pyx_L150_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 110, __pyx_L150_except_error)
    }
    goto __pyx_L150_except_error;
    __pyx_L150_except_error:;

    /* "FromPyStructUtility":107
 *         raise ValueError("No value specified for struct attribute 'square_weight'")
 *     result.square_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L153_try_end:;
  }

  /* "FromPyStructUtility":111
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 *     result.green_bolls_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['green_bolls_burr_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 111, __pyx_L1_error)
  __pyx_v_result.green_bolls_weight = __pyx_t_11;

  /* "FromPyStructUtility":112
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 *     result.green_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":113
 *     result.green_bolls_weight = value
 *     try:
 *         value = obj['green_bolls_burr_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_green_bolls_burr_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 113, __pyx_L156_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":112
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 *     result.green_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L161_try_end;
    __pyx_L156_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":114
 *     try:
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 *     result.green_bolls_burr_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 114, __pyx_L158_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":115
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")             # <<<<<<<<<<<<<<
 *     result.green_bolls_burr_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__77, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 115, __pyx_L158_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 115, __pyx_L158_except_error)
    }
    goto __pyx_L158_except_error;
    __pyx_L158_except_error:;

    /* "FromPyStructUtility":112
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")
 *     result.green_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L161_try_end:;
  }

  /* "FromPyStructUtility":116
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 *     result.green_bolls_burr_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['open_bolls_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 116, __pyx_L1_error)
  __pyx_v_result.green_bolls_burr_weight = __pyx_t_11;

  /* "FromPyStructUtility":117
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 *     result.green_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":118
 *     result.green_bolls_burr_weight = value
 *     try:
 *         value = obj['open_bolls_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_open_bolls_weight); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 118, __pyx_L164_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":117
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 *     result.green_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L169_try_end;
    __pyx_L164_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":119
 *     try:
 *         value = obj['open_bolls_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 *     result.open_bolls_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 119, __pyx_L166_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":120
 *         value = obj['open_bolls_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")             # <<<<<<<<<<<<<<
 *     result.open_bolls_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__78, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 120, __pyx_L166_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 120, __pyx_L166_except_error)
    }
    goto __pyx_L166_except_error;
    __pyx_L166_except_error:;

    /* "FromPyStructUtility":117
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")
 *     result.green_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L169_try_end:;
  }

  /* "FromPyStructUtility":121
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 *     result.open_bolls_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['open_bolls_burr_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 121, __pyx_L1_error)
  __pyx_v_result.open_bolls_weight = __pyx_t_11;

  /* "FromPyStructUtility":122
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 *     result.open_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":123
 *     result.open_bolls_weight = value
 *     try:
 *         value = obj['open_bolls_burr_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_open_bolls_burr_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 123, __pyx_L172_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":122
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 *     result.open_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L177_try_end;
    __pyx_L172_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":124
 *     try:
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 *     result.open_bolls_burr_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 124, __pyx_L174_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":125
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")             # <<<<<<<<<<<<<<
 *     result.open_bolls_burr_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__79, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 125, __pyx_L174_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 125, __pyx_L174_except_error)
    }
    goto __pyx_L174_except_error;
    __pyx_L174_except_error:;

    /* "FromPyStructUtility":122
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")
 *     result.open_bolls_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L177_try_end:;
  }

  /* "FromPyStructUtility":126
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 *     result.open_bolls_burr_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['runoff']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 126, __pyx_L1_error)
  __pyx_v_result.open_bolls_burr_weight = __pyx_t_11;

  /* "FromPyStructUtility":127
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 *     result.open_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['runoff']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":128
 *     result.open_bolls_burr_weight = value
 *     try:
 *         value = obj['runoff']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_runoff); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 128, __pyx_L180_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":127
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 *     result.open_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['runoff']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L185_try_end;
    __pyx_L180_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":129
 *     try:
 *         value = obj['runoff']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 *     result.runoff = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 129, __pyx_L182_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":130
 *         value = obj['runoff']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'runoff'")             # <<<<<<<<<<<<<<
 *     result.runoff = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__80, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 130, __pyx_L182_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 130, __pyx_L182_except_error)
    }
    goto __pyx_L182_except_error;
    __pyx_L182_except_error:;

    /* "FromPyStructUtility":127
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")
 *     result.open_bolls_burr_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['runoff']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L185_try_end:;
  }

  /* "FromPyStructUtility":131
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 *     result.runoff = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['solar_noon']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 131, __pyx_L1_error)
  __pyx_v_result.runoff = __pyx_t_11;

  /* "FromPyStructUtility":132
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 *     result.runoff = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['solar_noon']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":133
 *     result.runoff = value
 *     try:
 *         value = obj['solar_noon']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_solar_noon); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 133, __pyx_L188_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":132
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 *     result.runoff = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['solar_noon']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L193_try_end;
    __pyx_L188_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":134
 *     try:
 *         value = obj['solar_noon']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 *     result.solar_noon = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 134, __pyx_L190_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":135
 *         value = obj['solar_noon']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")             # <<<<<<<<<<<<<<
 *     result.solar_noon = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__81, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 135, __pyx_L190_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 135, __pyx_L190_except_error)
    }
    goto __pyx_L190_except_error;
    __pyx_L190_except_error:;

    /* "FromPyStructUtility":132
 *         raise ValueError("No value specified for struct attribute 'runoff'")
 *     result.runoff = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['solar_noon']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L193_try_end:;
  }

  /* "FromPyStructUtility":136
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 *     result.solar_noon = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['net_radiation']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 136, __pyx_L1_error)
  __pyx_v_result.solar_noon = __pyx_t_11;

  /* "FromPyStructUtility":137
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 *     result.solar_noon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['net_radiation']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":138
 *     result.solar_noon = value
 *     try:
 *         value = obj['net_radiation']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_net_radiation); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 138, __pyx_L196_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":137
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 *     result.solar_noon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['net_radiation']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L201_try_end;
    __pyx_L196_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":139
 *     try:
 *         value = obj['net_radiation']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 *     result.net_radiation = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 139, __pyx_L198_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":140
 *         value = obj['net_radiation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")             # <<<<<<<<<<<<<<
 *     result.net_radiation = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__82, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 140, __pyx_L198_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 140, __pyx_L198_except_error)
    }
    goto __pyx_L198_except_error;
    __pyx_L198_except_error:;

    /* "FromPyStructUtility":137
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")
 *     result.solar_noon = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['net_radiation']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L201_try_end:;
  }

  /* "FromPyStructUtility":141
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 *     result.net_radiation = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['evapotranspiration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 141, __pyx_L1_error)
  __pyx_v_result.net_radiation = __pyx_t_11;

  /* "FromPyStructUtility":142
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 *     result.net_radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['evapotranspiration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":143
 *     result.net_radiation = value
 *     try:
 *         value = obj['evapotranspiration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_evapotranspiration); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 143, __pyx_L204_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":142
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 *     result.net_radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['evapotranspiration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L209_try_end;
    __pyx_L204_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":144
 *     try:
 *         value = obj['evapotranspiration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 *     result.evapotranspiration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 144, __pyx_L206_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":145
 *         value = obj['evapotranspiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")             # <<<<<<<<<<<<<<
 *     result.evapotranspiration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__83, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 145, __pyx_L206_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 145, __pyx_L206_except_error)
    }
    goto __pyx_L206_except_error;
    __pyx_L206_except_error:;

    /* "FromPyStructUtility":142
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")
 *     result.net_radiation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['evapotranspiration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L209_try_end:;
  }

  /* "FromPyStructUtility":146
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 *     result.evapotranspiration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['actual_transpiration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 146, __pyx_L1_error)
  __pyx_v_result.evapotranspiration = __pyx_t_11;

  /* "FromPyStructUtility":147
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 *     result.evapotranspiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_transpiration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":148
 *     result.evapotranspiration = value
 *     try:
 *         value = obj['actual_transpiration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_actual_transpiration); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 148, __pyx_L212_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":147
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 *     result.evapotranspiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_transpiration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L217_try_end;
    __pyx_L212_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":149
 *     try:
 *         value = obj['actual_transpiration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 *     result.actual_transpiration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 149, __pyx_L214_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":150
 *         value = obj['actual_transpiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")             # <<<<<<<<<<<<<<
 *     result.actual_transpiration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__84, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 150, __pyx_L214_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 150, __pyx_L214_except_error)
    }
    goto __pyx_L214_except_error;
    __pyx_L214_except_error:;

    /* "FromPyStructUtility":147
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")
 *     result.evapotranspiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_transpiration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L217_try_end:;
  }

  /* "FromPyStructUtility":151
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 *     result.actual_transpiration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cumulative_transpiration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 151, __pyx_L1_error)
  __pyx_v_result.actual_transpiration = __pyx_t_11;

  /* "FromPyStructUtility":152
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 *     result.actual_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_transpiration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":153
 *     result.actual_transpiration = value
 *     try:
 *         value = obj['cumulative_transpiration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cumulative_transpiration); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 153, __pyx_L220_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":152
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 *     result.actual_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_transpiration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L225_try_end;
    __pyx_L220_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":154
 *     try:
 *         value = obj['cumulative_transpiration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 *     result.cumulative_transpiration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 154, __pyx_L222_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":155
 *         value = obj['cumulative_transpiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")             # <<<<<<<<<<<<<<
 *     result.cumulative_transpiration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__85, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 155, __pyx_L222_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 155, __pyx_L222_except_error)
    }
    goto __pyx_L222_except_error;
    __pyx_L222_except_error:;

    /* "FromPyStructUtility":152
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")
 *     result.actual_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_transpiration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L225_try_end:;
  }

  /* "FromPyStructUtility":156
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 *     result.cumulative_transpiration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['actual_soil_evaporation']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 156, __pyx_L1_error)
  __pyx_v_result.cumulative_transpiration = __pyx_t_11;

  /* "FromPyStructUtility":157
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 *     result.cumulative_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":158
 *     result.cumulative_transpiration = value
 *     try:
 *         value = obj['actual_soil_evaporation']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_actual_soil_evaporation); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 158, __pyx_L228_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":157
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 *     result.cumulative_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L233_try_end;
    __pyx_L228_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":159
 *     try:
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 *     result.actual_soil_evaporation = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 159, __pyx_L230_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":160
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")             # <<<<<<<<<<<<<<
 *     result.actual_soil_evaporation = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__86, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 160, __pyx_L230_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 160, __pyx_L230_except_error)
    }
    goto __pyx_L230_except_error;
    __pyx_L230_except_error:;

    /* "FromPyStructUtility":157
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")
 *     result.cumulative_transpiration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L233_try_end:;
  }

  /* "FromPyStructUtility":161
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 *     result.actual_soil_evaporation = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['cumulative_evaporation']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 161, __pyx_L1_error)
  __pyx_v_result.actual_soil_evaporation = __pyx_t_11;

  /* "FromPyStructUtility":162
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 *     result.actual_soil_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_evaporation']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":163
 *     result.actual_soil_evaporation = value
 *     try:
 *         value = obj['cumulative_evaporation']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_cumulative_evaporation); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 163, __pyx_L236_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":162
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 *     result.actual_soil_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_evaporation']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L241_try_end;
    __pyx_L236_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":164
 *     try:
 *         value = obj['cumulative_evaporation']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 *     result.cumulative_evaporation = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 164, __pyx_L238_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":165
 *         value = obj['cumulative_evaporation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")             # <<<<<<<<<<<<<<
 *     result.cumulative_evaporation = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__87, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 165, __pyx_L238_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 165, __pyx_L238_except_error)
    }
    goto __pyx_L238_except_error;
    __pyx_L238_except_error:;

    /* "FromPyStructUtility":162
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")
 *     result.actual_soil_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['cumulative_evaporation']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L241_try_end:;
  }

  /* "FromPyStructUtility":166
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 *     result.cumulative_evaporation = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['light_interception']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 166, __pyx_L1_error)
  __pyx_v_result.cumulative_evaporation = __pyx_t_11;

  /* "FromPyStructUtility":167
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 *     result.cumulative_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['light_interception']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":168
 *     result.cumulative_evaporation = value
 *     try:
 *         value = obj['light_interception']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_light_interception); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 168, __pyx_L244_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":167
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 *     result.cumulative_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['light_interception']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L249_try_end;
    __pyx_L244_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":169
 *     try:
 *         value = obj['light_interception']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 *     result.light_interception = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 169, __pyx_L246_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":170
 *         value = obj['light_interception']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'light_interception'")             # <<<<<<<<<<<<<<
 *     result.light_interception = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__88, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 170, __pyx_L246_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 170, __pyx_L246_except_error)
    }
    goto __pyx_L246_except_error;
    __pyx_L246_except_error:;

    /* "FromPyStructUtility":167
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")
 *     result.cumulative_evaporation = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['light_interception']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L249_try_end:;
  }

  /* "FromPyStructUtility":171
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 *     result.light_interception = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_vegetative_branches']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 171, __pyx_L1_error)
  __pyx_v_result.light_interception = __pyx_t_11;

  /* "FromPyStructUtility":172
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 *     result.light_interception = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":173
 *     result.light_interception = value
 *     try:
 *         value = obj['number_of_vegetative_branches']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_vegetative_branches); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 173, __pyx_L252_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":172
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 *     result.light_interception = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L257_try_end;
    __pyx_L252_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":174
 *     try:
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 *     result.number_of_vegetative_branches = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 174, __pyx_L254_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":175
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")             # <<<<<<<<<<<<<<
 *     result.number_of_vegetative_branches = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__89, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 175, __pyx_L254_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 175, __pyx_L254_except_error)
    }
    goto __pyx_L254_except_error;
    __pyx_L254_except_error:;

    /* "FromPyStructUtility":172
 *         raise ValueError("No value specified for struct attribute 'light_interception'")
 *     result.light_interception = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L257_try_end:;
  }

  /* "FromPyStructUtility":176
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 *     result.number_of_vegetative_branches = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_fruiting_sites']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 176, __pyx_L1_error)
  __pyx_v_result.number_of_vegetative_branches = __pyx_t_10;

  /* "FromPyStructUtility":177
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 *     result.number_of_vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":178
 *     result.number_of_vegetative_branches = value
 *     try:
 *         value = obj['number_of_fruiting_sites']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_fruiting_sites); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 178, __pyx_L260_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":177
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 *     result.number_of_vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L265_try_end;
    __pyx_L260_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":179
 *     try:
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 *     result.number_of_fruiting_sites = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 179, __pyx_L262_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":180
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_sites = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__90, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 180, __pyx_L262_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 180, __pyx_L262_except_error)
    }
    goto __pyx_L262_except_error;
    __pyx_L262_except_error:;

    /* "FromPyStructUtility":177
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")
 *     result.number_of_vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L265_try_end:;
  }

  /* "FromPyStructUtility":181
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 *     result.number_of_fruiting_sites = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_squares']
 */
  __pyx_t_10 = __Pyx_PyInt_As_unsigned_int(__pyx_v_value); if (unlikely((__pyx_t_10 == (unsigned int)-1) && PyErr_Occurred())) __PYX_ERR(1, 181, __pyx_L1_error)
  __pyx_v_result.number_of_fruiting_sites = __pyx_t_10;

  /* "FromPyStructUtility":182
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 *     result.number_of_fruiting_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_squares']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":183
 *     result.number_of_fruiting_sites = value
 *     try:
 *         value = obj['number_of_squares']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_squares); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 183, __pyx_L268_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":182
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 *     result.number_of_fruiting_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_squares']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L273_try_end;
    __pyx_L268_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":184
 *     try:
 *         value = obj['number_of_squares']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 *     result.number_of_squares = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 184, __pyx_L270_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":185
 *         value = obj['number_of_squares']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")             # <<<<<<<<<<<<<<
 *     result.number_of_squares = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__91, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 185, __pyx_L270_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 185, __pyx_L270_except_error)
    }
    goto __pyx_L270_except_error;
    __pyx_L270_except_error:;

    /* "FromPyStructUtility":182
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")
 *     result.number_of_fruiting_sites = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_squares']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L273_try_end:;
  }

  /* "FromPyStructUtility":186
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 *     result.number_of_squares = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_green_bolls']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 186, __pyx_L1_error)
  __pyx_v_result.number_of_squares = __pyx_t_11;

  /* "FromPyStructUtility":187
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 *     result.number_of_squares = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_green_bolls']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":188
 *     result.number_of_squares = value
 *     try:
 *         value = obj['number_of_green_bolls']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_green_bolls); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 188, __pyx_L276_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":187
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 *     result.number_of_squares = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_green_bolls']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L281_try_end;
    __pyx_L276_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":189
 *     try:
 *         value = obj['number_of_green_bolls']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 *     result.number_of_green_bolls = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 189, __pyx_L278_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":190
 *         value = obj['number_of_green_bolls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")             # <<<<<<<<<<<<<<
 *     result.number_of_green_bolls = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__92, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 190, __pyx_L278_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 190, __pyx_L278_except_error)
    }
    goto __pyx_L278_except_error;
    __pyx_L278_except_error:;

    /* "FromPyStructUtility":187
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")
 *     result.number_of_squares = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_green_bolls']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L281_try_end:;
  }

  /* "FromPyStructUtility":191
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 *     result.number_of_green_bolls = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_open_bolls']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 191, __pyx_L1_error)
  __pyx_v_result.number_of_green_bolls = __pyx_t_11;

  /* "FromPyStructUtility":192
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 *     result.number_of_green_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_open_bolls']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":193
 *     result.number_of_green_bolls = value
 *     try:
 *         value = obj['number_of_open_bolls']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_open_bolls); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 193, __pyx_L284_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":192
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 *     result.number_of_green_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_open_bolls']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L289_try_end;
    __pyx_L284_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":194
 *     try:
 *         value = obj['number_of_open_bolls']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 *     result.number_of_open_bolls = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 194, __pyx_L286_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":195
 *         value = obj['number_of_open_bolls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")             # <<<<<<<<<<<<<<
 *     result.number_of_open_bolls = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__93, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 195, __pyx_L286_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 195, __pyx_L286_except_error)
    }
    goto __pyx_L286_except_error;
    __pyx_L286_except_error:;

    /* "FromPyStructUtility":192
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")
 *     result.number_of_green_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_open_bolls']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L289_try_end:;
  }

  /* "FromPyStructUtility":196
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 *     result.number_of_open_bolls = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['nitrogen_stress']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 196, __pyx_L1_error)
  __pyx_v_result.number_of_open_bolls = __pyx_t_11;

  /* "FromPyStructUtility":197
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 *     result.number_of_open_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":198
 *     result.number_of_open_bolls = value
 *     try:
 *         value = obj['nitrogen_stress']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nitrogen_stress); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 198, __pyx_L292_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":197
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 *     result.number_of_open_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L297_try_end;
    __pyx_L292_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":199
 *     try:
 *         value = obj['nitrogen_stress']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 *     result.nitrogen_stress = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 199, __pyx_L294_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":200
 *         value = obj['nitrogen_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__94, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 200, __pyx_L294_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 200, __pyx_L294_except_error)
    }
    goto __pyx_L294_except_error;
    __pyx_L294_except_error:;

    /* "FromPyStructUtility":197
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")
 *     result.number_of_open_bolls = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L297_try_end:;
  }

  /* "FromPyStructUtility":201
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 *     result.nitrogen_stress = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['nitrogen_stress_vegetative']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 201, __pyx_L1_error)
  __pyx_v_result.nitrogen_stress = __pyx_t_11;

  /* "FromPyStructUtility":202
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 *     result.nitrogen_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":203
 *     result.nitrogen_stress = value
 *     try:
 *         value = obj['nitrogen_stress_vegetative']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nitrogen_stress_vegetative); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 203, __pyx_L300_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":202
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 *     result.nitrogen_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L305_try_end;
    __pyx_L300_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":204
 *     try:
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 *     result.nitrogen_stress_vegetative = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 204, __pyx_L302_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":205
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_vegetative = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__95, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 205, __pyx_L302_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 205, __pyx_L302_except_error)
    }
    goto __pyx_L302_except_error;
    __pyx_L302_except_error:;

    /* "FromPyStructUtility":202
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")
 *     result.nitrogen_stress = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L305_try_end:;
  }

  /* "FromPyStructUtility":206
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 *     result.nitrogen_stress_vegetative = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['nitrogen_stress_fruiting']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 206, __pyx_L1_error)
  __pyx_v_result.nitrogen_stress_vegetative = __pyx_t_11;

  /* "FromPyStructUtility":207
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 *     result.nitrogen_stress_vegetative = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":208
 *     result.nitrogen_stress_vegetative = value
 *     try:
 *         value = obj['nitrogen_stress_fruiting']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nitrogen_stress_fruiting); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 208, __pyx_L308_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":207
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 *     result.nitrogen_stress_vegetative = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L313_try_end;
    __pyx_L308_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":209
 *     try:
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 *     result.nitrogen_stress_fruiting = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 209, __pyx_L310_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":210
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_fruiting = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__96, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 210, __pyx_L310_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 210, __pyx_L310_except_error)
    }
    goto __pyx_L310_except_error;
    __pyx_L310_except_error:;

    /* "FromPyStructUtility":207
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")
 *     result.nitrogen_stress_vegetative = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L313_try_end:;
  }

  /* "FromPyStructUtility":211
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 *     result.nitrogen_stress_fruiting = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['nitrogen_stress_root']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 211, __pyx_L1_error)
  __pyx_v_result.nitrogen_stress_fruiting = __pyx_t_11;

  /* "FromPyStructUtility":212
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 *     result.nitrogen_stress_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":213
 *     result.nitrogen_stress_fruiting = value
 *     try:
 *         value = obj['nitrogen_stress_root']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_nitrogen_stress_root); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 213, __pyx_L316_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":212
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 *     result.nitrogen_stress_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L321_try_end;
    __pyx_L316_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":214
 *     try:
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 *     result.nitrogen_stress_root = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 214, __pyx_L318_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":215
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_root = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__97, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 215, __pyx_L318_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 215, __pyx_L318_except_error)
    }
    goto __pyx_L318_except_error;
    __pyx_L318_except_error:;

    /* "FromPyStructUtility":212
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")
 *     result.nitrogen_stress_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L321_try_end:;
  }

  /* "FromPyStructUtility":216
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 *     result.nitrogen_stress_root = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['total_required_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 216, __pyx_L1_error)
  __pyx_v_result.nitrogen_stress_root = __pyx_t_11;

  /* "FromPyStructUtility":217
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 *     result.nitrogen_stress_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['total_required_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":218
 *     result.nitrogen_stress_root = value
 *     try:
 *         value = obj['total_required_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_total_required_nitrogen); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 218, __pyx_L324_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":217
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 *     result.nitrogen_stress_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['total_required_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L329_try_end;
    __pyx_L324_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":219
 *     try:
 *         value = obj['total_required_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 *     result.total_required_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 219, __pyx_L326_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":220
 *         value = obj['total_required_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.total_required_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__98, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 220, __pyx_L326_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 220, __pyx_L326_except_error)
    }
    goto __pyx_L326_except_error;
    __pyx_L326_except_error:;

    /* "FromPyStructUtility":217
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")
 *     result.nitrogen_stress_root = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['total_required_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L329_try_end:;
  }

  /* "FromPyStructUtility":221
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 *     result.total_required_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_area_index']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 221, __pyx_L1_error)
  __pyx_v_result.total_required_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":222
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 *     result.total_required_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_index']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":223
 *     result.total_required_nitrogen = value
 *     try:
 *         value = obj['leaf_area_index']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_area_index); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 223, __pyx_L332_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":222
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 *     result.total_required_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_index']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L337_try_end;
    __pyx_L332_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":224
 *     try:
 *         value = obj['leaf_area_index']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 *     result.leaf_area_index = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 224, __pyx_L334_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":225
 *         value = obj['leaf_area_index']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")             # <<<<<<<<<<<<<<
 *     result.leaf_area_index = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__99, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 225, __pyx_L334_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 225, __pyx_L334_except_error)
    }
    goto __pyx_L334_except_error;
    __pyx_L334_except_error:;

    /* "FromPyStructUtility":222
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")
 *     result.total_required_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_index']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L337_try_end:;
  }

  /* "FromPyStructUtility":226
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 *     result.leaf_area_index = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_area']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 226, __pyx_L1_error)
  __pyx_v_result.leaf_area_index = __pyx_t_11;

  /* "FromPyStructUtility":227
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 *     result.leaf_area_index = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":228
 *     result.leaf_area_index = value
 *     try:
 *         value = obj['leaf_area']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_area); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 228, __pyx_L340_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":227
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 *     result.leaf_area_index = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L345_try_end;
    __pyx_L340_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":229
 *     try:
 *         value = obj['leaf_area']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 229, __pyx_L342_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":230
 *         value = obj['leaf_area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")             # <<<<<<<<<<<<<<
 *     result.leaf_area = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 230, __pyx_L342_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 230, __pyx_L342_except_error)
    }
    goto __pyx_L342_except_error;
    __pyx_L342_except_error:;

    /* "FromPyStructUtility":227
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")
 *     result.leaf_area_index = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L345_try_end:;
  }

  /* "FromPyStructUtility":231
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_weight']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 231, __pyx_L1_error)
  __pyx_v_result.leaf_area = __pyx_t_11;

  /* "FromPyStructUtility":232
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":233
 *     result.leaf_area = value
 *     try:
 *         value = obj['leaf_weight']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_weight); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 233, __pyx_L348_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":232
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L353_try_end;
    __pyx_L348_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":234
 *     try:
 *         value = obj['leaf_weight']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 234, __pyx_L350_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":235
 *         value = obj['leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 235, __pyx_L350_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 235, __pyx_L350_except_error)
    }
    goto __pyx_L350_except_error;
    __pyx_L350_except_error:;

    /* "FromPyStructUtility":232
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")
 *     result.leaf_area = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L353_try_end:;
  }

  /* "FromPyStructUtility":236
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_weight_pre_fruiting']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 236, __pyx_L1_error)
  __pyx_v_result.leaf_weight = __pyx_t_11;

  /* "FromPyStructUtility":237
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":238
 *     result.leaf_weight = value
 *     try:
 *         value = obj['leaf_weight_pre_fruiting']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_weight_pre_fruiting); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 238, __pyx_L356_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":237
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L361_try_end;
    __pyx_L356_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":239
 *     try:
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 *     result.leaf_weight_pre_fruiting = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 239, __pyx_L358_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":240
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight_pre_fruiting = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__100, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 240, __pyx_L358_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 240, __pyx_L358_except_error)
    }
    goto __pyx_L358_except_error;
    __pyx_L358_except_error:;

    /* "FromPyStructUtility":237
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")
 *     result.leaf_weight = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L361_try_end:;
  }

  /* "FromPyStructUtility":241
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 *     result.leaf_weight_pre_fruiting = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_weight_area_ratio']
 */
  if (unlikely((__Pyx_carray_from_py_double(__pyx_v_value, __pyx_t_12, 9) < 0))) __PYX_ERR(1, 241, __pyx_L1_error)
  memcpy(&(__pyx_v_result.leaf_weight_pre_fruiting[0]), __pyx_t_12, sizeof(__pyx_v_result.leaf_weight_pre_fruiting[0]) * (9));

  /* "FromPyStructUtility":242
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 *     result.leaf_weight_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":243
 *     result.leaf_weight_pre_fruiting = value
 *     try:
 *         value = obj['leaf_weight_area_ratio']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_weight_area_ratio); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 243, __pyx_L364_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":242
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 *     result.leaf_weight_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L369_try_end;
    __pyx_L364_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":244
 *     try:
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 *     result.leaf_weight_area_ratio = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 244, __pyx_L366_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":245
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight_area_ratio = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__101, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 245, __pyx_L366_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 245, __pyx_L366_except_error)
    }
    goto __pyx_L366_except_error;
    __pyx_L366_except_error:;

    /* "FromPyStructUtility":242
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")
 *     result.leaf_weight_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L369_try_end:;
  }

  /* "FromPyStructUtility":246
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 *     result.leaf_weight_area_ratio = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_nitrogen_concentration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 246, __pyx_L1_error)
  __pyx_v_result.leaf_weight_area_ratio = __pyx_t_11;

  /* "FromPyStructUtility":247
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 *     result.leaf_weight_area_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":248
 *     result.leaf_weight_area_ratio = value
 *     try:
 *         value = obj['leaf_nitrogen_concentration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_nitrogen_concentration); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 248, __pyx_L372_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":247
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 *     result.leaf_weight_area_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L377_try_end;
    __pyx_L372_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":249
 *     try:
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 *     result.leaf_nitrogen_concentration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 249, __pyx_L374_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":250
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.leaf_nitrogen_concentration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__102, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 250, __pyx_L374_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 250, __pyx_L374_except_error)
    }
    goto __pyx_L374_except_error;
    __pyx_L374_except_error:;

    /* "FromPyStructUtility":247
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")
 *     result.leaf_weight_area_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L377_try_end:;
  }

  /* "FromPyStructUtility":251
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 *     result.leaf_nitrogen_concentration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 251, __pyx_L1_error)
  __pyx_v_result.leaf_nitrogen_concentration = __pyx_t_11;

  /* "FromPyStructUtility":252
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 *     result.leaf_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":253
 *     result.leaf_nitrogen_concentration = value
 *     try:
 *         value = obj['leaf_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_nitrogen); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 253, __pyx_L380_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":252
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 *     result.leaf_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L385_try_end;
    __pyx_L380_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":254
 *     try:
 *         value = obj['leaf_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 *     result.leaf_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 254, __pyx_L382_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":255
 *         value = obj['leaf_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.leaf_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__103, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 255, __pyx_L382_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 255, __pyx_L382_except_error)
    }
    goto __pyx_L382_except_error;
    __pyx_L382_except_error:;

    /* "FromPyStructUtility":252
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")
 *     result.leaf_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L385_try_end:;
  }

  /* "FromPyStructUtility":256
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 *     result.leaf_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['petiole_nitrogen_concentration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 256, __pyx_L1_error)
  __pyx_v_result.leaf_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":257
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 *     result.leaf_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":258
 *     result.leaf_nitrogen = value
 *     try:
 *         value = obj['petiole_nitrogen_concentration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_petiole_nitrogen_concentration); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 258, __pyx_L388_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":257
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 *     result.leaf_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L393_try_end;
    __pyx_L388_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":259
 *     try:
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 *     result.petiole_nitrogen_concentration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 259, __pyx_L390_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":260
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.petiole_nitrogen_concentration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__104, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 260, __pyx_L390_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 260, __pyx_L390_except_error)
    }
    goto __pyx_L390_except_error;
    __pyx_L390_except_error:;

    /* "FromPyStructUtility":257
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")
 *     result.leaf_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L393_try_end:;
  }

  /* "FromPyStructUtility":261
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 *     result.petiole_nitrogen_concentration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['seed_nitrogen_concentration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 261, __pyx_L1_error)
  __pyx_v_result.petiole_nitrogen_concentration = __pyx_t_11;

  /* "FromPyStructUtility":262
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 *     result.petiole_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":263
 *     result.petiole_nitrogen_concentration = value
 *     try:
 *         value = obj['seed_nitrogen_concentration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_seed_nitrogen_concentration); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 263, __pyx_L396_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":262
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 *     result.petiole_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L401_try_end;
    __pyx_L396_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":264
 *     try:
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 *     result.seed_nitrogen_concentration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 264, __pyx_L398_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":265
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.seed_nitrogen_concentration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__105, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 265, __pyx_L398_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 265, __pyx_L398_except_error)
    }
    goto __pyx_L398_except_error;
    __pyx_L398_except_error:;

    /* "FromPyStructUtility":262
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")
 *     result.petiole_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L401_try_end:;
  }

  /* "FromPyStructUtility":266
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 *     result.seed_nitrogen_concentration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['seed_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 266, __pyx_L1_error)
  __pyx_v_result.seed_nitrogen_concentration = __pyx_t_11;

  /* "FromPyStructUtility":267
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 *     result.seed_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":268
 *     result.seed_nitrogen_concentration = value
 *     try:
 *         value = obj['seed_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_seed_nitrogen); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 268, __pyx_L404_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":267
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 *     result.seed_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L409_try_end;
    __pyx_L404_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":269
 *     try:
 *         value = obj['seed_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 *     result.seed_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 269, __pyx_L406_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":270
 *         value = obj['seed_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.seed_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__106, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 270, __pyx_L406_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 270, __pyx_L406_except_error)
    }
    goto __pyx_L406_except_error;
    __pyx_L406_except_error:;

    /* "FromPyStructUtility":267
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")
 *     result.seed_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['seed_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L409_try_end:;
  }

  /* "FromPyStructUtility":271
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 *     result.seed_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['root_nitrogen_concentration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 271, __pyx_L1_error)
  __pyx_v_result.seed_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":272
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 *     result.seed_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":273
 *     result.seed_nitrogen = value
 *     try:
 *         value = obj['root_nitrogen_concentration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_root_nitrogen_concentration); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 273, __pyx_L412_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":272
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 *     result.seed_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L417_try_end;
    __pyx_L412_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":274
 *     try:
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 *     result.root_nitrogen_concentration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 274, __pyx_L414_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":275
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.root_nitrogen_concentration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__107, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 275, __pyx_L414_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 275, __pyx_L414_except_error)
    }
    goto __pyx_L414_except_error;
    __pyx_L414_except_error:;

    /* "FromPyStructUtility":272
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")
 *     result.seed_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L417_try_end:;
  }

  /* "FromPyStructUtility":276
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 *     result.root_nitrogen_concentration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['square_nitrogen_concentration']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 276, __pyx_L1_error)
  __pyx_v_result.root_nitrogen_concentration = __pyx_t_11;

  /* "FromPyStructUtility":277
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 *     result.root_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":278
 *     result.root_nitrogen_concentration = value
 *     try:
 *         value = obj['square_nitrogen_concentration']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_square_nitrogen_concentration); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 278, __pyx_L420_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":277
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 *     result.root_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L425_try_end;
    __pyx_L420_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":279
 *     try:
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 *     result.square_nitrogen_concentration = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 279, __pyx_L422_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":280
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.square_nitrogen_concentration = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__108, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 280, __pyx_L422_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 280, __pyx_L422_except_error)
    }
    goto __pyx_L422_except_error;
    __pyx_L422_except_error:;

    /* "FromPyStructUtility":277
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")
 *     result.root_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L425_try_end:;
  }

  /* "FromPyStructUtility":281
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 *     result.square_nitrogen_concentration = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['burr_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 281, __pyx_L1_error)
  __pyx_v_result.square_nitrogen_concentration = __pyx_t_11;

  /* "FromPyStructUtility":282
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 *     result.square_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":283
 *     result.square_nitrogen_concentration = value
 *     try:
 *         value = obj['burr_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_burr_nitrogen); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 283, __pyx_L428_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":282
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 *     result.square_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L433_try_end;
    __pyx_L428_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":284
 *     try:
 *         value = obj['burr_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 *     result.burr_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 284, __pyx_L430_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":285
 *         value = obj['burr_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.burr_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__109, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 285, __pyx_L430_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 285, __pyx_L430_except_error)
    }
    goto __pyx_L430_except_error;
    __pyx_L430_except_error:;

    /* "FromPyStructUtility":282
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")
 *     result.square_nitrogen_concentration = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['burr_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L433_try_end:;
  }

  /* "FromPyStructUtility":286
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 *     result.burr_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['square_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 286, __pyx_L1_error)
  __pyx_v_result.burr_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":287
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 *     result.burr_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":288
 *     result.burr_nitrogen = value
 *     try:
 *         value = obj['square_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_square_nitrogen); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 288, __pyx_L436_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":287
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 *     result.burr_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L441_try_end;
    __pyx_L436_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":289
 *     try:
 *         value = obj['square_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 *     result.square_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 289, __pyx_L438_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":290
 *         value = obj['square_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.square_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__110, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 290, __pyx_L438_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 290, __pyx_L438_except_error)
    }
    goto __pyx_L438_except_error;
    __pyx_L438_except_error:;

    /* "FromPyStructUtility":287
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")
 *     result.burr_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['square_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L441_try_end:;
  }

  /* "FromPyStructUtility":291
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 *     result.square_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['stem_nitrogen']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 291, __pyx_L1_error)
  __pyx_v_result.square_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":292
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 *     result.square_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_nitrogen']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":293
 *     result.square_nitrogen = value
 *     try:
 *         value = obj['stem_nitrogen']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_stem_nitrogen); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 293, __pyx_L444_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":292
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 *     result.square_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_nitrogen']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L449_try_end;
    __pyx_L444_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":294
 *     try:
 *         value = obj['stem_nitrogen']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 *     result.stem_nitrogen = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 294, __pyx_L446_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":295
 *         value = obj['stem_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.stem_nitrogen = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__111, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 295, __pyx_L446_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 295, __pyx_L446_except_error)
    }
    goto __pyx_L446_except_error;
    __pyx_L446_except_error:;

    /* "FromPyStructUtility":292
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")
 *     result.square_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['stem_nitrogen']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L449_try_end:;
  }

  /* "FromPyStructUtility":296
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 *     result.stem_nitrogen = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['fruit_growth_ratio']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 296, __pyx_L1_error)
  __pyx_v_result.stem_nitrogen = __pyx_t_11;

  /* "FromPyStructUtility":297
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 *     result.stem_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":298
 *     result.stem_nitrogen = value
 *     try:
 *         value = obj['fruit_growth_ratio']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_fruit_growth_ratio); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 298, __pyx_L452_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":297
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 *     result.stem_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L457_try_end;
    __pyx_L452_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":299
 *     try:
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 *     result.fruit_growth_ratio = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 299, __pyx_L454_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":300
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")             # <<<<<<<<<<<<<<
 *     result.fruit_growth_ratio = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__112, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 300, __pyx_L454_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 300, __pyx_L454_except_error)
    }
    goto __pyx_L454_except_error;
    __pyx_L454_except_error:;

    /* "FromPyStructUtility":297
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")
 *     result.stem_nitrogen = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L457_try_end:;
  }

  /* "FromPyStructUtility":301
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 *     result.fruit_growth_ratio = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['ginning_percent']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 301, __pyx_L1_error)
  __pyx_v_result.fruit_growth_ratio = __pyx_t_11;

  /* "FromPyStructUtility":302
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 *     result.fruit_growth_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":303
 *     result.fruit_growth_ratio = value
 *     try:
 *         value = obj['ginning_percent']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_ginning_percent); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 303, __pyx_L460_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":302
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 *     result.fruit_growth_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L465_try_end;
    __pyx_L460_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":304
 *     try:
 *         value = obj['ginning_percent']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 304, __pyx_L462_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":305
 *         value = obj['ginning_percent']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")             # <<<<<<<<<<<<<<
 *     result.ginning_percent = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 305, __pyx_L462_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 305, __pyx_L462_except_error)
    }
    goto __pyx_L462_except_error;
    __pyx_L462_except_error:;

    /* "FromPyStructUtility":302
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")
 *     result.fruit_growth_ratio = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['ginning_percent']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L465_try_end:;
  }

  /* "FromPyStructUtility":306
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['average_temperature']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 306, __pyx_L1_error)
  __pyx_v_result.ginning_percent = __pyx_t_11;

  /* "FromPyStructUtility":307
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":308
 *     result.ginning_percent = value
 *     try:
 *         value = obj['average_temperature']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_average_temperature); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 308, __pyx_L468_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":307
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L473_try_end;
    __pyx_L468_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":309
 *     try:
 *         value = obj['average_temperature']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 309, __pyx_L470_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":310
 *         value = obj['average_temperature']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")             # <<<<<<<<<<<<<<
 *     result.average_temperature = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 310, __pyx_L470_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 310, __pyx_L470_except_error)
    }
    goto __pyx_L470_except_error;
    __pyx_L470_except_error:;

    /* "FromPyStructUtility":307
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")
 *     result.ginning_percent = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['average_temperature']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L473_try_end:;
  }

  /* "FromPyStructUtility":311
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['pollination_switch']
 */
  __pyx_t_11 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_11 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 311, __pyx_L1_error)
  __pyx_v_result.average_temperature = __pyx_t_11;

  /* "FromPyStructUtility":312
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['pollination_switch']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":313
 *     result.average_temperature = value
 *     try:
 *         value = obj['pollination_switch']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_pollination_switch); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 313, __pyx_L476_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":312
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['pollination_switch']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L481_try_end;
    __pyx_L476_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":314
 *     try:
 *         value = obj['pollination_switch']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 *     result.pollination_switch = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 314, __pyx_L478_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":315
 *         value = obj['pollination_switch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")             # <<<<<<<<<<<<<<
 *     result.pollination_switch = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__113, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 315, __pyx_L478_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 315, __pyx_L478_except_error)
    }
    goto __pyx_L478_except_error;
    __pyx_L478_except_error:;

    /* "FromPyStructUtility":312
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")
 *     result.average_temperature = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['pollination_switch']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L481_try_end:;
  }

  /* "FromPyStructUtility":316
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 *     result.pollination_switch = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['age_of_pre_fruiting_nodes']
 */
  __pyx_t_13 = __Pyx_PyObject_IsTrue(__pyx_v_value); if (unlikely((__pyx_t_13 == ((bool)-1)) && PyErr_Occurred())) __PYX_ERR(1, 316, __pyx_L1_error)
  __pyx_v_result.pollination_switch = __pyx_t_13;

  /* "FromPyStructUtility":317
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 *     result.pollination_switch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":318
 *     result.pollination_switch = value
 *     try:
 *         value = obj['age_of_pre_fruiting_nodes']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_age_of_pre_fruiting_nodes); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 318, __pyx_L484_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":317
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 *     result.pollination_switch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L489_try_end;
    __pyx_L484_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":319
 *     try:
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 *     result.age_of_pre_fruiting_nodes = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 319, __pyx_L486_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":320
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.age_of_pre_fruiting_nodes = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__114, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 320, __pyx_L486_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 320, __pyx_L486_except_error)
    }
    goto __pyx_L486_except_error;
    __pyx_L486_except_error:;

    /* "FromPyStructUtility":317
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")
 *     result.pollination_switch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L489_try_end:;
  }

  /* "FromPyStructUtility":321
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 *     result.age_of_pre_fruiting_nodes = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['number_of_pre_fruiting_nodes']
 */
  if (unlikely((__Pyx_carray_from_py_double(__pyx_v_value, __pyx_t_12, 9) < 0))) __PYX_ERR(1, 321, __pyx_L1_error)
  memcpy(&(__pyx_v_result.age_of_pre_fruiting_nodes[0]), __pyx_t_12, sizeof(__pyx_v_result.age_of_pre_fruiting_nodes[0]) * (9));

  /* "FromPyStructUtility":322
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 *     result.age_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":323
 *     result.age_of_pre_fruiting_nodes = value
 *     try:
 *         value = obj['number_of_pre_fruiting_nodes']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_number_of_pre_fruiting_nodes); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 323, __pyx_L492_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":322
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 *     result.age_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L497_try_end;
    __pyx_L492_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":324
 *     try:
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 *     result.number_of_pre_fruiting_nodes = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 324, __pyx_L494_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":325
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.number_of_pre_fruiting_nodes = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__115, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 325, __pyx_L494_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 325, __pyx_L494_except_error)
    }
    goto __pyx_L494_except_error;
    __pyx_L494_except_error:;

    /* "FromPyStructUtility":322
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")
 *     result.age_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L497_try_end:;
  }

  /* "FromPyStructUtility":326
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 *     result.number_of_pre_fruiting_nodes = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['leaf_area_pre_fruiting']
 */
  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 326, __pyx_L1_error)
  __pyx_v_result.number_of_pre_fruiting_nodes = __pyx_t_2;

  /* "FromPyStructUtility":327
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 *     result.number_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":328
 *     result.number_of_pre_fruiting_nodes = value
 *     try:
 *         value = obj['leaf_area_pre_fruiting']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_leaf_area_pre_fruiting); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 328, __pyx_L500_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":327
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 *     result.number_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L505_try_end;
    __pyx_L500_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":329
 *     try:
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 *     result.leaf_area_pre_fruiting = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 329, __pyx_L502_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":330
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")             # <<<<<<<<<<<<<<
 *     result.leaf_area_pre_fruiting = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__116, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 330, __pyx_L502_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 330, __pyx_L502_except_error)
    }
    goto __pyx_L502_except_error;
    __pyx_L502_except_error:;

    /* "FromPyStructUtility":327
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")
 *     result.number_of_pre_fruiting_nodes = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L505_try_end:;
  }

  /* "FromPyStructUtility":331
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 *     result.leaf_area_pre_fruiting = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['delay_for_new_branch']
 */
  if (unlikely((__Pyx_carray_from_py_double(__pyx_v_value, __pyx_t_12, 9) < 0))) __PYX_ERR(1, 331, __pyx_L1_error)
  memcpy(&(__pyx_v_result.leaf_area_pre_fruiting[0]), __pyx_t_12, sizeof(__pyx_v_result.leaf_area_pre_fruiting[0]) * (9));

  /* "FromPyStructUtility":332
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 *     result.leaf_area_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_branch']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":333
 *     result.leaf_area_pre_fruiting = value
 *     try:
 *         value = obj['delay_for_new_branch']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_delay_for_new_branch); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 333, __pyx_L508_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":332
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 *     result.leaf_area_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_branch']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L513_try_end;
    __pyx_L508_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":334
 *     try:
 *         value = obj['delay_for_new_branch']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 *     result.delay_for_new_branch = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 334, __pyx_L510_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":335
 *         value = obj['delay_for_new_branch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_branch = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__117, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 335, __pyx_L510_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 335, __pyx_L510_except_error)
    }
    goto __pyx_L510_except_error;
    __pyx_L510_except_error:;

    /* "FromPyStructUtility":332
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")
 *     result.leaf_area_pre_fruiting = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['delay_for_new_branch']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L513_try_end:;
  }

  /* "FromPyStructUtility":336
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 *     result.delay_for_new_branch = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['vegetative_branches']
 */
  if (unlikely((__Pyx_carray_from_py_double(__pyx_v_value, __pyx_t_14, 3) < 0))) __PYX_ERR(1, 336, __pyx_L1_error)
  memcpy(&(__pyx_v_result.delay_for_new_branch[0]), __pyx_t_14, sizeof(__pyx_v_result.delay_for_new_branch[0]) * (3));

  /* "FromPyStructUtility":337
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 *     result.delay_for_new_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['vegetative_branches']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":338
 *     result.delay_for_new_branch = value
 *     try:
 *         value = obj['vegetative_branches']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_vegetative_branches); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 338, __pyx_L516_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":337
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 *     result.delay_for_new_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['vegetative_branches']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L521_try_end;
    __pyx_L516_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":339
 *     try:
 *         value = obj['vegetative_branches']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 *     result.vegetative_branches = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 339, __pyx_L518_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":340
 *         value = obj['vegetative_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")             # <<<<<<<<<<<<<<
 *     result.vegetative_branches = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__118, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 340, __pyx_L518_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 340, __pyx_L518_except_error)
    }
    goto __pyx_L518_except_error;
    __pyx_L518_except_error:;

    /* "FromPyStructUtility":337
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")
 *     result.delay_for_new_branch = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['vegetative_branches']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L521_try_end:;
  }

  /* "FromPyStructUtility":341
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 *     result.vegetative_branches = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['hours']
 */
  if (unlikely((__Pyx_carray_from_py_VegetativeBranch(__pyx_v_value, __pyx_t_15, 3) < 0))) __PYX_ERR(1, 341, __pyx_L1_error)
  memcpy(&(__pyx_v_result.vegetative_branches[0]), __pyx_t_15, sizeof(__pyx_v_result.vegetative_branches[0]) * (3));

  /* "FromPyStructUtility":342
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 *     result.vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['hours']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":343
 *     result.vegetative_branches = value
 *     try:
 *         value = obj['hours']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'hours'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_hours); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 343, __pyx_L524_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":342
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 *     result.vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['hours']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L529_try_end;
    __pyx_L524_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":344
 *     try:
 *         value = obj['hours']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'hours'")
 *     result.hours = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 344, __pyx_L526_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":345
 *         value = obj['hours']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'hours'")             # <<<<<<<<<<<<<<
 *     result.hours = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__119, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 345, __pyx_L526_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 345, __pyx_L526_except_error)
    }
    goto __pyx_L526_except_error;
    __pyx_L526_except_error:;

    /* "FromPyStructUtility":342
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")
 *     result.vegetative_branches = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['hours']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L529_try_end:;
  }

  /* "FromPyStructUtility":346
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'hours'")
 *     result.hours = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['soil']
 */
  if (unlikely((__Pyx_carray_from_py_Hour(__pyx_v_value, __pyx_t_16, 24) < 0))) __PYX_ERR(1, 346, __pyx_L1_error)
  memcpy(&(__pyx_v_result.hours[0]), __pyx_t_16, sizeof(__pyx_v_result.hours[0]) * (24));

  /* "FromPyStructUtility":347
 *         raise ValueError("No value specified for struct attribute 'hours'")
 *     result.hours = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['soil']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":348
 *     result.hours = value
 *     try:
 *         value = obj['soil']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'soil'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_soil); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 348, __pyx_L532_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":347
 *         raise ValueError("No value specified for struct attribute 'hours'")
 *     result.hours = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['soil']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L537_try_end;
    __pyx_L532_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":349
 *     try:
 *         value = obj['soil']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'soil'")
 *     result.soil = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 349, __pyx_L534_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":350
 *         value = obj['soil']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'soil'")             # <<<<<<<<<<<<<<
 *     result.soil = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__120, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 350, __pyx_L534_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 350, __pyx_L534_except_error)
    }
    goto __pyx_L534_except_error;
    __pyx_L534_except_error:;

    /* "FromPyStructUtility":347
 *         raise ValueError("No value specified for struct attribute 'hours'")
 *     result.hours = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['soil']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L537_try_end:;
  }

  /* "FromPyStructUtility":351
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'soil'")
 *     result.soil = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_17 = __pyx_convert__from_py_Soil(__pyx_v_value); if (unlikely(PyErr_Occurred())) __PYX_ERR(1, 351, __pyx_L1_error)
  __pyx_v_result.soil = __pyx_t_17;

  /* "FromPyStructUtility":352
 *         raise ValueError("No value specified for struct attribute 'soil'")
 *     result.soil = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_State")
 * cdef struct_type __pyx_convert__from_py_State(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_State", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_ClimateStruct")
 * cdef inline list __Pyx_carray_to_py_ClimateStruct(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_py_ClimateStruct(ClimateStruct *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_l = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_py_ClimateStruct", 0);

  /* "carray.to_py":117
 *     cdef size_t i
 *     cdef object value
 *     l = PyList_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyList_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 117, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_l = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":118
 *     cdef object value
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":119
 *     l = PyList_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_ClimateStruct((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 119, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":120
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyList_SET_ITEM(l, i, value)
 *     return l
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":121
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)             # <<<<<<<<<<<<<<
 *     return l
 * 
 */
    PyList_SET_ITEM(__pyx_v_l, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":122
 *         Py_INCREF(value)
 *         PyList_SET_ITEM(l, i, value)
 *     return l             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_l);
  __pyx_r = __pyx_v_l;
  goto __pyx_L0;

  /* "carray.to_py":114
 * 
 * @cname("__Pyx_carray_to_py_ClimateStruct")
 * cdef inline list __Pyx_carray_to_py_ClimateStruct(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_l);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_ClimateStruct")
 * cdef inline tuple __Pyx_carray_to_tuple_ClimateStruct(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

static CYTHON_INLINE PyObject *__Pyx_carray_to_tuple_ClimateStruct(ClimateStruct *__pyx_v_v, Py_ssize_t __pyx_v_length) {
  size_t __pyx_v_i;
  PyObject *__pyx_v_value = 0;
  PyObject *__pyx_v_t = NULL;
  PyObject *__pyx_r = NULL;
  __Pyx_RefNannyDeclarations
  PyObject *__pyx_t_1 = NULL;
  size_t __pyx_t_2;
  size_t __pyx_t_3;
  size_t __pyx_t_4;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_carray_to_tuple_ClimateStruct", 0);

  /* "carray.to_py":129
 *     cdef size_t i
 *     cdef object value
 *     t = PyTuple_New(length)             # <<<<<<<<<<<<<<
 *     for i in range(<size_t>length):
 *         value = v[i]
 */
  __pyx_t_1 = PyTuple_New(__pyx_v_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 129, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_v_t = ((PyObject*)__pyx_t_1);
  __pyx_t_1 = 0;

  /* "carray.to_py":130
 *     cdef object value
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):             # <<<<<<<<<<<<<<
 *         value = v[i]
 *         Py_INCREF(value)
 */
  __pyx_t_2 = ((size_t)__pyx_v_length);
  __pyx_t_3 = __pyx_t_2;
  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
    __pyx_v_i = __pyx_t_4;

    /* "carray.to_py":131
 *     t = PyTuple_New(length)
 *     for i in range(<size_t>length):
 *         value = v[i]             # <<<<<<<<<<<<<<
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 */
    __pyx_t_1 = __pyx_convert__to_py_ClimateStruct((__pyx_v_v[__pyx_v_i])); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 131, __pyx_L1_error)
    __Pyx_GOTREF(__pyx_t_1);
    __Pyx_XDECREF_SET(__pyx_v_value, __pyx_t_1);
    __pyx_t_1 = 0;

    /* "carray.to_py":132
 *     for i in range(<size_t>length):
 *         value = v[i]
 *         Py_INCREF(value)             # <<<<<<<<<<<<<<
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t
 */
    Py_INCREF(__pyx_v_value);

    /* "carray.to_py":133
 *         value = v[i]
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)             # <<<<<<<<<<<<<<
 *     return t
 */
    PyTuple_SET_ITEM(__pyx_v_t, __pyx_v_i, __pyx_v_value);
  }

  /* "carray.to_py":134
 *         Py_INCREF(value)
 *         PyTuple_SET_ITEM(t, i, value)
 *     return t             # <<<<<<<<<<<<<<
 */
  __Pyx_XDECREF(__pyx_r);
  __Pyx_INCREF(__pyx_v_t);
  __pyx_r = __pyx_v_t;
  goto __pyx_L0;

  /* "carray.to_py":126
 * 
 * @cname("__Pyx_carray_to_tuple_ClimateStruct")
 * cdef inline tuple __Pyx_carray_to_tuple_ClimateStruct(base_type *v, Py_ssize_t length):             # <<<<<<<<<<<<<<
 *     cdef size_t i
 *     cdef object value
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_AddTraceback("carray.to_py.__Pyx_carray_to_tuple_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __pyx_r = 0;
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_XDECREF(__pyx_v_t);
  __Pyx_XGIVEREF(__pyx_r);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

/* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_ClimateStruct")
 * cdef struct_type __pyx_convert__from_py_ClimateStruct(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

static ClimateStruct __pyx_convert__from_py_ClimateStruct(PyObject *__pyx_v_obj) {
  ClimateStruct __pyx_v_result;
  PyObject *__pyx_v_value = NULL;
  ClimateStruct __pyx_r;
  __Pyx_RefNannyDeclarations
  int __pyx_t_1;
  int __pyx_t_2;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  PyObject *__pyx_t_5 = NULL;
  PyObject *__pyx_t_6 = NULL;
  PyObject *__pyx_t_7 = NULL;
  PyObject *__pyx_t_8 = NULL;
  PyObject *__pyx_t_9 = NULL;
  double __pyx_t_10;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__pyx_convert__from_py_ClimateStruct", 0);

  /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_ClimateStruct(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  __pyx_t_1 = ((!(PyMapping_Check(__pyx_v_obj) != 0)) != 0);
  if (__pyx_t_1) {

    /* "FromPyStructUtility":15
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)             # <<<<<<<<<<<<<<
 * 
 *     try:
 */
    __pyx_t_2 = __Pyx_RaiseUnexpectedTypeError(((char const *)"a mapping"), __pyx_v_obj); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(1, 15, __pyx_L1_error)

    /* "FromPyStructUtility":14
 * cdef struct_type __pyx_convert__from_py_ClimateStruct(obj) except *:
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):             # <<<<<<<<<<<<<<
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 */
  }

  /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rad']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":18
 * 
 *     try:
 *         value = obj['Rad']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Rad); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 18, __pyx_L4_error)
      __Pyx_GOTREF(__pyx_t_6);
      __pyx_v_value = __pyx_t_6;
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rad']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L9_try_end;
    __pyx_L4_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;

    /* "FromPyStructUtility":19
 *     try:
 *         value = obj['Rad']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 *     result.Rad = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 19, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":20
 *         value = obj['Rad']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rad'")             # <<<<<<<<<<<<<<
 *     result.Rad = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__121, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 20, __pyx_L6_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 20, __pyx_L6_except_error)
    }
    goto __pyx_L6_except_error;
    __pyx_L6_except_error:;

    /* "FromPyStructUtility":17
 *         __Pyx_RaiseUnexpectedTypeError(b"a mapping", obj)
 * 
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rad']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L9_try_end:;
  }

  /* "FromPyStructUtility":21
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 *     result.Rad = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['Tmax']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 21, __pyx_L1_error)
  __pyx_v_result.Rad = __pyx_t_10;

  /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 *     result.Rad = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmax']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":23
 *     result.Rad = value
 *     try:
 *         value = obj['Tmax']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Tmax); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 23, __pyx_L12_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 *     result.Rad = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmax']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L17_try_end;
    __pyx_L12_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":24
 *     try:
 *         value = obj['Tmax']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 *     result.Tmax = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 24, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":25
 *         value = obj['Tmax']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmax'")             # <<<<<<<<<<<<<<
 *     result.Tmax = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__122, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 25, __pyx_L14_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 25, __pyx_L14_except_error)
    }
    goto __pyx_L14_except_error;
    __pyx_L14_except_error:;

    /* "FromPyStructUtility":22
 *         raise ValueError("No value specified for struct attribute 'Rad'")
 *     result.Rad = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmax']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L17_try_end:;
  }

  /* "FromPyStructUtility":26
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 *     result.Tmax = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['Tmin']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 26, __pyx_L1_error)
  __pyx_v_result.Tmax = __pyx_t_10;

  /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 *     result.Tmax = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmin']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":28
 *     result.Tmax = value
 *     try:
 *         value = obj['Tmin']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Tmin); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 28, __pyx_L20_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 *     result.Tmax = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmin']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L25_try_end;
    __pyx_L20_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":29
 *     try:
 *         value = obj['Tmin']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 *     result.Tmin = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 29, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":30
 *         value = obj['Tmin']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmin'")             # <<<<<<<<<<<<<<
 *     result.Tmin = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__123, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 30, __pyx_L22_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 30, __pyx_L22_except_error)
    }
    goto __pyx_L22_except_error;
    __pyx_L22_except_error:;

    /* "FromPyStructUtility":27
 *         raise ValueError("No value specified for struct attribute 'Tmax'")
 *     result.Tmax = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tmin']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L25_try_end:;
  }

  /* "FromPyStructUtility":31
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 *     result.Tmin = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['Rain']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 31, __pyx_L1_error)
  __pyx_v_result.Tmin = __pyx_t_10;

  /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 *     result.Tmin = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rain']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":33
 *     result.Tmin = value
 *     try:
 *         value = obj['Rain']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Rain); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 33, __pyx_L28_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 *     result.Tmin = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rain']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L33_try_end;
    __pyx_L28_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":34
 *     try:
 *         value = obj['Rain']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 *     result.Rain = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 34, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":35
 *         value = obj['Rain']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rain'")             # <<<<<<<<<<<<<<
 *     result.Rain = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__124, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 35, __pyx_L30_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 35, __pyx_L30_except_error)
    }
    goto __pyx_L30_except_error;
    __pyx_L30_except_error:;

    /* "FromPyStructUtility":32
 *         raise ValueError("No value specified for struct attribute 'Tmin'")
 *     result.Tmin = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Rain']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L33_try_end:;
  }

  /* "FromPyStructUtility":36
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 *     result.Rain = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['Wind']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 36, __pyx_L1_error)
  __pyx_v_result.Rain = __pyx_t_10;

  /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 *     result.Rain = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Wind']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_5);
    /*try:*/ {

      /* "FromPyStructUtility":38
 *     result.Rain = value
 *     try:
 *         value = obj['Wind']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 */
      __pyx_t_6 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Wind); if (unlikely(!__pyx_t_6)) __PYX_ERR(1, 38, __pyx_L36_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_6);
      __pyx_t_6 = 0;

      /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 *     result.Rain = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Wind']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    goto __pyx_L41_try_end;
    __pyx_L36_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":39
 *     try:
 *         value = obj['Wind']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 *     result.Wind = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0) __PYX_ERR(1, 39, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_6);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_8);

      /* "FromPyStructUtility":40
 *         value = obj['Wind']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Wind'")             # <<<<<<<<<<<<<<
 *     result.Wind = value
 *     try:
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__125, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 40, __pyx_L38_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 40, __pyx_L38_except_error)
    }
    goto __pyx_L38_except_error;
    __pyx_L38_except_error:;

    /* "FromPyStructUtility":37
 *         raise ValueError("No value specified for struct attribute 'Rain'")
 *     result.Rain = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Wind']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
    goto __pyx_L1_error;
    __pyx_L41_try_end:;
  }

  /* "FromPyStructUtility":41
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 *     result.Wind = value             # <<<<<<<<<<<<<<
 *     try:
 *         value = obj['Tdew']
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 41, __pyx_L1_error)
  __pyx_v_result.Wind = __pyx_t_10;

  /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 *     result.Wind = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tdew']
 *     except KeyError:
 */
  {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ExceptionSave(&__pyx_t_5, &__pyx_t_4, &__pyx_t_3);
    __Pyx_XGOTREF(__pyx_t_5);
    __Pyx_XGOTREF(__pyx_t_4);
    __Pyx_XGOTREF(__pyx_t_3);
    /*try:*/ {

      /* "FromPyStructUtility":43
 *     result.Wind = value
 *     try:
 *         value = obj['Tdew']             # <<<<<<<<<<<<<<
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tdew'")
 */
      __pyx_t_8 = __Pyx_PyObject_Dict_GetItem(__pyx_v_obj, __pyx_n_s_Tdew); if (unlikely(!__pyx_t_8)) __PYX_ERR(1, 43, __pyx_L44_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_DECREF_SET(__pyx_v_value, __pyx_t_8);
      __pyx_t_8 = 0;

      /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 *     result.Wind = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tdew']
 *     except KeyError:
 */
    }
    __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
    __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
    __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
    goto __pyx_L49_try_end;
    __pyx_L44_error:;
    __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
    __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
    __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
    __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;

    /* "FromPyStructUtility":44
 *     try:
 *         value = obj['Tdew']
 *     except KeyError:             # <<<<<<<<<<<<<<
 *         raise ValueError("No value specified for struct attribute 'Tdew'")
 *     result.Tdew = value
 */
    __pyx_t_2 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_KeyError);
    if (__pyx_t_2) {
      __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
      if (__Pyx_GetException(&__pyx_t_8, &__pyx_t_7, &__pyx_t_6) < 0) __PYX_ERR(1, 44, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_8);
      __Pyx_GOTREF(__pyx_t_7);
      __Pyx_GOTREF(__pyx_t_6);

      /* "FromPyStructUtility":45
 *         value = obj['Tdew']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tdew'")             # <<<<<<<<<<<<<<
 *     result.Tdew = value
 *     return result
 */
      __pyx_t_9 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__126, NULL); if (unlikely(!__pyx_t_9)) __PYX_ERR(1, 45, __pyx_L46_except_error)
      __Pyx_GOTREF(__pyx_t_9);
      __Pyx_Raise(__pyx_t_9, 0, 0, 0);
      __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
      __PYX_ERR(1, 45, __pyx_L46_except_error)
    }
    goto __pyx_L46_except_error;
    __pyx_L46_except_error:;

    /* "FromPyStructUtility":42
 *         raise ValueError("No value specified for struct attribute 'Wind'")
 *     result.Wind = value
 *     try:             # <<<<<<<<<<<<<<
 *         value = obj['Tdew']
 *     except KeyError:
 */
    __Pyx_XGIVEREF(__pyx_t_5);
    __Pyx_XGIVEREF(__pyx_t_4);
    __Pyx_XGIVEREF(__pyx_t_3);
    __Pyx_ExceptionReset(__pyx_t_5, __pyx_t_4, __pyx_t_3);
    goto __pyx_L1_error;
    __pyx_L49_try_end:;
  }

  /* "FromPyStructUtility":46
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tdew'")
 *     result.Tdew = value             # <<<<<<<<<<<<<<
 *     return result
 * 
 */
  __pyx_t_10 = __pyx_PyFloat_AsDouble(__pyx_v_value); if (unlikely((__pyx_t_10 == (double)-1) && PyErr_Occurred())) __PYX_ERR(1, 46, __pyx_L1_error)
  __pyx_v_result.Tdew = __pyx_t_10;

  /* "FromPyStructUtility":47
 *         raise ValueError("No value specified for struct attribute 'Tdew'")
 *     result.Tdew = value
 *     return result             # <<<<<<<<<<<<<<
 * 
 * 
 */
  __pyx_r = __pyx_v_result;
  goto __pyx_L0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_ClimateStruct")
 * cdef struct_type __pyx_convert__from_py_ClimateStruct(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /* function exit code */
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_6);
  __Pyx_XDECREF(__pyx_t_7);
  __Pyx_XDECREF(__pyx_t_8);
  __Pyx_XDECREF(__pyx_t_9);
  __Pyx_AddTraceback("FromPyStructUtility.__pyx_convert__from_py_ClimateStruct", __pyx_clineno, __pyx_lineno, __pyx_filename);
  __Pyx_pretend_to_initialize(&__pyx_r);
  __pyx_L0:;
  __Pyx_XDECREF(__pyx_v_value);
  __Pyx_RefNannyFinishContext();
  return __pyx_r;
}

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_SoilInit(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_SoilInit(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8SoilInit_lyrsol(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8SoilInit_6lyrsol_1__get__(o);
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8SoilInit_layer_depth(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_8SoilInit_layer_depth(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_8SoilInit_11layer_depth_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8SoilInit_initial(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_8SoilInit_initial(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_8SoilInit_7initial_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8SoilInit_hydrology(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_8SoilInit_hydrology(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_8SoilInit_9hydrology_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_SoilInit[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_SoilInit[] = {
  {(char *)"lyrsol", __pyx_getprop_9_cotton2k_10simulation_8SoilInit_lyrsol, 0, (char *)0, 0},
  {(char *)"layer_depth", __pyx_getprop_9_cotton2k_10simulation_8SoilInit_layer_depth, __pyx_setprop_9_cotton2k_10simulation_8SoilInit_layer_depth, (char *)0, 0},
  {(char *)"initial", __pyx_getprop_9_cotton2k_10simulation_8SoilInit_initial, __pyx_setprop_9_cotton2k_10simulation_8SoilInit_initial, (char *)0, 0},
  {(char *)"hydrology", __pyx_getprop_9_cotton2k_10simulation_8SoilInit_hydrology, __pyx_setprop_9_cotton2k_10simulation_8SoilInit_hydrology, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_SoilInit_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_SoilInit},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_SoilInit},
  {Py_tp_init, (void *)__pyx_pw_9_cotton2k_10simulation_8SoilInit_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_SoilInit},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_SoilInit_spec = {
  "_cotton2k.simulation.SoilInit",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_SoilInit),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_SoilInit_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_SoilInit = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""SoilInit", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_SoilInit), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_SoilInit, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_SoilInit, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_SoilInit, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9_cotton2k_10simulation_8SoilInit_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_SoilInit, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_Climate(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_Climate(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif
static PyObject *__pyx_sq_item_9_cotton2k_10simulation_Climate(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_specialmethod___pyx_pw_9_cotton2k_10simulation_7Climate_7__next__(PyObject *self, CYTHON_UNUSED PyObject *arg) {return __pyx_pw_9_cotton2k_10simulation_7Climate_7__next__(self);}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_Climate[] = {
  {"__next__", (PyCFunction)__pyx_specialmethod___pyx_pw_9_cotton2k_10simulation_7Climate_7__next__, METH_NOARGS|METH_COEXIST, 0},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_7Climate_9__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_7Climate_11__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_Climate_slots[] = {
  {Py_sq_item, (void *)__pyx_sq_item_9_cotton2k_10simulation_Climate},
  {Py_mp_subscript, (void *)__pyx_pw_9_cotton2k_10simulation_7Climate_3__getitem__},
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_iter, (void *)__pyx_pw_9_cotton2k_10simulation_7Climate_5__iter__},
  {Py_tp_iternext, (void *)__pyx_pw_9_cotton2k_10simulation_7Climate_7__next__},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_Climate},
  {Py_tp_init, (void *)__pyx_pw_9_cotton2k_10simulation_7Climate_1__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_Climate},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_Climate_spec = {
  "_cotton2k.simulation.Climate",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_Climate),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_Climate_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_Climate = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_9_cotton2k_10simulation_Climate, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_Climate = {
  0, /*mp_length*/
  __pyx_pw_9_cotton2k_10simulation_7Climate_3__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_9_cotton2k_10simulation_Climate = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""Climate", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_Climate), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_Climate, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_Climate, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_Climate, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  __pyx_pw_9_cotton2k_10simulation_7Climate_5__iter__, /*tp_iter*/
  __pyx_pw_9_cotton2k_10simulation_7Climate_7__next__, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_Climate, /*tp_methods*/
  0, /*tp_members*/
  0, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9_cotton2k_10simulation_7Climate_1__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_Climate, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_NodeLeaf __pyx_vtable_9_cotton2k_10simulation_NodeLeaf;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_NodeLeaf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_NodeLeaf;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_NodeLeaf(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8NodeLeaf_area(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_8NodeLeaf_area(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_4area_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_8NodeLeaf_weight(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_8NodeLeaf_weight(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_8NodeLeaf_6weight_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_NodeLeaf[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_NodeLeaf[] = {
  {(char *)"area", __pyx_getprop_9_cotton2k_10simulation_8NodeLeaf_area, __pyx_setprop_9_cotton2k_10simulation_8NodeLeaf_area, (char *)0, 0},
  {(char *)"weight", __pyx_getprop_9_cotton2k_10simulation_8NodeLeaf_weight, __pyx_setprop_9_cotton2k_10simulation_8NodeLeaf_weight, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_NodeLeaf_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_NodeLeaf},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_NodeLeaf},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_NodeLeaf},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_NodeLeaf_spec = {
  "_cotton2k.simulation.NodeLeaf",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_NodeLeaf_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_NodeLeaf = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""NodeLeaf", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_NodeLeaf, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_NodeLeaf, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_NodeLeaf, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_NodeLeaf, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingNode __pyx_vtable_9_cotton2k_10simulation_FruitingNode;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_FruitingNode(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_FruitingNode;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_FruitingNode(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12FruitingNode_average_temperature(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_average_temperature(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_19average_temperature_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12FruitingNode_age(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_3age_1__get__(o);
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12FruitingNode_fraction(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_fraction(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_8fraction_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12FruitingNode_leaf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_4leaf_1__get__(o);
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12FruitingNode_stage(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_stage(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_12FruitingNode_5stage_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_FruitingNode[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_FruitingNode[] = {
  {(char *)"average_temperature", __pyx_getprop_9_cotton2k_10simulation_12FruitingNode_average_temperature, __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_average_temperature, (char *)0, 0},
  {(char *)"age", __pyx_getprop_9_cotton2k_10simulation_12FruitingNode_age, 0, (char *)0, 0},
  {(char *)"fraction", __pyx_getprop_9_cotton2k_10simulation_12FruitingNode_fraction, __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_fraction, (char *)0, 0},
  {(char *)"leaf", __pyx_getprop_9_cotton2k_10simulation_12FruitingNode_leaf, 0, (char *)0, 0},
  {(char *)"stage", __pyx_getprop_9_cotton2k_10simulation_12FruitingNode_stage, __pyx_setprop_9_cotton2k_10simulation_12FruitingNode_stage, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_FruitingNode_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_FruitingNode},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_FruitingNode},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_FruitingNode},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_FruitingNode_spec = {
  "_cotton2k.simulation.FruitingNode",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_FruitingNode_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_FruitingNode = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""FruitingNode", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_FruitingNode), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_FruitingNode, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_FruitingNode, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_FruitingNode, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_FruitingNode, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_MainStemLeaf __pyx_vtable_9_cotton2k_10simulation_MainStemLeaf;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_MainStemLeaf(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_MainStemLeaf;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_MainStemLeaf(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12MainStemLeaf_area(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_12MainStemLeaf_area(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_4area_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_12MainStemLeaf_weight(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_12MainStemLeaf_weight(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_6weight_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_MainStemLeaf[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_MainStemLeaf[] = {
  {(char *)"area", __pyx_getprop_9_cotton2k_10simulation_12MainStemLeaf_area, __pyx_setprop_9_cotton2k_10simulation_12MainStemLeaf_area, (char *)0, 0},
  {(char *)"weight", __pyx_getprop_9_cotton2k_10simulation_12MainStemLeaf_weight, __pyx_setprop_9_cotton2k_10simulation_12MainStemLeaf_weight, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_MainStemLeaf_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_MainStemLeaf},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_MainStemLeaf},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_MainStemLeaf},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_MainStemLeaf_spec = {
  "_cotton2k.simulation.MainStemLeaf",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_MainStemLeaf_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_MainStemLeaf = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""MainStemLeaf", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_MainStemLeaf, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_MainStemLeaf, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_MainStemLeaf, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_MainStemLeaf, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_FruitingBranch __pyx_vtable_9_cotton2k_10simulation_FruitingBranch;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_FruitingBranch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_FruitingBranch;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_FruitingBranch(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_number_of_fruiting_nodes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_14FruitingBranch_number_of_fruiting_nodes(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_24number_of_fruiting_nodes_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_delay_for_new_node(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_14FruitingBranch_delay_for_new_node(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_18delay_for_new_node_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_main_stem_leaf(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_14main_stem_leaf_1__get__(o);
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_nodes(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_14FruitingBranch_5nodes_1__get__(o);
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_FruitingBranch[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_FruitingBranch[] = {
  {(char *)"number_of_fruiting_nodes", __pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_number_of_fruiting_nodes, __pyx_setprop_9_cotton2k_10simulation_14FruitingBranch_number_of_fruiting_nodes, (char *)0, 0},
  {(char *)"delay_for_new_node", __pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_delay_for_new_node, __pyx_setprop_9_cotton2k_10simulation_14FruitingBranch_delay_for_new_node, (char *)0, 0},
  {(char *)"main_stem_leaf", __pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_main_stem_leaf, 0, (char *)0, 0},
  {(char *)"nodes", __pyx_getprop_9_cotton2k_10simulation_14FruitingBranch_nodes, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_FruitingBranch_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_FruitingBranch},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_FruitingBranch},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_FruitingBranch},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_FruitingBranch_spec = {
  "_cotton2k.simulation.FruitingBranch",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_FruitingBranch_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_FruitingBranch = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""FruitingBranch", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_FruitingBranch, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_FruitingBranch, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_FruitingBranch, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_FruitingBranch, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_VegetativeBranch __pyx_vtable_9_cotton2k_10simulation_VegetativeBranch;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_VegetativeBranch(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_VegetativeBranch;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_VegetativeBranch(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_number_of_fruiting_branches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_16VegetativeBranch_number_of_fruiting_branches(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_27number_of_fruiting_branches_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_delay_for_new_fruiting_branch(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_16VegetativeBranch_delay_for_new_fruiting_branch(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_29delay_for_new_fruiting_branch_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_fruiting_branches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_17fruiting_branches_1__get__(o);
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_VegetativeBranch[] = {
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_VegetativeBranch[] = {
  {(char *)"number_of_fruiting_branches", __pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_number_of_fruiting_branches, __pyx_setprop_9_cotton2k_10simulation_16VegetativeBranch_number_of_fruiting_branches, (char *)0, 0},
  {(char *)"delay_for_new_fruiting_branch", __pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_delay_for_new_fruiting_branch, __pyx_setprop_9_cotton2k_10simulation_16VegetativeBranch_delay_for_new_fruiting_branch, (char *)0, 0},
  {(char *)"fruiting_branches", __pyx_getprop_9_cotton2k_10simulation_16VegetativeBranch_fruiting_branches, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_VegetativeBranch_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_VegetativeBranch},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_VegetativeBranch},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_VegetativeBranch},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_VegetativeBranch_spec = {
  "_cotton2k.simulation.VegetativeBranch",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_VegetativeBranch_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_VegetativeBranch = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""VegetativeBranch", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_VegetativeBranch, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_VegetativeBranch, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_VegetativeBranch, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_VegetativeBranch, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif
static struct __pyx_vtabstruct_9_cotton2k_10simulation_State __pyx_vtable_9_cotton2k_10simulation_State;

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_State(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_State *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_State *)o);
  p->__pyx_vtab = __pyx_vtabptr_9_cotton2k_10simulation_State;
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_State(PyObject *o) {
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  (*Py_TYPE(o)->tp_free)(o);
}
#endif
static PyObject *__pyx_sq_item_9_cotton2k_10simulation_State(PyObject *o, Py_ssize_t i) {
  PyObject *r;
  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
  Py_DECREF(x);
  return r;
}

static PyObject *__pyx_tp_getattro_9_cotton2k_10simulation_State(PyObject *o, PyObject *n) {
  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
    PyErr_Clear();
    v = __pyx_pw_9_cotton2k_10simulation_5State_3__getattr__(o, n);
  }
  return v;
}

static int __pyx_tp_setattro_9_cotton2k_10simulation_State(PyObject *o, PyObject *n, PyObject *v) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_5State_5__setattr__(o, n, v);
  }
  else {
    return PyObject_GenericSetAttr(o, n, 0);
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_5State_vegetative_branches(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_5State_19vegetative_branches_1__get__(o);
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_State[] = {
  {"keys", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_1keys, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__getattr__", (PyCFunction)__pyx_pw_9_cotton2k_10simulation_5State_3__getattr__, METH_O|METH_COEXIST, 0},
  {"create_first_square", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_9create_first_square, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_5State_8create_first_square},
  {"add_fruiting_branch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_11add_fruiting_branch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_5State_10add_fruiting_branch},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_13__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_5State_15__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_State[] = {
  {(char *)"vegetative_branches", __pyx_getprop_9_cotton2k_10simulation_5State_vegetative_branches, 0, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_State_slots[] = {
  {Py_sq_item, (void *)__pyx_sq_item_9_cotton2k_10simulation_State},
  {Py_mp_subscript, (void *)__pyx_pw_9_cotton2k_10simulation_5State_7__getitem__},
  {Py_tp_getattro, (void *)__pyx_tp_getattro_9_cotton2k_10simulation_State},
  {Py_tp_setattro, (void *)__pyx_tp_setattro_9_cotton2k_10simulation_State},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_State},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_State},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_State},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_State_spec = {
  "_cotton2k.simulation.State",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_State),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_State_slots,
};
#else

static PySequenceMethods __pyx_tp_as_sequence_State = {
  0, /*sq_length*/
  0, /*sq_concat*/
  0, /*sq_repeat*/
  __pyx_sq_item_9_cotton2k_10simulation_State, /*sq_item*/
  0, /*sq_slice*/
  0, /*sq_ass_item*/
  0, /*sq_ass_slice*/
  0, /*sq_contains*/
  0, /*sq_inplace_concat*/
  0, /*sq_inplace_repeat*/
};

static PyMappingMethods __pyx_tp_as_mapping_State = {
  0, /*mp_length*/
  __pyx_pw_9_cotton2k_10simulation_5State_7__getitem__, /*mp_subscript*/
  0, /*mp_ass_subscript*/
};

static PyTypeObject __pyx_type_9_cotton2k_10simulation_State = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""State", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_State), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_State, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  &__pyx_tp_as_sequence_State, /*tp_as_sequence*/
  &__pyx_tp_as_mapping_State, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  __pyx_tp_getattro_9_cotton2k_10simulation_State, /*tp_getattro*/
  __pyx_tp_setattro_9_cotton2k_10simulation_State, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_State, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_State, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  0, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_State, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyObject *__pyx_tp_new_9_cotton2k_10simulation_Simulation(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
  struct __pyx_obj_9_cotton2k_10simulation_Simulation *p;
  PyObject *o;
  #if CYTHON_COMPILING_IN_LIMITED_API
  allocfunc alloc_func = (allocfunc)PyType_GetSlot(t, Py_tp_alloc);
  o = alloc_func(t, 0);
  #else
  if (likely(!__Pyx_PyType_HasFeature(t, Py_TPFLAGS_IS_ABSTRACT))) {
    o = (*t->tp_alloc)(t, 0);
  } else {
    o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
  }
  if (unlikely(!o)) return 0;
  #endif
  p = ((struct __pyx_obj_9_cotton2k_10simulation_Simulation *)o);
  new((void*)&(p->_sim)) Simulation();
  return o;
}

#if !CYTHON_COMPILING_IN_LIMITED_API
static void __pyx_tp_dealloc_9_cotton2k_10simulation_Simulation(PyObject *o) {
  struct __pyx_obj_9_cotton2k_10simulation_Simulation *p = (struct __pyx_obj_9_cotton2k_10simulation_Simulation *)o;
  #if CYTHON_USE_TP_FINALIZE
  if (unlikely((PY_VERSION_HEX >= 0x03080000 || __Pyx_PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE)) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
    if (PyObject_CallFinalizerFromDealloc(o)) return;
  }
  #endif
  __Pyx_call_destructor(p->_sim);
  (*Py_TYPE(o)->tp_free)(o);
}
#endif

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_year(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_4year_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_year(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_4year_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_start_date(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_start_date(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_10start_date_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_stop_date(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_stop_date(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_9stop_date_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_emerge_date(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_emerge_date(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_11emerge_date_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_plant_date(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_plant_date(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_10plant_date_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_topping_date(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_topping_date(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_12topping_date_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_latitude(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_latitude(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_8latitude_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_longitude(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_longitude(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_9longitude_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_elevation(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_elevation(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_9elevation_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_site_parameters(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_site_parameters(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_15site_parameters_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_cultivar_parameters(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_cultivar_parameters(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_19cultivar_parameters_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_row_space(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_row_space(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_9row_space_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_states(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_6states_1__get__(o);
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_climate(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_climate(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_7climate_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_version(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_7version_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_version(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_7version_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_skip_row_width(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_skip_row_width(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_14skip_row_width_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyObject *__pyx_getprop_9_cotton2k_10simulation_10Simulation_plants_per_meter(PyObject *o, CYTHON_UNUSED void *x) {
  return __pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_1__get__(o);
}

static int __pyx_setprop_9_cotton2k_10simulation_10Simulation_plants_per_meter(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
  if (v) {
    return __pyx_pw_9_cotton2k_10simulation_10Simulation_16plants_per_meter_3__set__(o, v);
  }
  else {
    PyErr_SetString(PyExc_NotImplementedError, "__del__");
    return -1;
  }
}

static PyMethodDef __pyx_methods_9_cotton2k_10simulation_Simulation[] = {
  {"_doy2date", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_1_doy2date, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"state", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_5state, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"run", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_7run, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_init_state", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_9_init_state, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_simulate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_11_simulate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_calc_light_interception", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_13_calc_light_interception, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_column_shading", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_15_column_shading, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_daily_climate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_17_daily_climate, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_stress", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_19_stress, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_get_net_photosynthesis", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_20_get_net_photosynthesis},
  {"_potential_fruit_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_22_potential_fruit_growth},
  {"_potential_leaf_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_24_potential_leaf_growth},
  {"_growth", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_27_growth, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_days_to_first_square", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_29_days_to_first_square, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_add_vegetative_branch", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_30_add_vegetative_branch},
  {"_phenology", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_33_phenology, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_32_phenology},
  {"_defoliate", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_35_defoliate, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_34_defoliate},
  {"_simulate_this_day", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_37_simulate_this_day, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"_init_grid", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_39_init_grid, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_38_init_grid},
  {"read_input", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_41read_input, __Pyx_METH_FASTCALL|METH_KEYWORDS, __pyx_doc_9_cotton2k_10simulation_10Simulation_40read_input},
  {"__reduce_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_43__reduce_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {"__setstate_cython__", (PyCFunction)(void*)(__Pyx_PyCFunction_FastCallWithKeywords)__pyx_pw_9_cotton2k_10simulation_10Simulation_45__setstate_cython__, __Pyx_METH_FASTCALL|METH_KEYWORDS, 0},
  {0, 0, 0, 0}
};

static struct PyGetSetDef __pyx_getsets_9_cotton2k_10simulation_Simulation[] = {
  {(char *)"year", __pyx_getprop_9_cotton2k_10simulation_10Simulation_year, __pyx_setprop_9_cotton2k_10simulation_10Simulation_year, (char *)0, 0},
  {(char *)"start_date", __pyx_getprop_9_cotton2k_10simulation_10Simulation_start_date, __pyx_setprop_9_cotton2k_10simulation_10Simulation_start_date, (char *)0, 0},
  {(char *)"stop_date", __pyx_getprop_9_cotton2k_10simulation_10Simulation_stop_date, __pyx_setprop_9_cotton2k_10simulation_10Simulation_stop_date, (char *)0, 0},
  {(char *)"emerge_date", __pyx_getprop_9_cotton2k_10simulation_10Simulation_emerge_date, __pyx_setprop_9_cotton2k_10simulation_10Simulation_emerge_date, (char *)0, 0},
  {(char *)"plant_date", __pyx_getprop_9_cotton2k_10simulation_10Simulation_plant_date, __pyx_setprop_9_cotton2k_10simulation_10Simulation_plant_date, (char *)0, 0},
  {(char *)"topping_date", __pyx_getprop_9_cotton2k_10simulation_10Simulation_topping_date, __pyx_setprop_9_cotton2k_10simulation_10Simulation_topping_date, (char *)0, 0},
  {(char *)"latitude", __pyx_getprop_9_cotton2k_10simulation_10Simulation_latitude, __pyx_setprop_9_cotton2k_10simulation_10Simulation_latitude, (char *)0, 0},
  {(char *)"longitude", __pyx_getprop_9_cotton2k_10simulation_10Simulation_longitude, __pyx_setprop_9_cotton2k_10simulation_10Simulation_longitude, (char *)0, 0},
  {(char *)"elevation", __pyx_getprop_9_cotton2k_10simulation_10Simulation_elevation, __pyx_setprop_9_cotton2k_10simulation_10Simulation_elevation, (char *)0, 0},
  {(char *)"site_parameters", __pyx_getprop_9_cotton2k_10simulation_10Simulation_site_parameters, __pyx_setprop_9_cotton2k_10simulation_10Simulation_site_parameters, (char *)0, 0},
  {(char *)"cultivar_parameters", __pyx_getprop_9_cotton2k_10simulation_10Simulation_cultivar_parameters, __pyx_setprop_9_cotton2k_10simulation_10Simulation_cultivar_parameters, (char *)0, 0},
  {(char *)"row_space", __pyx_getprop_9_cotton2k_10simulation_10Simulation_row_space, __pyx_setprop_9_cotton2k_10simulation_10Simulation_row_space, (char *)0, 0},
  {(char *)"states", __pyx_getprop_9_cotton2k_10simulation_10Simulation_states, 0, (char *)0, 0},
  {(char *)"climate", __pyx_getprop_9_cotton2k_10simulation_10Simulation_climate, __pyx_setprop_9_cotton2k_10simulation_10Simulation_climate, (char *)0, 0},
  {(char *)"version", __pyx_getprop_9_cotton2k_10simulation_10Simulation_version, __pyx_setprop_9_cotton2k_10simulation_10Simulation_version, (char *)0, 0},
  {(char *)"skip_row_width", __pyx_getprop_9_cotton2k_10simulation_10Simulation_skip_row_width, __pyx_setprop_9_cotton2k_10simulation_10Simulation_skip_row_width, (char *)0, 0},
  {(char *)"plants_per_meter", __pyx_getprop_9_cotton2k_10simulation_10Simulation_plants_per_meter, __pyx_setprop_9_cotton2k_10simulation_10Simulation_plants_per_meter, (char *)0, 0},
  {0, 0, 0, 0, 0}
};
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_type_9_cotton2k_10simulation_Simulation_slots[] = {
  {Py_tp_getattro, (void *)PyObject_GenericGetAttr},
  {Py_tp_methods, (void *)__pyx_methods_9_cotton2k_10simulation_Simulation},
  {Py_tp_getset, (void *)__pyx_getsets_9_cotton2k_10simulation_Simulation},
  {Py_tp_init, (void *)__pyx_pw_9_cotton2k_10simulation_10Simulation_3__init__},
  {Py_tp_new, (void *)__pyx_tp_new_9_cotton2k_10simulation_Simulation},
  {0, 0},
};
static PyType_Spec __pyx_type_9_cotton2k_10simulation_Simulation_spec = {
  "_cotton2k.simulation.Simulation",
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_Simulation),
  0,
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE,
  __pyx_type_9_cotton2k_10simulation_Simulation_slots,
};
#else

static PyTypeObject __pyx_type_9_cotton2k_10simulation_Simulation = {
  PyVarObject_HEAD_INIT(0, 0)
  "_cotton2k.simulation.""Simulation", /*tp_name*/
  sizeof(struct __pyx_obj_9_cotton2k_10simulation_Simulation), /*tp_basicsize*/
  0, /*tp_itemsize*/
  __pyx_tp_dealloc_9_cotton2k_10simulation_Simulation, /*tp_dealloc*/
  #if PY_VERSION_HEX < 0x030800b4
  0, /*tp_print*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4
  0, /*tp_vectorcall_offset*/
  #endif
  0, /*tp_getattr*/
  0, /*tp_setattr*/
  #if PY_MAJOR_VERSION < 3
  0, /*tp_compare*/
  #endif
  #if PY_MAJOR_VERSION >= 3
  0, /*tp_as_async*/
  #endif
  0, /*tp_repr*/
  0, /*tp_as_number*/
  0, /*tp_as_sequence*/
  0, /*tp_as_mapping*/
  0, /*tp_hash*/
  0, /*tp_call*/
  0, /*tp_str*/
  0, /*tp_getattro*/
  0, /*tp_setattro*/
  0, /*tp_as_buffer*/
  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
  0, /*tp_doc*/
  0, /*tp_traverse*/
  0, /*tp_clear*/
  0, /*tp_richcompare*/
  0, /*tp_weaklistoffset*/
  0, /*tp_iter*/
  0, /*tp_iternext*/
  __pyx_methods_9_cotton2k_10simulation_Simulation, /*tp_methods*/
  0, /*tp_members*/
  __pyx_getsets_9_cotton2k_10simulation_Simulation, /*tp_getset*/
  0, /*tp_base*/
  0, /*tp_dict*/
  0, /*tp_descr_get*/
  0, /*tp_descr_set*/
  0, /*tp_dictoffset*/
  __pyx_pw_9_cotton2k_10simulation_10Simulation_3__init__, /*tp_init*/
  0, /*tp_alloc*/
  __pyx_tp_new_9_cotton2k_10simulation_Simulation, /*tp_new*/
  0, /*tp_free*/
  0, /*tp_is_gc*/
  0, /*tp_bases*/
  0, /*tp_mro*/
  0, /*tp_cache*/
  0, /*tp_subclasses*/
  0, /*tp_weaklist*/
  0, /*tp_del*/
  0, /*tp_version_tag*/
  #if PY_VERSION_HEX >= 0x030400a1
  0, /*tp_finalize*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b1
  0, /*tp_vectorcall*/
  #endif
  #if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
  0, /*tp_print*/
  #endif
  #if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
  0, /*tp_pypy_flags*/
  #endif
};
#endif

static PyMethodDef __pyx_methods[] = {
  {0, 0, 0, 0}
};
#ifndef CYTHON_SMALL_CODE
#if defined(__clang__)
    #define CYTHON_SMALL_CODE
#elif defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 3))
    #define CYTHON_SMALL_CODE __attribute__((cold))
#else
    #define CYTHON_SMALL_CODE
#endif
#endif
/* #### Code section: pystring_table ### */

static __Pyx_StringTabEntry __pyx_string_tab[] = {
  #if CYTHON_COMPILING_IN_LIMITED_API
  {0, __pyx_k_Climate, sizeof(__pyx_k_Climate), 0, 0, 1, 1},
  {0, __pyx_k_Climate___reduce_cython, sizeof(__pyx_k_Climate___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_Climate___setstate_cython, sizeof(__pyx_k_Climate___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_DaysTo1stSqare, sizeof(__pyx_k_DaysTo1stSqare), 0, 0, 1, 1},
  {0, __pyx_k_FruitingBranch, sizeof(__pyx_k_FruitingBranch), 0, 0, 1, 1},
  {0, __pyx_k_FruitingBranch___reduce_cython, sizeof(__pyx_k_FruitingBranch___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_FruitingBranch___setstate_cython, sizeof(__pyx_k_FruitingBranch___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_FruitingNode, sizeof(__pyx_k_FruitingNode), 0, 0, 1, 1},
  {0, __pyx_k_FruitingNode___reduce_cython, sizeof(__pyx_k_FruitingNode___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_FruitingNode___setstate_cython, sizeof(__pyx_k_FruitingNode___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_Incompatible_checksums_s_vs_0x84, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x84), 0, 0, 1, 0},
  {0, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {0, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {0, __pyx_k_MainStemLeaf, sizeof(__pyx_k_MainStemLeaf), 0, 0, 1, 1},
  {0, __pyx_k_MainStemLeaf___reduce_cython, sizeof(__pyx_k_MainStemLeaf___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_MainStemLeaf___setstate_cython, sizeof(__pyx_k_MainStemLeaf___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_10, sizeof(__pyx_k_No_value_specified_for_struct_at_10), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_100, sizeof(__pyx_k_No_value_specified_for_struct_at_100), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_101, sizeof(__pyx_k_No_value_specified_for_struct_at_101), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_102, sizeof(__pyx_k_No_value_specified_for_struct_at_102), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_103, sizeof(__pyx_k_No_value_specified_for_struct_at_103), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_104, sizeof(__pyx_k_No_value_specified_for_struct_at_104), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_105, sizeof(__pyx_k_No_value_specified_for_struct_at_105), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_106, sizeof(__pyx_k_No_value_specified_for_struct_at_106), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_107, sizeof(__pyx_k_No_value_specified_for_struct_at_107), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_108, sizeof(__pyx_k_No_value_specified_for_struct_at_108), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_109, sizeof(__pyx_k_No_value_specified_for_struct_at_109), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_11, sizeof(__pyx_k_No_value_specified_for_struct_at_11), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_110, sizeof(__pyx_k_No_value_specified_for_struct_at_110), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_111, sizeof(__pyx_k_No_value_specified_for_struct_at_111), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_112, sizeof(__pyx_k_No_value_specified_for_struct_at_112), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_113, sizeof(__pyx_k_No_value_specified_for_struct_at_113), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_114, sizeof(__pyx_k_No_value_specified_for_struct_at_114), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_115, sizeof(__pyx_k_No_value_specified_for_struct_at_115), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_116, sizeof(__pyx_k_No_value_specified_for_struct_at_116), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_117, sizeof(__pyx_k_No_value_specified_for_struct_at_117), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_12, sizeof(__pyx_k_No_value_specified_for_struct_at_12), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_13, sizeof(__pyx_k_No_value_specified_for_struct_at_13), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_14, sizeof(__pyx_k_No_value_specified_for_struct_at_14), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_15, sizeof(__pyx_k_No_value_specified_for_struct_at_15), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_16, sizeof(__pyx_k_No_value_specified_for_struct_at_16), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_17, sizeof(__pyx_k_No_value_specified_for_struct_at_17), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_18, sizeof(__pyx_k_No_value_specified_for_struct_at_18), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_19, sizeof(__pyx_k_No_value_specified_for_struct_at_19), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_20, sizeof(__pyx_k_No_value_specified_for_struct_at_20), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_21, sizeof(__pyx_k_No_value_specified_for_struct_at_21), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_22, sizeof(__pyx_k_No_value_specified_for_struct_at_22), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_23, sizeof(__pyx_k_No_value_specified_for_struct_at_23), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_24, sizeof(__pyx_k_No_value_specified_for_struct_at_24), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_25, sizeof(__pyx_k_No_value_specified_for_struct_at_25), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_26, sizeof(__pyx_k_No_value_specified_for_struct_at_26), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_27, sizeof(__pyx_k_No_value_specified_for_struct_at_27), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_28, sizeof(__pyx_k_No_value_specified_for_struct_at_28), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_29, sizeof(__pyx_k_No_value_specified_for_struct_at_29), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_30, sizeof(__pyx_k_No_value_specified_for_struct_at_30), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_31, sizeof(__pyx_k_No_value_specified_for_struct_at_31), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_32, sizeof(__pyx_k_No_value_specified_for_struct_at_32), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_33, sizeof(__pyx_k_No_value_specified_for_struct_at_33), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_34, sizeof(__pyx_k_No_value_specified_for_struct_at_34), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_35, sizeof(__pyx_k_No_value_specified_for_struct_at_35), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_36, sizeof(__pyx_k_No_value_specified_for_struct_at_36), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_37, sizeof(__pyx_k_No_value_specified_for_struct_at_37), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_38, sizeof(__pyx_k_No_value_specified_for_struct_at_38), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_39, sizeof(__pyx_k_No_value_specified_for_struct_at_39), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_40, sizeof(__pyx_k_No_value_specified_for_struct_at_40), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_41, sizeof(__pyx_k_No_value_specified_for_struct_at_41), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_42, sizeof(__pyx_k_No_value_specified_for_struct_at_42), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_43, sizeof(__pyx_k_No_value_specified_for_struct_at_43), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_44, sizeof(__pyx_k_No_value_specified_for_struct_at_44), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_45, sizeof(__pyx_k_No_value_specified_for_struct_at_45), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_46, sizeof(__pyx_k_No_value_specified_for_struct_at_46), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_47, sizeof(__pyx_k_No_value_specified_for_struct_at_47), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_48, sizeof(__pyx_k_No_value_specified_for_struct_at_48), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_49, sizeof(__pyx_k_No_value_specified_for_struct_at_49), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_50, sizeof(__pyx_k_No_value_specified_for_struct_at_50), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_51, sizeof(__pyx_k_No_value_specified_for_struct_at_51), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_52, sizeof(__pyx_k_No_value_specified_for_struct_at_52), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_53, sizeof(__pyx_k_No_value_specified_for_struct_at_53), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_54, sizeof(__pyx_k_No_value_specified_for_struct_at_54), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_55, sizeof(__pyx_k_No_value_specified_for_struct_at_55), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_56, sizeof(__pyx_k_No_value_specified_for_struct_at_56), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_57, sizeof(__pyx_k_No_value_specified_for_struct_at_57), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_58, sizeof(__pyx_k_No_value_specified_for_struct_at_58), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_59, sizeof(__pyx_k_No_value_specified_for_struct_at_59), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_60, sizeof(__pyx_k_No_value_specified_for_struct_at_60), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_61, sizeof(__pyx_k_No_value_specified_for_struct_at_61), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_62, sizeof(__pyx_k_No_value_specified_for_struct_at_62), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_63, sizeof(__pyx_k_No_value_specified_for_struct_at_63), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_64, sizeof(__pyx_k_No_value_specified_for_struct_at_64), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_65, sizeof(__pyx_k_No_value_specified_for_struct_at_65), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_66, sizeof(__pyx_k_No_value_specified_for_struct_at_66), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_67, sizeof(__pyx_k_No_value_specified_for_struct_at_67), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_68, sizeof(__pyx_k_No_value_specified_for_struct_at_68), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_69, sizeof(__pyx_k_No_value_specified_for_struct_at_69), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_7, sizeof(__pyx_k_No_value_specified_for_struct_at_7), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_70, sizeof(__pyx_k_No_value_specified_for_struct_at_70), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_71, sizeof(__pyx_k_No_value_specified_for_struct_at_71), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_72, sizeof(__pyx_k_No_value_specified_for_struct_at_72), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_73, sizeof(__pyx_k_No_value_specified_for_struct_at_73), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_74, sizeof(__pyx_k_No_value_specified_for_struct_at_74), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_75, sizeof(__pyx_k_No_value_specified_for_struct_at_75), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_76, sizeof(__pyx_k_No_value_specified_for_struct_at_76), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_77, sizeof(__pyx_k_No_value_specified_for_struct_at_77), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_78, sizeof(__pyx_k_No_value_specified_for_struct_at_78), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_79, sizeof(__pyx_k_No_value_specified_for_struct_at_79), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_8, sizeof(__pyx_k_No_value_specified_for_struct_at_8), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_80, sizeof(__pyx_k_No_value_specified_for_struct_at_80), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_81, sizeof(__pyx_k_No_value_specified_for_struct_at_81), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_82, sizeof(__pyx_k_No_value_specified_for_struct_at_82), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_83, sizeof(__pyx_k_No_value_specified_for_struct_at_83), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_84, sizeof(__pyx_k_No_value_specified_for_struct_at_84), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_85, sizeof(__pyx_k_No_value_specified_for_struct_at_85), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_86, sizeof(__pyx_k_No_value_specified_for_struct_at_86), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_87, sizeof(__pyx_k_No_value_specified_for_struct_at_87), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_88, sizeof(__pyx_k_No_value_specified_for_struct_at_88), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_89, sizeof(__pyx_k_No_value_specified_for_struct_at_89), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_9, sizeof(__pyx_k_No_value_specified_for_struct_at_9), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_90, sizeof(__pyx_k_No_value_specified_for_struct_at_90), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_91, sizeof(__pyx_k_No_value_specified_for_struct_at_91), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_92, sizeof(__pyx_k_No_value_specified_for_struct_at_92), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_93, sizeof(__pyx_k_No_value_specified_for_struct_at_93), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_94, sizeof(__pyx_k_No_value_specified_for_struct_at_94), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_95, sizeof(__pyx_k_No_value_specified_for_struct_at_95), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_96, sizeof(__pyx_k_No_value_specified_for_struct_at_96), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_97, sizeof(__pyx_k_No_value_specified_for_struct_at_97), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_98, sizeof(__pyx_k_No_value_specified_for_struct_at_98), 0, 0, 1, 0},
  {0, __pyx_k_No_value_specified_for_struct_at_99, sizeof(__pyx_k_No_value_specified_for_struct_at_99), 0, 0, 1, 0},
  {0, __pyx_k_NodeLeaf, sizeof(__pyx_k_NodeLeaf), 0, 0, 1, 1},
  {0, __pyx_k_NodeLeaf___reduce_cython, sizeof(__pyx_k_NodeLeaf___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_NodeLeaf___setstate_cython, sizeof(__pyx_k_NodeLeaf___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_OpenRatio, sizeof(__pyx_k_OpenRatio), 0, 0, 1, 1},
  {0, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
  {0, __pyx_k_PhenDelayByNStress, sizeof(__pyx_k_PhenDelayByNStress), 0, 0, 1, 1},
  {0, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {0, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0},
  {0, __pyx_k_Rad, sizeof(__pyx_k_Rad), 0, 0, 1, 1},
  {0, __pyx_k_Rad, sizeof(__pyx_k_Rad), 0, 1, 0, 1},
  {0, __pyx_k_Rain, sizeof(__pyx_k_Rain), 0, 0, 1, 1},
  {0, __pyx_k_Rain, sizeof(__pyx_k_Rain), 0, 1, 0, 1},
  {0, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {0, __pyx_k_Simulation, sizeof(__pyx_k_Simulation), 0, 0, 1, 1},
  {0, __pyx_k_SimulationEnd, sizeof(__pyx_k_SimulationEnd), 0, 0, 1, 1},
  {0, __pyx_k_Simulation___reduce_cython, sizeof(__pyx_k_Simulation___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_Simulation___setstate_cython, sizeof(__pyx_k_Simulation___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__add_vegetative_branc, sizeof(__pyx_k_Simulation__add_vegetative_branc), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__calc_light_intercept, sizeof(__pyx_k_Simulation__calc_light_intercept), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__column_shading, sizeof(__pyx_k_Simulation__column_shading), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__daily_climate, sizeof(__pyx_k_Simulation__daily_climate), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__days_to_first_square, sizeof(__pyx_k_Simulation__days_to_first_square), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__defoliate, sizeof(__pyx_k_Simulation__defoliate), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__doy2date, sizeof(__pyx_k_Simulation__doy2date), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__get_net_photosynthes, sizeof(__pyx_k_Simulation__get_net_photosynthes), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__growth, sizeof(__pyx_k_Simulation__growth), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__init_grid, sizeof(__pyx_k_Simulation__init_grid), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__init_state, sizeof(__pyx_k_Simulation__init_state), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__phenology, sizeof(__pyx_k_Simulation__phenology), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__potential_fruit_grow, sizeof(__pyx_k_Simulation__potential_fruit_grow), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__potential_leaf_growt, sizeof(__pyx_k_Simulation__potential_leaf_growt), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__simulate, sizeof(__pyx_k_Simulation__simulate), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__simulate_this_day, sizeof(__pyx_k_Simulation__simulate_this_day), 0, 0, 1, 1},
  {0, __pyx_k_Simulation__stress, sizeof(__pyx_k_Simulation__stress), 0, 0, 1, 1},
  {0, __pyx_k_Simulation_read_input, sizeof(__pyx_k_Simulation_read_input), 0, 0, 1, 1},
  {0, __pyx_k_Simulation_run, sizeof(__pyx_k_Simulation_run), 0, 0, 1, 1},
  {0, __pyx_k_Simulation_state, sizeof(__pyx_k_Simulation_state), 0, 0, 1, 1},
  {0, __pyx_k_SoilInit, sizeof(__pyx_k_SoilInit), 0, 0, 1, 1},
  {0, __pyx_k_SoilInit___reduce_cython, sizeof(__pyx_k_SoilInit___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_SoilInit___setstate_cython, sizeof(__pyx_k_SoilInit___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_State, sizeof(__pyx_k_State), 0, 0, 1, 1},
  {0, __pyx_k_State___reduce_cython, sizeof(__pyx_k_State___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_State___setstate_cython, sizeof(__pyx_k_State___setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_State_add_fruiting_branch, sizeof(__pyx_k_State_add_fruiting_branch), 0, 0, 1, 1},
  {0, __pyx_k_State_create_first_square, sizeof(__pyx_k_State_create_first_square), 0, 0, 1, 1},
  {0, __pyx_k_State_keys, sizeof(__pyx_k_State_keys), 0, 0, 1, 1},
  {0, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {0, __pyx_k_Tdew, sizeof(__pyx_k_Tdew), 0, 0, 1, 1},
  {0, __pyx_k_Tdew, sizeof(__pyx_k_Tdew), 0, 1, 0, 1},
  {0, __pyx_k_TimeToNextFruBranch, sizeof(__pyx_k_TimeToNextFruBranch), 0, 0, 1, 1},
  {0, __pyx_k_TimeToNextVegBranch, sizeof(__pyx_k_TimeToNextVegBranch), 0, 0, 1, 1},
  {0, __pyx_k_Tmax, sizeof(__pyx_k_Tmax), 0, 0, 1, 1},
  {0, __pyx_k_Tmax, sizeof(__pyx_k_Tmax), 0, 1, 0, 1},
  {0, __pyx_k_Tmin, sizeof(__pyx_k_Tmin), 0, 0, 1, 1},
  {0, __pyx_k_Tmin, sizeof(__pyx_k_Tmin), 0, 1, 0, 1},
  {0, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {0, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {0, __pyx_k_VegetativeBranch, sizeof(__pyx_k_VegetativeBranch), 0, 0, 1, 1},
  {0, __pyx_k_VegetativeBranch___reduce_cython, sizeof(__pyx_k_VegetativeBranch___reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_VegetativeBranch___setstate_cyth, sizeof(__pyx_k_VegetativeBranch___setstate_cyth), 0, 0, 1, 1},
  {0, __pyx_k_WaterStress, sizeof(__pyx_k_WaterStress), 0, 0, 1, 1},
  {0, __pyx_k_Wind, sizeof(__pyx_k_Wind), 0, 0, 1, 1},
  {0, __pyx_k_Wind, sizeof(__pyx_k_Wind), 0, 1, 0, 1},
  {0, __pyx_k_Y_j, sizeof(__pyx_k_Y_j), 0, 1, 0, 0},
  {0, __pyx_k__213, sizeof(__pyx_k__213), 0, 0, 1, 1},
  {0, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {0, __pyx_k_abscised_fruit_sites, sizeof(__pyx_k_abscised_fruit_sites), 0, 0, 1, 1},
  {0, __pyx_k_abscised_leaf_weight, sizeof(__pyx_k_abscised_leaf_weight), 0, 0, 1, 1},
  {0, __pyx_k_acos, sizeof(__pyx_k_acos), 0, 0, 1, 1},
  {0, __pyx_k_actual_growth, sizeof(__pyx_k_actual_growth), 0, 0, 1, 1},
  {0, __pyx_k_actual_soil_evaporation, sizeof(__pyx_k_actual_soil_evaporation), 0, 0, 1, 1},
  {0, __pyx_k_actual_transpiration, sizeof(__pyx_k_actual_transpiration), 0, 0, 1, 1},
  {0, __pyx_k_add_fruiting_branch, sizeof(__pyx_k_add_fruiting_branch), 0, 0, 1, 1},
  {0, __pyx_k_add_vegetative_branch, sizeof(__pyx_k_add_vegetative_branch), 0, 0, 1, 1},
  {0, __pyx_k_addlfn, sizeof(__pyx_k_addlfn), 0, 0, 1, 1},
  {0, __pyx_k_age, sizeof(__pyx_k_age), 0, 0, 1, 1},
  {0, __pyx_k_age_of_pre_fruiting_nodes, sizeof(__pyx_k_age_of_pre_fruiting_nodes), 0, 0, 1, 1},
  {0, __pyx_k_agemax, sizeof(__pyx_k_agemax), 0, 0, 1, 1},
  {0, __pyx_k_agetop, sizeof(__pyx_k_agetop), 0, 0, 1, 1},
  {0, __pyx_k_agricultural_inputs, sizeof(__pyx_k_agricultural_inputs), 0, 1, 0, 1},
  {0, __pyx_k_air_dry, sizeof(__pyx_k_air_dry), 0, 1, 0, 1},
  {0, __pyx_k_albedo, sizeof(__pyx_k_albedo), 0, 0, 1, 1},
  {0, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 0, 1},
  {0, __pyx_k_ambient_co2_factor, sizeof(__pyx_k_ambient_co2_factor), 0, 0, 1, 1},
  {0, __pyx_k_ammonium, sizeof(__pyx_k_ammonium), 0, 1, 0, 1},
  {0, __pyx_k_ammonium_nitrogen, sizeof(__pyx_k_ammonium_nitrogen), 0, 1, 0, 1},
  {0, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 1, 0, 1},
  {0, __pyx_k_applied_water, sizeof(__pyx_k_applied_water), 0, 0, 1, 1},
  {0, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1},
  {0, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {0, __pyx_k_average_temperature, sizeof(__pyx_k_average_temperature), 0, 0, 1, 1},
  {0, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 1, 0, 1},
  {0, __pyx_k_bloom_weight_loss, sizeof(__pyx_k_bloom_weight_loss), 0, 0, 1, 1},
  {0, __pyx_k_bmain, sizeof(__pyx_k_bmain), 0, 0, 1, 1},
  {0, __pyx_k_boll, sizeof(__pyx_k_boll), 0, 0, 1, 1},
  {0, __pyx_k_bulk_density, sizeof(__pyx_k_bulk_density), 0, 1, 0, 1},
  {0, __pyx_k_burr, sizeof(__pyx_k_burr), 0, 0, 1, 1},
  {0, __pyx_k_burr_nitrogen, sizeof(__pyx_k_burr_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {0, __pyx_k_c11, sizeof(__pyx_k_c11), 0, 0, 1, 1},
  {0, __pyx_k_calc_light_interception, sizeof(__pyx_k_calc_light_interception), 0, 0, 1, 1},
  {0, __pyx_k_carbon_stress, sizeof(__pyx_k_carbon_stress), 0, 0, 1, 1},
  {0, __pyx_k_cc, sizeof(__pyx_k_cc), 0, 0, 1, 1},
  {0, __pyx_k_cd, sizeof(__pyx_k_cd), 0, 0, 1, 1},
  {0, __pyx_k_cdleaf, sizeof(__pyx_k_cdleaf), 0, 0, 1, 1},
  {0, __pyx_k_cdpet, sizeof(__pyx_k_cdpet), 0, 0, 1, 1},
  {0, __pyx_k_cdroot, sizeof(__pyx_k_cdroot), 0, 0, 1, 1},
  {0, __pyx_k_cdstem, sizeof(__pyx_k_cdstem), 0, 0, 1, 1},
  {0, __pyx_k_cells, sizeof(__pyx_k_cells), 0, 0, 1, 1},
  {0, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
  {0, __pyx_k_clay, sizeof(__pyx_k_clay), 0, 1, 0, 1},
  {0, __pyx_k_climate, sizeof(__pyx_k_climate), 0, 0, 1, 1},
  {0, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {0, __pyx_k_cloud_cor, sizeof(__pyx_k_cloud_cor), 0, 0, 1, 1},
  {0, __pyx_k_cloud_cov, sizeof(__pyx_k_cloud_cov), 0, 0, 1, 1},
  {0, __pyx_k_column_shading, sizeof(__pyx_k_column_shading), 0, 0, 1, 1},
  {0, __pyx_k_compute_day_length, sizeof(__pyx_k_compute_day_length), 0, 0, 1, 1},
  {0, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
  {0, __pyx_k_cotton2k_climate, sizeof(__pyx_k_cotton2k_climate), 0, 0, 1, 1},
  {0, __pyx_k_cotton2k_leaf, sizeof(__pyx_k_cotton2k_leaf), 0, 0, 1, 1},
  {0, __pyx_k_cotton2k_photosynthesis, sizeof(__pyx_k_cotton2k_photosynthesis), 0, 0, 1, 1},
  {0, __pyx_k_cotton2k_simulation, sizeof(__pyx_k_cotton2k_simulation), 0, 0, 1, 1},
  {0, __pyx_k_cotton2k_utils, sizeof(__pyx_k_cotton2k_utils), 0, 0, 1, 1},
  {0, __pyx_k_cotylwt, sizeof(__pyx_k_cotylwt), 0, 0, 1, 1},
  {0, __pyx_k_create_first_square, sizeof(__pyx_k_create_first_square), 0, 0, 1, 1},
  {0, __pyx_k_cultivar_parameters, sizeof(__pyx_k_cultivar_parameters), 0, 0, 1, 1},
  {0, __pyx_k_cumulative_evaporation, sizeof(__pyx_k_cumulative_evaporation), 0, 0, 1, 1},
  {0, __pyx_k_cumulative_nitrogen_loss, sizeof(__pyx_k_cumulative_nitrogen_loss), 0, 0, 1, 1},
  {0, __pyx_k_cumulative_transpiration, sizeof(__pyx_k_cumulative_transpiration), 0, 0, 1, 1},
  {0, __pyx_k_daily_climate, sizeof(__pyx_k_daily_climate), 0, 0, 1, 1},
  {0, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {0, __pyx_k_date, sizeof(__pyx_k_date), 0, 1, 0, 1},
  {0, __pyx_k_date2doy, sizeof(__pyx_k_date2doy), 0, 0, 1, 1},
  {0, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {0, __pyx_k_day_inc, sizeof(__pyx_k_day_inc), 0, 0, 1, 1},
  {0, __pyx_k_day_length, sizeof(__pyx_k_day_length), 0, 0, 1, 1},
  {0, __pyx_k_day_length, sizeof(__pyx_k_day_length), 0, 1, 0, 1},
  {0, __pyx_k_daynum, sizeof(__pyx_k_daynum), 0, 0, 1, 1},
  {0, __pyx_k_days_to_first_square, sizeof(__pyx_k_days_to_first_square), 0, 0, 1, 1},
  {0, __pyx_k_declination, sizeof(__pyx_k_declination), 0, 0, 1, 1},
  {0, __pyx_k_declination, sizeof(__pyx_k_declination), 0, 1, 0, 1},
  {0, __pyx_k_defoliate, sizeof(__pyx_k_defoliate), 0, 0, 1, 1},
  {0, __pyx_k_defoliation_prediction, sizeof(__pyx_k_defoliation_prediction), 0, 1, 0, 0},
  {0, __pyx_k_delayFrtByCStress, sizeof(__pyx_k_delayFrtByCStress), 0, 0, 1, 1},
  {0, __pyx_k_delayVegByCStress, sizeof(__pyx_k_delayVegByCStress), 0, 0, 1, 1},
  {0, __pyx_k_delay_for_new_branch, sizeof(__pyx_k_delay_for_new_branch), 0, 0, 1, 1},
  {0, __pyx_k_delay_for_new_fruiting_branch, sizeof(__pyx_k_delay_for_new_fruiting_branch), 0, 0, 1, 1},
  {0, __pyx_k_delay_for_new_node, sizeof(__pyx_k_delay_for_new_node), 0, 0, 1, 1},
  {0, __pyx_k_denf2, sizeof(__pyx_k_denf2), 0, 0, 1, 1},
  {0, __pyx_k_denfac, sizeof(__pyx_k_denfac), 0, 0, 1, 1},
  {0, __pyx_k_density_factor, sizeof(__pyx_k_density_factor), 0, 0, 1, 1},
  {0, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 1, 0, 1},
  {0, __pyx_k_dew_point, sizeof(__pyx_k_dew_point), 0, 0, 1, 1},
  {0, __pyx_k_dewpoint, sizeof(__pyx_k_dewpoint), 0, 1, 0, 1},
  {0, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {0, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {0, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
  {0, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {0, __pyx_k_doy2date, sizeof(__pyx_k_doy2date), 0, 0, 1, 1},
  {0, __pyx_k_drip_depth, sizeof(__pyx_k_drip_depth), 0, 1, 0, 1},
  {0, __pyx_k_drip_horizontal_place, sizeof(__pyx_k_drip_horizontal_place), 0, 1, 0, 1},
  {0, __pyx_k_dsbe, sizeof(__pyx_k_dsbe), 0, 0, 1, 1},
  {0, __pyx_k_dum, sizeof(__pyx_k_dum), 0, 0, 1, 1},
  {0, __pyx_k_elevation, sizeof(__pyx_k_elevation), 0, 0, 1, 1},
  {0, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
  {0, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {0, __pyx_k_et1, sizeof(__pyx_k_et1), 0, 0, 1, 1},
  {0, __pyx_k_et2, sizeof(__pyx_k_et2), 0, 0, 1, 1},
  {0, __pyx_k_evapotranspiration, sizeof(__pyx_k_evapotranspiration), 0, 0, 1, 1},
  {0, __pyx_k_extra_carbon, sizeof(__pyx_k_extra_carbon), 0, 0, 1, 1},
  {0, __pyx_k_fertilization, sizeof(__pyx_k_fertilization), 0, 1, 0, 1},
  {0, __pyx_k_field_capacity_hydraulic_conduct, sizeof(__pyx_k_field_capacity_hydraulic_conduct), 0, 1, 0, 1},
  {0, __pyx_k_field_capacity_water_potential, sizeof(__pyx_k_field_capacity_water_potential), 0, 1, 0, 1},
  {0, __pyx_k_first_node, sizeof(__pyx_k_first_node), 0, 0, 1, 1},
  {0, __pyx_k_first_square_leaf_area, sizeof(__pyx_k_first_square_leaf_area), 0, 0, 1, 1},
  {0, __pyx_k_fraction, sizeof(__pyx_k_fraction), 0, 0, 1, 1},
  {0, __pyx_k_fresh_organic_matter, sizeof(__pyx_k_fresh_organic_matter), 0, 0, 1, 1},
  {0, __pyx_k_fruit_growth_ratio, sizeof(__pyx_k_fruit_growth_ratio), 0, 0, 1, 1},
  {0, __pyx_k_fruiting_branches, sizeof(__pyx_k_fruiting_branches), 0, 0, 1, 1},
  {0, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
  {0, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {0, __pyx_k_get_net_photosynthesis, sizeof(__pyx_k_get_net_photosynthesis), 0, 0, 1, 1},
  {0, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {0, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {0, __pyx_k_ginning_percent, sizeof(__pyx_k_ginning_percent), 0, 0, 1, 1},
  {0, __pyx_k_green_bolls_burr_weight, sizeof(__pyx_k_green_bolls_burr_weight), 0, 0, 1, 1},
  {0, __pyx_k_green_bolls_weight, sizeof(__pyx_k_green_bolls_weight), 0, 0, 1, 1},
  {0, __pyx_k_growth, sizeof(__pyx_k_growth), 0, 0, 1, 1},
  {0, __pyx_k_growth_factor, sizeof(__pyx_k_growth_factor), 0, 0, 1, 1},
  {0, __pyx_k_gsubr, sizeof(__pyx_k_gsubr), 0, 0, 1, 1},
  {0, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
  {0, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {0, __pyx_k_htdenf, sizeof(__pyx_k_htdenf), 0, 0, 1, 1},
  {0, __pyx_k_humidity, sizeof(__pyx_k_humidity), 0, 0, 1, 1},
  {0, __pyx_k_hydrology, sizeof(__pyx_k_hydrology), 0, 0, 1, 1},
  {0, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {0, __pyx_k_ihr, sizeof(__pyx_k_ihr), 0, 0, 1, 1},
  {0, __pyx_k_immediate_drainage_water_potenti, sizeof(__pyx_k_immediate_drainage_water_potenti), 0, 1, 0, 1},
  {0, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {0, __pyx_k_init_grid, sizeof(__pyx_k_init_grid), 0, 0, 1, 1},
  {0, __pyx_k_init_state, sizeof(__pyx_k_init_state), 0, 0, 1, 1},
  {0, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
  {0, __pyx_k_initial, sizeof(__pyx_k_initial), 0, 0, 1, 1},
  {0, __pyx_k_irrigation, sizeof(__pyx_k_irrigation), 0, 1, 0, 1},
  {0, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  {0, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
  {0, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {0, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {0, __pyx_k_jp1, sizeof(__pyx_k_jp1), 0, 0, 1, 1},
  {0, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {0, __pyx_k_k0, sizeof(__pyx_k_k0), 0, 0, 1, 1},
  {0, __pyx_k_kday, sizeof(__pyx_k_kday), 0, 0, 1, 1},
  {0, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {0, __pyx_k_kkday, sizeof(__pyx_k_kkday), 0, 0, 1, 1},
  {0, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {0, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {0, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 0, 1, 1},
  {0, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 0, 1, 1},
  {0, __pyx_k_last_fruiting_branch, sizeof(__pyx_k_last_fruiting_branch), 0, 0, 1, 1},
  {0, __pyx_k_latitude, sizeof(__pyx_k_latitude), 0, 0, 1, 1},
  {0, __pyx_k_layer_depth, sizeof(__pyx_k_layer_depth), 0, 0, 1, 1},
  {0, __pyx_k_layers, sizeof(__pyx_k_layers), 0, 0, 1, 1},
  {0, __pyx_k_layers, sizeof(__pyx_k_layers), 0, 1, 0, 1},
  {0, __pyx_k_leaf, sizeof(__pyx_k_leaf), 0, 0, 1, 1},
  {0, __pyx_k_leaf_area, sizeof(__pyx_k_leaf_area), 0, 0, 1, 1},
  {0, __pyx_k_leaf_area_index, sizeof(__pyx_k_leaf_area_index), 0, 0, 1, 1},
  {0, __pyx_k_leaf_area_pre_fruiting, sizeof(__pyx_k_leaf_area_pre_fruiting), 0, 0, 1, 1},
  {0, __pyx_k_leaf_nitrogen, sizeof(__pyx_k_leaf_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_leaf_nitrogen_concentration, sizeof(__pyx_k_leaf_nitrogen_concentration), 0, 0, 1, 1},
  {0, __pyx_k_leaf_weight, sizeof(__pyx_k_leaf_weight), 0, 0, 1, 1},
  {0, __pyx_k_leaf_weight_area_ratio, sizeof(__pyx_k_leaf_weight_area_ratio), 0, 0, 1, 1},
  {0, __pyx_k_leaf_weight_pre_fruiting, sizeof(__pyx_k_leaf_weight_pre_fruiting), 0, 0, 1, 1},
  {0, __pyx_k_lfint, sizeof(__pyx_k_lfint), 0, 0, 1, 1},
  {0, __pyx_k_light_interception, sizeof(__pyx_k_light_interception), 0, 0, 1, 1},
  {0, __pyx_k_lint_yield, sizeof(__pyx_k_lint_yield), 0, 0, 1, 1},
  {0, __pyx_k_longitude, sizeof(__pyx_k_longitude), 0, 0, 1, 1},
  {0, __pyx_k_lp1, sizeof(__pyx_k_lp1), 0, 0, 1, 1},
  {0, __pyx_k_lyrsol, sizeof(__pyx_k_lyrsol), 0, 0, 1, 1},
  {0, __pyx_k_lytres, sizeof(__pyx_k_lytres), 0, 0, 1, 1},
  {0, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {0, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {0, __pyx_k_main_stem_leaf, sizeof(__pyx_k_main_stem_leaf), 0, 0, 1, 1},
  {0, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {0, __pyx_k_max, sizeof(__pyx_k_max), 0, 1, 0, 1},
  {0, __pyx_k_max_conductivity, sizeof(__pyx_k_max_conductivity), 0, 1, 0, 1},
  {0, __pyx_k_maxrtgr, sizeof(__pyx_k_maxrtgr), 0, 0, 1, 1},
  {0, __pyx_k_maxstmgr, sizeof(__pyx_k_maxstmgr), 0, 0, 1, 1},
  {0, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {0, __pyx_k_method, sizeof(__pyx_k_method), 0, 1, 0, 1},
  {0, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {0, __pyx_k_min, sizeof(__pyx_k_min), 0, 1, 0, 1},
  {0, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
  {0, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {0, __pyx_k_mp1, sizeof(__pyx_k_mp1), 0, 0, 1, 1},
  {0, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
  {0, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {0, __pyx_k_net_radiation, sizeof(__pyx_k_net_radiation), 0, 0, 1, 1},
  {0, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {0, __pyx_k_new_branch, sizeof(__pyx_k_new_branch), 0, 0, 1, 1},
  {0, __pyx_k_new_node, sizeof(__pyx_k_new_node), 0, 0, 1, 1},
  {0, __pyx_k_new_node_initial_leaf_area, sizeof(__pyx_k_new_node_initial_leaf_area), 0, 0, 1, 1},
  {0, __pyx_k_newbr, sizeof(__pyx_k_newbr), 0, 0, 1, 1},
  {0, __pyx_k_nidmax, sizeof(__pyx_k_nidmax), 0, 0, 1, 1},
  {0, __pyx_k_nitrate, sizeof(__pyx_k_nitrate), 0, 1, 0, 1},
  {0, __pyx_k_nitrate_nitrogen, sizeof(__pyx_k_nitrate_nitrogen), 0, 1, 0, 1},
  {0, __pyx_k_nitrate_nitrogen_content, sizeof(__pyx_k_nitrate_nitrogen_content), 0, 0, 1, 1},
  {0, __pyx_k_nitrogen_stress, sizeof(__pyx_k_nitrogen_stress), 0, 0, 1, 1},
  {0, __pyx_k_nitrogen_stress_fruiting, sizeof(__pyx_k_nitrogen_stress_fruiting), 0, 0, 1, 1},
  {0, __pyx_k_nitrogen_stress_root, sizeof(__pyx_k_nitrogen_stress_root), 0, 0, 1, 1},
  {0, __pyx_k_nitrogen_stress_vegetative, sizeof(__pyx_k_nitrogen_stress_vegetative), 0, 0, 1, 1},
  {0, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  {0, __pyx_k_number_of_fruiting_branches, sizeof(__pyx_k_number_of_fruiting_branches), 0, 0, 1, 1},
  {0, __pyx_k_number_of_fruiting_nodes, sizeof(__pyx_k_number_of_fruiting_nodes), 0, 0, 1, 1},
  {0, __pyx_k_number_of_fruiting_sites, sizeof(__pyx_k_number_of_fruiting_sites), 0, 0, 1, 1},
  {0, __pyx_k_number_of_green_bolls, sizeof(__pyx_k_number_of_green_bolls), 0, 0, 1, 1},
  {0, __pyx_k_number_of_layers_with_root, sizeof(__pyx_k_number_of_layers_with_root), 0, 0, 1, 1},
  {0, __pyx_k_number_of_left_columns_with_root, sizeof(__pyx_k_number_of_left_columns_with_root), 0, 0, 1, 1},
  {0, __pyx_k_number_of_open_bolls, sizeof(__pyx_k_number_of_open_bolls), 0, 0, 1, 1},
  {0, __pyx_k_number_of_pre_fruiting_nodes, sizeof(__pyx_k_number_of_pre_fruiting_nodes), 0, 0, 1, 1},
  {0, __pyx_k_number_of_right_columns_with_roo, sizeof(__pyx_k_number_of_right_columns_with_roo), 0, 0, 1, 1},
  {0, __pyx_k_number_of_squares, sizeof(__pyx_k_number_of_squares), 0, 0, 1, 1},
  {0, __pyx_k_number_of_vegetative_branches, sizeof(__pyx_k_number_of_vegetative_branches), 0, 0, 1, 1},
  {0, __pyx_k_nwfl, sizeof(__pyx_k_nwfl), 0, 0, 1, 1},
  {0, __pyx_k_oldstmwt, sizeof(__pyx_k_oldstmwt), 0, 0, 1, 1},
  {0, __pyx_k_open_bolls_burr_weight, sizeof(__pyx_k_open_bolls_burr_weight), 0, 0, 1, 1},
  {0, __pyx_k_open_bolls_weight, sizeof(__pyx_k_open_bolls_weight), 0, 0, 1, 1},
  {0, __pyx_k_organic_matter, sizeof(__pyx_k_organic_matter), 0, 1, 0, 1},
  {0, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {0, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
  {0, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
  {0, __pyx_k_p3, sizeof(__pyx_k_p3), 0, 0, 1, 1},
  {0, __pyx_k_p4, sizeof(__pyx_k_p4), 0, 0, 1, 1},
  {0, __pyx_k_p5, sizeof(__pyx_k_p5), 0, 0, 1, 1},
  {0, __pyx_k_p6, sizeof(__pyx_k_p6), 0, 0, 1, 1},
  {0, __pyx_k_p7, sizeof(__pyx_k_p7), 0, 0, 1, 1},
  {0, __pyx_k_perdmax, sizeof(__pyx_k_perdmax), 0, 0, 1, 1},
  {0, __pyx_k_petiole, sizeof(__pyx_k_petiole), 0, 0, 1, 1},
  {0, __pyx_k_petiole_nitrogen_concentration, sizeof(__pyx_k_petiole_nitrogen_concentration), 0, 0, 1, 1},
  {0, __pyx_k_petiole_weight, sizeof(__pyx_k_petiole_weight), 0, 0, 1, 1},
  {0, __pyx_k_pex, sizeof(__pyx_k_pex), 0, 0, 1, 1},
  {0, __pyx_k_phenology, sizeof(__pyx_k_phenology), 0, 0, 1, 1},
  {0, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {0, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {0, __pyx_k_plant_height, sizeof(__pyx_k_plant_height), 0, 0, 1, 1},
  {0, __pyx_k_plant_weight, sizeof(__pyx_k_plant_weight), 0, 0, 1, 1},
  {0, __pyx_k_planting_date_or_emergence_date, sizeof(__pyx_k_planting_date_or_emergence_date), 0, 1, 0, 0},
  {0, __pyx_k_pnetcor, sizeof(__pyx_k_pnetcor), 0, 0, 1, 1},
  {0, __pyx_k_pollination_switch, sizeof(__pyx_k_pollination_switch), 0, 0, 1, 1},
  {0, __pyx_k_potential_fruit_growth, sizeof(__pyx_k_potential_fruit_growth), 0, 0, 1, 1},
  {0, __pyx_k_potential_growth, sizeof(__pyx_k_potential_growth), 0, 0, 1, 1},
  {0, __pyx_k_potential_growth_for_leaf_area, sizeof(__pyx_k_potential_growth_for_leaf_area), 0, 0, 1, 1},
  {0, __pyx_k_potential_growth_for_leaf_weight, sizeof(__pyx_k_potential_growth_for_leaf_weight), 0, 0, 1, 1},
  {0, __pyx_k_potential_growth_for_petiole_wei, sizeof(__pyx_k_potential_growth_for_petiole_wei), 0, 0, 1, 1},
  {0, __pyx_k_potential_leaf_growth, sizeof(__pyx_k_potential_leaf_growth), 0, 0, 1, 1},
  {0, __pyx_k_pplant, sizeof(__pyx_k_pplant), 0, 0, 1, 1},
  {0, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {0, __pyx_k_psilim, sizeof(__pyx_k_psilim), 0, 0, 1, 1},
  {0, __pyx_k_pstand, sizeof(__pyx_k_pstand), 0, 0, 1, 1},
  {0, __pyx_k_ptnfac, sizeof(__pyx_k_ptnfac), 0, 0, 1, 1},
  {0, __pyx_k_pts, sizeof(__pyx_k_pts), 0, 0, 1, 1},
  {0, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {0, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {0, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {0, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {0, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {0, __pyx_k_pyx_unpickle_SoilInit, sizeof(__pyx_k_pyx_unpickle_SoilInit), 0, 0, 1, 1},
  {0, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {0, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {0, __pyx_k_radiation, sizeof(__pyx_k_radiation), 0, 0, 1, 1},
  {0, __pyx_k_radiation, sizeof(__pyx_k_radiation), 0, 1, 0, 1},
  {0, __pyx_k_radsum, sizeof(__pyx_k_radsum), 0, 0, 1, 1},
  {0, __pyx_k_rain, sizeof(__pyx_k_rain), 0, 1, 0, 1},
  {0, __pyx_k_rainToday, sizeof(__pyx_k_rainToday), 0, 0, 1, 1},
  {0, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {0, __pyx_k_rate, sizeof(__pyx_k_rate), 0, 0, 1, 1},
  {0, __pyx_k_ratebol, sizeof(__pyx_k_ratebol), 0, 0, 1, 1},
  {0, __pyx_k_ratebur, sizeof(__pyx_k_ratebur), 0, 0, 1, 1},
  {0, __pyx_k_ratesqr, sizeof(__pyx_k_ratesqr), 0, 0, 1, 1},
  {0, __pyx_k_ratio_implicit, sizeof(__pyx_k_ratio_implicit), 0, 1, 0, 1},
  {0, __pyx_k_rbmax, sizeof(__pyx_k_rbmax), 0, 0, 1, 1},
  {0, __pyx_k_read_input, sizeof(__pyx_k_read_input), 0, 0, 1, 1},
  {0, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {0, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {0, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {0, __pyx_k_ref_et, sizeof(__pyx_k_ref_et), 0, 0, 1, 1},
  {0, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {0, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {0, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
  {0, __pyx_k_root_nitrogen_concentration, sizeof(__pyx_k_root_nitrogen_concentration), 0, 0, 1, 1},
  {0, __pyx_k_row_space, sizeof(__pyx_k_row_space), 0, 0, 1, 1},
  {0, __pyx_k_rsubl, sizeof(__pyx_k_rsubl), 0, 0, 1, 1},
  {0, __pyx_k_rsubo, sizeof(__pyx_k_rsubo), 0, 0, 1, 1},
  {0, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1},
  {0, __pyx_k_runoff, sizeof(__pyx_k_runoff), 0, 0, 1, 1},
  {0, __pyx_k_runoffToday, sizeof(__pyx_k_runoffToday), 0, 0, 1, 1},
  {0, __pyx_k_sand, sizeof(__pyx_k_sand), 0, 1, 0, 1},
  {0, __pyx_k_saturated_hydraulic_conductivity, sizeof(__pyx_k_saturated_hydraulic_conductivity), 0, 1, 0, 1},
  {0, __pyx_k_sd, sizeof(__pyx_k_sd), 0, 0, 1, 1},
  {0, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {0, __pyx_k_seed_nitrogen, sizeof(__pyx_k_seed_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_seed_nitrogen_concentration, sizeof(__pyx_k_seed_nitrogen_concentration), 0, 0, 1, 1},
  {0, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {0, __pyx_k_self___cannot_be_converted_to_a, sizeof(__pyx_k_self___cannot_be_converted_to_a), 0, 0, 1, 0},
  {0, __pyx_k_self_climate_cannot_be_converted, sizeof(__pyx_k_self_climate_cannot_be_converted), 0, 0, 1, 0},
  {0, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {0, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {0, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {0, __pyx_k_shade, sizeof(__pyx_k_shade), 0, 0, 1, 1},
  {0, __pyx_k_simulate, sizeof(__pyx_k_simulate), 0, 0, 1, 1},
  {0, __pyx_k_simulate_this_day, sizeof(__pyx_k_simulate_this_day), 0, 0, 1, 1},
  {0, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {0, __pyx_k_sinb, sizeof(__pyx_k_sinb), 0, 0, 1, 1},
  {0, __pyx_k_smax, sizeof(__pyx_k_smax), 0, 0, 1, 1},
  {0, __pyx_k_smaxx, sizeof(__pyx_k_smaxx), 0, 0, 1, 1},
  {0, __pyx_k_soil, sizeof(__pyx_k_soil), 0, 0, 1, 1},
  {0, __pyx_k_solar_noon, sizeof(__pyx_k_solar_noon), 0, 0, 1, 1},
  {0, __pyx_k_solar_noon, sizeof(__pyx_k_solar_noon), 0, 1, 0, 1},
  {0, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {0, __pyx_k_square, sizeof(__pyx_k_square), 0, 0, 1, 1},
  {0, __pyx_k_square_nitrogen, sizeof(__pyx_k_square_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_square_nitrogen_concentration, sizeof(__pyx_k_square_nitrogen_concentration), 0, 0, 1, 1},
  {0, __pyx_k_square_weight, sizeof(__pyx_k_square_weight), 0, 0, 1, 1},
  {0, __pyx_k_src__cotton2k_simulation_pyx, sizeof(__pyx_k_src__cotton2k_simulation_pyx), 0, 0, 1, 0},
  {0, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1},
  {0, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {0, __pyx_k_start_date, sizeof(__pyx_k_start_date), 0, 0, 1, 1},
  {0, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {0, __pyx_k_state0, sizeof(__pyx_k_state0), 0, 0, 1, 1},
  {0, __pyx_k_stemNRatio, sizeof(__pyx_k_stemNRatio), 0, 0, 1, 1},
  {0, __pyx_k_stem_nitrogen, sizeof(__pyx_k_stem_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_stem_weight, sizeof(__pyx_k_stem_weight), 0, 0, 1, 1},
  {0, __pyx_k_stemnew, sizeof(__pyx_k_stemnew), 0, 0, 1, 1},
  {0, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {0, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {0, __pyx_k_stress, sizeof(__pyx_k_stress), 0, 0, 1, 1},
  {0, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {0, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {0, __pyx_k_sumpdr, sizeof(__pyx_k_sumpdr), 0, 0, 1, 1},
  {0, __pyx_k_sumwk, sizeof(__pyx_k_sumwk), 0, 0, 1, 1},
  {0, __pyx_k_sunr, sizeof(__pyx_k_sunr), 0, 0, 1, 1},
  {0, __pyx_k_sunr, sizeof(__pyx_k_sunr), 0, 1, 0, 1},
  {0, __pyx_k_suns, sizeof(__pyx_k_suns), 0, 0, 1, 1},
  {0, __pyx_k_suns, sizeof(__pyx_k_suns), 0, 1, 0, 1},
  {0, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {0, __pyx_k_sw, sizeof(__pyx_k_sw), 0, 0, 1, 1},
  {0, __pyx_k_sw0, sizeof(__pyx_k_sw0), 0, 0, 1, 1},
  {0, __pyx_k_sw1, sizeof(__pyx_k_sw1), 0, 0, 1, 1},
  {0, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
  {0, __pyx_k_t2, sizeof(__pyx_k_t2), 0, 0, 1, 1},
  {0, __pyx_k_t3, sizeof(__pyx_k_t3), 0, 0, 1, 1},
  {0, __pyx_k_tav, sizeof(__pyx_k_tav), 0, 0, 1, 1},
  {0, __pyx_k_tdday, sizeof(__pyx_k_tdday), 0, 0, 1, 1},
  {0, __pyx_k_temperature, sizeof(__pyx_k_temperature), 0, 0, 1, 1},
  {0, __pyx_k_temperature_on_leaf_growth_rate, sizeof(__pyx_k_temperature_on_leaf_growth_rate), 0, 0, 1, 1},
  {0, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {0, __pyx_k_tfrt, sizeof(__pyx_k_tfrt), 0, 0, 1, 1},
  {0, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 1, 0, 1},
  {0, __pyx_k_ti, sizeof(__pyx_k_ti), 0, 0, 1, 1},
  {0, __pyx_k_time_to_new_fruiting_branch, sizeof(__pyx_k_time_to_new_fruiting_branch), 0, 0, 1, 1},
  {0, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
  {0, __pyx_k_tmpisr, sizeof(__pyx_k_tmpisr), 0, 0, 1, 1},
  {0, __pyx_k_tmpisr, sizeof(__pyx_k_tmpisr), 0, 1, 0, 1},
  {0, __pyx_k_total_required_nitrogen, sizeof(__pyx_k_total_required_nitrogen), 0, 0, 1, 1},
  {0, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1},
  {0, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {0, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {0, __pyx_k_urea, sizeof(__pyx_k_urea), 0, 1, 0, 1},
  {0, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
  {0, __pyx_k_vegetative_branch, sizeof(__pyx_k_vegetative_branch), 0, 0, 1, 1},
  {0, __pyx_k_vegetative_branches, sizeof(__pyx_k_vegetative_branches), 0, 0, 1, 1},
  {0, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {0, __pyx_k_vfrtbr, sizeof(__pyx_k_vfrtbr), 0, 0, 1, 1},
  {0, __pyx_k_voldstm, sizeof(__pyx_k_voldstm), 0, 0, 1, 1},
  {0, __pyx_k_vpheno, sizeof(__pyx_k_vpheno), 0, 0, 1, 1},
  {0, __pyx_k_vpnet, sizeof(__pyx_k_vpnet), 0, 0, 1, 1},
  {0, __pyx_k_vpotfrt, sizeof(__pyx_k_vpotfrt), 0, 0, 1, 1},
  {0, __pyx_k_vpotlf, sizeof(__pyx_k_vpotlf), 0, 0, 1, 1},
  {0, __pyx_k_vpvegb, sizeof(__pyx_k_vpvegb), 0, 0, 1, 1},
  {0, __pyx_k_vstrs, sizeof(__pyx_k_vstrs), 0, 0, 1, 1},
  {0, __pyx_k_water, sizeof(__pyx_k_water), 0, 1, 0, 1},
  {0, __pyx_k_water_stress, sizeof(__pyx_k_water_stress), 0, 0, 1, 1},
  {0, __pyx_k_water_stress_stem, sizeof(__pyx_k_water_stress_stem), 0, 0, 1, 1},
  {0, __pyx_k_wattsm, sizeof(__pyx_k_wattsm), 0, 0, 1, 1},
  {0, __pyx_k_wbmax, sizeof(__pyx_k_wbmax), 0, 0, 1, 1},
  {0, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1},
  {0, __pyx_k_weight_capable_uptake, sizeof(__pyx_k_weight_capable_uptake), 0, 0, 1, 1},
  {0, __pyx_k_wfdb, sizeof(__pyx_k_wfdb), 0, 0, 1, 1},
  {0, __pyx_k_wind, sizeof(__pyx_k_wind), 0, 1, 0, 1},
  {0, __pyx_k_wind_speed, sizeof(__pyx_k_wind_speed), 0, 0, 1, 1},
  {0, __pyx_k_wnytf, sizeof(__pyx_k_wnytf), 0, 0, 1, 1},
  {0, __pyx_k_wstrlf, sizeof(__pyx_k_wstrlf), 0, 0, 1, 1},
  {0, __pyx_k_wtfstrs, sizeof(__pyx_k_wtfstrs), 0, 0, 1, 1},
  {0, __pyx_k_xlat, sizeof(__pyx_k_xlat), 0, 0, 1, 1},
  {0, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
  {0, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1},
  {0, __pyx_k_zero, sizeof(__pyx_k_zero), 0, 0, 1, 1},
  {0, __pyx_k_zint, sizeof(__pyx_k_zint), 0, 0, 1, 1},
  #else
  {&__pyx_n_s_Climate, __pyx_k_Climate, sizeof(__pyx_k_Climate), 0, 0, 1, 1},
  {&__pyx_n_s_Climate___reduce_cython, __pyx_k_Climate___reduce_cython, sizeof(__pyx_k_Climate___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Climate___setstate_cython, __pyx_k_Climate___setstate_cython, sizeof(__pyx_k_Climate___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_DaysTo1stSqare, __pyx_k_DaysTo1stSqare, sizeof(__pyx_k_DaysTo1stSqare), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingBranch, __pyx_k_FruitingBranch, sizeof(__pyx_k_FruitingBranch), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingBranch___reduce_cython, __pyx_k_FruitingBranch___reduce_cython, sizeof(__pyx_k_FruitingBranch___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingBranch___setstate_cython, __pyx_k_FruitingBranch___setstate_cython, sizeof(__pyx_k_FruitingBranch___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingNode, __pyx_k_FruitingNode, sizeof(__pyx_k_FruitingNode), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingNode___reduce_cython, __pyx_k_FruitingNode___reduce_cython, sizeof(__pyx_k_FruitingNode___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_FruitingNode___setstate_cython, __pyx_k_FruitingNode___setstate_cython, sizeof(__pyx_k_FruitingNode___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x84, __pyx_k_Incompatible_checksums_s_vs_0x84, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x84), 0, 0, 1, 0},
  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
  {&__pyx_n_s_KeyError, __pyx_k_KeyError, sizeof(__pyx_k_KeyError), 0, 0, 1, 1},
  {&__pyx_n_s_MainStemLeaf, __pyx_k_MainStemLeaf, sizeof(__pyx_k_MainStemLeaf), 0, 0, 1, 1},
  {&__pyx_n_s_MainStemLeaf___reduce_cython, __pyx_k_MainStemLeaf___reduce_cython, sizeof(__pyx_k_MainStemLeaf___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_MainStemLeaf___setstate_cython, __pyx_k_MainStemLeaf___setstate_cython, sizeof(__pyx_k_MainStemLeaf___setstate_cython), 0, 0, 1, 1},
  {&__pyx_kp_s_No_value_specified_for_struct_at, __pyx_k_No_value_specified_for_struct_at, sizeof(__pyx_k_No_value_specified_for_struct_at), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_10, __pyx_k_No_value_specified_for_struct_at_10, sizeof(__pyx_k_No_value_specified_for_struct_at_10), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_100, __pyx_k_No_value_specified_for_struct_at_100, sizeof(__pyx_k_No_value_specified_for_struct_at_100), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_101, __pyx_k_No_value_specified_for_struct_at_101, sizeof(__pyx_k_No_value_specified_for_struct_at_101), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_102, __pyx_k_No_value_specified_for_struct_at_102, sizeof(__pyx_k_No_value_specified_for_struct_at_102), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_103, __pyx_k_No_value_specified_for_struct_at_103, sizeof(__pyx_k_No_value_specified_for_struct_at_103), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_104, __pyx_k_No_value_specified_for_struct_at_104, sizeof(__pyx_k_No_value_specified_for_struct_at_104), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_105, __pyx_k_No_value_specified_for_struct_at_105, sizeof(__pyx_k_No_value_specified_for_struct_at_105), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_106, __pyx_k_No_value_specified_for_struct_at_106, sizeof(__pyx_k_No_value_specified_for_struct_at_106), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_107, __pyx_k_No_value_specified_for_struct_at_107, sizeof(__pyx_k_No_value_specified_for_struct_at_107), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_108, __pyx_k_No_value_specified_for_struct_at_108, sizeof(__pyx_k_No_value_specified_for_struct_at_108), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_109, __pyx_k_No_value_specified_for_struct_at_109, sizeof(__pyx_k_No_value_specified_for_struct_at_109), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_11, __pyx_k_No_value_specified_for_struct_at_11, sizeof(__pyx_k_No_value_specified_for_struct_at_11), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_110, __pyx_k_No_value_specified_for_struct_at_110, sizeof(__pyx_k_No_value_specified_for_struct_at_110), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_111, __pyx_k_No_value_specified_for_struct_at_111, sizeof(__pyx_k_No_value_specified_for_struct_at_111), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_112, __pyx_k_No_value_specified_for_struct_at_112, sizeof(__pyx_k_No_value_specified_for_struct_at_112), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_113, __pyx_k_No_value_specified_for_struct_at_113, sizeof(__pyx_k_No_value_specified_for_struct_at_113), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_114, __pyx_k_No_value_specified_for_struct_at_114, sizeof(__pyx_k_No_value_specified_for_struct_at_114), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_115, __pyx_k_No_value_specified_for_struct_at_115, sizeof(__pyx_k_No_value_specified_for_struct_at_115), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_116, __pyx_k_No_value_specified_for_struct_at_116, sizeof(__pyx_k_No_value_specified_for_struct_at_116), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_117, __pyx_k_No_value_specified_for_struct_at_117, sizeof(__pyx_k_No_value_specified_for_struct_at_117), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_12, __pyx_k_No_value_specified_for_struct_at_12, sizeof(__pyx_k_No_value_specified_for_struct_at_12), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_13, __pyx_k_No_value_specified_for_struct_at_13, sizeof(__pyx_k_No_value_specified_for_struct_at_13), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_14, __pyx_k_No_value_specified_for_struct_at_14, sizeof(__pyx_k_No_value_specified_for_struct_at_14), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_15, __pyx_k_No_value_specified_for_struct_at_15, sizeof(__pyx_k_No_value_specified_for_struct_at_15), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_16, __pyx_k_No_value_specified_for_struct_at_16, sizeof(__pyx_k_No_value_specified_for_struct_at_16), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_17, __pyx_k_No_value_specified_for_struct_at_17, sizeof(__pyx_k_No_value_specified_for_struct_at_17), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_18, __pyx_k_No_value_specified_for_struct_at_18, sizeof(__pyx_k_No_value_specified_for_struct_at_18), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_19, __pyx_k_No_value_specified_for_struct_at_19, sizeof(__pyx_k_No_value_specified_for_struct_at_19), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_2, __pyx_k_No_value_specified_for_struct_at_2, sizeof(__pyx_k_No_value_specified_for_struct_at_2), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_20, __pyx_k_No_value_specified_for_struct_at_20, sizeof(__pyx_k_No_value_specified_for_struct_at_20), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_21, __pyx_k_No_value_specified_for_struct_at_21, sizeof(__pyx_k_No_value_specified_for_struct_at_21), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_22, __pyx_k_No_value_specified_for_struct_at_22, sizeof(__pyx_k_No_value_specified_for_struct_at_22), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_23, __pyx_k_No_value_specified_for_struct_at_23, sizeof(__pyx_k_No_value_specified_for_struct_at_23), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_24, __pyx_k_No_value_specified_for_struct_at_24, sizeof(__pyx_k_No_value_specified_for_struct_at_24), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_25, __pyx_k_No_value_specified_for_struct_at_25, sizeof(__pyx_k_No_value_specified_for_struct_at_25), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_26, __pyx_k_No_value_specified_for_struct_at_26, sizeof(__pyx_k_No_value_specified_for_struct_at_26), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_27, __pyx_k_No_value_specified_for_struct_at_27, sizeof(__pyx_k_No_value_specified_for_struct_at_27), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_28, __pyx_k_No_value_specified_for_struct_at_28, sizeof(__pyx_k_No_value_specified_for_struct_at_28), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_29, __pyx_k_No_value_specified_for_struct_at_29, sizeof(__pyx_k_No_value_specified_for_struct_at_29), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_3, __pyx_k_No_value_specified_for_struct_at_3, sizeof(__pyx_k_No_value_specified_for_struct_at_3), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_30, __pyx_k_No_value_specified_for_struct_at_30, sizeof(__pyx_k_No_value_specified_for_struct_at_30), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_31, __pyx_k_No_value_specified_for_struct_at_31, sizeof(__pyx_k_No_value_specified_for_struct_at_31), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_32, __pyx_k_No_value_specified_for_struct_at_32, sizeof(__pyx_k_No_value_specified_for_struct_at_32), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_33, __pyx_k_No_value_specified_for_struct_at_33, sizeof(__pyx_k_No_value_specified_for_struct_at_33), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_34, __pyx_k_No_value_specified_for_struct_at_34, sizeof(__pyx_k_No_value_specified_for_struct_at_34), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_35, __pyx_k_No_value_specified_for_struct_at_35, sizeof(__pyx_k_No_value_specified_for_struct_at_35), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_36, __pyx_k_No_value_specified_for_struct_at_36, sizeof(__pyx_k_No_value_specified_for_struct_at_36), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_37, __pyx_k_No_value_specified_for_struct_at_37, sizeof(__pyx_k_No_value_specified_for_struct_at_37), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_38, __pyx_k_No_value_specified_for_struct_at_38, sizeof(__pyx_k_No_value_specified_for_struct_at_38), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_39, __pyx_k_No_value_specified_for_struct_at_39, sizeof(__pyx_k_No_value_specified_for_struct_at_39), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_4, __pyx_k_No_value_specified_for_struct_at_4, sizeof(__pyx_k_No_value_specified_for_struct_at_4), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_40, __pyx_k_No_value_specified_for_struct_at_40, sizeof(__pyx_k_No_value_specified_for_struct_at_40), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_41, __pyx_k_No_value_specified_for_struct_at_41, sizeof(__pyx_k_No_value_specified_for_struct_at_41), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_42, __pyx_k_No_value_specified_for_struct_at_42, sizeof(__pyx_k_No_value_specified_for_struct_at_42), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_43, __pyx_k_No_value_specified_for_struct_at_43, sizeof(__pyx_k_No_value_specified_for_struct_at_43), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_44, __pyx_k_No_value_specified_for_struct_at_44, sizeof(__pyx_k_No_value_specified_for_struct_at_44), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_45, __pyx_k_No_value_specified_for_struct_at_45, sizeof(__pyx_k_No_value_specified_for_struct_at_45), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_46, __pyx_k_No_value_specified_for_struct_at_46, sizeof(__pyx_k_No_value_specified_for_struct_at_46), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_47, __pyx_k_No_value_specified_for_struct_at_47, sizeof(__pyx_k_No_value_specified_for_struct_at_47), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_48, __pyx_k_No_value_specified_for_struct_at_48, sizeof(__pyx_k_No_value_specified_for_struct_at_48), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_49, __pyx_k_No_value_specified_for_struct_at_49, sizeof(__pyx_k_No_value_specified_for_struct_at_49), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_5, __pyx_k_No_value_specified_for_struct_at_5, sizeof(__pyx_k_No_value_specified_for_struct_at_5), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_50, __pyx_k_No_value_specified_for_struct_at_50, sizeof(__pyx_k_No_value_specified_for_struct_at_50), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_51, __pyx_k_No_value_specified_for_struct_at_51, sizeof(__pyx_k_No_value_specified_for_struct_at_51), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_52, __pyx_k_No_value_specified_for_struct_at_52, sizeof(__pyx_k_No_value_specified_for_struct_at_52), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_53, __pyx_k_No_value_specified_for_struct_at_53, sizeof(__pyx_k_No_value_specified_for_struct_at_53), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_54, __pyx_k_No_value_specified_for_struct_at_54, sizeof(__pyx_k_No_value_specified_for_struct_at_54), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_55, __pyx_k_No_value_specified_for_struct_at_55, sizeof(__pyx_k_No_value_specified_for_struct_at_55), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_56, __pyx_k_No_value_specified_for_struct_at_56, sizeof(__pyx_k_No_value_specified_for_struct_at_56), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_57, __pyx_k_No_value_specified_for_struct_at_57, sizeof(__pyx_k_No_value_specified_for_struct_at_57), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_58, __pyx_k_No_value_specified_for_struct_at_58, sizeof(__pyx_k_No_value_specified_for_struct_at_58), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_59, __pyx_k_No_value_specified_for_struct_at_59, sizeof(__pyx_k_No_value_specified_for_struct_at_59), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_6, __pyx_k_No_value_specified_for_struct_at_6, sizeof(__pyx_k_No_value_specified_for_struct_at_6), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_60, __pyx_k_No_value_specified_for_struct_at_60, sizeof(__pyx_k_No_value_specified_for_struct_at_60), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_61, __pyx_k_No_value_specified_for_struct_at_61, sizeof(__pyx_k_No_value_specified_for_struct_at_61), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_62, __pyx_k_No_value_specified_for_struct_at_62, sizeof(__pyx_k_No_value_specified_for_struct_at_62), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_63, __pyx_k_No_value_specified_for_struct_at_63, sizeof(__pyx_k_No_value_specified_for_struct_at_63), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_64, __pyx_k_No_value_specified_for_struct_at_64, sizeof(__pyx_k_No_value_specified_for_struct_at_64), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_65, __pyx_k_No_value_specified_for_struct_at_65, sizeof(__pyx_k_No_value_specified_for_struct_at_65), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_66, __pyx_k_No_value_specified_for_struct_at_66, sizeof(__pyx_k_No_value_specified_for_struct_at_66), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_67, __pyx_k_No_value_specified_for_struct_at_67, sizeof(__pyx_k_No_value_specified_for_struct_at_67), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_68, __pyx_k_No_value_specified_for_struct_at_68, sizeof(__pyx_k_No_value_specified_for_struct_at_68), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_69, __pyx_k_No_value_specified_for_struct_at_69, sizeof(__pyx_k_No_value_specified_for_struct_at_69), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_7, __pyx_k_No_value_specified_for_struct_at_7, sizeof(__pyx_k_No_value_specified_for_struct_at_7), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_70, __pyx_k_No_value_specified_for_struct_at_70, sizeof(__pyx_k_No_value_specified_for_struct_at_70), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_71, __pyx_k_No_value_specified_for_struct_at_71, sizeof(__pyx_k_No_value_specified_for_struct_at_71), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_72, __pyx_k_No_value_specified_for_struct_at_72, sizeof(__pyx_k_No_value_specified_for_struct_at_72), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_73, __pyx_k_No_value_specified_for_struct_at_73, sizeof(__pyx_k_No_value_specified_for_struct_at_73), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_74, __pyx_k_No_value_specified_for_struct_at_74, sizeof(__pyx_k_No_value_specified_for_struct_at_74), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_75, __pyx_k_No_value_specified_for_struct_at_75, sizeof(__pyx_k_No_value_specified_for_struct_at_75), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_76, __pyx_k_No_value_specified_for_struct_at_76, sizeof(__pyx_k_No_value_specified_for_struct_at_76), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_77, __pyx_k_No_value_specified_for_struct_at_77, sizeof(__pyx_k_No_value_specified_for_struct_at_77), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_78, __pyx_k_No_value_specified_for_struct_at_78, sizeof(__pyx_k_No_value_specified_for_struct_at_78), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_79, __pyx_k_No_value_specified_for_struct_at_79, sizeof(__pyx_k_No_value_specified_for_struct_at_79), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_8, __pyx_k_No_value_specified_for_struct_at_8, sizeof(__pyx_k_No_value_specified_for_struct_at_8), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_80, __pyx_k_No_value_specified_for_struct_at_80, sizeof(__pyx_k_No_value_specified_for_struct_at_80), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_81, __pyx_k_No_value_specified_for_struct_at_81, sizeof(__pyx_k_No_value_specified_for_struct_at_81), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_82, __pyx_k_No_value_specified_for_struct_at_82, sizeof(__pyx_k_No_value_specified_for_struct_at_82), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_83, __pyx_k_No_value_specified_for_struct_at_83, sizeof(__pyx_k_No_value_specified_for_struct_at_83), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_84, __pyx_k_No_value_specified_for_struct_at_84, sizeof(__pyx_k_No_value_specified_for_struct_at_84), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_85, __pyx_k_No_value_specified_for_struct_at_85, sizeof(__pyx_k_No_value_specified_for_struct_at_85), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_86, __pyx_k_No_value_specified_for_struct_at_86, sizeof(__pyx_k_No_value_specified_for_struct_at_86), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_87, __pyx_k_No_value_specified_for_struct_at_87, sizeof(__pyx_k_No_value_specified_for_struct_at_87), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_88, __pyx_k_No_value_specified_for_struct_at_88, sizeof(__pyx_k_No_value_specified_for_struct_at_88), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_89, __pyx_k_No_value_specified_for_struct_at_89, sizeof(__pyx_k_No_value_specified_for_struct_at_89), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_9, __pyx_k_No_value_specified_for_struct_at_9, sizeof(__pyx_k_No_value_specified_for_struct_at_9), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_90, __pyx_k_No_value_specified_for_struct_at_90, sizeof(__pyx_k_No_value_specified_for_struct_at_90), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_91, __pyx_k_No_value_specified_for_struct_at_91, sizeof(__pyx_k_No_value_specified_for_struct_at_91), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_92, __pyx_k_No_value_specified_for_struct_at_92, sizeof(__pyx_k_No_value_specified_for_struct_at_92), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_93, __pyx_k_No_value_specified_for_struct_at_93, sizeof(__pyx_k_No_value_specified_for_struct_at_93), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_94, __pyx_k_No_value_specified_for_struct_at_94, sizeof(__pyx_k_No_value_specified_for_struct_at_94), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_95, __pyx_k_No_value_specified_for_struct_at_95, sizeof(__pyx_k_No_value_specified_for_struct_at_95), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_96, __pyx_k_No_value_specified_for_struct_at_96, sizeof(__pyx_k_No_value_specified_for_struct_at_96), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_97, __pyx_k_No_value_specified_for_struct_at_97, sizeof(__pyx_k_No_value_specified_for_struct_at_97), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_98, __pyx_k_No_value_specified_for_struct_at_98, sizeof(__pyx_k_No_value_specified_for_struct_at_98), 0, 0, 1, 0},
  {&__pyx_kp_s_No_value_specified_for_struct_at_99, __pyx_k_No_value_specified_for_struct_at_99, sizeof(__pyx_k_No_value_specified_for_struct_at_99), 0, 0, 1, 0},
  {&__pyx_n_s_NodeLeaf, __pyx_k_NodeLeaf, sizeof(__pyx_k_NodeLeaf), 0, 0, 1, 1},
  {&__pyx_n_s_NodeLeaf___reduce_cython, __pyx_k_NodeLeaf___reduce_cython, sizeof(__pyx_k_NodeLeaf___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_NodeLeaf___setstate_cython, __pyx_k_NodeLeaf___setstate_cython, sizeof(__pyx_k_NodeLeaf___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_OpenRatio, __pyx_k_OpenRatio, sizeof(__pyx_k_OpenRatio), 0, 0, 1, 1},
  {&__pyx_n_s_OverflowError, __pyx_k_OverflowError, sizeof(__pyx_k_OverflowError), 0, 0, 1, 1},
  {&__pyx_n_s_PhenDelayByNStress, __pyx_k_PhenDelayByNStress, sizeof(__pyx_k_PhenDelayByNStress), 0, 0, 1, 1},
  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
  {&__pyx_kp_s_Pickling_of_struct_members_such, __pyx_k_Pickling_of_struct_members_such, sizeof(__pyx_k_Pickling_of_struct_members_such), 0, 0, 1, 0},
  {&__pyx_n_s_Rad, __pyx_k_Rad, sizeof(__pyx_k_Rad), 0, 0, 1, 1},
  {&__pyx_n_u_Rad, __pyx_k_Rad, sizeof(__pyx_k_Rad), 0, 1, 0, 1},
  {&__pyx_n_s_Rain, __pyx_k_Rain, sizeof(__pyx_k_Rain), 0, 0, 1, 1},
  {&__pyx_n_u_Rain, __pyx_k_Rain, sizeof(__pyx_k_Rain), 0, 1, 0, 1},
  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation, __pyx_k_Simulation, sizeof(__pyx_k_Simulation), 0, 0, 1, 1},
  {&__pyx_n_s_SimulationEnd, __pyx_k_SimulationEnd, sizeof(__pyx_k_SimulationEnd), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation___reduce_cython, __pyx_k_Simulation___reduce_cython, sizeof(__pyx_k_Simulation___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation___setstate_cython, __pyx_k_Simulation___setstate_cython, sizeof(__pyx_k_Simulation___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__add_vegetative_branc, __pyx_k_Simulation__add_vegetative_branc, sizeof(__pyx_k_Simulation__add_vegetative_branc), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__calc_light_intercept, __pyx_k_Simulation__calc_light_intercept, sizeof(__pyx_k_Simulation__calc_light_intercept), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__column_shading, __pyx_k_Simulation__column_shading, sizeof(__pyx_k_Simulation__column_shading), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__daily_climate, __pyx_k_Simulation__daily_climate, sizeof(__pyx_k_Simulation__daily_climate), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__days_to_first_square, __pyx_k_Simulation__days_to_first_square, sizeof(__pyx_k_Simulation__days_to_first_square), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__defoliate, __pyx_k_Simulation__defoliate, sizeof(__pyx_k_Simulation__defoliate), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__doy2date, __pyx_k_Simulation__doy2date, sizeof(__pyx_k_Simulation__doy2date), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__get_net_photosynthes, __pyx_k_Simulation__get_net_photosynthes, sizeof(__pyx_k_Simulation__get_net_photosynthes), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__growth, __pyx_k_Simulation__growth, sizeof(__pyx_k_Simulation__growth), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__init_grid, __pyx_k_Simulation__init_grid, sizeof(__pyx_k_Simulation__init_grid), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__init_state, __pyx_k_Simulation__init_state, sizeof(__pyx_k_Simulation__init_state), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__phenology, __pyx_k_Simulation__phenology, sizeof(__pyx_k_Simulation__phenology), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__potential_fruit_grow, __pyx_k_Simulation__potential_fruit_grow, sizeof(__pyx_k_Simulation__potential_fruit_grow), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__potential_leaf_growt, __pyx_k_Simulation__potential_leaf_growt, sizeof(__pyx_k_Simulation__potential_leaf_growt), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__simulate, __pyx_k_Simulation__simulate, sizeof(__pyx_k_Simulation__simulate), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__simulate_this_day, __pyx_k_Simulation__simulate_this_day, sizeof(__pyx_k_Simulation__simulate_this_day), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation__stress, __pyx_k_Simulation__stress, sizeof(__pyx_k_Simulation__stress), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation_read_input, __pyx_k_Simulation_read_input, sizeof(__pyx_k_Simulation_read_input), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation_run, __pyx_k_Simulation_run, sizeof(__pyx_k_Simulation_run), 0, 0, 1, 1},
  {&__pyx_n_s_Simulation_state, __pyx_k_Simulation_state, sizeof(__pyx_k_Simulation_state), 0, 0, 1, 1},
  {&__pyx_n_s_SoilInit, __pyx_k_SoilInit, sizeof(__pyx_k_SoilInit), 0, 0, 1, 1},
  {&__pyx_n_s_SoilInit___reduce_cython, __pyx_k_SoilInit___reduce_cython, sizeof(__pyx_k_SoilInit___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_SoilInit___setstate_cython, __pyx_k_SoilInit___setstate_cython, sizeof(__pyx_k_SoilInit___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_State, __pyx_k_State, sizeof(__pyx_k_State), 0, 0, 1, 1},
  {&__pyx_n_s_State___reduce_cython, __pyx_k_State___reduce_cython, sizeof(__pyx_k_State___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_State___setstate_cython, __pyx_k_State___setstate_cython, sizeof(__pyx_k_State___setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_State_add_fruiting_branch, __pyx_k_State_add_fruiting_branch, sizeof(__pyx_k_State_add_fruiting_branch), 0, 0, 1, 1},
  {&__pyx_n_s_State_create_first_square, __pyx_k_State_create_first_square, sizeof(__pyx_k_State_create_first_square), 0, 0, 1, 1},
  {&__pyx_n_s_State_keys, __pyx_k_State_keys, sizeof(__pyx_k_State_keys), 0, 0, 1, 1},
  {&__pyx_n_s_StopIteration, __pyx_k_StopIteration, sizeof(__pyx_k_StopIteration), 0, 0, 1, 1},
  {&__pyx_n_s_Tdew, __pyx_k_Tdew, sizeof(__pyx_k_Tdew), 0, 0, 1, 1},
  {&__pyx_n_u_Tdew, __pyx_k_Tdew, sizeof(__pyx_k_Tdew), 0, 1, 0, 1},
  {&__pyx_n_s_TimeToNextFruBranch, __pyx_k_TimeToNextFruBranch, sizeof(__pyx_k_TimeToNextFruBranch), 0, 0, 1, 1},
  {&__pyx_n_s_TimeToNextVegBranch, __pyx_k_TimeToNextVegBranch, sizeof(__pyx_k_TimeToNextVegBranch), 0, 0, 1, 1},
  {&__pyx_n_s_Tmax, __pyx_k_Tmax, sizeof(__pyx_k_Tmax), 0, 0, 1, 1},
  {&__pyx_n_u_Tmax, __pyx_k_Tmax, sizeof(__pyx_k_Tmax), 0, 1, 0, 1},
  {&__pyx_n_s_Tmin, __pyx_k_Tmin, sizeof(__pyx_k_Tmin), 0, 0, 1, 1},
  {&__pyx_n_u_Tmin, __pyx_k_Tmin, sizeof(__pyx_k_Tmin), 0, 1, 0, 1},
  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
  {&__pyx_n_s_VegetativeBranch, __pyx_k_VegetativeBranch, sizeof(__pyx_k_VegetativeBranch), 0, 0, 1, 1},
  {&__pyx_n_s_VegetativeBranch___reduce_cython, __pyx_k_VegetativeBranch___reduce_cython, sizeof(__pyx_k_VegetativeBranch___reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_VegetativeBranch___setstate_cyth, __pyx_k_VegetativeBranch___setstate_cyth, sizeof(__pyx_k_VegetativeBranch___setstate_cyth), 0, 0, 1, 1},
  {&__pyx_n_s_WaterStress, __pyx_k_WaterStress, sizeof(__pyx_k_WaterStress), 0, 0, 1, 1},
  {&__pyx_n_s_Wind, __pyx_k_Wind, sizeof(__pyx_k_Wind), 0, 0, 1, 1},
  {&__pyx_n_u_Wind, __pyx_k_Wind, sizeof(__pyx_k_Wind), 0, 1, 0, 1},
  {&__pyx_kp_u_Y_j, __pyx_k_Y_j, sizeof(__pyx_k_Y_j), 0, 1, 0, 0},
  {&__pyx_n_s__213, __pyx_k__213, sizeof(__pyx_k__213), 0, 0, 1, 1},
  {&__pyx_kp_u__8, __pyx_k__8, sizeof(__pyx_k__8), 0, 1, 0, 0},
  {&__pyx_n_s_abscised_fruit_sites, __pyx_k_abscised_fruit_sites, sizeof(__pyx_k_abscised_fruit_sites), 0, 0, 1, 1},
  {&__pyx_n_s_abscised_leaf_weight, __pyx_k_abscised_leaf_weight, sizeof(__pyx_k_abscised_leaf_weight), 0, 0, 1, 1},
  {&__pyx_n_s_acos, __pyx_k_acos, sizeof(__pyx_k_acos), 0, 0, 1, 1},
  {&__pyx_n_s_actual_growth, __pyx_k_actual_growth, sizeof(__pyx_k_actual_growth), 0, 0, 1, 1},
  {&__pyx_n_s_actual_soil_evaporation, __pyx_k_actual_soil_evaporation, sizeof(__pyx_k_actual_soil_evaporation), 0, 0, 1, 1},
  {&__pyx_n_s_actual_transpiration, __pyx_k_actual_transpiration, sizeof(__pyx_k_actual_transpiration), 0, 0, 1, 1},
  {&__pyx_n_s_add_fruiting_branch, __pyx_k_add_fruiting_branch, sizeof(__pyx_k_add_fruiting_branch), 0, 0, 1, 1},
  {&__pyx_n_s_add_vegetative_branch, __pyx_k_add_vegetative_branch, sizeof(__pyx_k_add_vegetative_branch), 0, 0, 1, 1},
  {&__pyx_n_s_addlfn, __pyx_k_addlfn, sizeof(__pyx_k_addlfn), 0, 0, 1, 1},
  {&__pyx_n_s_age, __pyx_k_age, sizeof(__pyx_k_age), 0, 0, 1, 1},
  {&__pyx_n_s_age_of_pre_fruiting_nodes, __pyx_k_age_of_pre_fruiting_nodes, sizeof(__pyx_k_age_of_pre_fruiting_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_agemax, __pyx_k_agemax, sizeof(__pyx_k_agemax), 0, 0, 1, 1},
  {&__pyx_n_s_agetop, __pyx_k_agetop, sizeof(__pyx_k_agetop), 0, 0, 1, 1},
  {&__pyx_n_u_agricultural_inputs, __pyx_k_agricultural_inputs, sizeof(__pyx_k_agricultural_inputs), 0, 1, 0, 1},
  {&__pyx_n_u_air_dry, __pyx_k_air_dry, sizeof(__pyx_k_air_dry), 0, 1, 0, 1},
  {&__pyx_n_s_albedo, __pyx_k_albedo, sizeof(__pyx_k_albedo), 0, 0, 1, 1},
  {&__pyx_n_u_alpha, __pyx_k_alpha, sizeof(__pyx_k_alpha), 0, 1, 0, 1},
  {&__pyx_n_s_ambient_co2_factor, __pyx_k_ambient_co2_factor, sizeof(__pyx_k_ambient_co2_factor), 0, 0, 1, 1},
  {&__pyx_n_u_ammonium, __pyx_k_ammonium, sizeof(__pyx_k_ammonium), 0, 1, 0, 1},
  {&__pyx_n_u_ammonium_nitrogen, __pyx_k_ammonium_nitrogen, sizeof(__pyx_k_ammonium_nitrogen), 0, 1, 0, 1},
  {&__pyx_n_u_amount, __pyx_k_amount, sizeof(__pyx_k_amount), 0, 1, 0, 1},
  {&__pyx_n_s_applied_water, __pyx_k_applied_water, sizeof(__pyx_k_applied_water), 0, 0, 1, 1},
  {&__pyx_n_s_area, __pyx_k_area, sizeof(__pyx_k_area), 0, 0, 1, 1},
  {&__pyx_n_s_asyncio_coroutines, __pyx_k_asyncio_coroutines, sizeof(__pyx_k_asyncio_coroutines), 0, 0, 1, 1},
  {&__pyx_n_s_average_temperature, __pyx_k_average_temperature, sizeof(__pyx_k_average_temperature), 0, 0, 1, 1},
  {&__pyx_n_u_beta, __pyx_k_beta, sizeof(__pyx_k_beta), 0, 1, 0, 1},
  {&__pyx_n_s_bloom_weight_loss, __pyx_k_bloom_weight_loss, sizeof(__pyx_k_bloom_weight_loss), 0, 0, 1, 1},
  {&__pyx_n_s_bmain, __pyx_k_bmain, sizeof(__pyx_k_bmain), 0, 0, 1, 1},
  {&__pyx_n_s_boll, __pyx_k_boll, sizeof(__pyx_k_boll), 0, 0, 1, 1},
  {&__pyx_n_u_bulk_density, __pyx_k_bulk_density, sizeof(__pyx_k_bulk_density), 0, 1, 0, 1},
  {&__pyx_n_s_burr, __pyx_k_burr, sizeof(__pyx_k_burr), 0, 0, 1, 1},
  {&__pyx_n_s_burr_nitrogen, __pyx_k_burr_nitrogen, sizeof(__pyx_k_burr_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
  {&__pyx_n_s_c11, __pyx_k_c11, sizeof(__pyx_k_c11), 0, 0, 1, 1},
  {&__pyx_n_s_calc_light_interception, __pyx_k_calc_light_interception, sizeof(__pyx_k_calc_light_interception), 0, 0, 1, 1},
  {&__pyx_n_s_carbon_stress, __pyx_k_carbon_stress, sizeof(__pyx_k_carbon_stress), 0, 0, 1, 1},
  {&__pyx_n_s_cc, __pyx_k_cc, sizeof(__pyx_k_cc), 0, 0, 1, 1},
  {&__pyx_n_s_cd, __pyx_k_cd, sizeof(__pyx_k_cd), 0, 0, 1, 1},
  {&__pyx_n_s_cdleaf, __pyx_k_cdleaf, sizeof(__pyx_k_cdleaf), 0, 0, 1, 1},
  {&__pyx_n_s_cdpet, __pyx_k_cdpet, sizeof(__pyx_k_cdpet), 0, 0, 1, 1},
  {&__pyx_n_s_cdroot, __pyx_k_cdroot, sizeof(__pyx_k_cdroot), 0, 0, 1, 1},
  {&__pyx_n_s_cdstem, __pyx_k_cdstem, sizeof(__pyx_k_cdstem), 0, 0, 1, 1},
  {&__pyx_n_s_cells, __pyx_k_cells, sizeof(__pyx_k_cells), 0, 0, 1, 1},
  {&__pyx_n_s_class_getitem, __pyx_k_class_getitem, sizeof(__pyx_k_class_getitem), 0, 0, 1, 1},
  {&__pyx_n_u_clay, __pyx_k_clay, sizeof(__pyx_k_clay), 0, 1, 0, 1},
  {&__pyx_n_s_climate, __pyx_k_climate, sizeof(__pyx_k_climate), 0, 0, 1, 1},
  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
  {&__pyx_n_s_cloud_cor, __pyx_k_cloud_cor, sizeof(__pyx_k_cloud_cor), 0, 0, 1, 1},
  {&__pyx_n_s_cloud_cov, __pyx_k_cloud_cov, sizeof(__pyx_k_cloud_cov), 0, 0, 1, 1},
  {&__pyx_n_s_column_shading, __pyx_k_column_shading, sizeof(__pyx_k_column_shading), 0, 0, 1, 1},
  {&__pyx_n_s_compute_day_length, __pyx_k_compute_day_length, sizeof(__pyx_k_compute_day_length), 0, 0, 1, 1},
  {&__pyx_n_s_cos, __pyx_k_cos, sizeof(__pyx_k_cos), 0, 0, 1, 1},
  {&__pyx_n_s_cotton2k_climate, __pyx_k_cotton2k_climate, sizeof(__pyx_k_cotton2k_climate), 0, 0, 1, 1},
  {&__pyx_n_s_cotton2k_leaf, __pyx_k_cotton2k_leaf, sizeof(__pyx_k_cotton2k_leaf), 0, 0, 1, 1},
  {&__pyx_n_s_cotton2k_photosynthesis, __pyx_k_cotton2k_photosynthesis, sizeof(__pyx_k_cotton2k_photosynthesis), 0, 0, 1, 1},
  {&__pyx_n_s_cotton2k_simulation, __pyx_k_cotton2k_simulation, sizeof(__pyx_k_cotton2k_simulation), 0, 0, 1, 1},
  {&__pyx_n_s_cotton2k_utils, __pyx_k_cotton2k_utils, sizeof(__pyx_k_cotton2k_utils), 0, 0, 1, 1},
  {&__pyx_n_s_cotylwt, __pyx_k_cotylwt, sizeof(__pyx_k_cotylwt), 0, 0, 1, 1},
  {&__pyx_n_s_create_first_square, __pyx_k_create_first_square, sizeof(__pyx_k_create_first_square), 0, 0, 1, 1},
  {&__pyx_n_s_cultivar_parameters, __pyx_k_cultivar_parameters, sizeof(__pyx_k_cultivar_parameters), 0, 0, 1, 1},
  {&__pyx_n_s_cumulative_evaporation, __pyx_k_cumulative_evaporation, sizeof(__pyx_k_cumulative_evaporation), 0, 0, 1, 1},
  {&__pyx_n_s_cumulative_nitrogen_loss, __pyx_k_cumulative_nitrogen_loss, sizeof(__pyx_k_cumulative_nitrogen_loss), 0, 0, 1, 1},
  {&__pyx_n_s_cumulative_transpiration, __pyx_k_cumulative_transpiration, sizeof(__pyx_k_cumulative_transpiration), 0, 0, 1, 1},
  {&__pyx_n_s_daily_climate, __pyx_k_daily_climate, sizeof(__pyx_k_daily_climate), 0, 0, 1, 1},
  {&__pyx_n_s_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 0, 1, 1},
  {&__pyx_n_u_date, __pyx_k_date, sizeof(__pyx_k_date), 0, 1, 0, 1},
  {&__pyx_n_s_date2doy, __pyx_k_date2doy, sizeof(__pyx_k_date2doy), 0, 0, 1, 1},
  {&__pyx_n_s_datetime, __pyx_k_datetime, sizeof(__pyx_k_datetime), 0, 0, 1, 1},
  {&__pyx_n_s_day_inc, __pyx_k_day_inc, sizeof(__pyx_k_day_inc), 0, 0, 1, 1},
  {&__pyx_n_s_day_length, __pyx_k_day_length, sizeof(__pyx_k_day_length), 0, 0, 1, 1},
  {&__pyx_n_u_day_length, __pyx_k_day_length, sizeof(__pyx_k_day_length), 0, 1, 0, 1},
  {&__pyx_n_s_daynum, __pyx_k_daynum, sizeof(__pyx_k_daynum), 0, 0, 1, 1},
  {&__pyx_n_s_days_to_first_square, __pyx_k_days_to_first_square, sizeof(__pyx_k_days_to_first_square), 0, 0, 1, 1},
  {&__pyx_n_s_declination, __pyx_k_declination, sizeof(__pyx_k_declination), 0, 0, 1, 1},
  {&__pyx_n_u_declination, __pyx_k_declination, sizeof(__pyx_k_declination), 0, 1, 0, 1},
  {&__pyx_n_s_defoliate, __pyx_k_defoliate, sizeof(__pyx_k_defoliate), 0, 0, 1, 1},
  {&__pyx_kp_u_defoliation_prediction, __pyx_k_defoliation_prediction, sizeof(__pyx_k_defoliation_prediction), 0, 1, 0, 0},
  {&__pyx_n_s_delayFrtByCStress, __pyx_k_delayFrtByCStress, sizeof(__pyx_k_delayFrtByCStress), 0, 0, 1, 1},
  {&__pyx_n_s_delayVegByCStress, __pyx_k_delayVegByCStress, sizeof(__pyx_k_delayVegByCStress), 0, 0, 1, 1},
  {&__pyx_n_s_delay_for_new_branch, __pyx_k_delay_for_new_branch, sizeof(__pyx_k_delay_for_new_branch), 0, 0, 1, 1},
  {&__pyx_n_s_delay_for_new_fruiting_branch, __pyx_k_delay_for_new_fruiting_branch, sizeof(__pyx_k_delay_for_new_fruiting_branch), 0, 0, 1, 1},
  {&__pyx_n_s_delay_for_new_node, __pyx_k_delay_for_new_node, sizeof(__pyx_k_delay_for_new_node), 0, 0, 1, 1},
  {&__pyx_n_s_denf2, __pyx_k_denf2, sizeof(__pyx_k_denf2), 0, 0, 1, 1},
  {&__pyx_n_s_denfac, __pyx_k_denfac, sizeof(__pyx_k_denfac), 0, 0, 1, 1},
  {&__pyx_n_s_density_factor, __pyx_k_density_factor, sizeof(__pyx_k_density_factor), 0, 0, 1, 1},
  {&__pyx_n_u_depth, __pyx_k_depth, sizeof(__pyx_k_depth), 0, 1, 0, 1},
  {&__pyx_n_s_dew_point, __pyx_k_dew_point, sizeof(__pyx_k_dew_point), 0, 0, 1, 1},
  {&__pyx_n_u_dewpoint, __pyx_k_dewpoint, sizeof(__pyx_k_dewpoint), 0, 1, 0, 1},
  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
  {&__pyx_kp_u_disable, __pyx_k_disable, sizeof(__pyx_k_disable), 0, 1, 0, 0},
  {&__pyx_n_s_doc, __pyx_k_doc, sizeof(__pyx_k_doc), 0, 0, 1, 1},
  {&__pyx_n_s_doy2date, __pyx_k_doy2date, sizeof(__pyx_k_doy2date), 0, 0, 1, 1},
  {&__pyx_n_u_drip_depth, __pyx_k_drip_depth, sizeof(__pyx_k_drip_depth), 0, 1, 0, 1},
  {&__pyx_n_u_drip_horizontal_place, __pyx_k_drip_horizontal_place, sizeof(__pyx_k_drip_horizontal_place), 0, 1, 0, 1},
  {&__pyx_n_s_dsbe, __pyx_k_dsbe, sizeof(__pyx_k_dsbe), 0, 0, 1, 1},
  {&__pyx_n_s_dum, __pyx_k_dum, sizeof(__pyx_k_dum), 0, 0, 1, 1},
  {&__pyx_n_s_elevation, __pyx_k_elevation, sizeof(__pyx_k_elevation), 0, 0, 1, 1},
  {&__pyx_kp_u_enable, __pyx_k_enable, sizeof(__pyx_k_enable), 0, 1, 0, 0},
  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
  {&__pyx_n_s_et1, __pyx_k_et1, sizeof(__pyx_k_et1), 0, 0, 1, 1},
  {&__pyx_n_s_et2, __pyx_k_et2, sizeof(__pyx_k_et2), 0, 0, 1, 1},
  {&__pyx_n_s_evapotranspiration, __pyx_k_evapotranspiration, sizeof(__pyx_k_evapotranspiration), 0, 0, 1, 1},
  {&__pyx_n_s_extra_carbon, __pyx_k_extra_carbon, sizeof(__pyx_k_extra_carbon), 0, 0, 1, 1},
  {&__pyx_n_u_fertilization, __pyx_k_fertilization, sizeof(__pyx_k_fertilization), 0, 1, 0, 1},
  {&__pyx_n_u_field_capacity_hydraulic_conduct, __pyx_k_field_capacity_hydraulic_conduct, sizeof(__pyx_k_field_capacity_hydraulic_conduct), 0, 1, 0, 1},
  {&__pyx_n_u_field_capacity_water_potential, __pyx_k_field_capacity_water_potential, sizeof(__pyx_k_field_capacity_water_potential), 0, 1, 0, 1},
  {&__pyx_n_s_first_node, __pyx_k_first_node, sizeof(__pyx_k_first_node), 0, 0, 1, 1},
  {&__pyx_n_s_first_square_leaf_area, __pyx_k_first_square_leaf_area, sizeof(__pyx_k_first_square_leaf_area), 0, 0, 1, 1},
  {&__pyx_n_s_fraction, __pyx_k_fraction, sizeof(__pyx_k_fraction), 0, 0, 1, 1},
  {&__pyx_n_s_fresh_organic_matter, __pyx_k_fresh_organic_matter, sizeof(__pyx_k_fresh_organic_matter), 0, 0, 1, 1},
  {&__pyx_n_s_fruit_growth_ratio, __pyx_k_fruit_growth_ratio, sizeof(__pyx_k_fruit_growth_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_fruiting_branches, __pyx_k_fruiting_branches, sizeof(__pyx_k_fruiting_branches), 0, 0, 1, 1},
  {&__pyx_kp_u_gc, __pyx_k_gc, sizeof(__pyx_k_gc), 0, 1, 0, 0},
  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
  {&__pyx_n_s_get_net_photosynthesis, __pyx_k_get_net_photosynthesis, sizeof(__pyx_k_get_net_photosynthesis), 0, 0, 1, 1},
  {&__pyx_n_s_getattr, __pyx_k_getattr, sizeof(__pyx_k_getattr), 0, 0, 1, 1},
  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
  {&__pyx_n_s_ginning_percent, __pyx_k_ginning_percent, sizeof(__pyx_k_ginning_percent), 0, 0, 1, 1},
  {&__pyx_n_s_green_bolls_burr_weight, __pyx_k_green_bolls_burr_weight, sizeof(__pyx_k_green_bolls_burr_weight), 0, 0, 1, 1},
  {&__pyx_n_s_green_bolls_weight, __pyx_k_green_bolls_weight, sizeof(__pyx_k_green_bolls_weight), 0, 0, 1, 1},
  {&__pyx_n_s_growth, __pyx_k_growth, sizeof(__pyx_k_growth), 0, 0, 1, 1},
  {&__pyx_n_s_growth_factor, __pyx_k_growth_factor, sizeof(__pyx_k_growth_factor), 0, 0, 1, 1},
  {&__pyx_n_s_gsubr, __pyx_k_gsubr, sizeof(__pyx_k_gsubr), 0, 0, 1, 1},
  {&__pyx_n_s_hour, __pyx_k_hour, sizeof(__pyx_k_hour), 0, 0, 1, 1},
  {&__pyx_n_s_hours, __pyx_k_hours, sizeof(__pyx_k_hours), 0, 0, 1, 1},
  {&__pyx_n_s_htdenf, __pyx_k_htdenf, sizeof(__pyx_k_htdenf), 0, 0, 1, 1},
  {&__pyx_n_s_humidity, __pyx_k_humidity, sizeof(__pyx_k_humidity), 0, 0, 1, 1},
  {&__pyx_n_s_hydrology, __pyx_k_hydrology, sizeof(__pyx_k_hydrology), 0, 0, 1, 1},
  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
  {&__pyx_n_s_ihr, __pyx_k_ihr, sizeof(__pyx_k_ihr), 0, 0, 1, 1},
  {&__pyx_n_u_immediate_drainage_water_potenti, __pyx_k_immediate_drainage_water_potenti, sizeof(__pyx_k_immediate_drainage_water_potenti), 0, 1, 0, 1},
  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
  {&__pyx_n_s_init_grid, __pyx_k_init_grid, sizeof(__pyx_k_init_grid), 0, 0, 1, 1},
  {&__pyx_n_s_init_state, __pyx_k_init_state, sizeof(__pyx_k_init_state), 0, 0, 1, 1},
  {&__pyx_n_s_init_subclass, __pyx_k_init_subclass, sizeof(__pyx_k_init_subclass), 0, 0, 1, 1},
  {&__pyx_n_s_initial, __pyx_k_initial, sizeof(__pyx_k_initial), 0, 0, 1, 1},
  {&__pyx_n_u_irrigation, __pyx_k_irrigation, sizeof(__pyx_k_irrigation), 0, 1, 0, 1},
  {&__pyx_n_s_is_coroutine, __pyx_k_is_coroutine, sizeof(__pyx_k_is_coroutine), 0, 0, 1, 1},
  {&__pyx_kp_u_isenabled, __pyx_k_isenabled, sizeof(__pyx_k_isenabled), 0, 1, 0, 0},
  {&__pyx_n_s_items, __pyx_k_items, sizeof(__pyx_k_items), 0, 0, 1, 1},
  {&__pyx_n_s_j, __pyx_k_j, sizeof(__pyx_k_j), 0, 0, 1, 1},
  {&__pyx_n_s_jp1, __pyx_k_jp1, sizeof(__pyx_k_jp1), 0, 0, 1, 1},
  {&__pyx_n_s_k, __pyx_k_k, sizeof(__pyx_k_k), 0, 0, 1, 1},
  {&__pyx_n_s_k0, __pyx_k_k0, sizeof(__pyx_k_k0), 0, 0, 1, 1},
  {&__pyx_n_s_kday, __pyx_k_kday, sizeof(__pyx_k_kday), 0, 0, 1, 1},
  {&__pyx_n_s_keys, __pyx_k_keys, sizeof(__pyx_k_keys), 0, 0, 1, 1},
  {&__pyx_n_s_kkday, __pyx_k_kkday, sizeof(__pyx_k_kkday), 0, 0, 1, 1},
  {&__pyx_n_s_kwargs, __pyx_k_kwargs, sizeof(__pyx_k_kwargs), 0, 0, 1, 1},
  {&__pyx_n_s_l, __pyx_k_l, sizeof(__pyx_k_l), 0, 0, 1, 1},
  {&__pyx_n_s_l1, __pyx_k_l1, sizeof(__pyx_k_l1), 0, 0, 1, 1},
  {&__pyx_n_s_l2, __pyx_k_l2, sizeof(__pyx_k_l2), 0, 0, 1, 1},
  {&__pyx_n_s_last_fruiting_branch, __pyx_k_last_fruiting_branch, sizeof(__pyx_k_last_fruiting_branch), 0, 0, 1, 1},
  {&__pyx_n_s_latitude, __pyx_k_latitude, sizeof(__pyx_k_latitude), 0, 0, 1, 1},
  {&__pyx_n_s_layer_depth, __pyx_k_layer_depth, sizeof(__pyx_k_layer_depth), 0, 0, 1, 1},
  {&__pyx_n_s_layers, __pyx_k_layers, sizeof(__pyx_k_layers), 0, 0, 1, 1},
  {&__pyx_n_u_layers, __pyx_k_layers, sizeof(__pyx_k_layers), 0, 1, 0, 1},
  {&__pyx_n_s_leaf, __pyx_k_leaf, sizeof(__pyx_k_leaf), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_area, __pyx_k_leaf_area, sizeof(__pyx_k_leaf_area), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_area_index, __pyx_k_leaf_area_index, sizeof(__pyx_k_leaf_area_index), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_area_pre_fruiting, __pyx_k_leaf_area_pre_fruiting, sizeof(__pyx_k_leaf_area_pre_fruiting), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_nitrogen, __pyx_k_leaf_nitrogen, sizeof(__pyx_k_leaf_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_nitrogen_concentration, __pyx_k_leaf_nitrogen_concentration, sizeof(__pyx_k_leaf_nitrogen_concentration), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_weight, __pyx_k_leaf_weight, sizeof(__pyx_k_leaf_weight), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_weight_area_ratio, __pyx_k_leaf_weight_area_ratio, sizeof(__pyx_k_leaf_weight_area_ratio), 0, 0, 1, 1},
  {&__pyx_n_s_leaf_weight_pre_fruiting, __pyx_k_leaf_weight_pre_fruiting, sizeof(__pyx_k_leaf_weight_pre_fruiting), 0, 0, 1, 1},
  {&__pyx_n_s_lfint, __pyx_k_lfint, sizeof(__pyx_k_lfint), 0, 0, 1, 1},
  {&__pyx_n_s_light_interception, __pyx_k_light_interception, sizeof(__pyx_k_light_interception), 0, 0, 1, 1},
  {&__pyx_n_s_lint_yield, __pyx_k_lint_yield, sizeof(__pyx_k_lint_yield), 0, 0, 1, 1},
  {&__pyx_n_s_longitude, __pyx_k_longitude, sizeof(__pyx_k_longitude), 0, 0, 1, 1},
  {&__pyx_n_s_lp1, __pyx_k_lp1, sizeof(__pyx_k_lp1), 0, 0, 1, 1},
  {&__pyx_n_s_lyrsol, __pyx_k_lyrsol, sizeof(__pyx_k_lyrsol), 0, 0, 1, 1},
  {&__pyx_n_s_lytres, __pyx_k_lytres, sizeof(__pyx_k_lytres), 0, 0, 1, 1},
  {&__pyx_n_s_m, __pyx_k_m, sizeof(__pyx_k_m), 0, 0, 1, 1},
  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
  {&__pyx_n_s_main_stem_leaf, __pyx_k_main_stem_leaf, sizeof(__pyx_k_main_stem_leaf), 0, 0, 1, 1},
  {&__pyx_n_s_math, __pyx_k_math, sizeof(__pyx_k_math), 0, 0, 1, 1},
  {&__pyx_n_u_max, __pyx_k_max, sizeof(__pyx_k_max), 0, 1, 0, 1},
  {&__pyx_n_u_max_conductivity, __pyx_k_max_conductivity, sizeof(__pyx_k_max_conductivity), 0, 1, 0, 1},
  {&__pyx_n_s_maxrtgr, __pyx_k_maxrtgr, sizeof(__pyx_k_maxrtgr), 0, 0, 1, 1},
  {&__pyx_n_s_maxstmgr, __pyx_k_maxstmgr, sizeof(__pyx_k_maxstmgr), 0, 0, 1, 1},
  {&__pyx_n_s_metaclass, __pyx_k_metaclass, sizeof(__pyx_k_metaclass), 0, 0, 1, 1},
  {&__pyx_n_u_method, __pyx_k_method, sizeof(__pyx_k_method), 0, 1, 0, 1},
  {&__pyx_n_s_microsecond, __pyx_k_microsecond, sizeof(__pyx_k_microsecond), 0, 0, 1, 1},
  {&__pyx_n_u_min, __pyx_k_min, sizeof(__pyx_k_min), 0, 1, 0, 1},
  {&__pyx_n_s_minute, __pyx_k_minute, sizeof(__pyx_k_minute), 0, 0, 1, 1},
  {&__pyx_n_s_module, __pyx_k_module, sizeof(__pyx_k_module), 0, 0, 1, 1},
  {&__pyx_n_s_mp1, __pyx_k_mp1, sizeof(__pyx_k_mp1), 0, 0, 1, 1},
  {&__pyx_n_s_mro_entries, __pyx_k_mro_entries, sizeof(__pyx_k_mro_entries), 0, 0, 1, 1},
  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
  {&__pyx_n_s_net_radiation, __pyx_k_net_radiation, sizeof(__pyx_k_net_radiation), 0, 0, 1, 1},
  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
  {&__pyx_n_s_new_branch, __pyx_k_new_branch, sizeof(__pyx_k_new_branch), 0, 0, 1, 1},
  {&__pyx_n_s_new_node, __pyx_k_new_node, sizeof(__pyx_k_new_node), 0, 0, 1, 1},
  {&__pyx_n_s_new_node_initial_leaf_area, __pyx_k_new_node_initial_leaf_area, sizeof(__pyx_k_new_node_initial_leaf_area), 0, 0, 1, 1},
  {&__pyx_n_s_newbr, __pyx_k_newbr, sizeof(__pyx_k_newbr), 0, 0, 1, 1},
  {&__pyx_n_s_nidmax, __pyx_k_nidmax, sizeof(__pyx_k_nidmax), 0, 0, 1, 1},
  {&__pyx_n_u_nitrate, __pyx_k_nitrate, sizeof(__pyx_k_nitrate), 0, 1, 0, 1},
  {&__pyx_n_u_nitrate_nitrogen, __pyx_k_nitrate_nitrogen, sizeof(__pyx_k_nitrate_nitrogen), 0, 1, 0, 1},
  {&__pyx_n_s_nitrate_nitrogen_content, __pyx_k_nitrate_nitrogen_content, sizeof(__pyx_k_nitrate_nitrogen_content), 0, 0, 1, 1},
  {&__pyx_n_s_nitrogen_stress, __pyx_k_nitrogen_stress, sizeof(__pyx_k_nitrogen_stress), 0, 0, 1, 1},
  {&__pyx_n_s_nitrogen_stress_fruiting, __pyx_k_nitrogen_stress_fruiting, sizeof(__pyx_k_nitrogen_stress_fruiting), 0, 0, 1, 1},
  {&__pyx_n_s_nitrogen_stress_root, __pyx_k_nitrogen_stress_root, sizeof(__pyx_k_nitrogen_stress_root), 0, 0, 1, 1},
  {&__pyx_n_s_nitrogen_stress_vegetative, __pyx_k_nitrogen_stress_vegetative, sizeof(__pyx_k_nitrogen_stress_vegetative), 0, 0, 1, 1},
  {&__pyx_n_s_nodes, __pyx_k_nodes, sizeof(__pyx_k_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_fruiting_branches, __pyx_k_number_of_fruiting_branches, sizeof(__pyx_k_number_of_fruiting_branches), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_fruiting_nodes, __pyx_k_number_of_fruiting_nodes, sizeof(__pyx_k_number_of_fruiting_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_fruiting_sites, __pyx_k_number_of_fruiting_sites, sizeof(__pyx_k_number_of_fruiting_sites), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_green_bolls, __pyx_k_number_of_green_bolls, sizeof(__pyx_k_number_of_green_bolls), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_layers_with_root, __pyx_k_number_of_layers_with_root, sizeof(__pyx_k_number_of_layers_with_root), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_left_columns_with_root, __pyx_k_number_of_left_columns_with_root, sizeof(__pyx_k_number_of_left_columns_with_root), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_open_bolls, __pyx_k_number_of_open_bolls, sizeof(__pyx_k_number_of_open_bolls), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_pre_fruiting_nodes, __pyx_k_number_of_pre_fruiting_nodes, sizeof(__pyx_k_number_of_pre_fruiting_nodes), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_right_columns_with_roo, __pyx_k_number_of_right_columns_with_roo, sizeof(__pyx_k_number_of_right_columns_with_roo), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_squares, __pyx_k_number_of_squares, sizeof(__pyx_k_number_of_squares), 0, 0, 1, 1},
  {&__pyx_n_s_number_of_vegetative_branches, __pyx_k_number_of_vegetative_branches, sizeof(__pyx_k_number_of_vegetative_branches), 0, 0, 1, 1},
  {&__pyx_n_s_nwfl, __pyx_k_nwfl, sizeof(__pyx_k_nwfl), 0, 0, 1, 1},
  {&__pyx_n_s_oldstmwt, __pyx_k_oldstmwt, sizeof(__pyx_k_oldstmwt), 0, 0, 1, 1},
  {&__pyx_n_s_open_bolls_burr_weight, __pyx_k_open_bolls_burr_weight, sizeof(__pyx_k_open_bolls_burr_weight), 0, 0, 1, 1},
  {&__pyx_n_s_open_bolls_weight, __pyx_k_open_bolls_weight, sizeof(__pyx_k_open_bolls_weight), 0, 0, 1, 1},
  {&__pyx_n_u_organic_matter, __pyx_k_organic_matter, sizeof(__pyx_k_organic_matter), 0, 1, 0, 1},
  {&__pyx_n_s_p, __pyx_k_p, sizeof(__pyx_k_p), 0, 0, 1, 1},
  {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
  {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
  {&__pyx_n_s_p3, __pyx_k_p3, sizeof(__pyx_k_p3), 0, 0, 1, 1},
  {&__pyx_n_s_p4, __pyx_k_p4, sizeof(__pyx_k_p4), 0, 0, 1, 1},
  {&__pyx_n_s_p5, __pyx_k_p5, sizeof(__pyx_k_p5), 0, 0, 1, 1},
  {&__pyx_n_s_p6, __pyx_k_p6, sizeof(__pyx_k_p6), 0, 0, 1, 1},
  {&__pyx_n_s_p7, __pyx_k_p7, sizeof(__pyx_k_p7), 0, 0, 1, 1},
  {&__pyx_n_s_perdmax, __pyx_k_perdmax, sizeof(__pyx_k_perdmax), 0, 0, 1, 1},
  {&__pyx_n_s_petiole, __pyx_k_petiole, sizeof(__pyx_k_petiole), 0, 0, 1, 1},
  {&__pyx_n_s_petiole_nitrogen_concentration, __pyx_k_petiole_nitrogen_concentration, sizeof(__pyx_k_petiole_nitrogen_concentration), 0, 0, 1, 1},
  {&__pyx_n_s_petiole_weight, __pyx_k_petiole_weight, sizeof(__pyx_k_petiole_weight), 0, 0, 1, 1},
  {&__pyx_n_s_pex, __pyx_k_pex, sizeof(__pyx_k_pex), 0, 0, 1, 1},
  {&__pyx_n_s_phenology, __pyx_k_phenology, sizeof(__pyx_k_phenology), 0, 0, 1, 1},
  {&__pyx_n_s_pi, __pyx_k_pi, sizeof(__pyx_k_pi), 0, 0, 1, 1},
  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
  {&__pyx_n_s_plant_height, __pyx_k_plant_height, sizeof(__pyx_k_plant_height), 0, 0, 1, 1},
  {&__pyx_n_s_plant_weight, __pyx_k_plant_weight, sizeof(__pyx_k_plant_weight), 0, 0, 1, 1},
  {&__pyx_kp_u_planting_date_or_emergence_date, __pyx_k_planting_date_or_emergence_date, sizeof(__pyx_k_planting_date_or_emergence_date), 0, 1, 0, 0},
  {&__pyx_n_s_pnetcor, __pyx_k_pnetcor, sizeof(__pyx_k_pnetcor), 0, 0, 1, 1},
  {&__pyx_n_s_pollination_switch, __pyx_k_pollination_switch, sizeof(__pyx_k_pollination_switch), 0, 0, 1, 1},
  {&__pyx_n_s_potential_fruit_growth, __pyx_k_potential_fruit_growth, sizeof(__pyx_k_potential_fruit_growth), 0, 0, 1, 1},
  {&__pyx_n_s_potential_growth, __pyx_k_potential_growth, sizeof(__pyx_k_potential_growth), 0, 0, 1, 1},
  {&__pyx_n_s_potential_growth_for_leaf_area, __pyx_k_potential_growth_for_leaf_area, sizeof(__pyx_k_potential_growth_for_leaf_area), 0, 0, 1, 1},
  {&__pyx_n_s_potential_growth_for_leaf_weight, __pyx_k_potential_growth_for_leaf_weight, sizeof(__pyx_k_potential_growth_for_leaf_weight), 0, 0, 1, 1},
  {&__pyx_n_s_potential_growth_for_petiole_wei, __pyx_k_potential_growth_for_petiole_wei, sizeof(__pyx_k_potential_growth_for_petiole_wei), 0, 0, 1, 1},
  {&__pyx_n_s_potential_leaf_growth, __pyx_k_potential_leaf_growth, sizeof(__pyx_k_potential_leaf_growth), 0, 0, 1, 1},
  {&__pyx_n_s_pplant, __pyx_k_pplant, sizeof(__pyx_k_pplant), 0, 0, 1, 1},
  {&__pyx_n_s_prepare, __pyx_k_prepare, sizeof(__pyx_k_prepare), 0, 0, 1, 1},
  {&__pyx_n_s_psilim, __pyx_k_psilim, sizeof(__pyx_k_psilim), 0, 0, 1, 1},
  {&__pyx_n_s_pstand, __pyx_k_pstand, sizeof(__pyx_k_pstand), 0, 0, 1, 1},
  {&__pyx_n_s_ptnfac, __pyx_k_ptnfac, sizeof(__pyx_k_ptnfac), 0, 0, 1, 1},
  {&__pyx_n_s_pts, __pyx_k_pts, sizeof(__pyx_k_pts), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_unpickle_SoilInit, __pyx_k_pyx_unpickle_SoilInit, sizeof(__pyx_k_pyx_unpickle_SoilInit), 0, 0, 1, 1},
  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
  {&__pyx_n_s_qualname, __pyx_k_qualname, sizeof(__pyx_k_qualname), 0, 0, 1, 1},
  {&__pyx_n_s_radiation, __pyx_k_radiation, sizeof(__pyx_k_radiation), 0, 0, 1, 1},
  {&__pyx_n_u_radiation, __pyx_k_radiation, sizeof(__pyx_k_radiation), 0, 1, 0, 1},
  {&__pyx_n_s_radsum, __pyx_k_radsum, sizeof(__pyx_k_radsum), 0, 0, 1, 1},
  {&__pyx_n_u_rain, __pyx_k_rain, sizeof(__pyx_k_rain), 0, 1, 0, 1},
  {&__pyx_n_s_rainToday, __pyx_k_rainToday, sizeof(__pyx_k_rainToday), 0, 0, 1, 1},
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
  {&__pyx_n_s_rate, __pyx_k_rate, sizeof(__pyx_k_rate), 0, 0, 1, 1},
  {&__pyx_n_s_ratebol, __pyx_k_ratebol, sizeof(__pyx_k_ratebol), 0, 0, 1, 1},
  {&__pyx_n_s_ratebur, __pyx_k_ratebur, sizeof(__pyx_k_ratebur), 0, 0, 1, 1},
  {&__pyx_n_s_ratesqr, __pyx_k_ratesqr, sizeof(__pyx_k_ratesqr), 0, 0, 1, 1},
  {&__pyx_n_u_ratio_implicit, __pyx_k_ratio_implicit, sizeof(__pyx_k_ratio_implicit), 0, 1, 0, 1},
  {&__pyx_n_s_rbmax, __pyx_k_rbmax, sizeof(__pyx_k_rbmax), 0, 0, 1, 1},
  {&__pyx_n_s_read_input, __pyx_k_read_input, sizeof(__pyx_k_read_input), 0, 0, 1, 1},
  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
  {&__pyx_n_s_ref_et, __pyx_k_ref_et, sizeof(__pyx_k_ref_et), 0, 0, 1, 1},
  {&__pyx_n_s_replace, __pyx_k_replace, sizeof(__pyx_k_replace), 0, 0, 1, 1},
  {&__pyx_n_s_result, __pyx_k_result, sizeof(__pyx_k_result), 0, 0, 1, 1},
  {&__pyx_n_s_root, __pyx_k_root, sizeof(__pyx_k_root), 0, 0, 1, 1},
  {&__pyx_n_s_root_nitrogen_concentration, __pyx_k_root_nitrogen_concentration, sizeof(__pyx_k_root_nitrogen_concentration), 0, 0, 1, 1},
  {&__pyx_n_s_row_space, __pyx_k_row_space, sizeof(__pyx_k_row_space), 0, 0, 1, 1},
  {&__pyx_n_s_rsubl, __pyx_k_rsubl, sizeof(__pyx_k_rsubl), 0, 0, 1, 1},
  {&__pyx_n_s_rsubo, __pyx_k_rsubo, sizeof(__pyx_k_rsubo), 0, 0, 1, 1},
  {&__pyx_n_s_run, __pyx_k_run, sizeof(__pyx_k_run), 0, 0, 1, 1},
  {&__pyx_n_s_runoff, __pyx_k_runoff, sizeof(__pyx_k_runoff), 0, 0, 1, 1},
  {&__pyx_n_s_runoffToday, __pyx_k_runoffToday, sizeof(__pyx_k_runoffToday), 0, 0, 1, 1},
  {&__pyx_n_u_sand, __pyx_k_sand, sizeof(__pyx_k_sand), 0, 1, 0, 1},
  {&__pyx_n_u_saturated_hydraulic_conductivity, __pyx_k_saturated_hydraulic_conductivity, sizeof(__pyx_k_saturated_hydraulic_conductivity), 0, 1, 0, 1},
  {&__pyx_n_s_sd, __pyx_k_sd, sizeof(__pyx_k_sd), 0, 0, 1, 1},
  {&__pyx_n_s_second, __pyx_k_second, sizeof(__pyx_k_second), 0, 0, 1, 1},
  {&__pyx_n_s_seed_nitrogen, __pyx_k_seed_nitrogen, sizeof(__pyx_k_seed_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_s_seed_nitrogen_concentration, __pyx_k_seed_nitrogen_concentration, sizeof(__pyx_k_seed_nitrogen_concentration), 0, 0, 1, 1},
  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
  {&__pyx_kp_s_self___cannot_be_converted_to_a, __pyx_k_self___cannot_be_converted_to_a, sizeof(__pyx_k_self___cannot_be_converted_to_a), 0, 0, 1, 0},
  {&__pyx_kp_s_self_climate_cannot_be_converted, __pyx_k_self_climate_cannot_be_converted, sizeof(__pyx_k_self_climate_cannot_be_converted), 0, 0, 1, 0},
  {&__pyx_n_s_set_name, __pyx_k_set_name, sizeof(__pyx_k_set_name), 0, 0, 1, 1},
  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
  {&__pyx_n_s_shade, __pyx_k_shade, sizeof(__pyx_k_shade), 0, 0, 1, 1},
  {&__pyx_n_s_simulate, __pyx_k_simulate, sizeof(__pyx_k_simulate), 0, 0, 1, 1},
  {&__pyx_n_s_simulate_this_day, __pyx_k_simulate_this_day, sizeof(__pyx_k_simulate_this_day), 0, 0, 1, 1},
  {&__pyx_n_s_sin, __pyx_k_sin, sizeof(__pyx_k_sin), 0, 0, 1, 1},
  {&__pyx_n_s_sinb, __pyx_k_sinb, sizeof(__pyx_k_sinb), 0, 0, 1, 1},
  {&__pyx_n_s_smax, __pyx_k_smax, sizeof(__pyx_k_smax), 0, 0, 1, 1},
  {&__pyx_n_s_smaxx, __pyx_k_smaxx, sizeof(__pyx_k_smaxx), 0, 0, 1, 1},
  {&__pyx_n_s_soil, __pyx_k_soil, sizeof(__pyx_k_soil), 0, 0, 1, 1},
  {&__pyx_n_s_solar_noon, __pyx_k_solar_noon, sizeof(__pyx_k_solar_noon), 0, 0, 1, 1},
  {&__pyx_n_u_solar_noon, __pyx_k_solar_noon, sizeof(__pyx_k_solar_noon), 0, 1, 0, 1},
  {&__pyx_n_s_sqrt, __pyx_k_sqrt, sizeof(__pyx_k_sqrt), 0, 0, 1, 1},
  {&__pyx_n_s_square, __pyx_k_square, sizeof(__pyx_k_square), 0, 0, 1, 1},
  {&__pyx_n_s_square_nitrogen, __pyx_k_square_nitrogen, sizeof(__pyx_k_square_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_s_square_nitrogen_concentration, __pyx_k_square_nitrogen_concentration, sizeof(__pyx_k_square_nitrogen_concentration), 0, 0, 1, 1},
  {&__pyx_n_s_square_weight, __pyx_k_square_weight, sizeof(__pyx_k_square_weight), 0, 0, 1, 1},
  {&__pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_k_src__cotton2k_simulation_pyx, sizeof(__pyx_k_src__cotton2k_simulation_pyx), 0, 0, 1, 0},
  {&__pyx_n_s_stage, __pyx_k_stage, sizeof(__pyx_k_stage), 0, 0, 1, 1},
  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
  {&__pyx_n_s_start_date, __pyx_k_start_date, sizeof(__pyx_k_start_date), 0, 0, 1, 1},
  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
  {&__pyx_n_s_state0, __pyx_k_state0, sizeof(__pyx_k_state0), 0, 0, 1, 1},
  {&__pyx_n_s_stemNRatio, __pyx_k_stemNRatio, sizeof(__pyx_k_stemNRatio), 0, 0, 1, 1},
  {&__pyx_n_s_stem_nitrogen, __pyx_k_stem_nitrogen, sizeof(__pyx_k_stem_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_s_stem_weight, __pyx_k_stem_weight, sizeof(__pyx_k_stem_weight), 0, 0, 1, 1},
  {&__pyx_n_s_stemnew, __pyx_k_stemnew, sizeof(__pyx_k_stemnew), 0, 0, 1, 1},
  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
  {&__pyx_n_s_stress, __pyx_k_stress, sizeof(__pyx_k_stress), 0, 0, 1, 1},
  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
  {&__pyx_n_s_strptime, __pyx_k_strptime, sizeof(__pyx_k_strptime), 0, 0, 1, 1},
  {&__pyx_n_s_sumpdr, __pyx_k_sumpdr, sizeof(__pyx_k_sumpdr), 0, 0, 1, 1},
  {&__pyx_n_s_sumwk, __pyx_k_sumwk, sizeof(__pyx_k_sumwk), 0, 0, 1, 1},
  {&__pyx_n_s_sunr, __pyx_k_sunr, sizeof(__pyx_k_sunr), 0, 0, 1, 1},
  {&__pyx_n_u_sunr, __pyx_k_sunr, sizeof(__pyx_k_sunr), 0, 1, 0, 1},
  {&__pyx_n_s_suns, __pyx_k_suns, sizeof(__pyx_k_suns), 0, 0, 1, 1},
  {&__pyx_n_u_suns, __pyx_k_suns, sizeof(__pyx_k_suns), 0, 1, 0, 1},
  {&__pyx_n_s_super, __pyx_k_super, sizeof(__pyx_k_super), 0, 0, 1, 1},
  {&__pyx_n_s_sw, __pyx_k_sw, sizeof(__pyx_k_sw), 0, 0, 1, 1},
  {&__pyx_n_s_sw0, __pyx_k_sw0, sizeof(__pyx_k_sw0), 0, 0, 1, 1},
  {&__pyx_n_s_sw1, __pyx_k_sw1, sizeof(__pyx_k_sw1), 0, 0, 1, 1},
  {&__pyx_n_s_t1, __pyx_k_t1, sizeof(__pyx_k_t1), 0, 0, 1, 1},
  {&__pyx_n_s_t2, __pyx_k_t2, sizeof(__pyx_k_t2), 0, 0, 1, 1},
  {&__pyx_n_s_t3, __pyx_k_t3, sizeof(__pyx_k_t3), 0, 0, 1, 1},
  {&__pyx_n_s_tav, __pyx_k_tav, sizeof(__pyx_k_tav), 0, 0, 1, 1},
  {&__pyx_n_s_tdday, __pyx_k_tdday, sizeof(__pyx_k_tdday), 0, 0, 1, 1},
  {&__pyx_n_s_temperature, __pyx_k_temperature, sizeof(__pyx_k_temperature), 0, 0, 1, 1},
  {&__pyx_n_s_temperature_on_leaf_growth_rate, __pyx_k_temperature_on_leaf_growth_rate, sizeof(__pyx_k_temperature_on_leaf_growth_rate), 0, 0, 1, 1},
  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
  {&__pyx_n_s_tfrt, __pyx_k_tfrt, sizeof(__pyx_k_tfrt), 0, 0, 1, 1},
  {&__pyx_n_u_theta, __pyx_k_theta, sizeof(__pyx_k_theta), 0, 1, 0, 1},
  {&__pyx_n_s_ti, __pyx_k_ti, sizeof(__pyx_k_ti), 0, 0, 1, 1},
  {&__pyx_n_s_time_to_new_fruiting_branch, __pyx_k_time_to_new_fruiting_branch, sizeof(__pyx_k_time_to_new_fruiting_branch), 0, 0, 1, 1},
  {&__pyx_n_s_timedelta, __pyx_k_timedelta, sizeof(__pyx_k_timedelta), 0, 0, 1, 1},
  {&__pyx_n_s_tmpisr, __pyx_k_tmpisr, sizeof(__pyx_k_tmpisr), 0, 0, 1, 1},
  {&__pyx_n_u_tmpisr, __pyx_k_tmpisr, sizeof(__pyx_k_tmpisr), 0, 1, 0, 1},
  {&__pyx_n_s_total_required_nitrogen, __pyx_k_total_required_nitrogen, sizeof(__pyx_k_total_required_nitrogen), 0, 0, 1, 1},
  {&__pyx_n_u_type, __pyx_k_type, sizeof(__pyx_k_type), 0, 1, 0, 1},
  {&__pyx_n_s_u, __pyx_k_u, sizeof(__pyx_k_u), 0, 0, 1, 1},
  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
  {&__pyx_n_u_urea, __pyx_k_urea, sizeof(__pyx_k_urea), 0, 1, 0, 1},
  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
  {&__pyx_n_s_vegetative_branch, __pyx_k_vegetative_branch, sizeof(__pyx_k_vegetative_branch), 0, 0, 1, 1},
  {&__pyx_n_s_vegetative_branches, __pyx_k_vegetative_branches, sizeof(__pyx_k_vegetative_branches), 0, 0, 1, 1},
  {&__pyx_n_s_version, __pyx_k_version, sizeof(__pyx_k_version), 0, 0, 1, 1},
  {&__pyx_n_s_vfrtbr, __pyx_k_vfrtbr, sizeof(__pyx_k_vfrtbr), 0, 0, 1, 1},
  {&__pyx_n_s_voldstm, __pyx_k_voldstm, sizeof(__pyx_k_voldstm), 0, 0, 1, 1},
  {&__pyx_n_s_vpheno, __pyx_k_vpheno, sizeof(__pyx_k_vpheno), 0, 0, 1, 1},
  {&__pyx_n_s_vpnet, __pyx_k_vpnet, sizeof(__pyx_k_vpnet), 0, 0, 1, 1},
  {&__pyx_n_s_vpotfrt, __pyx_k_vpotfrt, sizeof(__pyx_k_vpotfrt), 0, 0, 1, 1},
  {&__pyx_n_s_vpotlf, __pyx_k_vpotlf, sizeof(__pyx_k_vpotlf), 0, 0, 1, 1},
  {&__pyx_n_s_vpvegb, __pyx_k_vpvegb, sizeof(__pyx_k_vpvegb), 0, 0, 1, 1},
  {&__pyx_n_s_vstrs, __pyx_k_vstrs, sizeof(__pyx_k_vstrs), 0, 0, 1, 1},
  {&__pyx_n_u_water, __pyx_k_water, sizeof(__pyx_k_water), 0, 1, 0, 1},
  {&__pyx_n_s_water_stress, __pyx_k_water_stress, sizeof(__pyx_k_water_stress), 0, 0, 1, 1},
  {&__pyx_n_s_water_stress_stem, __pyx_k_water_stress_stem, sizeof(__pyx_k_water_stress_stem), 0, 0, 1, 1},
  {&__pyx_n_s_wattsm, __pyx_k_wattsm, sizeof(__pyx_k_wattsm), 0, 0, 1, 1},
  {&__pyx_n_s_wbmax, __pyx_k_wbmax, sizeof(__pyx_k_wbmax), 0, 0, 1, 1},
  {&__pyx_n_s_weight, __pyx_k_weight, sizeof(__pyx_k_weight), 0, 0, 1, 1},
  {&__pyx_n_s_weight_capable_uptake, __pyx_k_weight_capable_uptake, sizeof(__pyx_k_weight_capable_uptake), 0, 0, 1, 1},
  {&__pyx_n_s_wfdb, __pyx_k_wfdb, sizeof(__pyx_k_wfdb), 0, 0, 1, 1},
  {&__pyx_n_u_wind, __pyx_k_wind, sizeof(__pyx_k_wind), 0, 1, 0, 1},
  {&__pyx_n_s_wind_speed, __pyx_k_wind_speed, sizeof(__pyx_k_wind_speed), 0, 0, 1, 1},
  {&__pyx_n_s_wnytf, __pyx_k_wnytf, sizeof(__pyx_k_wnytf), 0, 0, 1, 1},
  {&__pyx_n_s_wstrlf, __pyx_k_wstrlf, sizeof(__pyx_k_wstrlf), 0, 0, 1, 1},
  {&__pyx_n_s_wtfstrs, __pyx_k_wtfstrs, sizeof(__pyx_k_wtfstrs), 0, 0, 1, 1},
  {&__pyx_n_s_xlat, __pyx_k_xlat, sizeof(__pyx_k_xlat), 0, 0, 1, 1},
  {&__pyx_n_s_year, __pyx_k_year, sizeof(__pyx_k_year), 0, 0, 1, 1},
  {&__pyx_n_s_z1, __pyx_k_z1, sizeof(__pyx_k_z1), 0, 0, 1, 1},
  {&__pyx_n_s_zero, __pyx_k_zero, sizeof(__pyx_k_zero), 0, 0, 1, 1},
  {&__pyx_n_s_zint, __pyx_k_zint, sizeof(__pyx_k_zint), 0, 0, 1, 1},
  #endif
  {0, 0, 0, 0, 0, 0, 0}
};
/* #### Code section: cached_builtins ### */
static CYTHON_SMALL_CODE int __Pyx_InitCachedBuiltins(void) {
  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(0, 50, __pyx_L1_error)
  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(0, 108, __pyx_L1_error)
  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 113, __pyx_L1_error)
  __pyx_builtin_StopIteration = __Pyx_GetBuiltinName(__pyx_n_s_StopIteration); if (!__pyx_builtin_StopIteration) __PYX_ERR(0, 223, __pyx_L1_error)
  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(1, 2, __pyx_L1_error)
  __pyx_builtin_OverflowError = __Pyx_GetBuiltinName(__pyx_n_s_OverflowError); if (!__pyx_builtin_OverflowError) __PYX_ERR(1, 83, __pyx_L1_error)
  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(1, 96, __pyx_L1_error)
  __pyx_builtin_KeyError = __Pyx_GetBuiltinName(__pyx_n_s_KeyError); if (!__pyx_builtin_KeyError) __PYX_ERR(1, 19, __pyx_L1_error)
  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(1, 20, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: cached_constants ### */

static CYTHON_SMALL_CODE int __Pyx_InitCachedConstants(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);

  /* "_cotton2k/simulation.pyx":67
 *     if sim.day_emerge <= 0:
 *         if sim.day_plant <= 0:
 *             raise Exception(             # <<<<<<<<<<<<<<
 *                 " planting date or emergence date must be given in the profile file !!")
 *         isw = 0
 */
  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_u_planting_date_or_emergence_date); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 67, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple_);
  __Pyx_GIVEREF(__pyx_tuple_);

  /* "_cotton2k/simulation.pyx":235
 *             irrigation.day = date2doy(i["date"])  # day of year of this irrigation
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip             # <<<<<<<<<<<<<<
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm
 */
  __pyx_tuple__2 = PyTuple_Pack(2, __pyx_n_u_method, __pyx_int_0); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 235, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__2);
  __Pyx_GIVEREF(__pyx_tuple__2);

  /* "_cotton2k/simulation.pyx":236
 *             irrigation.amount = i["amount"]  # net amount of water applied, mm
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm             # <<<<<<<<<<<<<<
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm
 *             # If this is a drip irrigation, convert distances to soil
 */
  __pyx_tuple__3 = PyTuple_Pack(2, __pyx_n_u_drip_horizontal_place, __pyx_int_0); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(0, 236, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__3);
  __Pyx_GIVEREF(__pyx_tuple__3);

  /* "_cotton2k/simulation.pyx":237
 *             irrigation.method = i.get("method", 0)  # method of irrigation: 1=  2=drip
 *             isdhrz = i.get("drip_horizontal_place", 0)  # horizontal placement cm
 *             isddph = i.get("drip_depth", 0)  # vertical placement cm             # <<<<<<<<<<<<<<
 *             # If this is a drip irrigation, convert distances to soil
 *             # layer and column numbers by calling SlabLoc.
 */
  __pyx_tuple__4 = PyTuple_Pack(2, __pyx_n_u_drip_depth, __pyx_int_0); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(0, 237, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__4);
  __Pyx_GIVEREF(__pyx_tuple__4);

  /* "_cotton2k/simulation.pyx":247
 *         elif i["type"] == "fertilization":
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)             # <<<<<<<<<<<<<<
 *             nf.amtnit = i.get("nitrate", 0)
 *             nf.amtura = i.get("urea", 0)
 */
  __pyx_tuple__5 = PyTuple_Pack(2, __pyx_n_u_ammonium, __pyx_int_0); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(0, 247, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__5);
  __Pyx_GIVEREF(__pyx_tuple__5);

  /* "_cotton2k/simulation.pyx":248
 *             nf.day = date2doy(i["date"])
 *             nf.amtamm = i.get("ammonium", 0)
 *             nf.amtnit = i.get("nitrate", 0)             # <<<<<<<<<<<<<<
 *             nf.amtura = i.get("urea", 0)
 *             nf.mthfrt = i.get("method", 0)
 */
  __pyx_tuple__6 = PyTuple_Pack(2, __pyx_n_u_nitrate, __pyx_int_0); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(0, 248, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__6);
  __Pyx_GIVEREF(__pyx_tuple__6);

  /* "_cotton2k/simulation.pyx":249
 *             nf.amtamm = i.get("ammonium", 0)
 *             nf.amtnit = i.get("nitrate", 0)
 *             nf.amtura = i.get("urea", 0)             # <<<<<<<<<<<<<<
 *             nf.mthfrt = i.get("method", 0)
 *             isdhrz = i.get("drip_horizontal_place",
 */
  __pyx_tuple__7 = PyTuple_Pack(2, __pyx_n_u_urea, __pyx_int_0); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(0, 249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__7);
  __Pyx_GIVEREF(__pyx_tuple__7);

  /* "_cotton2k/simulation.pyx":958
 *         AverageLwpMin += (LwpMin - LwpMinX[2]) / 3
 *         AverageLwp += (LwpMin + LwpMax - LwpX[2]) / 3
 *         for i in (2, 1):             # <<<<<<<<<<<<<<
 *             LwpMinX[i] = LwpMinX[i - 1]
 *             LwpX[i] = LwpX[i - 1]
 */
  __pyx_tuple__9 = PyTuple_Pack(2, __pyx_int_2, __pyx_int_1); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(0, 958, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__9);
  __Pyx_GIVEREF(__pyx_tuple__9);

  /* "FromPyStructUtility":20
 *         value = obj['leaf_area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area'")             # <<<<<<<<<<<<<<
 *     result.leaf_area = value
 *     try:
 */
  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__10);
  __Pyx_GIVEREF(__pyx_tuple__10);

  /* "FromPyStructUtility":25
 *         value = obj['leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight = value
 *     try:
 */
  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_2); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__11);
  __Pyx_GIVEREF(__pyx_tuple__11);

  /* "FromPyStructUtility":30
 *         value = obj['petiole_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_weight'")             # <<<<<<<<<<<<<<
 *     result.petiole_weight = value
 *     try:
 */
  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_3); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__12);
  __Pyx_GIVEREF(__pyx_tuple__12);

  /* "FromPyStructUtility":35
 *         value = obj['potential_growth_for_leaf_area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_area'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_leaf_area = value
 *     try:
 */
  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_4); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__13);
  __Pyx_GIVEREF(__pyx_tuple__13);

  /* "FromPyStructUtility":40
 *         value = obj['potential_growth_for_leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_leaf_weight = value
 *     try:
 */
  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_5); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__14);
  __Pyx_GIVEREF(__pyx_tuple__14);

  /* "FromPyStructUtility":45
 *         value = obj['potential_growth_for_petiole_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth_for_petiole_weight'")             # <<<<<<<<<<<<<<
 *     result.potential_growth_for_petiole_weight = value
 *     return result
 */
  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_6); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__15);
  __Pyx_GIVEREF(__pyx_tuple__15);

  /* "FromPyStructUtility":20
 *         value = obj['age']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age'")             # <<<<<<<<<<<<<<
 *     result.age = value
 *     try:
 */
  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_7); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__16);
  __Pyx_GIVEREF(__pyx_tuple__16);

  /* "FromPyStructUtility":25
 *         value = obj['potential_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'potential_growth'")             # <<<<<<<<<<<<<<
 *     result.potential_growth = value
 *     try:
 */
  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_8); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__17);
  __Pyx_GIVEREF(__pyx_tuple__17);

  /* "FromPyStructUtility":30
 *         value = obj['area']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'area'")             # <<<<<<<<<<<<<<
 *     result.area = value
 *     try:
 */
  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_9); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__18);
  __Pyx_GIVEREF(__pyx_tuple__18);

  /* "FromPyStructUtility":35
 *         value = obj['weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight'")             # <<<<<<<<<<<<<<
 *     result.weight = value
 *     return result
 */
  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_10); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__19);
  __Pyx_GIVEREF(__pyx_tuple__19);

  /* "FromPyStructUtility":25
 *         value = obj['fraction']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fraction'")             # <<<<<<<<<<<<<<
 *     result.fraction = value
 *     try:
 */
  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_11); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__20);
  __Pyx_GIVEREF(__pyx_tuple__20);

  /* "FromPyStructUtility":30
 *         value = obj['average_temperature']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'average_temperature'")             # <<<<<<<<<<<<<<
 *     result.average_temperature = value
 *     try:
 */
  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_12); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__21);
  __Pyx_GIVEREF(__pyx_tuple__21);

  /* "FromPyStructUtility":35
 *         value = obj['ginning_percent']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ginning_percent'")             # <<<<<<<<<<<<<<
 *     result.ginning_percent = value
 *     try:
 */
  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_13); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__22);
  __Pyx_GIVEREF(__pyx_tuple__22);

  /* "FromPyStructUtility":40
 *         value = obj['stage']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stage'")             # <<<<<<<<<<<<<<
 *     result.stage = value
 *     try:
 */
  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_14); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__23);
  __Pyx_GIVEREF(__pyx_tuple__23);

  /* "FromPyStructUtility":45
 *         value = obj['leaf']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf'")             # <<<<<<<<<<<<<<
 *     result.leaf = value
 *     try:
 */
  __pyx_tuple__24 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_15); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__24);
  __Pyx_GIVEREF(__pyx_tuple__24);

  /* "FromPyStructUtility":50
 *         value = obj['square']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square'")             # <<<<<<<<<<<<<<
 *     result.square = value
 *     try:
 */
  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_16); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__25);
  __Pyx_GIVEREF(__pyx_tuple__25);

  /* "FromPyStructUtility":55
 *         value = obj['boll']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'boll'")             # <<<<<<<<<<<<<<
 *     result.boll = value
 *     try:
 */
  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_17); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__26);
  __Pyx_GIVEREF(__pyx_tuple__26);

  /* "FromPyStructUtility":60
 *         value = obj['burr']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr'")             # <<<<<<<<<<<<<<
 *     result.burr = value
 *     try:
 */
  __pyx_tuple__27 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_18); if (unlikely(!__pyx_tuple__27)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__27);
  __Pyx_GIVEREF(__pyx_tuple__27);

  /* "FromPyStructUtility":65
 *         value = obj['petiole']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole'")             # <<<<<<<<<<<<<<
 *     result.petiole = value
 *     return result
 */
  __pyx_tuple__28 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_19); if (unlikely(!__pyx_tuple__28)) __PYX_ERR(1, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__28);
  __Pyx_GIVEREF(__pyx_tuple__28);

  /* "FromPyStructUtility":20
 *         value = obj['number_of_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_nodes = value
 *     try:
 */
  __pyx_tuple__29 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_20); if (unlikely(!__pyx_tuple__29)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__29);
  __Pyx_GIVEREF(__pyx_tuple__29);

  /* "FromPyStructUtility":25
 *         value = obj['delay_for_new_node']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_node'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_node = value
 *     try:
 */
  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_21); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__30);
  __Pyx_GIVEREF(__pyx_tuple__30);

  /* "FromPyStructUtility":30
 *         value = obj['main_stem_leaf']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'main_stem_leaf'")             # <<<<<<<<<<<<<<
 *     result.main_stem_leaf = value
 *     try:
 */
  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_22); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__31);
  __Pyx_GIVEREF(__pyx_tuple__31);

  /* "FromPyStructUtility":35
 *         value = obj['nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nodes'")             # <<<<<<<<<<<<<<
 *     result.nodes = value
 *     return result
 */
  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_23); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__32);
  __Pyx_GIVEREF(__pyx_tuple__32);

  /* "FromPyStructUtility":20
 *         value = obj['number_of_fruiting_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_branches'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_branches = value
 *     try:
 */
  __pyx_tuple__33 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_24); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__33);
  __Pyx_GIVEREF(__pyx_tuple__33);

  /* "FromPyStructUtility":25
 *         value = obj['delay_for_new_fruiting_branch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_fruiting_branch'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_fruiting_branch = value
 *     try:
 */
  __pyx_tuple__34 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_25); if (unlikely(!__pyx_tuple__34)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__34);
  __Pyx_GIVEREF(__pyx_tuple__34);

  /* "FromPyStructUtility":30
 *         value = obj['fruiting_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruiting_branches'")             # <<<<<<<<<<<<<<
 *     result.fruiting_branches = value
 *     return result
 */
  __pyx_tuple__35 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_26); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__35);
  __Pyx_GIVEREF(__pyx_tuple__35);

  /* "FromPyStructUtility":20
 *         value = obj['temperature']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'temperature'")             # <<<<<<<<<<<<<<
 *     result.temperature = value
 *     try:
 */
  __pyx_tuple__36 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_27); if (unlikely(!__pyx_tuple__36)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__36);
  __Pyx_GIVEREF(__pyx_tuple__36);

  /* "FromPyStructUtility":25
 *         value = obj['radiation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'radiation'")             # <<<<<<<<<<<<<<
 *     result.radiation = value
 *     try:
 */
  __pyx_tuple__37 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_28); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__37);
  __Pyx_GIVEREF(__pyx_tuple__37);

  /* "FromPyStructUtility":30
 *         value = obj['cloud_cov']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cov'")             # <<<<<<<<<<<<<<
 *     result.cloud_cov = value
 *     try:
 */
  __pyx_tuple__38 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_29); if (unlikely(!__pyx_tuple__38)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__38);
  __Pyx_GIVEREF(__pyx_tuple__38);

  /* "FromPyStructUtility":35
 *         value = obj['cloud_cor']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cloud_cor'")             # <<<<<<<<<<<<<<
 *     result.cloud_cor = value
 *     try:
 */
  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_30); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__39);
  __Pyx_GIVEREF(__pyx_tuple__39);

  /* "FromPyStructUtility":40
 *         value = obj['et1']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et1'")             # <<<<<<<<<<<<<<
 *     result.et1 = value
 *     try:
 */
  __pyx_tuple__40 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_31); if (unlikely(!__pyx_tuple__40)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__40);
  __Pyx_GIVEREF(__pyx_tuple__40);

  /* "FromPyStructUtility":45
 *         value = obj['et2']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'et2'")             # <<<<<<<<<<<<<<
 *     result.et2 = value
 *     try:
 */
  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_32); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__41);
  __Pyx_GIVEREF(__pyx_tuple__41);

  /* "FromPyStructUtility":50
 *         value = obj['ref_et']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'ref_et'")             # <<<<<<<<<<<<<<
 *     result.ref_et = value
 *     try:
 */
  __pyx_tuple__42 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_33); if (unlikely(!__pyx_tuple__42)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__42);
  __Pyx_GIVEREF(__pyx_tuple__42);

  /* "FromPyStructUtility":55
 *         value = obj['wind_speed']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'wind_speed'")             # <<<<<<<<<<<<<<
 *     result.wind_speed = value
 *     try:
 */
  __pyx_tuple__43 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_34); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__43);
  __Pyx_GIVEREF(__pyx_tuple__43);

  /* "FromPyStructUtility":60
 *         value = obj['dew_point']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'dew_point'")             # <<<<<<<<<<<<<<
 *     result.dew_point = value
 *     try:
 */
  __pyx_tuple__44 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_35); if (unlikely(!__pyx_tuple__44)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__44);
  __Pyx_GIVEREF(__pyx_tuple__44);

  /* "FromPyStructUtility":65
 *         value = obj['humidity']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'humidity'")             # <<<<<<<<<<<<<<
 *     result.humidity = value
 *     try:
 */
  __pyx_tuple__45 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_36); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__45);
  __Pyx_GIVEREF(__pyx_tuple__45);

  /* "FromPyStructUtility":70
 *         value = obj['albedo']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'albedo'")             # <<<<<<<<<<<<<<
 *     result.albedo = value
 *     return result
 */
  __pyx_tuple__46 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_37); if (unlikely(!__pyx_tuple__46)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__46);
  __Pyx_GIVEREF(__pyx_tuple__46);

  /* "FromPyStructUtility":20
 *         value = obj['number_of_left_columns_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_left_columns_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_left_columns_with_root = value
 *     try:
 */
  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_38); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__47);
  __Pyx_GIVEREF(__pyx_tuple__47);

  /* "FromPyStructUtility":25
 *         value = obj['number_of_right_columns_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_right_columns_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_right_columns_with_root = value
 *     return result
 */
  __pyx_tuple__48 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_39); if (unlikely(!__pyx_tuple__48)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__48);
  __Pyx_GIVEREF(__pyx_tuple__48);
  __pyx_tuple__49 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_40); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__49);
  __Pyx_GIVEREF(__pyx_tuple__49);

  /* "FromPyStructUtility":30
 *         value = obj['actual_growth']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_growth'")             # <<<<<<<<<<<<<<
 *     result.actual_growth = value
 *     try:
 */
  __pyx_tuple__50 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_41); if (unlikely(!__pyx_tuple__50)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__50);
  __Pyx_GIVEREF(__pyx_tuple__50);

  /* "FromPyStructUtility":40
 *         value = obj['weight_capable_uptake']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'weight_capable_uptake'")             # <<<<<<<<<<<<<<
 *     result.weight_capable_uptake = value
 *     try:
 */
  __pyx_tuple__51 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_42); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__51);
  __Pyx_GIVEREF(__pyx_tuple__51);

  /* "FromPyStructUtility":20
 *         value = obj['nitrate_nitrogen_content']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrate_nitrogen_content'")             # <<<<<<<<<<<<<<
 *     result.nitrate_nitrogen_content = value
 *     try:
 */
  __pyx_tuple__52 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_43); if (unlikely(!__pyx_tuple__52)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__52);
  __Pyx_GIVEREF(__pyx_tuple__52);

  /* "FromPyStructUtility":25
 *         value = obj['fresh_organic_matter']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fresh_organic_matter'")             # <<<<<<<<<<<<<<
 *     result.fresh_organic_matter = value
 *     try:
 */
  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_44); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__53);
  __Pyx_GIVEREF(__pyx_tuple__53);

  /* "FromPyStructUtility":30
 *         value = obj['root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root'")             # <<<<<<<<<<<<<<
 *     result.root = value
 *     return result
 */
  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_45); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__54);
  __Pyx_GIVEREF(__pyx_tuple__54);

  /* "FromPyStructUtility":20
 *         value = obj['number_of_layers_with_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_layers_with_root'")             # <<<<<<<<<<<<<<
 *     result.number_of_layers_with_root = value
 *     try:
 */
  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_46); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__55);
  __Pyx_GIVEREF(__pyx_tuple__55);

  /* "FromPyStructUtility":25
 *         value = obj['layers']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'layers'")             # <<<<<<<<<<<<<<
 *     result.layers = value
 *     try:
 */
  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_47); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__56);
  __Pyx_GIVEREF(__pyx_tuple__56);

  /* "FromPyStructUtility":30
 *         value = obj['cells']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cells'")             # <<<<<<<<<<<<<<
 *     result.cells = value
 *     return result
 */
  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_48); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__57);
  __Pyx_GIVEREF(__pyx_tuple__57);

  /* "FromPyStructUtility":20
 *         value = obj['daynum']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'daynum'")             # <<<<<<<<<<<<<<
 *     result.daynum = value
 *     try:
 */
  __pyx_tuple__58 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_49); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__58);
  __Pyx_GIVEREF(__pyx_tuple__58);

  /* "FromPyStructUtility":25
 *         value = obj['kday']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'kday'")             # <<<<<<<<<<<<<<
 *     result.kday = value
 *     try:
 */
  __pyx_tuple__59 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_50); if (unlikely(!__pyx_tuple__59)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__59);
  __Pyx_GIVEREF(__pyx_tuple__59);

  /* "FromPyStructUtility":30
 *         value = obj['day_inc']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_inc'")             # <<<<<<<<<<<<<<
 *     result.day_inc = value
 *     try:
 */
  __pyx_tuple__60 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_51); if (unlikely(!__pyx_tuple__60)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__60);
  __Pyx_GIVEREF(__pyx_tuple__60);

  /* "FromPyStructUtility":35
 *         value = obj['lint_yield']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'lint_yield'")             # <<<<<<<<<<<<<<
 *     result.lint_yield = value
 *     try:
 */
  __pyx_tuple__61 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_52); if (unlikely(!__pyx_tuple__61)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__61);
  __Pyx_GIVEREF(__pyx_tuple__61);

  /* "FromPyStructUtility":40
 *         value = obj['bloom_weight_loss']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'bloom_weight_loss'")             # <<<<<<<<<<<<<<
 *     result.bloom_weight_loss = value
 *     try:
 */
  __pyx_tuple__62 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_53); if (unlikely(!__pyx_tuple__62)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__62);
  __Pyx_GIVEREF(__pyx_tuple__62);

  /* "FromPyStructUtility":45
 *         value = obj['abscised_fruit_sites']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_fruit_sites'")             # <<<<<<<<<<<<<<
 *     result.abscised_fruit_sites = value
 *     try:
 */
  __pyx_tuple__63 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_54); if (unlikely(!__pyx_tuple__63)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__63);
  __Pyx_GIVEREF(__pyx_tuple__63);

  /* "FromPyStructUtility":50
 *         value = obj['abscised_leaf_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'abscised_leaf_weight'")             # <<<<<<<<<<<<<<
 *     result.abscised_leaf_weight = value
 *     try:
 */
  __pyx_tuple__64 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_55); if (unlikely(!__pyx_tuple__64)) __PYX_ERR(1, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__64);
  __Pyx_GIVEREF(__pyx_tuple__64);

  /* "FromPyStructUtility":55
 *         value = obj['cumulative_nitrogen_loss']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_nitrogen_loss'")             # <<<<<<<<<<<<<<
 *     result.cumulative_nitrogen_loss = value
 *     try:
 */
  __pyx_tuple__65 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_56); if (unlikely(!__pyx_tuple__65)) __PYX_ERR(1, 55, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__65);
  __Pyx_GIVEREF(__pyx_tuple__65);

  /* "FromPyStructUtility":60
 *         value = obj['applied_water']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'applied_water'")             # <<<<<<<<<<<<<<
 *     result.applied_water = value
 *     try:
 */
  __pyx_tuple__66 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_57); if (unlikely(!__pyx_tuple__66)) __PYX_ERR(1, 60, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__66);
  __Pyx_GIVEREF(__pyx_tuple__66);

  /* "FromPyStructUtility":65
 *         value = obj['water_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress'")             # <<<<<<<<<<<<<<
 *     result.water_stress = value
 *     try:
 */
  __pyx_tuple__67 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_58); if (unlikely(!__pyx_tuple__67)) __PYX_ERR(1, 65, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__67);
  __Pyx_GIVEREF(__pyx_tuple__67);

  /* "FromPyStructUtility":70
 *         value = obj['water_stress_stem']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'water_stress_stem'")             # <<<<<<<<<<<<<<
 *     result.water_stress_stem = value
 *     try:
 */
  __pyx_tuple__68 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_59); if (unlikely(!__pyx_tuple__68)) __PYX_ERR(1, 70, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__68);
  __Pyx_GIVEREF(__pyx_tuple__68);

  /* "FromPyStructUtility":75
 *         value = obj['carbon_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'carbon_stress'")             # <<<<<<<<<<<<<<
 *     result.carbon_stress = value
 *     try:
 */
  __pyx_tuple__69 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_60); if (unlikely(!__pyx_tuple__69)) __PYX_ERR(1, 75, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__69);
  __Pyx_GIVEREF(__pyx_tuple__69);

  /* "FromPyStructUtility":80
 *         value = obj['extra_carbon']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'extra_carbon'")             # <<<<<<<<<<<<<<
 *     result.extra_carbon = value
 *     try:
 */
  __pyx_tuple__70 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_61); if (unlikely(!__pyx_tuple__70)) __PYX_ERR(1, 80, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__70);
  __Pyx_GIVEREF(__pyx_tuple__70);

  /* "FromPyStructUtility":85
 *         value = obj['day_length']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'day_length'")             # <<<<<<<<<<<<<<
 *     result.day_length = value
 *     try:
 */
  __pyx_tuple__71 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_62); if (unlikely(!__pyx_tuple__71)) __PYX_ERR(1, 85, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__71);
  __Pyx_GIVEREF(__pyx_tuple__71);

  /* "FromPyStructUtility":90
 *         value = obj['plant_height']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_height'")             # <<<<<<<<<<<<<<
 *     result.plant_height = value
 *     try:
 */
  __pyx_tuple__72 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_63); if (unlikely(!__pyx_tuple__72)) __PYX_ERR(1, 90, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__72);
  __Pyx_GIVEREF(__pyx_tuple__72);

  /* "FromPyStructUtility":95
 *         value = obj['plant_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'plant_weight'")             # <<<<<<<<<<<<<<
 *     result.plant_weight = value
 *     try:
 */
  __pyx_tuple__73 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_64); if (unlikely(!__pyx_tuple__73)) __PYX_ERR(1, 95, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__73);
  __Pyx_GIVEREF(__pyx_tuple__73);

  /* "FromPyStructUtility":100
 *         value = obj['stem_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_weight'")             # <<<<<<<<<<<<<<
 *     result.stem_weight = value
 *     try:
 */
  __pyx_tuple__74 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_65); if (unlikely(!__pyx_tuple__74)) __PYX_ERR(1, 100, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__74);
  __Pyx_GIVEREF(__pyx_tuple__74);

  /* "FromPyStructUtility":105
 *         value = obj['square_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_weight'")             # <<<<<<<<<<<<<<
 *     result.square_weight = value
 *     try:
 */
  __pyx_tuple__75 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_66); if (unlikely(!__pyx_tuple__75)) __PYX_ERR(1, 105, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__75);
  __Pyx_GIVEREF(__pyx_tuple__75);

  /* "FromPyStructUtility":110
 *         value = obj['green_bolls_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_weight'")             # <<<<<<<<<<<<<<
 *     result.green_bolls_weight = value
 *     try:
 */
  __pyx_tuple__76 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_67); if (unlikely(!__pyx_tuple__76)) __PYX_ERR(1, 110, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__76);
  __Pyx_GIVEREF(__pyx_tuple__76);

  /* "FromPyStructUtility":115
 *         value = obj['green_bolls_burr_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'green_bolls_burr_weight'")             # <<<<<<<<<<<<<<
 *     result.green_bolls_burr_weight = value
 *     try:
 */
  __pyx_tuple__77 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_68); if (unlikely(!__pyx_tuple__77)) __PYX_ERR(1, 115, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__77);
  __Pyx_GIVEREF(__pyx_tuple__77);

  /* "FromPyStructUtility":120
 *         value = obj['open_bolls_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_weight'")             # <<<<<<<<<<<<<<
 *     result.open_bolls_weight = value
 *     try:
 */
  __pyx_tuple__78 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_69); if (unlikely(!__pyx_tuple__78)) __PYX_ERR(1, 120, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__78);
  __Pyx_GIVEREF(__pyx_tuple__78);

  /* "FromPyStructUtility":125
 *         value = obj['open_bolls_burr_weight']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'open_bolls_burr_weight'")             # <<<<<<<<<<<<<<
 *     result.open_bolls_burr_weight = value
 *     try:
 */
  __pyx_tuple__79 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_70); if (unlikely(!__pyx_tuple__79)) __PYX_ERR(1, 125, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__79);
  __Pyx_GIVEREF(__pyx_tuple__79);

  /* "FromPyStructUtility":130
 *         value = obj['runoff']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'runoff'")             # <<<<<<<<<<<<<<
 *     result.runoff = value
 *     try:
 */
  __pyx_tuple__80 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_71); if (unlikely(!__pyx_tuple__80)) __PYX_ERR(1, 130, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__80);
  __Pyx_GIVEREF(__pyx_tuple__80);

  /* "FromPyStructUtility":135
 *         value = obj['solar_noon']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'solar_noon'")             # <<<<<<<<<<<<<<
 *     result.solar_noon = value
 *     try:
 */
  __pyx_tuple__81 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_72); if (unlikely(!__pyx_tuple__81)) __PYX_ERR(1, 135, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__81);
  __Pyx_GIVEREF(__pyx_tuple__81);

  /* "FromPyStructUtility":140
 *         value = obj['net_radiation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'net_radiation'")             # <<<<<<<<<<<<<<
 *     result.net_radiation = value
 *     try:
 */
  __pyx_tuple__82 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_73); if (unlikely(!__pyx_tuple__82)) __PYX_ERR(1, 140, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__82);
  __Pyx_GIVEREF(__pyx_tuple__82);

  /* "FromPyStructUtility":145
 *         value = obj['evapotranspiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'evapotranspiration'")             # <<<<<<<<<<<<<<
 *     result.evapotranspiration = value
 *     try:
 */
  __pyx_tuple__83 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_74); if (unlikely(!__pyx_tuple__83)) __PYX_ERR(1, 145, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__83);
  __Pyx_GIVEREF(__pyx_tuple__83);

  /* "FromPyStructUtility":150
 *         value = obj['actual_transpiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_transpiration'")             # <<<<<<<<<<<<<<
 *     result.actual_transpiration = value
 *     try:
 */
  __pyx_tuple__84 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_75); if (unlikely(!__pyx_tuple__84)) __PYX_ERR(1, 150, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__84);
  __Pyx_GIVEREF(__pyx_tuple__84);

  /* "FromPyStructUtility":155
 *         value = obj['cumulative_transpiration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_transpiration'")             # <<<<<<<<<<<<<<
 *     result.cumulative_transpiration = value
 *     try:
 */
  __pyx_tuple__85 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_76); if (unlikely(!__pyx_tuple__85)) __PYX_ERR(1, 155, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__85);
  __Pyx_GIVEREF(__pyx_tuple__85);

  /* "FromPyStructUtility":160
 *         value = obj['actual_soil_evaporation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'actual_soil_evaporation'")             # <<<<<<<<<<<<<<
 *     result.actual_soil_evaporation = value
 *     try:
 */
  __pyx_tuple__86 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_77); if (unlikely(!__pyx_tuple__86)) __PYX_ERR(1, 160, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__86);
  __Pyx_GIVEREF(__pyx_tuple__86);

  /* "FromPyStructUtility":165
 *         value = obj['cumulative_evaporation']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'cumulative_evaporation'")             # <<<<<<<<<<<<<<
 *     result.cumulative_evaporation = value
 *     try:
 */
  __pyx_tuple__87 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_78); if (unlikely(!__pyx_tuple__87)) __PYX_ERR(1, 165, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__87);
  __Pyx_GIVEREF(__pyx_tuple__87);

  /* "FromPyStructUtility":170
 *         value = obj['light_interception']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'light_interception'")             # <<<<<<<<<<<<<<
 *     result.light_interception = value
 *     try:
 */
  __pyx_tuple__88 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_79); if (unlikely(!__pyx_tuple__88)) __PYX_ERR(1, 170, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__88);
  __Pyx_GIVEREF(__pyx_tuple__88);

  /* "FromPyStructUtility":175
 *         value = obj['number_of_vegetative_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_vegetative_branches'")             # <<<<<<<<<<<<<<
 *     result.number_of_vegetative_branches = value
 *     try:
 */
  __pyx_tuple__89 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_80); if (unlikely(!__pyx_tuple__89)) __PYX_ERR(1, 175, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__89);
  __Pyx_GIVEREF(__pyx_tuple__89);

  /* "FromPyStructUtility":180
 *         value = obj['number_of_fruiting_sites']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_fruiting_sites'")             # <<<<<<<<<<<<<<
 *     result.number_of_fruiting_sites = value
 *     try:
 */
  __pyx_tuple__90 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_81); if (unlikely(!__pyx_tuple__90)) __PYX_ERR(1, 180, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__90);
  __Pyx_GIVEREF(__pyx_tuple__90);

  /* "FromPyStructUtility":185
 *         value = obj['number_of_squares']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_squares'")             # <<<<<<<<<<<<<<
 *     result.number_of_squares = value
 *     try:
 */
  __pyx_tuple__91 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_82); if (unlikely(!__pyx_tuple__91)) __PYX_ERR(1, 185, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__91);
  __Pyx_GIVEREF(__pyx_tuple__91);

  /* "FromPyStructUtility":190
 *         value = obj['number_of_green_bolls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_green_bolls'")             # <<<<<<<<<<<<<<
 *     result.number_of_green_bolls = value
 *     try:
 */
  __pyx_tuple__92 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_83); if (unlikely(!__pyx_tuple__92)) __PYX_ERR(1, 190, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__92);
  __Pyx_GIVEREF(__pyx_tuple__92);

  /* "FromPyStructUtility":195
 *         value = obj['number_of_open_bolls']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_open_bolls'")             # <<<<<<<<<<<<<<
 *     result.number_of_open_bolls = value
 *     try:
 */
  __pyx_tuple__93 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_84); if (unlikely(!__pyx_tuple__93)) __PYX_ERR(1, 195, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__93);
  __Pyx_GIVEREF(__pyx_tuple__93);

  /* "FromPyStructUtility":200
 *         value = obj['nitrogen_stress']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress = value
 *     try:
 */
  __pyx_tuple__94 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_85); if (unlikely(!__pyx_tuple__94)) __PYX_ERR(1, 200, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__94);
  __Pyx_GIVEREF(__pyx_tuple__94);

  /* "FromPyStructUtility":205
 *         value = obj['nitrogen_stress_vegetative']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_vegetative'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_vegetative = value
 *     try:
 */
  __pyx_tuple__95 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_86); if (unlikely(!__pyx_tuple__95)) __PYX_ERR(1, 205, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__95);
  __Pyx_GIVEREF(__pyx_tuple__95);

  /* "FromPyStructUtility":210
 *         value = obj['nitrogen_stress_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_fruiting'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_fruiting = value
 *     try:
 */
  __pyx_tuple__96 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_87); if (unlikely(!__pyx_tuple__96)) __PYX_ERR(1, 210, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__96);
  __Pyx_GIVEREF(__pyx_tuple__96);

  /* "FromPyStructUtility":215
 *         value = obj['nitrogen_stress_root']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'nitrogen_stress_root'")             # <<<<<<<<<<<<<<
 *     result.nitrogen_stress_root = value
 *     try:
 */
  __pyx_tuple__97 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_88); if (unlikely(!__pyx_tuple__97)) __PYX_ERR(1, 215, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__97);
  __Pyx_GIVEREF(__pyx_tuple__97);

  /* "FromPyStructUtility":220
 *         value = obj['total_required_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'total_required_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.total_required_nitrogen = value
 *     try:
 */
  __pyx_tuple__98 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_89); if (unlikely(!__pyx_tuple__98)) __PYX_ERR(1, 220, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__98);
  __Pyx_GIVEREF(__pyx_tuple__98);

  /* "FromPyStructUtility":225
 *         value = obj['leaf_area_index']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_index'")             # <<<<<<<<<<<<<<
 *     result.leaf_area_index = value
 *     try:
 */
  __pyx_tuple__99 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_90); if (unlikely(!__pyx_tuple__99)) __PYX_ERR(1, 225, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__99);
  __Pyx_GIVEREF(__pyx_tuple__99);

  /* "FromPyStructUtility":240
 *         value = obj['leaf_weight_pre_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_pre_fruiting'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight_pre_fruiting = value
 *     try:
 */
  __pyx_tuple__100 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_91); if (unlikely(!__pyx_tuple__100)) __PYX_ERR(1, 240, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__100);
  __Pyx_GIVEREF(__pyx_tuple__100);

  /* "FromPyStructUtility":245
 *         value = obj['leaf_weight_area_ratio']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_weight_area_ratio'")             # <<<<<<<<<<<<<<
 *     result.leaf_weight_area_ratio = value
 *     try:
 */
  __pyx_tuple__101 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_92); if (unlikely(!__pyx_tuple__101)) __PYX_ERR(1, 245, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__101);
  __Pyx_GIVEREF(__pyx_tuple__101);

  /* "FromPyStructUtility":250
 *         value = obj['leaf_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.leaf_nitrogen_concentration = value
 *     try:
 */
  __pyx_tuple__102 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_93); if (unlikely(!__pyx_tuple__102)) __PYX_ERR(1, 250, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__102);
  __Pyx_GIVEREF(__pyx_tuple__102);

  /* "FromPyStructUtility":255
 *         value = obj['leaf_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.leaf_nitrogen = value
 *     try:
 */
  __pyx_tuple__103 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_94); if (unlikely(!__pyx_tuple__103)) __PYX_ERR(1, 255, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__103);
  __Pyx_GIVEREF(__pyx_tuple__103);

  /* "FromPyStructUtility":260
 *         value = obj['petiole_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'petiole_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.petiole_nitrogen_concentration = value
 *     try:
 */
  __pyx_tuple__104 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_95); if (unlikely(!__pyx_tuple__104)) __PYX_ERR(1, 260, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__104);
  __Pyx_GIVEREF(__pyx_tuple__104);

  /* "FromPyStructUtility":265
 *         value = obj['seed_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.seed_nitrogen_concentration = value
 *     try:
 */
  __pyx_tuple__105 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_96); if (unlikely(!__pyx_tuple__105)) __PYX_ERR(1, 265, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__105);
  __Pyx_GIVEREF(__pyx_tuple__105);

  /* "FromPyStructUtility":270
 *         value = obj['seed_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'seed_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.seed_nitrogen = value
 *     try:
 */
  __pyx_tuple__106 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_97); if (unlikely(!__pyx_tuple__106)) __PYX_ERR(1, 270, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__106);
  __Pyx_GIVEREF(__pyx_tuple__106);

  /* "FromPyStructUtility":275
 *         value = obj['root_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'root_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.root_nitrogen_concentration = value
 *     try:
 */
  __pyx_tuple__107 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_98); if (unlikely(!__pyx_tuple__107)) __PYX_ERR(1, 275, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__107);
  __Pyx_GIVEREF(__pyx_tuple__107);

  /* "FromPyStructUtility":280
 *         value = obj['square_nitrogen_concentration']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen_concentration'")             # <<<<<<<<<<<<<<
 *     result.square_nitrogen_concentration = value
 *     try:
 */
  __pyx_tuple__108 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_99); if (unlikely(!__pyx_tuple__108)) __PYX_ERR(1, 280, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__108);
  __Pyx_GIVEREF(__pyx_tuple__108);

  /* "FromPyStructUtility":285
 *         value = obj['burr_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'burr_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.burr_nitrogen = value
 *     try:
 */
  __pyx_tuple__109 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_100); if (unlikely(!__pyx_tuple__109)) __PYX_ERR(1, 285, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__109);
  __Pyx_GIVEREF(__pyx_tuple__109);

  /* "FromPyStructUtility":290
 *         value = obj['square_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'square_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.square_nitrogen = value
 *     try:
 */
  __pyx_tuple__110 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_101); if (unlikely(!__pyx_tuple__110)) __PYX_ERR(1, 290, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__110);
  __Pyx_GIVEREF(__pyx_tuple__110);

  /* "FromPyStructUtility":295
 *         value = obj['stem_nitrogen']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'stem_nitrogen'")             # <<<<<<<<<<<<<<
 *     result.stem_nitrogen = value
 *     try:
 */
  __pyx_tuple__111 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_102); if (unlikely(!__pyx_tuple__111)) __PYX_ERR(1, 295, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__111);
  __Pyx_GIVEREF(__pyx_tuple__111);

  /* "FromPyStructUtility":300
 *         value = obj['fruit_growth_ratio']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'fruit_growth_ratio'")             # <<<<<<<<<<<<<<
 *     result.fruit_growth_ratio = value
 *     try:
 */
  __pyx_tuple__112 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_103); if (unlikely(!__pyx_tuple__112)) __PYX_ERR(1, 300, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__112);
  __Pyx_GIVEREF(__pyx_tuple__112);

  /* "FromPyStructUtility":315
 *         value = obj['pollination_switch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'pollination_switch'")             # <<<<<<<<<<<<<<
 *     result.pollination_switch = value
 *     try:
 */
  __pyx_tuple__113 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_104); if (unlikely(!__pyx_tuple__113)) __PYX_ERR(1, 315, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__113);
  __Pyx_GIVEREF(__pyx_tuple__113);

  /* "FromPyStructUtility":320
 *         value = obj['age_of_pre_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'age_of_pre_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.age_of_pre_fruiting_nodes = value
 *     try:
 */
  __pyx_tuple__114 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_105); if (unlikely(!__pyx_tuple__114)) __PYX_ERR(1, 320, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__114);
  __Pyx_GIVEREF(__pyx_tuple__114);

  /* "FromPyStructUtility":325
 *         value = obj['number_of_pre_fruiting_nodes']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'number_of_pre_fruiting_nodes'")             # <<<<<<<<<<<<<<
 *     result.number_of_pre_fruiting_nodes = value
 *     try:
 */
  __pyx_tuple__115 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_106); if (unlikely(!__pyx_tuple__115)) __PYX_ERR(1, 325, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__115);
  __Pyx_GIVEREF(__pyx_tuple__115);

  /* "FromPyStructUtility":330
 *         value = obj['leaf_area_pre_fruiting']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'leaf_area_pre_fruiting'")             # <<<<<<<<<<<<<<
 *     result.leaf_area_pre_fruiting = value
 *     try:
 */
  __pyx_tuple__116 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_107); if (unlikely(!__pyx_tuple__116)) __PYX_ERR(1, 330, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__116);
  __Pyx_GIVEREF(__pyx_tuple__116);

  /* "FromPyStructUtility":335
 *         value = obj['delay_for_new_branch']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'delay_for_new_branch'")             # <<<<<<<<<<<<<<
 *     result.delay_for_new_branch = value
 *     try:
 */
  __pyx_tuple__117 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_108); if (unlikely(!__pyx_tuple__117)) __PYX_ERR(1, 335, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__117);
  __Pyx_GIVEREF(__pyx_tuple__117);

  /* "FromPyStructUtility":340
 *         value = obj['vegetative_branches']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'vegetative_branches'")             # <<<<<<<<<<<<<<
 *     result.vegetative_branches = value
 *     try:
 */
  __pyx_tuple__118 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_109); if (unlikely(!__pyx_tuple__118)) __PYX_ERR(1, 340, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__118);
  __Pyx_GIVEREF(__pyx_tuple__118);

  /* "FromPyStructUtility":345
 *         value = obj['hours']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'hours'")             # <<<<<<<<<<<<<<
 *     result.hours = value
 *     try:
 */
  __pyx_tuple__119 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_110); if (unlikely(!__pyx_tuple__119)) __PYX_ERR(1, 345, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__119);
  __Pyx_GIVEREF(__pyx_tuple__119);

  /* "FromPyStructUtility":350
 *         value = obj['soil']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'soil'")             # <<<<<<<<<<<<<<
 *     result.soil = value
 *     return result
 */
  __pyx_tuple__120 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_111); if (unlikely(!__pyx_tuple__120)) __PYX_ERR(1, 350, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__120);
  __Pyx_GIVEREF(__pyx_tuple__120);

  /* "FromPyStructUtility":20
 *         value = obj['Rad']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rad'")             # <<<<<<<<<<<<<<
 *     result.Rad = value
 *     try:
 */
  __pyx_tuple__121 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_112); if (unlikely(!__pyx_tuple__121)) __PYX_ERR(1, 20, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__121);
  __Pyx_GIVEREF(__pyx_tuple__121);

  /* "FromPyStructUtility":25
 *         value = obj['Tmax']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmax'")             # <<<<<<<<<<<<<<
 *     result.Tmax = value
 *     try:
 */
  __pyx_tuple__122 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_113); if (unlikely(!__pyx_tuple__122)) __PYX_ERR(1, 25, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__122);
  __Pyx_GIVEREF(__pyx_tuple__122);

  /* "FromPyStructUtility":30
 *         value = obj['Tmin']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tmin'")             # <<<<<<<<<<<<<<
 *     result.Tmin = value
 *     try:
 */
  __pyx_tuple__123 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_114); if (unlikely(!__pyx_tuple__123)) __PYX_ERR(1, 30, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__123);
  __Pyx_GIVEREF(__pyx_tuple__123);

  /* "FromPyStructUtility":35
 *         value = obj['Rain']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Rain'")             # <<<<<<<<<<<<<<
 *     result.Rain = value
 *     try:
 */
  __pyx_tuple__124 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_115); if (unlikely(!__pyx_tuple__124)) __PYX_ERR(1, 35, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__124);
  __Pyx_GIVEREF(__pyx_tuple__124);

  /* "FromPyStructUtility":40
 *         value = obj['Wind']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Wind'")             # <<<<<<<<<<<<<<
 *     result.Wind = value
 *     try:
 */
  __pyx_tuple__125 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_116); if (unlikely(!__pyx_tuple__125)) __PYX_ERR(1, 40, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__125);
  __Pyx_GIVEREF(__pyx_tuple__125);

  /* "FromPyStructUtility":45
 *         value = obj['Tdew']
 *     except KeyError:
 *         raise ValueError("No value specified for struct attribute 'Tdew'")             # <<<<<<<<<<<<<<
 *     result.Tdew = value
 *     return result
 */
  __pyx_tuple__126 = PyTuple_Pack(1, __pyx_kp_s_No_value_specified_for_struct_at_117); if (unlikely(!__pyx_tuple__126)) __PYX_ERR(1, 45, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__126);
  __Pyx_GIVEREF(__pyx_tuple__126);

  /* "_cotton2k/simulation.pyx":50
 * 
 * 
 * class SimulationEnd(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_tuple__127 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__127)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__127);
  __Pyx_GIVEREF(__pyx_tuple__127);
  __pyx_tuple__128 = PyTuple_Pack(1, __pyx_builtin_RuntimeError); if (unlikely(!__pyx_tuple__128)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__128);
  __Pyx_GIVEREF(__pyx_tuple__128);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_tuple__129 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_state, __pyx_n_s_dict_2, __pyx_n_s_use_setstate); if (unlikely(!__pyx_tuple__129)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__129);
  __Pyx_GIVEREF(__pyx_tuple__129);
  __pyx_codeobj__130 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__129, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__130)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)
 */
  __pyx_tuple__131 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__131)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__131);
  __Pyx_GIVEREF(__pyx_tuple__131);
  __pyx_codeobj__132 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__131, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 16, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__132)) __PYX_ERR(1, 16, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__133 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__133)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__133);
  __Pyx_GIVEREF(__pyx_tuple__133);
  __pyx_codeobj__134 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__133, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__134)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__135 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__135)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__135);
  __Pyx_GIVEREF(__pyx_tuple__135);
  __pyx_codeobj__136 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__135, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__136)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__137 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__137)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__137);
  __Pyx_GIVEREF(__pyx_tuple__137);
  __pyx_codeobj__138 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__137, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__138)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__139 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__139)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__139);
  __Pyx_GIVEREF(__pyx_tuple__139);
  __pyx_codeobj__140 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__139, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__140)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__141 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__141)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__141);
  __Pyx_GIVEREF(__pyx_tuple__141);
  __pyx_codeobj__142 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__141, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__142)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__143 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__143)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__143);
  __Pyx_GIVEREF(__pyx_tuple__143);
  __pyx_codeobj__144 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__143, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__144)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__145 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__145)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__145);
  __Pyx_GIVEREF(__pyx_tuple__145);
  __pyx_codeobj__146 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__145, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__146)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__147 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__147)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__147);
  __Pyx_GIVEREF(__pyx_tuple__147);
  __pyx_codeobj__148 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__147, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__148)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__149 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__149)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__149);
  __Pyx_GIVEREF(__pyx_tuple__149);
  __pyx_codeobj__150 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__149, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__150)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__151 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__151)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__151);
  __Pyx_GIVEREF(__pyx_tuple__151);
  __pyx_codeobj__152 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__151, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__152)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__153 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__153)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__153);
  __Pyx_GIVEREF(__pyx_tuple__153);
  __pyx_codeobj__154 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__153, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__154)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__155 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__155)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__155);
  __Pyx_GIVEREF(__pyx_tuple__155);
  __pyx_codeobj__156 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__155, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__156)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":456
 *     cdef cState *_
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return dict(self._[0]).keys()
 * 
 */
  __pyx_tuple__157 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__157)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__157);
  __Pyx_GIVEREF(__pyx_tuple__157);
  __pyx_codeobj__158 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__157, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_keys, 456, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__158)) __PYX_ERR(0, 456, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":488
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 * 
 *     def create_first_square(self, stemNRatio, first_square_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function initiates the first square. It is called from function CottonPhenology().
 */
  __pyx_tuple__159 = PyTuple_Pack(5, __pyx_n_s_self, __pyx_n_s_stemNRatio, __pyx_n_s_first_square_leaf_area, __pyx_n_s_first_node, __pyx_n_s_cotylwt); if (unlikely(!__pyx_tuple__159)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__159);
  __Pyx_GIVEREF(__pyx_tuple__159);
  __pyx_codeobj__160 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__159, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_create_first_square, 488, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__160)) __PYX_ERR(0, 488, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":515
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 * 
 *     def add_fruiting_branch(self, k, density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, time_to_new_fruiting_branch, new_node_initial_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides if a new fruiting branch is to be added to a vegetative branch, and forms it. It is called from function CottonPhenology().
 */
  __pyx_tuple__161 = PyTuple_Pack(19, __pyx_n_s_self, __pyx_n_s_k, __pyx_n_s_density_factor, __pyx_n_s_delayVegByCStress, __pyx_n_s_delayFrtByCStress, __pyx_n_s_stemNRatio, __pyx_n_s_PhenDelayByNStress, __pyx_n_s_time_to_new_fruiting_branch, __pyx_n_s_new_node_initial_leaf_area, __pyx_n_s_vfrtbr, __pyx_n_s_vegetative_branch, __pyx_n_s_last_fruiting_branch, __pyx_n_s_tav, __pyx_n_s_TimeToNextFruBranch, __pyx_n_s_newbr, __pyx_n_s_new_branch, __pyx_n_s_new_node, __pyx_n_s_main_stem_leaf, __pyx_n_s_addlfn); if (unlikely(!__pyx_tuple__161)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__161);
  __Pyx_GIVEREF(__pyx_tuple__161);
  __pyx_codeobj__162 = (PyObject*)__Pyx_PyCode_New(9, 0, 0, 19, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__161, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_add_fruiting_branch, 515, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__162)) __PYX_ERR(0, 515, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__163 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__163)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__163);
  __Pyx_GIVEREF(__pyx_tuple__163);
  __pyx_codeobj__164 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__163, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__164)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_tuple__165 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__165)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__165);
  __Pyx_GIVEREF(__pyx_tuple__165);
  __pyx_codeobj__166 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__165, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__166)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":582
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.
 * 
 *     def _doy2date(self, j):             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 */
  __pyx_tuple__167 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_j); if (unlikely(!__pyx_tuple__167)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__167);
  __Pyx_GIVEREF(__pyx_tuple__167);
  __pyx_codeobj__168 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__167, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_doy2date, 582, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__168)) __PYX_ERR(0, 582, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":695
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 *     def state(self, i):             # <<<<<<<<<<<<<<
 *         return State.from_ptr(&self._sim.states[i])
 * 
 */
  __pyx_tuple__169 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__169)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__169);
  __Pyx_GIVEREF(__pyx_tuple__169);
  __pyx_codeobj__170 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__169, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_state, 695, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__170)) __PYX_ERR(0, 695, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":717
 *             }
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         self._init_state()
 *         try:
 */
  __pyx_tuple__171 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__171)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__171);
  __Pyx_GIVEREF(__pyx_tuple__171);
  __pyx_codeobj__172 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__171, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_run, 717, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__172)) __PYX_ERR(0, 717, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":724
 *             pass
 * 
 *     def _init_state(self):             # <<<<<<<<<<<<<<
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start
 */
  __pyx_tuple__173 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_state0, __pyx_n_s_i, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_m); if (unlikely(!__pyx_tuple__173)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__173);
  __Pyx_GIVEREF(__pyx_tuple__173);
  __pyx_codeobj__174 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__173, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_init_state, 724, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__174)) __PYX_ERR(0, 724, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":824
 *         self._sim.states[0] = state0
 * 
 *     def _simulate(self):             # <<<<<<<<<<<<<<
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 */
  __pyx_tuple__175 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_i); if (unlikely(!__pyx_tuple__175)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__175);
  __Pyx_GIVEREF(__pyx_tuple__175);
  __pyx_codeobj__176 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__175, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_simulate, 824, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__176)) __PYX_ERR(0, 824, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":830
 *                 CopyState(self._sim, i)
 * 
 *     def _calc_light_interception(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 */
  __pyx_tuple__177 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state, __pyx_n_s_zint, __pyx_n_s_lfint, __pyx_n_s_light_interception); if (unlikely(!__pyx_tuple__177)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__177);
  __Pyx_GIVEREF(__pyx_tuple__177);
  __pyx_codeobj__178 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__177, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_calc_light_interception, 830, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__178)) __PYX_ERR(0, 830, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":852
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)
 * 
 *     def _column_shading(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space
 */
  __pyx_tuple__179 = PyTuple_Pack(11, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state, __pyx_n_s_zint, __pyx_n_s_sw, __pyx_n_s_k, __pyx_n_s_j, __pyx_n_s_sw0, __pyx_n_s_sw1, __pyx_n_s_k0, __pyx_n_s_shade); if (unlikely(!__pyx_tuple__179)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__179);
  __Pyx_GIVEREF(__pyx_tuple__179);
  __pyx_codeobj__180 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 11, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__179, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_column_shading, 852, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__180)) __PYX_ERR(0, 852, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":876
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 *     def _daily_climate(self, u):             # <<<<<<<<<<<<<<
 *         cdef double declination  # daily declination angle, in radians
 *         cdef double sunr  # time of sunrise, hours.
 */
  __pyx_tuple__181 = PyTuple_Pack(24, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_declination, __pyx_n_s_sunr, __pyx_n_s_suns, __pyx_n_s_tmpisr, __pyx_n_s_hour, __pyx_n_s_result, __pyx_n_s_zero, __pyx_n_s_xlat, __pyx_n_s_cd, __pyx_n_s_sd, __pyx_n_s_c11, __pyx_n_s_radsum, __pyx_n_s_dsbe, __pyx_n_s_rainToday, __pyx_n_s_runoffToday, __pyx_n_s_t1, __pyx_n_s_t2, __pyx_n_s_t3, __pyx_n_s_wnytf, __pyx_n_s_ihr, __pyx_n_s_ti, __pyx_n_s_sinb); if (unlikely(!__pyx_tuple__181)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__181);
  __Pyx_GIVEREF(__pyx_tuple__181);
  __pyx_codeobj__182 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 24, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__181, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_daily_climate, 876, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__182)) __PYX_ERR(0, 876, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":948
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])
 * 
 *     def _stress(self, u):             # <<<<<<<<<<<<<<
 *         global AverageLwpMin, AverageLwp, LwpMin, LwpMax
 *         # The following constant parameters are used:
 */
  __pyx_tuple__183 = PyTuple_Pack(6, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_vstrs, __pyx_n_s_i, __pyx_n_s_psilim, __pyx_n_s_WaterStress); if (unlikely(!__pyx_tuple__183)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__183);
  __Pyx_GIVEREF(__pyx_tuple__183);
  __pyx_codeobj__184 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 6, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__183, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_stress, 948, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__184)) __PYX_ERR(0, 948, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":994
 *         self._sim.states[u].water_stress = WaterStress
 * 
 *     def _get_net_photosynthesis(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         References:
 */
  __pyx_tuple__185 = PyTuple_Pack(18, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state, __pyx_n_s_gsubr, __pyx_n_s_rsubo, __pyx_n_s_vpnet, __pyx_n_s_pnetcor, __pyx_n_s_ptnfac, __pyx_n_s_wattsm, __pyx_n_s_pstand, __pyx_n_s_pplant, __pyx_n_s_rsubl, __pyx_n_s_lytres, __pyx_n_s_oldstmwt, __pyx_n_s_voldstm, __pyx_n_s_kkday, __pyx_n_s_bmain, __pyx_n_s_pts); if (unlikely(!__pyx_tuple__185)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__185);
  __Pyx_GIVEREF(__pyx_tuple__185);
  __pyx_codeobj__186 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 18, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__185, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_get_net_photosynthesis, 994, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__186)) __PYX_ERR(0, 994, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1060
 *         CumNetPhotosynth += NetPhotosynthesis
 * 
 *     def _potential_fruit_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of fruiting sites of cotton plants. It is called from PlantGrowth(). It calls TemperatureOnFruitGrowthRate()
 */
  __pyx_tuple__187 = PyTuple_Pack(15, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_vpotfrt, __pyx_n_s_tfrt, __pyx_n_s_agemax, __pyx_n_s_rbmax, __pyx_n_s_wbmax, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_m, __pyx_n_s_ratesqr, __pyx_n_s_pex, __pyx_n_s_ratebol, __pyx_n_s_wfdb, __pyx_n_s_ratebur); if (unlikely(!__pyx_tuple__187)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__187);
  __Pyx_GIVEREF(__pyx_tuple__187);
  __pyx_codeobj__188 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 15, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__187, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_potential_fruit_growth, 1060, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__188)) __PYX_ERR(0, 1060, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1137
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0
 * 
 *     def _potential_leaf_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of leaves of cotton plants. It is called from self._growth(). It calls function temperature_on_leaf_growth_rate().
 */
  __pyx_tuple__189 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_p, __pyx_n_s_vpotlf, __pyx_n_s_wstrlf, __pyx_n_s_wtfstrs, __pyx_n_s_tdday, __pyx_n_s_c, __pyx_n_s_smax, __pyx_n_s_rate, __pyx_n_s_j, __pyx_n_s_jp1, __pyx_n_s_denfac, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_lp1, __pyx_n_s_smaxx, __pyx_n_s_cc, __pyx_n_s_m, __pyx_n_s_mp1); if (unlikely(!__pyx_tuple__189)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__189);
  __Pyx_GIVEREF(__pyx_tuple__189);
  __pyx_codeobj__190 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__189, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_potential_leaf_growth, 1137, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__190)) __PYX_ERR(0, 1137, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1249
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 * 
 *     def _growth(self, u):             # <<<<<<<<<<<<<<
 *         global PotGroStem, PotGroAllRoots, TotalPetioleWeight
 *         # Call self._potential_leaf_growth(u) to compute potential growth rate of leaves.
 */
  __pyx_tuple__191 = PyTuple_Pack(20, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_voldstm, __pyx_n_s_kkday, __pyx_n_s_stemnew, __pyx_n_s_maxstmgr, __pyx_n_s_sumpdr, __pyx_n_s_maxrtgr, __pyx_n_s_cdstem, __pyx_n_s_cdleaf, __pyx_n_s_cdpet, __pyx_n_s_cdroot, __pyx_n_s_cotylwt, __pyx_n_s_htdenf, __pyx_n_s_z1, __pyx_n_s_denf2, __pyx_n_s_l, __pyx_n_s_l1, __pyx_n_s_l2, __pyx_n_s_agetop); if (unlikely(!__pyx_tuple__191)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__191);
  __Pyx_GIVEREF(__pyx_tuple__191);
  __pyx_codeobj__192 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 20, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__191, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_growth, 1249, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__192)) __PYX_ERR(0, 1249, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1349
 *                                 self._sim.plant_row_column)
 * 
 *     def _days_to_first_square(self, u):             # <<<<<<<<<<<<<<
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:
 */
  __pyx_tuple__193 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state); if (unlikely(!__pyx_tuple__193)) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__193);
  __Pyx_GIVEREF(__pyx_tuple__193);
  __pyx_codeobj__194 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__193, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_days_to_first_square, 1349, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__194)) __PYX_ERR(0, 1349, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1360
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 * 
 *     def _add_vegetative_branch(self, u, delayVegByCStress, stemNRatio, DaysTo1stSqare, PhenDelayByNStress):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 */
  __pyx_tuple__195 = PyTuple_Pack(9, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_delayVegByCStress, __pyx_n_s_stemNRatio, __pyx_n_s_DaysTo1stSqare, __pyx_n_s_PhenDelayByNStress, __pyx_n_s_vpvegb, __pyx_n_s_TimeToNextVegBranch, __pyx_n_s_addlfn); if (unlikely(!__pyx_tuple__195)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__195);
  __Pyx_GIVEREF(__pyx_tuple__195);
  __pyx_codeobj__196 = (PyObject*)__Pyx_PyCode_New(6, 0, 0, 9, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__195, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_add_vegetative_branch, 1360, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__196)) __PYX_ERR(0, 1360, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1398
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 * 
 *     def _phenology(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This is is the main function for simulating events of phenology and abscission in the cotton plant. It is called each day from DailySimulation().
 */
  __pyx_tuple__197 = PyTuple_Pack(13, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state, __pyx_n_s_vpheno, __pyx_n_s_nwfl, __pyx_n_s_stemNRatio, __pyx_n_s_PhenDelayByNStress, __pyx_n_s_delayVegByCStress, __pyx_n_s_delayFrtByCStress, __pyx_n_s_nidmax, __pyx_n_s_k, __pyx_n_s_l, __pyx_n_s_m); if (unlikely(!__pyx_tuple__197)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__197);
  __Pyx_GIVEREF(__pyx_tuple__197);
  __pyx_codeobj__198 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 13, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__197, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_phenology, 1398, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__198)) __PYX_ERR(0, 1398, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1474
 *         LeafAbscission(self._sim, u)
 * 
 *     def _defoliate(self, u):             # <<<<<<<<<<<<<<
 *         """This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay()."""
 *         global PercentDefoliation
 */
  __pyx_tuple__199 = PyTuple_Pack(14, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state, __pyx_n_s_p1, __pyx_n_s_p2, __pyx_n_s_p3, __pyx_n_s_p4, __pyx_n_s_p5, __pyx_n_s_p6, __pyx_n_s_p7, __pyx_n_s_i, __pyx_n_s_OpenRatio, __pyx_n_s_dum, __pyx_n_s_perdmax); if (unlikely(!__pyx_tuple__199)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__199);
  __Pyx_GIVEREF(__pyx_tuple__199);
  __pyx_codeobj__200 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 14, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__199, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_defoliate, 1474, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__200)) __PYX_ERR(0, 1474, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1537
 * 
 * 
 *     def _simulate_this_day(self, u):             # <<<<<<<<<<<<<<
 *         global isw
 *         state = self.state(u)
 */
  __pyx_tuple__201 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_u, __pyx_n_s_state); if (unlikely(!__pyx_tuple__201)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__201);
  __Pyx_GIVEREF(__pyx_tuple__201);
  __pyx_codeobj__202 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__201, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_simulate_this_day, 1537, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__202)) __PYX_ERR(0, 1537, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1571
 *             raise SimulationEnd
 * 
 *     def _init_grid(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function initializes the soil grid variables. It is executed once at the beginning of the simulation. It is called from ReadInput().
 */
  __pyx_tuple__203 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_sumwk, __pyx_n_s_k); if (unlikely(!__pyx_tuple__203)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__203);
  __Pyx_GIVEREF(__pyx_tuple__203);
  __pyx_codeobj__204 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__203, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_init_grid, 1571, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__204)) __PYX_ERR(0, 1571, __pyx_L1_error)

  /* "_cotton2k/simulation.pyx":1612
 *                     self._sim.plant_row_column = k
 * 
 *     def read_input(self, lyrsol, **kwargs):             # <<<<<<<<<<<<<<
 *         """This is the main function for reading input."""
 *         InitializeGlobal()
 */
  __pyx_tuple__205 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_lyrsol, __pyx_n_s_kwargs); if (unlikely(!__pyx_tuple__205)) __PYX_ERR(0, 1612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__205);
  __Pyx_GIVEREF(__pyx_tuple__205);
  __pyx_codeobj__206 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS|CO_VARKEYWORDS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__205, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_src__cotton2k_simulation_pyx, __pyx_n_s_read_input, 1612, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__206)) __PYX_ERR(0, 1612, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_tuple__207 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__207)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__207);
  __Pyx_GIVEREF(__pyx_tuple__207);
  __pyx_codeobj__208 = (PyObject*)__Pyx_PyCode_New(1, 0, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__207, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__208)) __PYX_ERR(1, 1, __pyx_L1_error)

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 */
  __pyx_tuple__209 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__209)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__209);
  __Pyx_GIVEREF(__pyx_tuple__209);
  __pyx_codeobj__210 = (PyObject*)__Pyx_PyCode_New(2, 0, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__209, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__210)) __PYX_ERR(1, 3, __pyx_L1_error)

  /* "(tree fragment)":1
 * def __pyx_unpickle_SoilInit(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_tuple__211 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__211)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_tuple__211);
  __Pyx_GIVEREF(__pyx_tuple__211);
  __pyx_codeobj__212 = (PyObject*)__Pyx_PyCode_New(3, 0, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__211, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_SoilInit, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__212)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}
/* #### Code section: init_globals ### */

static CYTHON_SMALL_CODE int __Pyx_InitGlobals(void) {
  __pyx_umethod_PyDict_Type_get.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_get.method_name = &__pyx_n_s_get;
  __pyx_umethod_PyDict_Type_keys.type = (PyObject*)&PyDict_Type;
  __pyx_umethod_PyDict_Type_keys.method_name = &__pyx_n_s_keys;
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_InitString(__pyx_string_tab[0], &__pyx_n_s_Climate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[1], &__pyx_n_s_Climate___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[2], &__pyx_n_s_Climate___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[3], &__pyx_n_s_DaysTo1stSqare) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[4], &__pyx_n_s_FruitingBranch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[5], &__pyx_n_s_FruitingBranch___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[6], &__pyx_n_s_FruitingBranch___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[7], &__pyx_n_s_FruitingNode) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[8], &__pyx_n_s_FruitingNode___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[9], &__pyx_n_s_FruitingNode___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[10], &__pyx_kp_s_Incompatible_checksums_s_vs_0x84) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[11], &__pyx_n_s_IndexError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[12], &__pyx_n_s_KeyError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[13], &__pyx_n_s_MainStemLeaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[14], &__pyx_n_s_MainStemLeaf___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[15], &__pyx_n_s_MainStemLeaf___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[16], &__pyx_kp_s_No_value_specified_for_struct_at) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[17], &__pyx_kp_s_No_value_specified_for_struct_at_10) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[18], &__pyx_kp_s_No_value_specified_for_struct_at_100) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[19], &__pyx_kp_s_No_value_specified_for_struct_at_101) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[20], &__pyx_kp_s_No_value_specified_for_struct_at_102) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[21], &__pyx_kp_s_No_value_specified_for_struct_at_103) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[22], &__pyx_kp_s_No_value_specified_for_struct_at_104) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[23], &__pyx_kp_s_No_value_specified_for_struct_at_105) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[24], &__pyx_kp_s_No_value_specified_for_struct_at_106) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[25], &__pyx_kp_s_No_value_specified_for_struct_at_107) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[26], &__pyx_kp_s_No_value_specified_for_struct_at_108) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[27], &__pyx_kp_s_No_value_specified_for_struct_at_109) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[28], &__pyx_kp_s_No_value_specified_for_struct_at_11) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[29], &__pyx_kp_s_No_value_specified_for_struct_at_110) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[30], &__pyx_kp_s_No_value_specified_for_struct_at_111) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[31], &__pyx_kp_s_No_value_specified_for_struct_at_112) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[32], &__pyx_kp_s_No_value_specified_for_struct_at_113) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[33], &__pyx_kp_s_No_value_specified_for_struct_at_114) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[34], &__pyx_kp_s_No_value_specified_for_struct_at_115) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[35], &__pyx_kp_s_No_value_specified_for_struct_at_116) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[36], &__pyx_kp_s_No_value_specified_for_struct_at_117) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[37], &__pyx_kp_s_No_value_specified_for_struct_at_12) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[38], &__pyx_kp_s_No_value_specified_for_struct_at_13) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[39], &__pyx_kp_s_No_value_specified_for_struct_at_14) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[40], &__pyx_kp_s_No_value_specified_for_struct_at_15) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[41], &__pyx_kp_s_No_value_specified_for_struct_at_16) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[42], &__pyx_kp_s_No_value_specified_for_struct_at_17) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[43], &__pyx_kp_s_No_value_specified_for_struct_at_18) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[44], &__pyx_kp_s_No_value_specified_for_struct_at_19) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[45], &__pyx_kp_s_No_value_specified_for_struct_at_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[46], &__pyx_kp_s_No_value_specified_for_struct_at_20) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[47], &__pyx_kp_s_No_value_specified_for_struct_at_21) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[48], &__pyx_kp_s_No_value_specified_for_struct_at_22) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[49], &__pyx_kp_s_No_value_specified_for_struct_at_23) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[50], &__pyx_kp_s_No_value_specified_for_struct_at_24) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[51], &__pyx_kp_s_No_value_specified_for_struct_at_25) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[52], &__pyx_kp_s_No_value_specified_for_struct_at_26) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[53], &__pyx_kp_s_No_value_specified_for_struct_at_27) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[54], &__pyx_kp_s_No_value_specified_for_struct_at_28) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[55], &__pyx_kp_s_No_value_specified_for_struct_at_29) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[56], &__pyx_kp_s_No_value_specified_for_struct_at_3) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[57], &__pyx_kp_s_No_value_specified_for_struct_at_30) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[58], &__pyx_kp_s_No_value_specified_for_struct_at_31) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[59], &__pyx_kp_s_No_value_specified_for_struct_at_32) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[60], &__pyx_kp_s_No_value_specified_for_struct_at_33) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[61], &__pyx_kp_s_No_value_specified_for_struct_at_34) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[62], &__pyx_kp_s_No_value_specified_for_struct_at_35) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[63], &__pyx_kp_s_No_value_specified_for_struct_at_36) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[64], &__pyx_kp_s_No_value_specified_for_struct_at_37) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[65], &__pyx_kp_s_No_value_specified_for_struct_at_38) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[66], &__pyx_kp_s_No_value_specified_for_struct_at_39) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[67], &__pyx_kp_s_No_value_specified_for_struct_at_4) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[68], &__pyx_kp_s_No_value_specified_for_struct_at_40) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[69], &__pyx_kp_s_No_value_specified_for_struct_at_41) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[70], &__pyx_kp_s_No_value_specified_for_struct_at_42) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[71], &__pyx_kp_s_No_value_specified_for_struct_at_43) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[72], &__pyx_kp_s_No_value_specified_for_struct_at_44) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[73], &__pyx_kp_s_No_value_specified_for_struct_at_45) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[74], &__pyx_kp_s_No_value_specified_for_struct_at_46) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[75], &__pyx_kp_s_No_value_specified_for_struct_at_47) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[76], &__pyx_kp_s_No_value_specified_for_struct_at_48) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[77], &__pyx_kp_s_No_value_specified_for_struct_at_49) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[78], &__pyx_kp_s_No_value_specified_for_struct_at_5) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[79], &__pyx_kp_s_No_value_specified_for_struct_at_50) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[80], &__pyx_kp_s_No_value_specified_for_struct_at_51) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[81], &__pyx_kp_s_No_value_specified_for_struct_at_52) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[82], &__pyx_kp_s_No_value_specified_for_struct_at_53) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[83], &__pyx_kp_s_No_value_specified_for_struct_at_54) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[84], &__pyx_kp_s_No_value_specified_for_struct_at_55) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[85], &__pyx_kp_s_No_value_specified_for_struct_at_56) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[86], &__pyx_kp_s_No_value_specified_for_struct_at_57) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[87], &__pyx_kp_s_No_value_specified_for_struct_at_58) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[88], &__pyx_kp_s_No_value_specified_for_struct_at_59) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[89], &__pyx_kp_s_No_value_specified_for_struct_at_6) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[90], &__pyx_kp_s_No_value_specified_for_struct_at_60) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[91], &__pyx_kp_s_No_value_specified_for_struct_at_61) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[92], &__pyx_kp_s_No_value_specified_for_struct_at_62) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[93], &__pyx_kp_s_No_value_specified_for_struct_at_63) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[94], &__pyx_kp_s_No_value_specified_for_struct_at_64) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[95], &__pyx_kp_s_No_value_specified_for_struct_at_65) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[96], &__pyx_kp_s_No_value_specified_for_struct_at_66) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[97], &__pyx_kp_s_No_value_specified_for_struct_at_67) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[98], &__pyx_kp_s_No_value_specified_for_struct_at_68) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[99], &__pyx_kp_s_No_value_specified_for_struct_at_69) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[100], &__pyx_kp_s_No_value_specified_for_struct_at_7) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[101], &__pyx_kp_s_No_value_specified_for_struct_at_70) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[102], &__pyx_kp_s_No_value_specified_for_struct_at_71) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[103], &__pyx_kp_s_No_value_specified_for_struct_at_72) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[104], &__pyx_kp_s_No_value_specified_for_struct_at_73) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[105], &__pyx_kp_s_No_value_specified_for_struct_at_74) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[106], &__pyx_kp_s_No_value_specified_for_struct_at_75) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[107], &__pyx_kp_s_No_value_specified_for_struct_at_76) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[108], &__pyx_kp_s_No_value_specified_for_struct_at_77) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[109], &__pyx_kp_s_No_value_specified_for_struct_at_78) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[110], &__pyx_kp_s_No_value_specified_for_struct_at_79) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[111], &__pyx_kp_s_No_value_specified_for_struct_at_8) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[112], &__pyx_kp_s_No_value_specified_for_struct_at_80) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[113], &__pyx_kp_s_No_value_specified_for_struct_at_81) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[114], &__pyx_kp_s_No_value_specified_for_struct_at_82) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[115], &__pyx_kp_s_No_value_specified_for_struct_at_83) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[116], &__pyx_kp_s_No_value_specified_for_struct_at_84) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[117], &__pyx_kp_s_No_value_specified_for_struct_at_85) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[118], &__pyx_kp_s_No_value_specified_for_struct_at_86) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[119], &__pyx_kp_s_No_value_specified_for_struct_at_87) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[120], &__pyx_kp_s_No_value_specified_for_struct_at_88) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[121], &__pyx_kp_s_No_value_specified_for_struct_at_89) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[122], &__pyx_kp_s_No_value_specified_for_struct_at_9) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[123], &__pyx_kp_s_No_value_specified_for_struct_at_90) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[124], &__pyx_kp_s_No_value_specified_for_struct_at_91) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[125], &__pyx_kp_s_No_value_specified_for_struct_at_92) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[126], &__pyx_kp_s_No_value_specified_for_struct_at_93) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[127], &__pyx_kp_s_No_value_specified_for_struct_at_94) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[128], &__pyx_kp_s_No_value_specified_for_struct_at_95) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[129], &__pyx_kp_s_No_value_specified_for_struct_at_96) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[130], &__pyx_kp_s_No_value_specified_for_struct_at_97) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[131], &__pyx_kp_s_No_value_specified_for_struct_at_98) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[132], &__pyx_kp_s_No_value_specified_for_struct_at_99) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[133], &__pyx_n_s_NodeLeaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[134], &__pyx_n_s_NodeLeaf___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[135], &__pyx_n_s_NodeLeaf___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[136], &__pyx_n_s_OpenRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[137], &__pyx_n_s_OverflowError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[138], &__pyx_n_s_PhenDelayByNStress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[139], &__pyx_n_s_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[140], &__pyx_kp_s_Pickling_of_struct_members_such) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[141], &__pyx_n_s_Rad) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[142], &__pyx_n_u_Rad) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[143], &__pyx_n_s_Rain) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[144], &__pyx_n_u_Rain) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[145], &__pyx_n_s_RuntimeError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[146], &__pyx_n_s_Simulation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[147], &__pyx_n_s_SimulationEnd) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[148], &__pyx_n_s_Simulation___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[149], &__pyx_n_s_Simulation___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[150], &__pyx_n_s_Simulation__add_vegetative_branc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[151], &__pyx_n_s_Simulation__calc_light_intercept) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[152], &__pyx_n_s_Simulation__column_shading) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[153], &__pyx_n_s_Simulation__daily_climate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[154], &__pyx_n_s_Simulation__days_to_first_square) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[155], &__pyx_n_s_Simulation__defoliate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[156], &__pyx_n_s_Simulation__doy2date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[157], &__pyx_n_s_Simulation__get_net_photosynthes) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[158], &__pyx_n_s_Simulation__growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[159], &__pyx_n_s_Simulation__init_grid) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[160], &__pyx_n_s_Simulation__init_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[161], &__pyx_n_s_Simulation__phenology) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[162], &__pyx_n_s_Simulation__potential_fruit_grow) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[163], &__pyx_n_s_Simulation__potential_leaf_growt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[164], &__pyx_n_s_Simulation__simulate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[165], &__pyx_n_s_Simulation__simulate_this_day) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[166], &__pyx_n_s_Simulation__stress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[167], &__pyx_n_s_Simulation_read_input) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[168], &__pyx_n_s_Simulation_run) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[169], &__pyx_n_s_Simulation_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[170], &__pyx_n_s_SoilInit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[171], &__pyx_n_s_SoilInit___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[172], &__pyx_n_s_SoilInit___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[173], &__pyx_n_s_State) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[174], &__pyx_n_s_State___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[175], &__pyx_n_s_State___setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[176], &__pyx_n_s_State_add_fruiting_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[177], &__pyx_n_s_State_create_first_square) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[178], &__pyx_n_s_State_keys) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[179], &__pyx_n_s_StopIteration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[180], &__pyx_n_s_Tdew) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[181], &__pyx_n_u_Tdew) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[182], &__pyx_n_s_TimeToNextFruBranch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[183], &__pyx_n_s_TimeToNextVegBranch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[184], &__pyx_n_s_Tmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[185], &__pyx_n_u_Tmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[186], &__pyx_n_s_Tmin) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[187], &__pyx_n_u_Tmin) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[188], &__pyx_n_s_TypeError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[189], &__pyx_n_s_ValueError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[190], &__pyx_n_s_VegetativeBranch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[191], &__pyx_n_s_VegetativeBranch___reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[192], &__pyx_n_s_VegetativeBranch___setstate_cyth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[193], &__pyx_n_s_WaterStress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[194], &__pyx_n_s_Wind) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[195], &__pyx_n_u_Wind) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[196], &__pyx_kp_u_Y_j) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[197], &__pyx_n_s__213) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[198], &__pyx_kp_u__8) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[199], &__pyx_n_s_abscised_fruit_sites) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[200], &__pyx_n_s_abscised_leaf_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[201], &__pyx_n_s_acos) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[202], &__pyx_n_s_actual_growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[203], &__pyx_n_s_actual_soil_evaporation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[204], &__pyx_n_s_actual_transpiration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[205], &__pyx_n_s_add_fruiting_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[206], &__pyx_n_s_add_vegetative_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[207], &__pyx_n_s_addlfn) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[208], &__pyx_n_s_age) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[209], &__pyx_n_s_age_of_pre_fruiting_nodes) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[210], &__pyx_n_s_agemax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[211], &__pyx_n_s_agetop) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[212], &__pyx_n_u_agricultural_inputs) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[213], &__pyx_n_u_air_dry) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[214], &__pyx_n_s_albedo) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[215], &__pyx_n_u_alpha) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[216], &__pyx_n_s_ambient_co2_factor) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[217], &__pyx_n_u_ammonium) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[218], &__pyx_n_u_ammonium_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[219], &__pyx_n_u_amount) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[220], &__pyx_n_s_applied_water) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[221], &__pyx_n_s_area) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[222], &__pyx_n_s_asyncio_coroutines) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[223], &__pyx_n_s_average_temperature) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[224], &__pyx_n_u_beta) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[225], &__pyx_n_s_bloom_weight_loss) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[226], &__pyx_n_s_bmain) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[227], &__pyx_n_s_boll) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[228], &__pyx_n_u_bulk_density) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[229], &__pyx_n_s_burr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[230], &__pyx_n_s_burr_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[231], &__pyx_n_s_c) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[232], &__pyx_n_s_c11) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[233], &__pyx_n_s_calc_light_interception) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[234], &__pyx_n_s_carbon_stress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[235], &__pyx_n_s_cc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[236], &__pyx_n_s_cd) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[237], &__pyx_n_s_cdleaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[238], &__pyx_n_s_cdpet) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[239], &__pyx_n_s_cdroot) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[240], &__pyx_n_s_cdstem) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[241], &__pyx_n_s_cells) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[242], &__pyx_n_s_class_getitem) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[243], &__pyx_n_u_clay) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[244], &__pyx_n_s_climate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[245], &__pyx_n_s_cline_in_traceback) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[246], &__pyx_n_s_cloud_cor) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[247], &__pyx_n_s_cloud_cov) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[248], &__pyx_n_s_column_shading) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[249], &__pyx_n_s_compute_day_length) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[250], &__pyx_n_s_cos) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[251], &__pyx_n_s_cotton2k_climate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[252], &__pyx_n_s_cotton2k_leaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[253], &__pyx_n_s_cotton2k_photosynthesis) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[254], &__pyx_n_s_cotton2k_simulation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[255], &__pyx_n_s_cotton2k_utils) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[256], &__pyx_n_s_cotylwt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[257], &__pyx_n_s_create_first_square) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[258], &__pyx_n_s_cultivar_parameters) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[259], &__pyx_n_s_cumulative_evaporation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[260], &__pyx_n_s_cumulative_nitrogen_loss) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[261], &__pyx_n_s_cumulative_transpiration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[262], &__pyx_n_s_daily_climate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[263], &__pyx_n_s_date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[264], &__pyx_n_u_date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[265], &__pyx_n_s_date2doy) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[266], &__pyx_n_s_datetime) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[267], &__pyx_n_s_day_inc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[268], &__pyx_n_s_day_length) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[269], &__pyx_n_u_day_length) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[270], &__pyx_n_s_daynum) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[271], &__pyx_n_s_days_to_first_square) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[272], &__pyx_n_s_declination) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[273], &__pyx_n_u_declination) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[274], &__pyx_n_s_defoliate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[275], &__pyx_kp_u_defoliation_prediction) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[276], &__pyx_n_s_delayFrtByCStress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[277], &__pyx_n_s_delayVegByCStress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[278], &__pyx_n_s_delay_for_new_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[279], &__pyx_n_s_delay_for_new_fruiting_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[280], &__pyx_n_s_delay_for_new_node) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[281], &__pyx_n_s_denf2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[282], &__pyx_n_s_denfac) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[283], &__pyx_n_s_density_factor) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[284], &__pyx_n_u_depth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[285], &__pyx_n_s_dew_point) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[286], &__pyx_n_u_dewpoint) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[287], &__pyx_n_s_dict) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[288], &__pyx_n_s_dict_2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[289], &__pyx_kp_u_disable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[290], &__pyx_n_s_doc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[291], &__pyx_n_s_doy2date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[292], &__pyx_n_u_drip_depth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[293], &__pyx_n_u_drip_horizontal_place) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[294], &__pyx_n_s_dsbe) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[295], &__pyx_n_s_dum) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[296], &__pyx_n_s_elevation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[297], &__pyx_kp_u_enable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[298], &__pyx_n_s_enumerate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[299], &__pyx_n_s_et1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[300], &__pyx_n_s_et2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[301], &__pyx_n_s_evapotranspiration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[302], &__pyx_n_s_extra_carbon) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[303], &__pyx_n_u_fertilization) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[304], &__pyx_n_u_field_capacity_hydraulic_conduct) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[305], &__pyx_n_u_field_capacity_water_potential) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[306], &__pyx_n_s_first_node) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[307], &__pyx_n_s_first_square_leaf_area) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[308], &__pyx_n_s_fraction) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[309], &__pyx_n_s_fresh_organic_matter) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[310], &__pyx_n_s_fruit_growth_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[311], &__pyx_n_s_fruiting_branches) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[312], &__pyx_kp_u_gc) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[313], &__pyx_n_s_get) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[314], &__pyx_n_s_get_net_photosynthesis) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[315], &__pyx_n_s_getattr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[316], &__pyx_n_s_getstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[317], &__pyx_n_s_ginning_percent) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[318], &__pyx_n_s_green_bolls_burr_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[319], &__pyx_n_s_green_bolls_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[320], &__pyx_n_s_growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[321], &__pyx_n_s_growth_factor) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[322], &__pyx_n_s_gsubr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[323], &__pyx_n_s_hour) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[324], &__pyx_n_s_hours) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[325], &__pyx_n_s_htdenf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[326], &__pyx_n_s_humidity) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[327], &__pyx_n_s_hydrology) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[328], &__pyx_n_s_i) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[329], &__pyx_n_s_ihr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[330], &__pyx_n_u_immediate_drainage_water_potenti) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[331], &__pyx_n_s_import) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[332], &__pyx_n_s_init_grid) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[333], &__pyx_n_s_init_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[334], &__pyx_n_s_init_subclass) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[335], &__pyx_n_s_initial) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[336], &__pyx_n_u_irrigation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[337], &__pyx_n_s_is_coroutine) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[338], &__pyx_kp_u_isenabled) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[339], &__pyx_n_s_items) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[340], &__pyx_n_s_j) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[341], &__pyx_n_s_jp1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[342], &__pyx_n_s_k) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[343], &__pyx_n_s_k0) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[344], &__pyx_n_s_kday) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[345], &__pyx_n_s_keys) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[346], &__pyx_n_s_kkday) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[347], &__pyx_n_s_kwargs) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[348], &__pyx_n_s_l) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[349], &__pyx_n_s_l1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[350], &__pyx_n_s_l2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[351], &__pyx_n_s_last_fruiting_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[352], &__pyx_n_s_latitude) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[353], &__pyx_n_s_layer_depth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[354], &__pyx_n_s_layers) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[355], &__pyx_n_u_layers) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[356], &__pyx_n_s_leaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[357], &__pyx_n_s_leaf_area) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[358], &__pyx_n_s_leaf_area_index) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[359], &__pyx_n_s_leaf_area_pre_fruiting) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[360], &__pyx_n_s_leaf_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[361], &__pyx_n_s_leaf_nitrogen_concentration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[362], &__pyx_n_s_leaf_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[363], &__pyx_n_s_leaf_weight_area_ratio) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[364], &__pyx_n_s_leaf_weight_pre_fruiting) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[365], &__pyx_n_s_lfint) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[366], &__pyx_n_s_light_interception) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[367], &__pyx_n_s_lint_yield) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[368], &__pyx_n_s_longitude) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[369], &__pyx_n_s_lp1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[370], &__pyx_n_s_lyrsol) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[371], &__pyx_n_s_lytres) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[372], &__pyx_n_s_m) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[373], &__pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[374], &__pyx_n_s_main_stem_leaf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[375], &__pyx_n_s_math) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[376], &__pyx_n_u_max) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[377], &__pyx_n_u_max_conductivity) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[378], &__pyx_n_s_maxrtgr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[379], &__pyx_n_s_maxstmgr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[380], &__pyx_n_s_metaclass) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[381], &__pyx_n_u_method) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[382], &__pyx_n_s_microsecond) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[383], &__pyx_n_u_min) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[384], &__pyx_n_s_minute) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[385], &__pyx_n_s_module) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[386], &__pyx_n_s_mp1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[387], &__pyx_n_s_mro_entries) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[388], &__pyx_n_s_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[389], &__pyx_n_s_net_radiation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[390], &__pyx_n_s_new) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[391], &__pyx_n_s_new_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[392], &__pyx_n_s_new_node) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[393], &__pyx_n_s_new_node_initial_leaf_area) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[394], &__pyx_n_s_newbr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[395], &__pyx_n_s_nidmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[396], &__pyx_n_u_nitrate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[397], &__pyx_n_u_nitrate_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[398], &__pyx_n_s_nitrate_nitrogen_content) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[399], &__pyx_n_s_nitrogen_stress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[400], &__pyx_n_s_nitrogen_stress_fruiting) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[401], &__pyx_n_s_nitrogen_stress_root) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[402], &__pyx_n_s_nitrogen_stress_vegetative) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[403], &__pyx_n_s_nodes) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[404], &__pyx_n_s_number_of_fruiting_branches) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[405], &__pyx_n_s_number_of_fruiting_nodes) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[406], &__pyx_n_s_number_of_fruiting_sites) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[407], &__pyx_n_s_number_of_green_bolls) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[408], &__pyx_n_s_number_of_layers_with_root) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[409], &__pyx_n_s_number_of_left_columns_with_root) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[410], &__pyx_n_s_number_of_open_bolls) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[411], &__pyx_n_s_number_of_pre_fruiting_nodes) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[412], &__pyx_n_s_number_of_right_columns_with_roo) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[413], &__pyx_n_s_number_of_squares) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[414], &__pyx_n_s_number_of_vegetative_branches) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[415], &__pyx_n_s_nwfl) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[416], &__pyx_n_s_oldstmwt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[417], &__pyx_n_s_open_bolls_burr_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[418], &__pyx_n_s_open_bolls_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[419], &__pyx_n_u_organic_matter) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[420], &__pyx_n_s_p) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[421], &__pyx_n_s_p1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[422], &__pyx_n_s_p2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[423], &__pyx_n_s_p3) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[424], &__pyx_n_s_p4) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[425], &__pyx_n_s_p5) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[426], &__pyx_n_s_p6) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[427], &__pyx_n_s_p7) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[428], &__pyx_n_s_perdmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[429], &__pyx_n_s_petiole) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[430], &__pyx_n_s_petiole_nitrogen_concentration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[431], &__pyx_n_s_petiole_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[432], &__pyx_n_s_pex) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[433], &__pyx_n_s_phenology) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[434], &__pyx_n_s_pi) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[435], &__pyx_n_s_pickle) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[436], &__pyx_n_s_plant_height) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[437], &__pyx_n_s_plant_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[438], &__pyx_kp_u_planting_date_or_emergence_date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[439], &__pyx_n_s_pnetcor) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[440], &__pyx_n_s_pollination_switch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[441], &__pyx_n_s_potential_fruit_growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[442], &__pyx_n_s_potential_growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[443], &__pyx_n_s_potential_growth_for_leaf_area) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[444], &__pyx_n_s_potential_growth_for_leaf_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[445], &__pyx_n_s_potential_growth_for_petiole_wei) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[446], &__pyx_n_s_potential_leaf_growth) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[447], &__pyx_n_s_pplant) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[448], &__pyx_n_s_prepare) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[449], &__pyx_n_s_psilim) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[450], &__pyx_n_s_pstand) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[451], &__pyx_n_s_ptnfac) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[452], &__pyx_n_s_pts) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[453], &__pyx_n_s_pyx_PickleError) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[454], &__pyx_n_s_pyx_checksum) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[455], &__pyx_n_s_pyx_result) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[456], &__pyx_n_s_pyx_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[457], &__pyx_n_s_pyx_type) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[458], &__pyx_n_s_pyx_unpickle_SoilInit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[459], &__pyx_n_s_pyx_vtable) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[460], &__pyx_n_s_qualname) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[461], &__pyx_n_s_radiation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[462], &__pyx_n_u_radiation) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[463], &__pyx_n_s_radsum) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[464], &__pyx_n_u_rain) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[465], &__pyx_n_s_rainToday) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[466], &__pyx_n_s_range) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[467], &__pyx_n_s_rate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[468], &__pyx_n_s_ratebol) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[469], &__pyx_n_s_ratebur) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[470], &__pyx_n_s_ratesqr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[471], &__pyx_n_u_ratio_implicit) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[472], &__pyx_n_s_rbmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[473], &__pyx_n_s_read_input) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[474], &__pyx_n_s_reduce) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[475], &__pyx_n_s_reduce_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[476], &__pyx_n_s_reduce_ex) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[477], &__pyx_n_s_ref_et) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[478], &__pyx_n_s_replace) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[479], &__pyx_n_s_result) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[480], &__pyx_n_s_root) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[481], &__pyx_n_s_root_nitrogen_concentration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[482], &__pyx_n_s_row_space) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[483], &__pyx_n_s_rsubl) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[484], &__pyx_n_s_rsubo) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[485], &__pyx_n_s_run) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[486], &__pyx_n_s_runoff) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[487], &__pyx_n_s_runoffToday) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[488], &__pyx_n_u_sand) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[489], &__pyx_n_u_saturated_hydraulic_conductivity) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[490], &__pyx_n_s_sd) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[491], &__pyx_n_s_second) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[492], &__pyx_n_s_seed_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[493], &__pyx_n_s_seed_nitrogen_concentration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[494], &__pyx_n_s_self) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[495], &__pyx_kp_s_self___cannot_be_converted_to_a) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[496], &__pyx_kp_s_self_climate_cannot_be_converted) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[497], &__pyx_n_s_set_name) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[498], &__pyx_n_s_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[499], &__pyx_n_s_setstate_cython) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[500], &__pyx_n_s_shade) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[501], &__pyx_n_s_simulate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[502], &__pyx_n_s_simulate_this_day) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[503], &__pyx_n_s_sin) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[504], &__pyx_n_s_sinb) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[505], &__pyx_n_s_smax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[506], &__pyx_n_s_smaxx) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[507], &__pyx_n_s_soil) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[508], &__pyx_n_s_solar_noon) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[509], &__pyx_n_u_solar_noon) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[510], &__pyx_n_s_sqrt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[511], &__pyx_n_s_square) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[512], &__pyx_n_s_square_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[513], &__pyx_n_s_square_nitrogen_concentration) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[514], &__pyx_n_s_square_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[515], &__pyx_kp_s_src__cotton2k_simulation_pyx) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[516], &__pyx_n_s_stage) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[517], &__pyx_n_s_start) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[518], &__pyx_n_s_start_date) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[519], &__pyx_n_s_state) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[520], &__pyx_n_s_state0) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[521], &__pyx_n_s_stemNRatio) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[522], &__pyx_n_s_stem_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[523], &__pyx_n_s_stem_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[524], &__pyx_n_s_stemnew) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[525], &__pyx_n_s_step) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[526], &__pyx_n_s_stop) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[527], &__pyx_n_s_stress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[528], &__pyx_kp_s_stringsource) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[529], &__pyx_n_s_strptime) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[530], &__pyx_n_s_sumpdr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[531], &__pyx_n_s_sumwk) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[532], &__pyx_n_s_sunr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[533], &__pyx_n_u_sunr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[534], &__pyx_n_s_suns) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[535], &__pyx_n_u_suns) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[536], &__pyx_n_s_super) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[537], &__pyx_n_s_sw) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[538], &__pyx_n_s_sw0) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[539], &__pyx_n_s_sw1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[540], &__pyx_n_s_t1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[541], &__pyx_n_s_t2) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[542], &__pyx_n_s_t3) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[543], &__pyx_n_s_tav) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[544], &__pyx_n_s_tdday) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[545], &__pyx_n_s_temperature) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[546], &__pyx_n_s_temperature_on_leaf_growth_rate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[547], &__pyx_n_s_test) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[548], &__pyx_n_s_tfrt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[549], &__pyx_n_u_theta) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[550], &__pyx_n_s_ti) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[551], &__pyx_n_s_time_to_new_fruiting_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[552], &__pyx_n_s_timedelta) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[553], &__pyx_n_s_tmpisr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[554], &__pyx_n_u_tmpisr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[555], &__pyx_n_s_total_required_nitrogen) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[556], &__pyx_n_u_type) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[557], &__pyx_n_s_u) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[558], &__pyx_n_s_update) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[559], &__pyx_n_u_urea) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[560], &__pyx_n_s_use_setstate) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[561], &__pyx_n_s_vegetative_branch) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[562], &__pyx_n_s_vegetative_branches) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[563], &__pyx_n_s_version) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[564], &__pyx_n_s_vfrtbr) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[565], &__pyx_n_s_voldstm) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[566], &__pyx_n_s_vpheno) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[567], &__pyx_n_s_vpnet) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[568], &__pyx_n_s_vpotfrt) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[569], &__pyx_n_s_vpotlf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[570], &__pyx_n_s_vpvegb) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[571], &__pyx_n_s_vstrs) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[572], &__pyx_n_u_water) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[573], &__pyx_n_s_water_stress) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[574], &__pyx_n_s_water_stress_stem) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[575], &__pyx_n_s_wattsm) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[576], &__pyx_n_s_wbmax) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[577], &__pyx_n_s_weight) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[578], &__pyx_n_s_weight_capable_uptake) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[579], &__pyx_n_s_wfdb) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[580], &__pyx_n_u_wind) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[581], &__pyx_n_s_wind_speed) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[582], &__pyx_n_s_wnytf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[583], &__pyx_n_s_wstrlf) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[584], &__pyx_n_s_wtfstrs) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[585], &__pyx_n_s_xlat) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[586], &__pyx_n_s_year) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[587], &__pyx_n_s_z1) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[588], &__pyx_n_s_zero) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  if (__Pyx_InitString(__pyx_string_tab[589], &__pyx_n_s_zint) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  #endif
  __pyx_float_0_3 = PyFloat_FromDouble(0.3); if (unlikely(!__pyx_float_0_3)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_5 = PyFloat_FromDouble(0.5); if (unlikely(!__pyx_float_0_5)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_08 = PyFloat_FromDouble(0.08); if (unlikely(!__pyx_float_0_08)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_float_0_0002 = PyFloat_FromDouble(0.0002); if (unlikely(!__pyx_float_0_0002)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_2 = PyInt_FromLong(2); if (unlikely(!__pyx_int_2)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_4 = PyInt_FromLong(4); if (unlikely(!__pyx_int_4)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_10 = PyInt_FromLong(10); if (unlikely(!__pyx_int_10)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_12 = PyInt_FromLong(12); if (unlikely(!__pyx_int_12)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_24 = PyInt_FromLong(24); if (unlikely(!__pyx_int_24)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_30 = PyInt_FromLong(30); if (unlikely(!__pyx_int_30)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_180 = PyInt_FromLong(180); if (unlikely(!__pyx_int_180)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1024 = PyInt_FromLong(1024); if (unlikely(!__pyx_int_1024)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_1000000 = PyInt_FromLong(1000000L); if (unlikely(!__pyx_int_1000000)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_int_139140702 = PyInt_FromLong(139140702L); if (unlikely(!__pyx_int_139140702)) __PYX_ERR(0, 1, __pyx_L1_error)
  return 0;
  __pyx_L1_error:;
  return -1;
}
/* #### Code section: init_module ### */

static CYTHON_SMALL_CODE int __Pyx_modinit_global_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_export_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_init_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_type_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_variable_import_code(void); /*proto*/
static CYTHON_SMALL_CODE int __Pyx_modinit_function_import_code(void); /*proto*/

static int __Pyx_modinit_global_init_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
  /*--- Global init code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
  /*--- Variable export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_export_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
  /*--- Function export code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_type_init_code(void) {
  __Pyx_RefNannyDeclarations
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
  /*--- Type init code ---*/
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_SoilInit = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_SoilInit_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_SoilInit)) __PYX_ERR(0, 78, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_SoilInit) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_SoilInit.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_SoilInit.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_SoilInit.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_SoilInit.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SoilInit, __pyx_type_9_cotton2k_10simulation_SoilInit) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_SoilInit, (PyObject *)&__pyx_type_9_cotton2k_10simulation_SoilInit) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_SoilInit) < 0) __PYX_ERR(0, 78, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_SoilInit = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_SoilInit;
  #else
  __pyx_ptype_9_cotton2k_10simulation_SoilInit = &__pyx_type_9_cotton2k_10simulation_SoilInit;
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_Climate = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_Climate_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_Climate)) __PYX_ERR(0, 162, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_Climate) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_Climate.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_Climate.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_Climate.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_Climate.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Climate, __pyx_type_9_cotton2k_10simulation_Climate) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Climate, (PyObject *)&__pyx_type_9_cotton2k_10simulation_Climate) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_Climate) < 0) __PYX_ERR(0, 162, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_Climate = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_Climate;
  #else
  __pyx_ptype_9_cotton2k_10simulation_Climate = &__pyx_type_9_cotton2k_10simulation_Climate;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_NodeLeaf = &__pyx_vtable_9_cotton2k_10simulation_NodeLeaf;
  __pyx_vtable_9_cotton2k_10simulation_NodeLeaf.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_NodeLeaf *(*)(Leaf *))__pyx_f_9_cotton2k_10simulation_8NodeLeaf_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_NodeLeaf = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_NodeLeaf_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_NodeLeaf)) __PYX_ERR(0, 272, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_NodeLeaf.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_NodeLeaf.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_NodeLeaf.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_NodeLeaf.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_NodeLeaf, __pyx_vtabptr_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_NodeLeaf.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NodeLeaf, __pyx_type_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_NodeLeaf, (PyObject *)&__pyx_type_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_NodeLeaf) < 0) __PYX_ERR(0, 272, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_NodeLeaf = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_NodeLeaf;
  #else
  __pyx_ptype_9_cotton2k_10simulation_NodeLeaf = &__pyx_type_9_cotton2k_10simulation_NodeLeaf;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_FruitingNode = &__pyx_vtable_9_cotton2k_10simulation_FruitingNode;
  __pyx_vtable_9_cotton2k_10simulation_FruitingNode.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_FruitingNode *(*)(FruitingSite *))__pyx_f_9_cotton2k_10simulation_12FruitingNode_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_FruitingNode = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_FruitingNode_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_FruitingNode)) __PYX_ERR(0, 298, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_FruitingNode.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_FruitingNode.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_FruitingNode.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_FruitingNode.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_FruitingNode, __pyx_vtabptr_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_FruitingNode.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FruitingNode, __pyx_type_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FruitingNode, (PyObject *)&__pyx_type_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_FruitingNode) < 0) __PYX_ERR(0, 298, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_FruitingNode = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_FruitingNode;
  #else
  __pyx_ptype_9_cotton2k_10simulation_FruitingNode = &__pyx_type_9_cotton2k_10simulation_FruitingNode;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_MainStemLeaf = &__pyx_vtable_9_cotton2k_10simulation_MainStemLeaf;
  __pyx_vtable_9_cotton2k_10simulation_MainStemLeaf.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_MainStemLeaf *(*)(MainStemLeaf *))__pyx_f_9_cotton2k_10simulation_12MainStemLeaf_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_MainStemLeaf = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_MainStemLeaf_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_MainStemLeaf)) __PYX_ERR(0, 340, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_MainStemLeaf.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_MainStemLeaf.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_MainStemLeaf.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_MainStemLeaf.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_MainStemLeaf, __pyx_vtabptr_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_MainStemLeaf.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MainStemLeaf, __pyx_type_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_MainStemLeaf, (PyObject *)&__pyx_type_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_MainStemLeaf) < 0) __PYX_ERR(0, 340, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_MainStemLeaf = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_MainStemLeaf;
  #else
  __pyx_ptype_9_cotton2k_10simulation_MainStemLeaf = &__pyx_type_9_cotton2k_10simulation_MainStemLeaf;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_FruitingBranch = &__pyx_vtable_9_cotton2k_10simulation_FruitingBranch;
  __pyx_vtable_9_cotton2k_10simulation_FruitingBranch.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_FruitingBranch *(*)(FruitingBranch *))__pyx_f_9_cotton2k_10simulation_14FruitingBranch_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_FruitingBranch = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_FruitingBranch_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_FruitingBranch)) __PYX_ERR(0, 373, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_FruitingBranch.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_FruitingBranch.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_FruitingBranch.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_FruitingBranch.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_FruitingBranch, __pyx_vtabptr_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_FruitingBranch.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FruitingBranch, __pyx_type_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_FruitingBranch, (PyObject *)&__pyx_type_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_FruitingBranch) < 0) __PYX_ERR(0, 373, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_FruitingBranch = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_FruitingBranch;
  #else
  __pyx_ptype_9_cotton2k_10simulation_FruitingBranch = &__pyx_type_9_cotton2k_10simulation_FruitingBranch;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_VegetativeBranch = &__pyx_vtable_9_cotton2k_10simulation_VegetativeBranch;
  __pyx_vtable_9_cotton2k_10simulation_VegetativeBranch.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_VegetativeBranch *(*)(VegetativeBranch *))__pyx_f_9_cotton2k_10simulation_16VegetativeBranch_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_VegetativeBranch = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_VegetativeBranch_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_VegetativeBranch)) __PYX_ERR(0, 415, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_VegetativeBranch.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_VegetativeBranch.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_VegetativeBranch.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_VegetativeBranch.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_VegetativeBranch, __pyx_vtabptr_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_VegetativeBranch.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VegetativeBranch, __pyx_type_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_VegetativeBranch, (PyObject *)&__pyx_type_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_VegetativeBranch) < 0) __PYX_ERR(0, 415, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_VegetativeBranch = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_VegetativeBranch;
  #else
  __pyx_ptype_9_cotton2k_10simulation_VegetativeBranch = &__pyx_type_9_cotton2k_10simulation_VegetativeBranch;
  #endif
  __pyx_vtabptr_9_cotton2k_10simulation_State = &__pyx_vtable_9_cotton2k_10simulation_State;
  __pyx_vtable_9_cotton2k_10simulation_State.from_ptr = (struct __pyx_obj_9_cotton2k_10simulation_State *(*)(State *))__pyx_f_9_cotton2k_10simulation_5State_from_ptr;
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_State = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_State_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_State)) __PYX_ERR(0, 453, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_State.tp_print = 0;
  #endif
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_State, __pyx_vtabptr_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #else
  if (__Pyx_SetVtable(__pyx_type_9_cotton2k_10simulation_State.tp_dict, __pyx_vtabptr_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  if (__Pyx_MergeVtables(&__pyx_type_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_State, __pyx_type_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_State, (PyObject *)&__pyx_type_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_State) < 0) __PYX_ERR(0, 453, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_State = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_State;
  #else
  __pyx_ptype_9_cotton2k_10simulation_State = &__pyx_type_9_cotton2k_10simulation_State;
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_type_9_cotton2k_10simulation_Simulation = PyType_FromSpec(&__pyx_type_9_cotton2k_10simulation_Simulation_spec); if (unlikely(!__pyx_type_9_cotton2k_10simulation_Simulation)) __PYX_ERR(0, 567, __pyx_L1_error)
  #else
  if (__Pyx_PyType_Ready(&__pyx_type_9_cotton2k_10simulation_Simulation) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3
  __pyx_type_9_cotton2k_10simulation_Simulation.tp_print = 0;
  #endif
  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_9_cotton2k_10simulation_Simulation.tp_dictoffset && __pyx_type_9_cotton2k_10simulation_Simulation.tp_getattro == PyObject_GenericGetAttr)) {
    __pyx_type_9_cotton2k_10simulation_Simulation.tp_getattro = __Pyx_PyObject_GenericGetAttr;
  }
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Simulation, __pyx_type_9_cotton2k_10simulation_Simulation) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  #else
  if (PyObject_SetAttr(__pyx_m, __pyx_n_s_Simulation, (PyObject *)&__pyx_type_9_cotton2k_10simulation_Simulation) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  #endif
  #if !CYTHON_COMPILING_IN_LIMITED_API
  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_9_cotton2k_10simulation_Simulation) < 0) __PYX_ERR(0, 567, __pyx_L1_error)
  #endif
  #if CYTHON_COMPILING_IN_LIMITED_API
  __pyx_ptype_9_cotton2k_10simulation_Simulation = (PyTypeObject *)__pyx_type_9_cotton2k_10simulation_Simulation;
  #else
  __pyx_ptype_9_cotton2k_10simulation_Simulation = &__pyx_type_9_cotton2k_10simulation_Simulation;
  #endif
  __Pyx_RefNannyFinishContext();
  return 0;
  __pyx_L1_error:;
  __Pyx_RefNannyFinishContext();
  return -1;
}

static int __Pyx_modinit_type_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
  /*--- Type import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_variable_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
  /*--- Variable import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}

static int __Pyx_modinit_function_import_code(void) {
  __Pyx_RefNannyDeclarations
  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
  /*--- Function import code ---*/
  __Pyx_RefNannyFinishContext();
  return 0;
}


#if PY_MAJOR_VERSION >= 3
#if CYTHON_PEP489_MULTI_PHASE_INIT
static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
static int __pyx_pymod_exec_simulation(PyObject* module); /*proto*/
static PyModuleDef_Slot __pyx_moduledef_slots[] = {
  {Py_mod_create, (void*)__pyx_pymod_create},
  {Py_mod_exec, (void*)__pyx_pymod_exec_simulation},
  {0, NULL}
};
#endif

#ifdef __cplusplus
namespace {
  struct PyModuleDef __pyx_moduledef =
  #else
  static struct PyModuleDef __pyx_moduledef =
  #endif
  {
      PyModuleDef_HEAD_INIT,
      "simulation",
      0, /* m_doc */
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      0, /* m_size */
    #elif CYTHON_COMPILING_IN_LIMITED_API
      sizeof(__pyx_mstate), /* m_size */
    #else
      -1, /* m_size */
    #endif
      __pyx_methods /* m_methods */,
    #if CYTHON_PEP489_MULTI_PHASE_INIT
      __pyx_moduledef_slots, /* m_slots */
    #else
      NULL, /* m_reload */
    #endif
    #if CYTHON_COMPILING_IN_LIMITED_API
      __pyx_m_traverse, /* m_traverse */
      __pyx_m_clear, /* m_clear */
      NULL /* m_free */
    #else
      NULL, /* m_traverse */
      NULL, /* m_clear */
      NULL /* m_free */
    #endif
  };
  #ifdef __cplusplus
} /* anonymous namespace */
#endif
#endif

#ifndef CYTHON_NO_PYINIT_EXPORT
#define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
#elif PY_MAJOR_VERSION < 3
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" void
#else
#define __Pyx_PyMODINIT_FUNC void
#endif
#else
#ifdef __cplusplus
#define __Pyx_PyMODINIT_FUNC extern "C" PyObject *
#else
#define __Pyx_PyMODINIT_FUNC PyObject *
#endif
#endif


#if PY_MAJOR_VERSION < 3
__Pyx_PyMODINIT_FUNC initsimulation(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC initsimulation(void)
#else
__Pyx_PyMODINIT_FUNC PyInit_simulation(void) CYTHON_SMALL_CODE; /*proto*/
__Pyx_PyMODINIT_FUNC PyInit_simulation(void)
#if CYTHON_PEP489_MULTI_PHASE_INIT
{
  return PyModuleDef_Init(&__pyx_moduledef);
}
static CYTHON_SMALL_CODE int __Pyx_check_single_interpreter(void) {
    #if PY_VERSION_HEX >= 0x030700A1
    static PY_INT64_T main_interpreter_id = -1;
    PY_INT64_T current_id = PyInterpreterState_GetID(PyThreadState_Get()->interp);
    if (main_interpreter_id == -1) {
        main_interpreter_id = current_id;
        return (unlikely(current_id == -1)) ? -1 : 0;
    } else if (unlikely(main_interpreter_id != current_id))
    #else
    static PyInterpreterState *main_interpreter = NULL;
    PyInterpreterState *current_interpreter = PyThreadState_Get()->interp;
    if (!main_interpreter) {
        main_interpreter = current_interpreter;
    } else if (unlikely(main_interpreter != current_interpreter))
    #endif
    {
        PyErr_SetString(
            PyExc_ImportError,
            "Interpreter change detected - this module can only be loaded into one interpreter per process.");
        return -1;
    }
    return 0;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *module, const char* from_name, const char* to_name, int allow_none)
#else
static CYTHON_SMALL_CODE int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name, int allow_none)
#endif
{
    PyObject *value = PyObject_GetAttrString(spec, from_name);
    int result = 0;
    if (likely(value)) {
        if (allow_none || value != Py_None) {
#if CYTHON_COMPILING_IN_LIMITED_API
            result = PyModule_AddObject(module, to_name, value);
#else
            result = PyDict_SetItemString(moddict, to_name, value);
#endif
        }
        Py_DECREF(value);
    } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Clear();
    } else {
        result = -1;
    }
    return result;
}
static CYTHON_SMALL_CODE PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def) {
    PyObject *module = NULL, *moddict, *modname;
    CYTHON_UNUSED_VAR(def);
    if (__Pyx_check_single_interpreter())
        return NULL;
    if (__pyx_m)
        return __Pyx_NewRef(__pyx_m);
    modname = PyObject_GetAttrString(spec, "name");
    if (unlikely(!modname)) goto bad;
    module = PyModule_NewObject(modname);
    Py_DECREF(modname);
    if (unlikely(!module)) goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    moddict = module;
#else
    moddict = PyModule_GetDict(module);
    if (unlikely(!moddict)) goto bad;
#endif
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__", 1) < 0)) goto bad;
    if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__", 0) < 0)) goto bad;
    return module;
bad:
    Py_XDECREF(module);
    return NULL;
}


static CYTHON_SMALL_CODE int __pyx_pymod_exec_simulation(PyObject *__pyx_pyinit_module)
#endif
#endif
{
  PyObject *__pyx_t_1 = NULL;
  PyObject *__pyx_t_2 = NULL;
  PyObject *__pyx_t_3 = NULL;
  PyObject *__pyx_t_4 = NULL;
  int __pyx_lineno = 0;
  const char *__pyx_filename = NULL;
  int __pyx_clineno = 0;
  __Pyx_RefNannyDeclarations
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  if (__pyx_m) {
    if (__pyx_m == __pyx_pyinit_module) return 0;
    PyErr_SetString(PyExc_RuntimeError, "Module 'simulation' has already been imported. Re-initialisation is not supported.");
    return -1;
  }
  #elif PY_MAJOR_VERSION >= 3
  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
  #endif
  /*--- Module creation code ---*/
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  __pyx_m = __pyx_pyinit_module;
  Py_INCREF(__pyx_m);
  #else
  #if PY_MAJOR_VERSION < 3
  __pyx_m = Py_InitModule4("simulation", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #elif CYTHON_COMPILING_IN_LIMITED_API
  __pyx_t_1 = PyModule_Create(&__pyx_moduledef); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (unlikely((PyState_AddModule(__pyx_t_1, &__pyx_moduledef) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  #else
  __pyx_m = PyModule_Create(&__pyx_moduledef);
  if (unlikely(!__pyx_m)) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #endif
  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_d);
  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_b);
  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(0, 1, __pyx_L1_error)
  Py_INCREF(__pyx_cython_runtime);
  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(0, 1, __pyx_L1_error);
  #if CYTHON_REFNANNY
__Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
if (!__Pyx_RefNanny) {
  PyErr_Clear();
  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
  if (!__Pyx_RefNanny)
      Py_FatalError("failed to import 'refnanny' module");
}
#endif
  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_simulation(void)", 0);
  if (__Pyx_check_binary_version() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pxy_PyFrame_Initialize_Offsets
  __Pxy_PyFrame_Initialize_Offsets();
  #endif
  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(0, 1, __pyx_L1_error)
  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(0, 1, __pyx_L1_error)
  #ifdef __Pyx_CyFunction_USED
  if (__pyx_CyFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_FusedFunction_USED
  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Coroutine_USED
  if (__pyx_Coroutine_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_Generator_USED
  if (__pyx_Generator_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_AsyncGen_USED
  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  #ifdef __Pyx_StopAsyncIteration_USED
  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  /*--- Library function declarations ---*/
  /*--- Threads initialization code ---*/
  #if defined(WITH_THREAD) && PY_VERSION_HEX < 0x030700F0 && defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
  PyEval_InitThreads();
  #endif
  /*--- Initialize various global constants etc. ---*/
  if (__Pyx_InitGlobals() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif
  if (__pyx_module_is_main__cotton2k__simulation) {
    if (PyObject_SetAttr(__pyx_m, __pyx_n_s_name, __pyx_n_s_main) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  }
  #if PY_MAJOR_VERSION >= 3
  {
    PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(0, 1, __pyx_L1_error)
    if (!PyDict_GetItemString(modules, "_cotton2k.simulation")) {
      if (unlikely((PyDict_SetItemString(modules, "_cotton2k.simulation", __pyx_m) < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
    }
  }
  #endif
  /*--- Builtin init code ---*/
  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Constants init code ---*/
  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  /*--- Global type/function init code ---*/
  (void)__Pyx_modinit_global_init_code();
  (void)__Pyx_modinit_variable_export_code();
  (void)__Pyx_modinit_function_export_code();
  if (unlikely((__Pyx_modinit_type_init_code() < 0))) __PYX_ERR(0, 1, __pyx_L1_error)
  (void)__Pyx_modinit_type_import_code();
  (void)__Pyx_modinit_variable_import_code();
  (void)__Pyx_modinit_function_import_code();
  /*--- Execution code ---*/
  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
  if (__Pyx_patch_abc() < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  #endif

  /* "_cotton2k/simulation.pyx":3
 * # distutils: language=c++
 * # cython: language_level=3
 * from datetime import datetime, date, timedelta             # <<<<<<<<<<<<<<
 * from math import sin, cos, acos, sqrt, pi
 * 
 */
  __pyx_t_1 = PyList_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_datetime);
  __Pyx_GIVEREF(__pyx_n_s_datetime);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_datetime);
  __Pyx_INCREF(__pyx_n_s_date);
  __Pyx_GIVEREF(__pyx_n_s_date);
  PyList_SET_ITEM(__pyx_t_1, 1, __pyx_n_s_date);
  __Pyx_INCREF(__pyx_n_s_timedelta);
  __Pyx_GIVEREF(__pyx_n_s_timedelta);
  PyList_SET_ITEM(__pyx_t_1, 2, __pyx_n_s_timedelta);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_datetime, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_datetime); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_datetime, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_date); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_timedelta); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_timedelta, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":4
 * # cython: language_level=3
 * from datetime import datetime, date, timedelta
 * from math import sin, cos, acos, sqrt, pi             # <<<<<<<<<<<<<<
 * 
 * from libc.math cimport exp
 */
  __pyx_t_2 = PyList_New(5); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_sin);
  __Pyx_GIVEREF(__pyx_n_s_sin);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_sin);
  __Pyx_INCREF(__pyx_n_s_cos);
  __Pyx_GIVEREF(__pyx_n_s_cos);
  PyList_SET_ITEM(__pyx_t_2, 1, __pyx_n_s_cos);
  __Pyx_INCREF(__pyx_n_s_acos);
  __Pyx_GIVEREF(__pyx_n_s_acos);
  PyList_SET_ITEM(__pyx_t_2, 2, __pyx_n_s_acos);
  __Pyx_INCREF(__pyx_n_s_sqrt);
  __Pyx_GIVEREF(__pyx_n_s_sqrt);
  PyList_SET_ITEM(__pyx_t_2, 3, __pyx_n_s_sqrt);
  __Pyx_INCREF(__pyx_n_s_pi);
  __Pyx_GIVEREF(__pyx_n_s_pi);
  PyList_SET_ITEM(__pyx_t_2, 4, __pyx_n_s_pi);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_math, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_sin); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sin, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_cos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_cos, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_acos); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_acos, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_sqrt); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_sqrt, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_pi); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pi, __pyx_t_2) < 0) __PYX_ERR(0, 4, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":10
 * from libcpp cimport bool as bool_t
 * 
 * from _cotton2k.climate import compute_day_length             # <<<<<<<<<<<<<<
 * from _cotton2k.leaf import temperature_on_leaf_growth_rate
 * from _cotton2k.photosynthesis import ambient_co2_factor
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_compute_day_length);
  __Pyx_GIVEREF(__pyx_n_s_compute_day_length);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_compute_day_length);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_cotton2k_climate, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_compute_day_length); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_compute_day_length, __pyx_t_1) < 0) __PYX_ERR(0, 10, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":11
 * 
 * from _cotton2k.climate import compute_day_length
 * from _cotton2k.leaf import temperature_on_leaf_growth_rate             # <<<<<<<<<<<<<<
 * from _cotton2k.photosynthesis import ambient_co2_factor
 * from _cotton2k.utils import date2doy
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_temperature_on_leaf_growth_rate);
  __Pyx_GIVEREF(__pyx_n_s_temperature_on_leaf_growth_rate);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_temperature_on_leaf_growth_rate);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_cotton2k_leaf, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_temperature_on_leaf_growth_rate); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_temperature_on_leaf_growth_rate, __pyx_t_2) < 0) __PYX_ERR(0, 11, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":12
 * from _cotton2k.climate import compute_day_length
 * from _cotton2k.leaf import temperature_on_leaf_growth_rate
 * from _cotton2k.photosynthesis import ambient_co2_factor             # <<<<<<<<<<<<<<
 * from _cotton2k.utils import date2doy
 * from .climate cimport ClimateStruct
 */
  __pyx_t_1 = PyList_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_INCREF(__pyx_n_s_ambient_co2_factor);
  __Pyx_GIVEREF(__pyx_n_s_ambient_co2_factor);
  PyList_SET_ITEM(__pyx_t_1, 0, __pyx_n_s_ambient_co2_factor);
  __pyx_t_2 = __Pyx_Import(__pyx_n_s_cotton2k_photosynthesis, __pyx_t_1, 0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __pyx_t_1 = __Pyx_ImportFrom(__pyx_t_2, __pyx_n_s_ambient_co2_factor); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_ambient_co2_factor, __pyx_t_1) < 0) __PYX_ERR(0, 12, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;

  /* "_cotton2k/simulation.pyx":13
 * from _cotton2k.leaf import temperature_on_leaf_growth_rate
 * from _cotton2k.photosynthesis import ambient_co2_factor
 * from _cotton2k.utils import date2doy             # <<<<<<<<<<<<<<
 * from .climate cimport ClimateStruct
 * from .cxx cimport (
 */
  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __Pyx_INCREF(__pyx_n_s_date2doy);
  __Pyx_GIVEREF(__pyx_n_s_date2doy);
  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_date2doy);
  __pyx_t_1 = __Pyx_Import(__pyx_n_s_cotton2k_utils, __pyx_t_2, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_1, __pyx_n_s_date2doy); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_date2doy, __pyx_t_2) < 0) __PYX_ERR(0, 13, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":50
 * 
 * 
 * class SimulationEnd(RuntimeError):             # <<<<<<<<<<<<<<
 *     pass
 * 
 */
  __pyx_t_1 = __Pyx_PEP560_update_bases(__pyx_tuple__128); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  __pyx_t_2 = __Pyx_CalculateMetaclass(NULL, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_2);
  __pyx_t_3 = __Pyx_Py3MetaclassPrepare(__pyx_t_2, __pyx_t_1, __pyx_n_s_SimulationEnd, __pyx_n_s_SimulationEnd, (PyObject *) NULL, __pyx_n_s_cotton2k_simulation, (PyObject *) NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_3);
  if (__pyx_t_1 != __pyx_tuple__128) {
    if (unlikely((PyDict_SetItemString(__pyx_t_3, "__orig_bases__", __pyx_tuple__128) < 0))) __PYX_ERR(0, 50, __pyx_L1_error)
  }
  __pyx_t_4 = __Pyx_Py3ClassCreate(__pyx_t_2, __pyx_n_s_SimulationEnd, __pyx_t_1, __pyx_t_3, NULL, 0, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_4);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_SimulationEnd, __pyx_t_4) < 0) __PYX_ERR(0, 50, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     cdef tuple state
 *     cdef object _dict
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_8SoilInit_3__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SoilInit___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__130)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_SoilInit->tp_dict, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_SoilInit);

  /* "(tree fragment)":16
 *     else:
 *         return __pyx_unpickle_SoilInit, (type(self), 0x84b1e5e, state)
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     __pyx_unpickle_SoilInit__set_state(self, __pyx_state)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_8SoilInit_5__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_SoilInit___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__132)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_SoilInit->tp_dict, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 16, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_SoilInit);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_7Climate_9__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Climate___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__134)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self.climate cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_7Climate_11__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Climate___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__136)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_8NodeLeaf_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NodeLeaf___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__138)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_8NodeLeaf_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_NodeLeaf___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__140)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_12FruitingNode_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FruitingNode___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__142)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_12FruitingNode_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FruitingNode___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__144)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_12MainStemLeaf_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MainStemLeaf___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__146)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_12MainStemLeaf_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_MainStemLeaf___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__148)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_14FruitingBranch_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FruitingBranch___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__150)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_14FruitingBranch_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_FruitingBranch___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__152)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_16VegetativeBranch_1__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_VegetativeBranch___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__154)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_16VegetativeBranch_3__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_VegetativeBranch___setstate_cyth, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__156)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":456
 *     cdef cState *_
 * 
 *     def keys(self):             # <<<<<<<<<<<<<<
 *         return dict(self._[0]).keys()
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_5State_1keys, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_State_keys, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__158)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_State->tp_dict, __pyx_n_s_keys, __pyx_t_1) < 0) __PYX_ERR(0, 456, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_State);

  /* "_cotton2k/simulation.pyx":488
 *         return [VegetativeBranch.from_ptr(&self._[0].vegetative_branches[k]) for k in range(self.number_of_vegetative_branches)]
 * 
 *     def create_first_square(self, stemNRatio, first_square_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function initiates the first square. It is called from function CottonPhenology().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_5State_9create_first_square, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_State_create_first_square, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__160)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_State->tp_dict, __pyx_n_s_create_first_square, __pyx_t_1) < 0) __PYX_ERR(0, 488, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_State);

  /* "_cotton2k/simulation.pyx":515
 *         self.leaf_nitrogen -= cotylwt * self.leaf_nitrogen / self.leaf_weight
 * 
 *     def add_fruiting_branch(self, k, density_factor, delayVegByCStress, delayFrtByCStress, stemNRatio, PhenDelayByNStress, time_to_new_fruiting_branch, new_node_initial_leaf_area):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides if a new fruiting branch is to be added to a vegetative branch, and forms it. It is called from function CottonPhenology().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_5State_11add_fruiting_branch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_State_add_fruiting_branch, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__162)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_State->tp_dict, __pyx_n_s_add_fruiting_branch, __pyx_t_1) < 0) __PYX_ERR(0, 515, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_State);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_5State_13__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_State___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__164)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "self._ cannot be converted to a Python object for pickling"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_5State_15__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_State___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__166)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":582
 *     cdef public double plants_per_meter  # average number of plants pre meter of row.
 * 
 *     def _doy2date(self, j):             # <<<<<<<<<<<<<<
 *         try:
 *             return datetime.strptime(f"{self.year} {j}", "%Y %j").date()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_1_doy2date, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__doy2date, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__168)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_doy2date, __pyx_t_1) < 0) __PYX_ERR(0, 582, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":695
 *                 range(self._sim.day_finish - self._sim.day_start + 1)]
 * 
 *     def state(self, i):             # <<<<<<<<<<<<<<
 *         return State.from_ptr(&self._sim.states[i])
 * 
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_5state, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation_state, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__170)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_state, __pyx_t_1) < 0) __PYX_ERR(0, 695, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":717
 *             }
 * 
 *     def run(self):             # <<<<<<<<<<<<<<
 *         self._init_state()
 *         try:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_7run, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation_run, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__172)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_run, __pyx_t_1) < 0) __PYX_ERR(0, 717, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":724
 *             pass
 * 
 *     def _init_state(self):             # <<<<<<<<<<<<<<
 *         cdef cState state0 = self.state(0)
 *         state0.daynum = self._sim.day_start
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_9_init_state, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__init_state, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__174)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_init_state, __pyx_t_1) < 0) __PYX_ERR(0, 724, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":824
 *         self._sim.states[0] = state0
 * 
 *     def _simulate(self):             # <<<<<<<<<<<<<<
 *         for i in range(self._sim.day_finish - self._sim.day_start + 1):
 *             self._simulate_this_day(i)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_11_simulate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__simulate, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__176)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_simulate, __pyx_t_1) < 0) __PYX_ERR(0, 824, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":830
 *                 CopyState(self._sim, i)
 * 
 *     def _calc_light_interception(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         if self.version < 0x0500:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_13_calc_light_interception, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__calc_light_intercept, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__178)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_calc_light_interception, __pyx_t_1) < 0) __PYX_ERR(0, 830, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":852
 *             self._sim.states[u].light_interception = 1 - exp(-1.16 * state.leaf_area_index)
 * 
 *     def _column_shading(self, u):             # <<<<<<<<<<<<<<
 *         cdef cState state = self._sim.states[u]
 *         zint = 1.0756 * state.plant_height / self.row_space
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_15_column_shading, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__column_shading, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__180)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_column_shading, __pyx_t_1) < 0) __PYX_ERR(0, 852, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":876
 *                 self.relative_radiation_received_by_a_soil_column[k0] = 0.05
 * 
 *     def _daily_climate(self, u):             # <<<<<<<<<<<<<<
 *         cdef double declination  # daily declination angle, in radians
 *         cdef double sunr  # time of sunrise, hours.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_17_daily_climate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__daily_climate, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__182)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_daily_climate, __pyx_t_1) < 0) __PYX_ERR(0, 876, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":948
 *         EvapoTranspiration(self._sim.states[u], self.latitude, self.elevation, declination, tmpisr, SitePar[7])
 * 
 *     def _stress(self, u):             # <<<<<<<<<<<<<<
 *         global AverageLwpMin, AverageLwp, LwpMin, LwpMax
 *         # The following constant parameters are used:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_19_stress, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__stress, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__184)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_stress, __pyx_t_1) < 0) __PYX_ERR(0, 948, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":994
 *         self._sim.states[u].water_stress = WaterStress
 * 
 *     def _get_net_photosynthesis(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         References:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_21_get_net_photosynthesis, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__get_net_photosynthes, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__186)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_get_net_photosynthesis, __pyx_t_1) < 0) __PYX_ERR(0, 994, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1060
 *         CumNetPhotosynth += NetPhotosynthesis
 * 
 *     def _potential_fruit_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of fruiting sites of cotton plants. It is called from PlantGrowth(). It calls TemperatureOnFruitGrowthRate()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_23_potential_fruit_growth, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__potential_fruit_grow, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__188)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_potential_fruit_growth, __pyx_t_1) < 0) __PYX_ERR(0, 1060, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1137
 *                         self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].burr.potential_growth = 0
 * 
 *     def _potential_leaf_growth(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This function simulates the potential growth of leaves of cotton plants. It is called from self._growth(). It calls function temperature_on_leaf_growth_rate().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_25_potential_leaf_growth, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__potential_leaf_growt, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__190)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_potential_leaf_growth, __pyx_t_1) < 0) __PYX_ERR(0, 1137, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1249
 *                             PotGroAllPetioles += self._sim.states[u].vegetative_branches[k].fruiting_branches[l].nodes[m].petiole.potential_growth
 * 
 *     def _growth(self, u):             # <<<<<<<<<<<<<<
 *         global PotGroStem, PotGroAllRoots, TotalPetioleWeight
 *         # Call self._potential_leaf_growth(u) to compute potential growth rate of leaves.
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_27_growth, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__growth, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__192)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_growth, __pyx_t_1) < 0) __PYX_ERR(0, 1249, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1349
 *                                 self._sim.plant_row_column)
 * 
 *     def _days_to_first_square(self, u):             # <<<<<<<<<<<<<<
 *         state = self.state(u)
 *         if state.daynum <= self._sim.day_emerge:
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_29_days_to_first_square, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__days_to_first_square, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__194)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_days_to_first_square, __pyx_t_1) < 0) __PYX_ERR(0, 1349, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1360
 *         return (132.2 + self.avtemp * (-7 + self.avtemp * 0.125)) * self.cultivar_parameters[30] - self.sumstrs
 * 
 *     def _add_vegetative_branch(self, u, delayVegByCStress, stemNRatio, DaysTo1stSqare, PhenDelayByNStress):             # <<<<<<<<<<<<<<
 *         """
 *         This function decides whether a new vegetative branch is to be added, and then forms it. It is called from CottonPhenology().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_31_add_vegetative_branch, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__add_vegetative_branc, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__196)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_add_vegetative_branch, __pyx_t_1) < 0) __PYX_ERR(0, 1360, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1398
 *         self._sim.states[u].vegetative_branches[self._sim.states[u].number_of_vegetative_branches - 1].fruiting_branches[0].number_of_fruiting_nodes = 1
 * 
 *     def _phenology(self, u):             # <<<<<<<<<<<<<<
 *         """
 *         This is is the main function for simulating events of phenology and abscission in the cotton plant. It is called each day from DailySimulation().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_33_phenology, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__phenology, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__198)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_phenology, __pyx_t_1) < 0) __PYX_ERR(0, 1398, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1474
 *         LeafAbscission(self._sim, u)
 * 
 *     def _defoliate(self, u):             # <<<<<<<<<<<<<<
 *         """This function simulates the effects of defoliating chemicals applied on the cotton. It is called from SimulateThisDay()."""
 *         global PercentDefoliation
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_35_defoliate, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__defoliate, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__200)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_defoliate, __pyx_t_1) < 0) __PYX_ERR(0, 1474, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1537
 * 
 * 
 *     def _simulate_this_day(self, u):             # <<<<<<<<<<<<<<
 *         global isw
 *         state = self.state(u)
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_37_simulate_this_day, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__simulate_this_day, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__202)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_simulate_this_day, __pyx_t_1) < 0) __PYX_ERR(0, 1537, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1571
 *             raise SimulationEnd
 * 
 *     def _init_grid(self):             # <<<<<<<<<<<<<<
 *         """
 *         This function initializes the soil grid variables. It is executed once at the beginning of the simulation. It is called from ReadInput().
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_39_init_grid, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation__init_grid, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__204)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_init_grid, __pyx_t_1) < 0) __PYX_ERR(0, 1571, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "_cotton2k/simulation.pyx":1612
 *                     self._sim.plant_row_column = k
 * 
 *     def read_input(self, lyrsol, **kwargs):             # <<<<<<<<<<<<<<
 *         """This is the main function for reading input."""
 *         InitializeGlobal()
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_41read_input, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation_read_input, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__206)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1612, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem((PyObject *)__pyx_ptype_9_cotton2k_10simulation_Simulation->tp_dict, __pyx_n_s_read_input, __pyx_t_1) < 0) __PYX_ERR(0, 1612, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
  PyType_Modified(__pyx_ptype_9_cotton2k_10simulation_Simulation);

  /* "(tree fragment)":1
 * def __reduce_cython__(self):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_43__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation___reduce_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__208)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":3
 * def __reduce_cython__(self):
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 * def __setstate_cython__(self, __pyx_state):             # <<<<<<<<<<<<<<
 *     raise TypeError, "Pickling of struct members such as self._sim must be explicitly requested with @auto_pickle(True)"
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_10Simulation_45__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_Simulation___setstate_cython, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__210)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(1, 3, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "(tree fragment)":1
 * def __pyx_unpickle_SoilInit(__pyx_type, long __pyx_checksum, __pyx_state):             # <<<<<<<<<<<<<<
 *     cdef object __pyx_PickleError
 *     cdef object __pyx_result
 */
  __pyx_t_1 = __Pyx_CyFunction_New(&__pyx_mdef_9_cotton2k_10simulation_1__pyx_unpickle_SoilInit, 0, __pyx_n_s_pyx_unpickle_SoilInit, NULL, __pyx_n_s_cotton2k_simulation, __pyx_d, ((PyObject *)__pyx_codeobj__212)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_SoilInit, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "_cotton2k/simulation.pyx":1
 * # distutils: language=c++             # <<<<<<<<<<<<<<
 * # cython: language_level=3
 * from datetime import datetime, date, timedelta
 */
  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_GOTREF(__pyx_t_1);
  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;

  /* "FromPyStructUtility":12
 * 
 * @cname("__pyx_convert__from_py_ClimateStruct")
 * cdef struct_type __pyx_convert__from_py_ClimateStruct(obj) except *:             # <<<<<<<<<<<<<<
 *     cdef struct_type result
 *     if not PyMapping_Check(obj):
 */

  /*--- Wrapped vars code ---*/

  goto __pyx_L0;
  __pyx_L1_error:;
  __Pyx_XDECREF(__pyx_t_1);
  __Pyx_XDECREF(__pyx_t_2);
  __Pyx_XDECREF(__pyx_t_3);
  __Pyx_XDECREF(__pyx_t_4);
  if (__pyx_m) {
    if (__pyx_d) {
      __Pyx_AddTraceback("init _cotton2k.simulation", __pyx_clineno, __pyx_lineno, __pyx_filename);
    }
    #if !CYTHON_COMPILING_IN_LIMITED_API
    Py_CLEAR(__pyx_m);
    #endif
  } else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_ImportError, "init _cotton2k.simulation");
  }
  __pyx_L0:;
  __Pyx_RefNannyFinishContext();
  #if CYTHON_PEP489_MULTI_PHASE_INIT
  return (__pyx_m != NULL) ? 0 : -1;
  #elif PY_MAJOR_VERSION >= 3
  return __pyx_m;
  #else
  return;
  #endif
}
/* #### Code section: cleanup_globals ### */
/* #### Code section: cleanup_module ### */
/* #### Code section: main_method ### */
/* #### Code section: utility_code_def ### */

/* --- Runtime support code --- */
/* Refnanny */
#if CYTHON_REFNANNY
static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
    PyObject *m = NULL, *p = NULL;
    void *r = NULL;
    m = PyImport_ImportModule(modname);
    if (!m) goto end;
    p = PyObject_GetAttrString(m, "RefNannyAPI");
    if (!p) goto end;
    r = PyLong_AsVoidPtr(p);
end:
    Py_XDECREF(p);
    Py_XDECREF(m);
    return (__Pyx_RefNannyAPIStruct *)r;
}
#endif

/* PyErrExceptionMatches */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
    PyObject *exc_type = tstate->curexc_type;
    if (exc_type == err) return 1;
    if (unlikely(!exc_type)) return 0;
    if (unlikely(PyTuple_Check(err)))
        return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
    return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
}
#endif

/* PyErrFetchRestore */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    tmp_type = tstate->curexc_type;
    tmp_value = tstate->curexc_value;
    tmp_tb = tstate->curexc_traceback;
    tstate->curexc_type = type;
    tstate->curexc_value = value;
    tstate->curexc_traceback = tb;
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    *type = tstate->curexc_type;
    *value = tstate->curexc_value;
    *tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
}
#endif

/* PyObjectGetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro))
        return tp->tp_getattro(obj, attr_name);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_getattr))
        return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
#endif
    return PyObject_GetAttr(obj, attr_name);
}
#endif

/* PyObjectGetAttrStrNoError */
static void __Pyx_PyObject_GetAttrStr_ClearAttributeError(void) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (likely(__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        __Pyx_PyErr_Clear();
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStrNoError(PyObject* obj, PyObject* attr_name) {
    PyObject *result;
#if CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_TYPE_SLOTS && PY_VERSION_HEX >= 0x030700B1
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_getattro == PyObject_GenericGetAttr)) {
        return _PyObject_GenericGetAttrWithDict(obj, attr_name, NULL, 1);
    }
#endif
    result = __Pyx_PyObject_GetAttrStr(obj, attr_name);
    if (unlikely(!result)) {
        __Pyx_PyObject_GetAttrStr_ClearAttributeError();
    }
    return result;
}

/* GetBuiltinName */
static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
    PyObject* result = __Pyx_PyObject_GetAttrStrNoError(__pyx_b, name);
    if (unlikely(!result) && !PyErr_Occurred()) {
        PyErr_Format(PyExc_NameError,
#if PY_MAJOR_VERSION >= 3
            "name '%U' is not defined", name);
#else
            "name '%.200s' is not defined", PyString_AS_STRING(name));
#endif
    }
    return result;
}

/* PyObjectCall */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    PyObject *result;
    ternaryfunc call = Py_TYPE(func)->tp_call;
    if (unlikely(!call))
        return PyObject_Call(func, arg, kw);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = (*call)(func, arg, kw);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* RaiseException */
#if PY_MAJOR_VERSION < 3
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    __Pyx_PyThreadState_declare
    CYTHON_UNUSED_VAR(cause);
    Py_XINCREF(type);
    if (!value || value == Py_None)
        value = NULL;
    else
        Py_INCREF(value);
    if (!tb || tb == Py_None)
        tb = NULL;
    else {
        Py_INCREF(tb);
        if (!PyTraceBack_Check(tb)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: arg 3 must be a traceback or None");
            goto raise_error;
        }
    }
    if (PyType_Check(type)) {
#if CYTHON_COMPILING_IN_PYPY
        if (!value) {
            Py_INCREF(Py_None);
            value = Py_None;
        }
#endif
        PyErr_NormalizeException(&type, &value, &tb);
    } else {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto raise_error;
        }
        value = type;
        type = (PyObject*) Py_TYPE(type);
        Py_INCREF(type);
        if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
            PyErr_SetString(PyExc_TypeError,
                "raise: exception class must be a subclass of BaseException");
            goto raise_error;
        }
    }
    __Pyx_PyThreadState_assign
    __Pyx_ErrRestore(type, value, tb);
    return;
raise_error:
    Py_XDECREF(value);
    Py_XDECREF(type);
    Py_XDECREF(tb);
    return;
}
#else
static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
    PyObject* owned_instance = NULL;
    if (tb == Py_None) {
        tb = 0;
    } else if (tb && !PyTraceBack_Check(tb)) {
        PyErr_SetString(PyExc_TypeError,
            "raise: arg 3 must be a traceback or None");
        goto bad;
    }
    if (value == Py_None)
        value = 0;
    if (PyExceptionInstance_Check(type)) {
        if (value) {
            PyErr_SetString(PyExc_TypeError,
                "instance exception may not have a separate value");
            goto bad;
        }
        value = type;
        type = (PyObject*) Py_TYPE(value);
    } else if (PyExceptionClass_Check(type)) {
        PyObject *instance_class = NULL;
        if (value && PyExceptionInstance_Check(value)) {
            instance_class = (PyObject*) Py_TYPE(value);
            if (instance_class != type) {
                int is_subclass = PyObject_IsSubclass(instance_class, type);
                if (!is_subclass) {
                    instance_class = NULL;
                } else if (unlikely(is_subclass == -1)) {
                    goto bad;
                } else {
                    type = instance_class;
                }
            }
        }
        if (!instance_class) {
            PyObject *args;
            if (!value)
                args = PyTuple_New(0);
            else if (PyTuple_Check(value)) {
                Py_INCREF(value);
                args = value;
            } else
                args = PyTuple_Pack(1, value);
            if (!args)
                goto bad;
            owned_instance = PyObject_Call(type, args, NULL);
            Py_DECREF(args);
            if (!owned_instance)
                goto bad;
            value = owned_instance;
            if (!PyExceptionInstance_Check(value)) {
                PyErr_Format(PyExc_TypeError,
                             "calling %R should have returned an instance of "
                             "BaseException, not %R",
                             type, Py_TYPE(value));
                goto bad;
            }
        }
    } else {
        PyErr_SetString(PyExc_TypeError,
            "raise: exception class must be a subclass of BaseException");
        goto bad;
    }
    if (cause) {
        PyObject *fixed_cause;
        if (cause == Py_None) {
            fixed_cause = NULL;
        } else if (PyExceptionClass_Check(cause)) {
            fixed_cause = PyObject_CallObject(cause, NULL);
            if (fixed_cause == NULL)
                goto bad;
        } else if (PyExceptionInstance_Check(cause)) {
            fixed_cause = cause;
            Py_INCREF(fixed_cause);
        } else {
            PyErr_SetString(PyExc_TypeError,
                            "exception causes must derive from "
                            "BaseException");
            goto bad;
        }
        PyException_SetCause(value, fixed_cause);
    }
    PyErr_SetObject(type, value);
    if (tb) {
#if CYTHON_COMPILING_IN_PYPY ||  CYTHON_COMPILING_IN_LIMITED_API
        PyObject *tmp_type, *tmp_value, *tmp_tb;
        PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
        Py_INCREF(tb);
        PyErr_Restore(tmp_type, tmp_value, tb);
        Py_XDECREF(tmp_tb);
#else
        PyThreadState *tstate = __Pyx_PyThreadState_Current;
        PyObject* tmp_tb = tstate->curexc_traceback;
        if (tb != tmp_tb) {
            Py_INCREF(tb);
            tstate->curexc_traceback = tb;
            Py_XDECREF(tmp_tb);
        }
#endif
    }
bad:
    Py_XDECREF(owned_instance);
    return;
}
#endif

/* WriteUnraisableException */
static void __Pyx_WriteUnraisable(const char *name, int clineno,
                                  int lineno, const char *filename,
                                  int full_traceback, int nogil) {
    PyObject *old_exc, *old_val, *old_tb;
    PyObject *ctx;
    __Pyx_PyThreadState_declare
#ifdef WITH_THREAD
    PyGILState_STATE state;
    if (nogil)
        state = PyGILState_Ensure();
#ifdef _MSC_VER
    else state = (PyGILState_STATE)-1;
#endif
#endif
    CYTHON_UNUSED_VAR(clineno);
    CYTHON_UNUSED_VAR(lineno);
    CYTHON_UNUSED_VAR(filename);
    CYTHON_MAYBE_UNUSED_VAR(nogil);
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
    if (full_traceback) {
        Py_XINCREF(old_exc);
        Py_XINCREF(old_val);
        Py_XINCREF(old_tb);
        __Pyx_ErrRestore(old_exc, old_val, old_tb);
        PyErr_PrintEx(1);
    }
    #if PY_MAJOR_VERSION < 3
    ctx = PyString_FromString(name);
    #else
    ctx = PyUnicode_FromString(name);
    #endif
    __Pyx_ErrRestore(old_exc, old_val, old_tb);
    if (!ctx) {
        PyErr_WriteUnraisable(Py_None);
    } else {
        PyErr_WriteUnraisable(ctx);
        Py_DECREF(ctx);
    }
#ifdef WITH_THREAD
    if (nogil)
        PyGILState_Release(state);
#endif
}

/* TupleAndListFromArray */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE void __Pyx_copy_object_array(PyObject *const *CYTHON_RESTRICT src, PyObject** CYTHON_RESTRICT dest, Py_ssize_t length) {
    PyObject *v;
    Py_ssize_t i;
    for (i = 0; i < length; i++) {
        v = dest[i] = src[i];
        Py_INCREF(v);
    }
}
static CYTHON_INLINE PyObject *
__Pyx_PyTuple_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        Py_INCREF(__pyx_empty_tuple);
        return __pyx_empty_tuple;
    }
    res = PyTuple_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyTupleObject*)res)->ob_item, n);
    return res;
}
static CYTHON_INLINE PyObject *
__Pyx_PyList_FromArray(PyObject *const *src, Py_ssize_t n)
{
    PyObject *res;
    if (n <= 0) {
        return PyList_New(0);
    }
    res = PyList_New(n);
    if (unlikely(res == NULL)) return NULL;
    __Pyx_copy_object_array(src, ((PyListObject*)res)->ob_item, n);
    return res;
}
#endif

/* BytesEquals */
static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
    if (s1 == s2) {
        return (equals == Py_EQ);
    } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
        const char *ps1, *ps2;
        Py_ssize_t length = PyBytes_GET_SIZE(s1);
        if (length != PyBytes_GET_SIZE(s2))
            return (equals == Py_NE);
        ps1 = PyBytes_AS_STRING(s1);
        ps2 = PyBytes_AS_STRING(s2);
        if (ps1[0] != ps2[0]) {
            return (equals == Py_NE);
        } else if (length == 1) {
            return (equals == Py_EQ);
        } else {
            int result;
#if CYTHON_USE_UNICODE_INTERNALS
            Py_hash_t hash1, hash2;
            hash1 = ((PyBytesObject*)s1)->ob_shash;
            hash2 = ((PyBytesObject*)s2)->ob_shash;
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                return (equals == Py_NE);
            }
#endif
            result = memcmp(ps1, ps2, (size_t)length);
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
        return (equals == Py_NE);
    } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
        return (equals == Py_NE);
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
#endif
}

/* UnicodeEquals */
static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
#if CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API
    return PyObject_RichCompareBool(s1, s2, equals);
#else
#if PY_MAJOR_VERSION < 3
    PyObject* owned_ref = NULL;
#endif
    int s1_is_unicode, s2_is_unicode;
    if (s1 == s2) {
        goto return_eq;
    }
    s1_is_unicode = PyUnicode_CheckExact(s1);
    s2_is_unicode = PyUnicode_CheckExact(s2);
#if PY_MAJOR_VERSION < 3
    if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
        owned_ref = PyUnicode_FromObject(s2);
        if (unlikely(!owned_ref))
            return -1;
        s2 = owned_ref;
        s2_is_unicode = 1;
    } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
        owned_ref = PyUnicode_FromObject(s1);
        if (unlikely(!owned_ref))
            return -1;
        s1 = owned_ref;
        s1_is_unicode = 1;
    } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
        return __Pyx_PyBytes_Equals(s1, s2, equals);
    }
#endif
    if (s1_is_unicode & s2_is_unicode) {
        Py_ssize_t length;
        int kind;
        void *data1, *data2;
        if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
            return -1;
        length = __Pyx_PyUnicode_GET_LENGTH(s1);
        if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
            goto return_ne;
        }
#if CYTHON_USE_UNICODE_INTERNALS
        {
            Py_hash_t hash1, hash2;
        #if CYTHON_PEP393_ENABLED
            hash1 = ((PyASCIIObject*)s1)->hash;
            hash2 = ((PyASCIIObject*)s2)->hash;
        #else
            hash1 = ((PyUnicodeObject*)s1)->hash;
            hash2 = ((PyUnicodeObject*)s2)->hash;
        #endif
            if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
                goto return_ne;
            }
        }
#endif
        kind = __Pyx_PyUnicode_KIND(s1);
        if (kind != __Pyx_PyUnicode_KIND(s2)) {
            goto return_ne;
        }
        data1 = __Pyx_PyUnicode_DATA(s1);
        data2 = __Pyx_PyUnicode_DATA(s2);
        if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
            goto return_ne;
        } else if (length == 1) {
            goto return_eq;
        } else {
            int result = memcmp(data1, data2, (size_t)(length * kind));
            #if PY_MAJOR_VERSION < 3
            Py_XDECREF(owned_ref);
            #endif
            return (equals == Py_EQ) ? (result == 0) : (result != 0);
        }
    } else if ((s1 == Py_None) & s2_is_unicode) {
        goto return_ne;
    } else if ((s2 == Py_None) & s1_is_unicode) {
        goto return_ne;
    } else {
        int result;
        PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
        #if PY_MAJOR_VERSION < 3
        Py_XDECREF(owned_ref);
        #endif
        if (!py_result)
            return -1;
        result = __Pyx_PyObject_IsTrue(py_result);
        Py_DECREF(py_result);
        return result;
    }
return_eq:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_EQ);
return_ne:
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(owned_ref);
    #endif
    return (equals == Py_NE);
#endif
}

/* fastcall */
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE PyObject * __Pyx_GetKwValue_FASTCALL(PyObject *kwnames, PyObject *const *kwvalues, PyObject *s)
{
    Py_ssize_t i, n = PyTuple_GET_SIZE(kwnames);
    for (i = 0; i < n; i++)
    {
        if (s == PyTuple_GET_ITEM(kwnames, i)) return kwvalues[i];
    }
    for (i = 0; i < n; i++)
    {
        int eq = __Pyx_PyUnicode_Equals(s, PyTuple_GET_ITEM(kwnames, i), Py_EQ);
        if (unlikely(eq != 0)) {
            if (unlikely(eq < 0)) return NULL;  // error
            return kwvalues[i];
        }
    }
    return NULL;  // not found (no exception set)
}
#endif

/* RaiseArgTupleInvalid */
static void __Pyx_RaiseArgtupleInvalid(
    const char* func_name,
    int exact,
    Py_ssize_t num_min,
    Py_ssize_t num_max,
    Py_ssize_t num_found)
{
    Py_ssize_t num_expected;
    const char *more_or_less;
    if (num_found < num_min) {
        num_expected = num_min;
        more_or_less = "at least";
    } else {
        num_expected = num_max;
        more_or_less = "at most";
    }
    if (exact) {
        more_or_less = "exactly";
    }
    PyErr_Format(PyExc_TypeError,
                 "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
                 func_name, more_or_less, num_expected,
                 (num_expected == 1) ? "" : "s", num_found);
}

/* RaiseDoubleKeywords */
static void __Pyx_RaiseDoubleKeywordsError(
    const char* func_name,
    PyObject* kw_name)
{
    PyErr_Format(PyExc_TypeError,
        #if PY_MAJOR_VERSION >= 3
        "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
        #else
        "%s() got multiple values for keyword argument '%s'", func_name,
        PyString_AsString(kw_name));
        #endif
}

/* ParseKeywords */
static int __Pyx_ParseOptionalKeywords(
    PyObject *kwds,
    PyObject *const *kwvalues,
    PyObject **argnames[],
    PyObject *kwds2,
    PyObject *values[],
    Py_ssize_t num_pos_args,
    const char* function_name)
{
    PyObject *key = 0, *value = 0;
    Py_ssize_t pos = 0;
    PyObject*** name;
    PyObject*** first_kw_arg = argnames + num_pos_args;
    int kwds_is_tuple = CYTHON_METH_FASTCALL && likely(PyTuple_Check(kwds));
    while (1) {
        if (kwds_is_tuple) {
            if (pos >= PyTuple_GET_SIZE(kwds)) break;
            key = PyTuple_GET_ITEM(kwds, pos);
            value = kwvalues[pos];
            pos++;
        }
        else
        {
            if (!PyDict_Next(kwds, &pos, &key, &value)) break;
        }
        name = first_kw_arg;
        while (*name && (**name != key)) name++;
        if (*name) {
            values[name-argnames] = value;
            continue;
        }
        name = first_kw_arg;
        #if PY_MAJOR_VERSION < 3
        if (likely(PyString_Check(key))) {
            while (*name) {
                if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
                        && _PyString_Eq(**name, key)) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    if ((**argname == key) || (
                            (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
                             && _PyString_Eq(**argname, key))) {
                        goto arg_passed_twice;
                    }
                    argname++;
                }
            }
        } else
        #endif
        if (likely(PyUnicode_Check(key))) {
            while (*name) {
                int cmp = (
                #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                    (__Pyx_PyUnicode_GET_LENGTH(**name) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                #endif
                    PyUnicode_Compare(**name, key)
                );
                if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                if (cmp == 0) {
                    values[name-argnames] = value;
                    break;
                }
                name++;
            }
            if (*name) continue;
            else {
                PyObject*** argname = argnames;
                while (argname != first_kw_arg) {
                    int cmp = (**argname == key) ? 0 :
                    #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
                        (__Pyx_PyUnicode_GET_LENGTH(**argname) != __Pyx_PyUnicode_GET_LENGTH(key)) ? 1 :
                    #endif
                        PyUnicode_Compare(**argname, key);
                    if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
                    if (cmp == 0) goto arg_passed_twice;
                    argname++;
                }
            }
        } else
            goto invalid_keyword_type;
        if (kwds2) {
            if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
        } else {
            goto invalid_keyword;
        }
    }
    return 0;
arg_passed_twice:
    __Pyx_RaiseDoubleKeywordsError(function_name, key);
    goto bad;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    goto bad;
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
bad:
    return -1;
}

/* PyObjectSetAttrStr */
#if CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE int __Pyx_PyObject_SetAttrStr(PyObject* obj, PyObject* attr_name, PyObject* value) {
    PyTypeObject* tp = Py_TYPE(obj);
    if (likely(tp->tp_setattro))
        return tp->tp_setattro(obj, attr_name, value);
#if PY_MAJOR_VERSION < 3
    if (likely(tp->tp_setattr))
        return tp->tp_setattr(obj, PyString_AS_STRING(attr_name), value);
#endif
    return PyObject_SetAttr(obj, attr_name, value);
}
#endif

/* DictGetItem */
#if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
    PyObject *value;
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (!PyErr_Occurred()) {
            if (unlikely(PyTuple_Check(key))) {
                PyObject* args = PyTuple_Pack(1, key);
                if (likely(args)) {
                    PyErr_SetObject(PyExc_KeyError, args);
                    Py_DECREF(args);
                }
            } else {
                PyErr_SetObject(PyExc_KeyError, key);
            }
        }
        return NULL;
    }
    Py_INCREF(value);
    return value;
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (unlikely(size == 0)) {
            return __Pyx_NewRef(op2);
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* KeywordStringCheck */
static int __Pyx_CheckKeywordStrings(
    PyObject *kw,
    const char* function_name,
    int kw_allowed)
{
    PyObject* key = 0;
    Py_ssize_t pos = 0;
#if CYTHON_COMPILING_IN_PYPY
    if (!kw_allowed && PyDict_Next(kw, &pos, &key, 0))
        goto invalid_keyword;
    return 1;
#else
    if (CYTHON_METH_FASTCALL && likely(PyTuple_Check(kw))) {
        if (unlikely(PyTuple_GET_SIZE(kw) == 0))
            return 1;
        if (!kw_allowed) {
            key = PyTuple_GET_ITEM(kw, 0);
            goto invalid_keyword;
        }
#if PY_VERSION_HEX < 0x03090000
        for (pos = 0; pos < PyTuple_GET_SIZE(kw); pos++) {
            key = PyTuple_GET_ITEM(kw, pos);
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
        }
#endif
        return 1;
    }
    while (PyDict_Next(kw, &pos, &key, 0)) {
        #if PY_MAJOR_VERSION < 3
        if (unlikely(!PyString_Check(key)))
        #endif
            if (unlikely(!PyUnicode_Check(key)))
                goto invalid_keyword_type;
    }
    if (!kw_allowed && unlikely(key))
        goto invalid_keyword;
    return 1;
invalid_keyword_type:
    PyErr_Format(PyExc_TypeError,
        "%.200s() keywords must be strings", function_name);
    return 0;
#endif
invalid_keyword:
    #if PY_MAJOR_VERSION < 3
    PyErr_Format(PyExc_TypeError,
        "%.200s() got an unexpected keyword argument '%.200s'",
        function_name, PyString_AsString(key));
    #else
    PyErr_Format(PyExc_TypeError,
        "%s() got an unexpected keyword argument '%U'",
        function_name, key);
    #endif
    return 0;
}

/* GetAttr3 */
static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
        return NULL;
    __Pyx_PyErr_Clear();
    Py_INCREF(d);
    return d;
}
static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
    PyObject *r;
#if CYTHON_USE_TYPE_SLOTS
    if (likely(PyString_Check(n))) {
        r = __Pyx_PyObject_GetAttrStrNoError(o, n);
        if (unlikely(!r) && likely(!PyErr_Occurred())) {
            r = __Pyx_NewRef(d);
        }
        return r;
    }
#endif
    r = PyObject_GetAttr(o, n);
    return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
}

/* PyDictVersioning */
#if CYTHON_USE_DICT_VERSIONS && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PY_UINT64_T __Pyx_get_tp_dict_version(PyObject *obj) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    return likely(dict) ? __PYX_GET_DICT_VERSION(dict) : 0;
}
static CYTHON_INLINE PY_UINT64_T __Pyx_get_object_dict_version(PyObject *obj) {
    PyObject **dictptr = NULL;
    Py_ssize_t offset = Py_TYPE(obj)->tp_dictoffset;
    if (offset) {
#if CYTHON_COMPILING_IN_CPYTHON
        dictptr = (likely(offset > 0)) ? (PyObject **) ((char *)obj + offset) : _PyObject_GetDictPtr(obj);
#else
        dictptr = _PyObject_GetDictPtr(obj);
#endif
    }
    return (dictptr && *dictptr) ? __PYX_GET_DICT_VERSION(*dictptr) : 0;
}
static CYTHON_INLINE int __Pyx_object_dict_version_matches(PyObject* obj, PY_UINT64_T tp_dict_version, PY_UINT64_T obj_dict_version) {
    PyObject *dict = Py_TYPE(obj)->tp_dict;
    if (unlikely(!dict) || unlikely(tp_dict_version != __PYX_GET_DICT_VERSION(dict)))
        return 0;
    return obj_dict_version == __Pyx_get_object_dict_version(obj);
}
#endif

/* GetModuleGlobalName */
#if CYTHON_USE_DICT_VERSIONS
static PyObject *__Pyx__GetModuleGlobalName(PyObject *name, PY_UINT64_T *dict_version, PyObject **dict_cached_value)
#else
static CYTHON_INLINE PyObject *__Pyx__GetModuleGlobalName(PyObject *name)
#endif
{
    PyObject *result;
#if !CYTHON_AVOID_BORROWED_REFS
#if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
    result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    } else if (unlikely(PyErr_Occurred())) {
        return NULL;
    }
#elif CYTHON_COMPILING_IN_LIMITED_API
    if (unlikely(!__pyx_m)) {
        return NULL;
    }
    result = PyObject_GetAttr(__pyx_m, name);
    if (likely(result)) {
        return result;
    }
#else
    result = PyDict_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
#endif
#else
    result = PyObject_GetItem(__pyx_d, name);
    __PYX_UPDATE_DICT_CACHE(__pyx_d, result, *dict_cached_value, *dict_version)
    if (likely(result)) {
        return __Pyx_NewRef(result);
    }
    PyErr_Clear();
#endif
    return __Pyx_GetBuiltinName(name);
}

/* RaiseUnexpectedTypeError */
static int
__Pyx_RaiseUnexpectedTypeError(const char *expected, PyObject *obj)
{
    __Pyx_TypeName obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError, "Expected %s, got " __Pyx_FMT_TYPENAME,
                 expected, obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return 0;
}

/* PyFunctionFastCall */
#if CYTHON_FAST_PYCALL && !CYTHON_VECTORCALL
static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
                                               PyObject *globals) {
    PyFrameObject *f;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject **fastlocals;
    Py_ssize_t i;
    PyObject *result;
    assert(globals != NULL);
    /* XXX Perhaps we should create a specialized
       PyFrame_New() that doesn't take locals, but does
       take builtins without sanity checking them.
       */
    assert(tstate != NULL);
    f = PyFrame_New(tstate, co, globals, NULL);
    if (f == NULL) {
        return NULL;
    }
    fastlocals = __Pyx_PyFrame_GetLocalsplus(f);
    for (i = 0; i < na; i++) {
        Py_INCREF(*args);
        fastlocals[i] = *args++;
    }
    result = PyEval_EvalFrameEx(f,0);
    ++tstate->recursion_depth;
    Py_DECREF(f);
    --tstate->recursion_depth;
    return result;
}
static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, Py_ssize_t nargs, PyObject *kwargs) {
    PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
    PyObject *globals = PyFunction_GET_GLOBALS(func);
    PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
    PyObject *closure;
#if PY_MAJOR_VERSION >= 3
    PyObject *kwdefs;
#endif
    PyObject *kwtuple, **k;
    PyObject **d;
    Py_ssize_t nd;
    Py_ssize_t nk;
    PyObject *result;
    assert(kwargs == NULL || PyDict_Check(kwargs));
    nk = kwargs ? PyDict_Size(kwargs) : 0;
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object"))) {
        return NULL;
    }
    if (
#if PY_MAJOR_VERSION >= 3
            co->co_kwonlyargcount == 0 &&
#endif
            likely(kwargs == NULL || nk == 0) &&
            co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
        if (argdefs == NULL && co->co_argcount == nargs) {
            result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
            goto done;
        }
        else if (nargs == 0 && argdefs != NULL
                 && co->co_argcount == Py_SIZE(argdefs)) {
            /* function called with no arguments, but all parameters have
               a default value: use default values as arguments .*/
            args = &PyTuple_GET_ITEM(argdefs, 0);
            result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
            goto done;
        }
    }
    if (kwargs != NULL) {
        Py_ssize_t pos, i;
        kwtuple = PyTuple_New(2 * nk);
        if (kwtuple == NULL) {
            result = NULL;
            goto done;
        }
        k = &PyTuple_GET_ITEM(kwtuple, 0);
        pos = i = 0;
        while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
            Py_INCREF(k[i]);
            Py_INCREF(k[i+1]);
            i += 2;
        }
        nk = i / 2;
    }
    else {
        kwtuple = NULL;
        k = NULL;
    }
    closure = PyFunction_GET_CLOSURE(func);
#if PY_MAJOR_VERSION >= 3
    kwdefs = PyFunction_GET_KW_DEFAULTS(func);
#endif
    if (argdefs != NULL) {
        d = &PyTuple_GET_ITEM(argdefs, 0);
        nd = Py_SIZE(argdefs);
    }
    else {
        d = NULL;
        nd = 0;
    }
#if PY_MAJOR_VERSION >= 3
    result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, kwdefs, closure);
#else
    result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
                               args, (int)nargs,
                               k, (int)nk,
                               d, (int)nd, closure);
#endif
    Py_XDECREF(kwtuple);
done:
    Py_LeaveRecursiveCall();
    return result;
}
#endif

/* PyObjectCallMethO */
#if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
    PyObject *self, *result;
    PyCFunction cfunc;
    cfunc = PyCFunction_GET_FUNCTION(func);
    self = PyCFunction_GET_SELF(func);
    if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
        return NULL;
    result = cfunc(self, arg);
    Py_LeaveRecursiveCall();
    if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
        PyErr_SetString(
            PyExc_SystemError,
            "NULL result without error in PyObject_Call");
    }
    return result;
}
#endif

/* PyObjectFastCall */
static PyObject* __Pyx_PyObject_FastCall_fallback(PyObject *func, PyObject **args, size_t nargs, PyObject *kwargs) {
    PyObject *argstuple;
    PyObject *result;
    size_t i;
    argstuple = PyTuple_New((Py_ssize_t)nargs);
    if (unlikely(!argstuple)) return NULL;
    for (i = 0; i < nargs; i++) {
        Py_INCREF(args[i]);
        PyTuple_SET_ITEM(argstuple, (Py_ssize_t)i, args[i]);
    }
    result = __Pyx_PyObject_Call(func, argstuple, kwargs);
    Py_DECREF(argstuple);
    return result;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_FastCallDict(PyObject *func, PyObject **args, size_t _nargs, PyObject *kwargs) {
    Py_ssize_t nargs = __Pyx_PyVectorcall_NARGS(_nargs);
#if CYTHON_COMPILING_IN_CPYTHON
    if (nargs == 0 && kwargs == NULL) {
#ifdef __Pyx_CyFunction_USED
        if (__Pyx_IsCyOrPyCFunction(func))
#else
        if (PyCFunction_Check(func))
#endif
        {
            if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
                return __Pyx_PyObject_CallMethO(func, NULL);
            }
        }
    }
    else if (nargs == 1 && kwargs == NULL) {
        if (PyCFunction_Check(func))
        {
            if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
                return __Pyx_PyObject_CallMethO(func, args[0]);
            }
        }
    }
#endif
    #if PY_VERSION_HEX < 0x030800B1
    #if CYTHON_FAST_PYCCALL
    if (PyCFunction_Check(func)) {
        if (kwargs) {
            return _PyCFunction_FastCallDict(func, args, nargs, kwargs);
        } else {
            return _PyCFunction_FastCallKeywords(func, args, nargs, NULL);
        }
    }
    #if PY_VERSION_HEX >= 0x030700A1
    if (!kwargs && __Pyx_IS_TYPE(func, &PyMethodDescr_Type)) {
        return _PyMethodDescr_FastCallKeywords(func, args, nargs, NULL);
    }
    #endif
    #endif
    #if CYTHON_FAST_PYCALL
    if (PyFunction_Check(func)) {
        return __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs);
    }
    #endif
    #endif
    #if CYTHON_VECTORCALL
    vectorcallfunc f = _PyVectorcall_Function(func);
    if (f) {
        return f(func, args, (size_t)nargs, kwargs);
    }
    #elif defined(__Pyx_CyFunction_USED) && CYTHON_BACKPORT_VECTORCALL
    if (__Pyx_CyFunction_CheckExact(func)) {
        __pyx_vectorcallfunc f = __Pyx_CyFunction_func_vectorcall(func);
        if (f) return f(func, args, (size_t)nargs, kwargs);
    }
    #endif
    if (nargs == 0) {
        return __Pyx_PyObject_Call(func, __pyx_empty_tuple, kwargs);
    }
    return __Pyx_PyObject_FastCall_fallback(func, args, (size_t)nargs, kwargs);
}

/* GetItemInt */
static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
    PyObject *r;
    if (unlikely(!j)) return NULL;
    r = PyObject_GetItem(o, j);
    Py_DECREF(j);
    return r;
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyList_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyList_GET_SIZE(o)))) {
        PyObject *r = PyList_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
                                                              CYTHON_NCP_UNUSED int wraparound,
                                                              CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    Py_ssize_t wrapped_i = i;
    if (wraparound & unlikely(i < 0)) {
        wrapped_i += PyTuple_GET_SIZE(o);
    }
    if ((!boundscheck) || likely(__Pyx_is_valid_index(wrapped_i, PyTuple_GET_SIZE(o)))) {
        PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
        Py_INCREF(r);
        return r;
    }
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
#else
    return PySequence_GetItem(o, i);
#endif
}
static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
                                                     CYTHON_NCP_UNUSED int wraparound,
                                                     CYTHON_NCP_UNUSED int boundscheck) {
#if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
    if (is_list || PyList_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
        if ((!boundscheck) || (likely(__Pyx_is_valid_index(n, PyList_GET_SIZE(o))))) {
            PyObject *r = PyList_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    }
    else if (PyTuple_CheckExact(o)) {
        Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
        if ((!boundscheck) || likely(__Pyx_is_valid_index(n, PyTuple_GET_SIZE(o)))) {
            PyObject *r = PyTuple_GET_ITEM(o, n);
            Py_INCREF(r);
            return r;
        }
    } else {
        PyMappingMethods *mm = Py_TYPE(o)->tp_as_mapping;
        PySequenceMethods *sm = Py_TYPE(o)->tp_as_sequence;
        if (mm && mm->mp_subscript) {
            PyObject *r, *key = PyInt_FromSsize_t(i);
            if (unlikely(!key)) return NULL;
            r = mm->mp_subscript(o, key);
            Py_DECREF(key);
            return r;
        }
        if (likely(sm && sm->sq_item)) {
            if (wraparound && unlikely(i < 0) && likely(sm->sq_length)) {
                Py_ssize_t l = sm->sq_length(o);
                if (likely(l >= 0)) {
                    i += l;
                } else {
                    if (!PyErr_ExceptionMatches(PyExc_OverflowError))
                        return NULL;
                    PyErr_Clear();
                }
            }
            return sm->sq_item(o, i);
        }
    }
#else
    if (is_list || PySequence_Check(o)) {
        return PySequence_GetItem(o, i);
    }
#endif
    return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
}

/* PyIntCompare */
static CYTHON_INLINE PyObject* __Pyx_PyInt_EqObjC(PyObject *op1, PyObject *op2, long intval, long inplace) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_UNUSED_VAR(inplace);
    if (op1 == op2) {
        Py_RETURN_TRUE;
    }
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        if (a == b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        int unequal;
        unsigned long uintval;
        Py_ssize_t size = Py_SIZE(op1);
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        if (intval == 0) {
            if (size == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
        } else if (intval < 0) {
            if (size >= 0)
                Py_RETURN_FALSE;
            intval = -intval;
            size = -size;
        } else {
            if (size <= 0)
                Py_RETURN_FALSE;
        }
        uintval = (unsigned long) intval;
#if PyLong_SHIFT * 4 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 4)) {
            unequal = (size != 5) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[4] != ((uintval >> (4 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 3 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 3)) {
            unequal = (size != 4) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[3] != ((uintval >> (3 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 2 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 2)) {
            unequal = (size != 3) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK)) | (digits[2] != ((uintval >> (2 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
#if PyLong_SHIFT * 1 < SIZEOF_LONG*8
        if (uintval >> (PyLong_SHIFT * 1)) {
            unequal = (size != 2) || (digits[0] != (uintval & (unsigned long) PyLong_MASK))
                 | (digits[1] != ((uintval >> (1 * PyLong_SHIFT)) & (unsigned long) PyLong_MASK));
        } else
#endif
            unequal = (size != 1) || (((unsigned long) digits[0]) != (uintval & (unsigned long) PyLong_MASK));
        if (unequal == 0) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
        if ((double)a == (double)b) Py_RETURN_TRUE; else Py_RETURN_FALSE;
    }
    return (
        PyObject_RichCompare(op1, op2, Py_EQ));
}

/* UnpackUnboundCMethod */
static int __Pyx_TryUnpackUnboundCMethod(__Pyx_CachedCFunction* target) {
    PyObject *method;
    method = __Pyx_PyObject_GetAttrStr(target->type, *target->method_name);
    if (unlikely(!method))
        return -1;
    target->method = method;
#if CYTHON_COMPILING_IN_CPYTHON
    #if PY_MAJOR_VERSION >= 3
    if (likely(__Pyx_TypeCheck(method, &PyMethodDescr_Type)))
    #endif
    {
        PyMethodDescrObject *descr = (PyMethodDescrObject*) method;
        target->func = descr->d_method->ml_meth;
        target->flag = descr->d_method->ml_flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_STACKLESS);
    }
#endif
    return 0;
}

/* CallUnboundCMethod0 */
static PyObject* __Pyx__CallUnboundCMethod0(__Pyx_CachedCFunction* cfunc, PyObject* self) {
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_ASSUME_SAFE_MACROS
    args = PyTuple_New(1);
    if (unlikely(!args)) goto bad;
    Py_INCREF(self);
    PyTuple_SET_ITEM(args, 0, self);
#else
    args = PyTuple_Pack(1, self);
    if (unlikely(!args)) goto bad;
#endif
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    Py_DECREF(args);
bad:
    return result;
}

/* py_dict_keys */
static CYTHON_INLINE PyObject* __Pyx_PyDict_Keys(PyObject* d) {
    if (PY_MAJOR_VERSION >= 3)
        return __Pyx_CallUnboundCMethod0(&__pyx_umethod_PyDict_Type_keys, d);
    else
        return PyDict_Keys(d);
}

/* PyObjectCallOneArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
    PyObject *args[2] = {NULL, arg};
    return __Pyx_PyObject_FastCall(func, args+1, 1 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* ObjectGetItem */
#if CYTHON_USE_TYPE_SLOTS
static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject *index) {
    PyObject *runerr;
    Py_ssize_t key_value;
    key_value = __Pyx_PyIndex_AsSsize_t(index);
    if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
        return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
    }
    if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
        __Pyx_TypeName index_type_name = __Pyx_PyType_GetName(Py_TYPE(index));
        PyErr_Clear();
        PyErr_Format(PyExc_IndexError,
            "cannot fit '" __Pyx_FMT_TYPENAME "' into an index-sized integer", index_type_name);
        __Pyx_DECREF_TypeName(index_type_name);
    }
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem_Slow(PyObject *obj, PyObject *key) {
    __Pyx_TypeName obj_type_name;
    if (likely(PyType_Check(obj))) {
        PyObject *meth = __Pyx_PyObject_GetAttrStrNoError(obj, __pyx_n_s_class_getitem);
        if (meth) {
            PyObject *result = __Pyx_PyObject_CallOneArg(meth, key);
            Py_DECREF(meth);
            return result;
        }
    }
    obj_type_name = __Pyx_PyType_GetName(Py_TYPE(obj));
    PyErr_Format(PyExc_TypeError,
        "'" __Pyx_FMT_TYPENAME "' object is not subscriptable", obj_type_name);
    __Pyx_DECREF_TypeName(obj_type_name);
    return NULL;
}
static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject *key) {
    PyTypeObject *tp = Py_TYPE(obj);
    PyMappingMethods *mm = tp->tp_as_mapping;
    PySequenceMethods *sm = tp->tp_as_sequence;
    if (likely(mm && mm->mp_subscript)) {
        return mm->mp_subscript(obj, key);
    }
    if (likely(sm && sm->sq_item)) {
        return __Pyx_PyObject_GetIndex(obj, key);
    }
    return __Pyx_PyObject_GetItem_Slow(obj, key);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
        
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (unlikely(size == 0)) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double b = __pyx_PyFloat_AsDouble(op2);
#else
        double b = PyFloat_AS_DOUBLE(op2);
#endif
            double result;
            
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_AddCObj(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op2))) {
        const long a = intval;
        long x;
        long b = PyInt_AS_LONG(op2);
        
            x = (long)((unsigned long)a + b);
            if (likely((x^a) >= 0 || (x^b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_add(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op2))) {
        const long a = intval;
        long b, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG lla = intval;
        PY_LONG_LONG llb, llx;
#endif
        const digit* digits = ((PyLongObject*)op2)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op2);
        if (unlikely(size == 0)) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            b = likely(size) ? digits[0] : 0;
            if (size == -1) b = -b;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        b = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        b = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        b = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        llb = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
            }
        }
                x = a + b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla + llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op2)) {
        const long a = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double b = __pyx_PyFloat_AsDouble(op2);
#else
        double b = PyFloat_AS_DOUBLE(op2);
#endif
            double result;
            
            PyFPE_START_PROTECT("add", return NULL)
            result = ((double)a) + (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
}
#endif

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_SubtractObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long x;
        long a = PyInt_AS_LONG(op1);
        
            x = (long)((unsigned long)a - b);
            if (likely((x^a) >= 0 || (x^~b) >= 0))
                return PyInt_FromLong(x);
            return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (unlikely(size == 0)) {
            return PyLong_FromLong(-intval);
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_subtract(op1, op2);
            }
        }
                x = a - b;
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla - llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("subtract", return NULL)
            result = ((double)a) - (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceSubtract : PyNumber_Subtract)(op1, op2);
}
#endif

/* JoinPyUnicode */
static PyObject* __Pyx_PyUnicode_Join(PyObject* value_tuple, Py_ssize_t value_count, Py_ssize_t result_ulength,
                                      Py_UCS4 max_char) {
#if CYTHON_USE_UNICODE_INTERNALS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyObject *result_uval;
    int result_ukind, kind_shift;
    Py_ssize_t i, char_pos;
    void *result_udata;
    CYTHON_MAYBE_UNUSED_VAR(max_char);
#if CYTHON_PEP393_ENABLED
    result_uval = PyUnicode_New(result_ulength, max_char);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = (max_char <= 255) ? PyUnicode_1BYTE_KIND : (max_char <= 65535) ? PyUnicode_2BYTE_KIND : PyUnicode_4BYTE_KIND;
    kind_shift = (result_ukind == PyUnicode_4BYTE_KIND) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_DATA(result_uval);
#else
    result_uval = PyUnicode_FromUnicode(NULL, result_ulength);
    if (unlikely(!result_uval)) return NULL;
    result_ukind = sizeof(Py_UNICODE);
    kind_shift = (result_ukind == 4) ? 2 : result_ukind - 1;
    result_udata = PyUnicode_AS_UNICODE(result_uval);
#endif
    assert(kind_shift == 2 || kind_shift == 1 || kind_shift == 0);
    char_pos = 0;
    for (i=0; i < value_count; i++) {
        int ukind;
        Py_ssize_t ulength;
        void *udata;
        PyObject *uval = PyTuple_GET_ITEM(value_tuple, i);
        if (unlikely(__Pyx_PyUnicode_READY(uval)))
            goto bad;
        ulength = __Pyx_PyUnicode_GET_LENGTH(uval);
        if (unlikely(!ulength))
            continue;
        if (unlikely((PY_SSIZE_T_MAX >> kind_shift) - ulength < char_pos))
            goto overflow;
        ukind = __Pyx_PyUnicode_KIND(uval);
        udata = __Pyx_PyUnicode_DATA(uval);
        if (!CYTHON_PEP393_ENABLED || ukind == result_ukind) {
            memcpy((char *)result_udata + (char_pos << kind_shift), udata, (size_t) (ulength << kind_shift));
        } else {
            #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030300F0 || defined(_PyUnicode_FastCopyCharacters)
            _PyUnicode_FastCopyCharacters(result_uval, char_pos, uval, 0, ulength);
            #else
            Py_ssize_t j;
            for (j=0; j < ulength; j++) {
                Py_UCS4 uchar = __Pyx_PyUnicode_READ(ukind, udata, j);
                __Pyx_PyUnicode_WRITE(result_ukind, result_udata, char_pos+j, uchar);
            }
            #endif
        }
        char_pos += ulength;
    }
    return result_uval;
overflow:
    PyErr_SetString(PyExc_OverflowError, "join() result is too long for a Python string");
bad:
    Py_DECREF(result_uval);
    return NULL;
#else
    CYTHON_UNUSED_VAR(max_char);
    CYTHON_UNUSED_VAR(result_ulength);
    CYTHON_UNUSED_VAR(value_count);
    return PyUnicode_Join(__pyx_empty_unicode, value_tuple);
#endif
}

/* GetTopmostException */
#if CYTHON_USE_EXC_INFO_STACK
static _PyErr_StackItem *
__Pyx_PyErr_GetTopmostException(PyThreadState *tstate)
{
    _PyErr_StackItem *exc_info = tstate->exc_info;
    while ((exc_info->exc_type == NULL || exc_info->exc_type == Py_None) &&
           exc_info->previous_item != NULL)
    {
        exc_info = exc_info->previous_item;
    }
    return exc_info;
}
#endif

/* SaveResetException */
#if CYTHON_FAST_THREAD_STATE
static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = __Pyx_PyErr_GetTopmostException(tstate);
    *type = exc_info->exc_type;
    *value = exc_info->exc_value;
    *tb = exc_info->exc_traceback;
    #else
    *type = tstate->exc_type;
    *value = tstate->exc_value;
    *tb = tstate->exc_traceback;
    #endif
    Py_XINCREF(*type);
    Py_XINCREF(*value);
    Py_XINCREF(*tb);
}
static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    #if CYTHON_USE_EXC_INFO_STACK
    _PyErr_StackItem *exc_info = tstate->exc_info;
    tmp_type = exc_info->exc_type;
    tmp_value = exc_info->exc_value;
    tmp_tb = exc_info->exc_traceback;
    exc_info->exc_type = type;
    exc_info->exc_value = value;
    exc_info->exc_traceback = tb;
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = type;
    tstate->exc_value = value;
    tstate->exc_traceback = tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
}
#endif

/* GetException */
#if CYTHON_FAST_THREAD_STATE
static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb)
#else
static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb)
#endif
{
    PyObject *local_type, *local_value, *local_tb;
#if CYTHON_FAST_THREAD_STATE
    PyObject *tmp_type, *tmp_value, *tmp_tb;
    local_type = tstate->curexc_type;
    local_value = tstate->curexc_value;
    local_tb = tstate->curexc_traceback;
    tstate->curexc_type = 0;
    tstate->curexc_value = 0;
    tstate->curexc_traceback = 0;
#else
    PyErr_Fetch(&local_type, &local_value, &local_tb);
#endif
    PyErr_NormalizeException(&local_type, &local_value, &local_tb);
#if CYTHON_FAST_THREAD_STATE
    if (unlikely(tstate->curexc_type))
#else
    if (unlikely(PyErr_Occurred()))
#endif
        goto bad;
    #if PY_MAJOR_VERSION >= 3
    if (local_tb) {
        if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
            goto bad;
    }
    #endif
    Py_XINCREF(local_tb);
    Py_XINCREF(local_type);
    Py_XINCREF(local_value);
    *type = local_type;
    *value = local_value;
    *tb = local_tb;
#if CYTHON_FAST_THREAD_STATE
    #if CYTHON_USE_EXC_INFO_STACK
    {
        _PyErr_StackItem *exc_info = tstate->exc_info;
        tmp_type = exc_info->exc_type;
        tmp_value = exc_info->exc_value;
        tmp_tb = exc_info->exc_traceback;
        exc_info->exc_type = local_type;
        exc_info->exc_value = local_value;
        exc_info->exc_traceback = local_tb;
    }
    #else
    tmp_type = tstate->exc_type;
    tmp_value = tstate->exc_value;
    tmp_tb = tstate->exc_traceback;
    tstate->exc_type = local_type;
    tstate->exc_value = local_value;
    tstate->exc_traceback = local_tb;
    #endif
    Py_XDECREF(tmp_type);
    Py_XDECREF(tmp_value);
    Py_XDECREF(tmp_tb);
#else
    PyErr_SetExcInfo(local_type, local_value, local_tb);
#endif
    return 0;
bad:
    *type = 0;
    *value = 0;
    *tb = 0;
    Py_XDECREF(local_type);
    Py_XDECREF(local_value);
    Py_XDECREF(local_tb);
    return -1;
}

/* IterFinish */
static CYTHON_INLINE int __Pyx_IterFinish(void) {
#if CYTHON_FAST_THREAD_STATE
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    PyObject* exc_type = tstate->curexc_type;
    if (unlikely(exc_type)) {
        if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) {
            PyObject *exc_value, *exc_tb;
            exc_value = tstate->curexc_value;
            exc_tb = tstate->curexc_traceback;
            tstate->curexc_type = 0;
            tstate->curexc_value = 0;
            tstate->curexc_traceback = 0;
            Py_DECREF(exc_type);
            Py_XDECREF(exc_value);
            Py_XDECREF(exc_tb);
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#else
    if (unlikely(PyErr_Occurred())) {
        if (likely(PyErr_ExceptionMatches(PyExc_StopIteration))) {
            PyErr_Clear();
            return 0;
        } else {
            return -1;
        }
    }
    return 0;
#endif
}

/* PyObjectCallNoArg */
static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
    PyObject *arg = NULL;
    return __Pyx_PyObject_FastCall(func, (&arg)+1, 0 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectGetMethod */
static int __Pyx_PyObject_GetMethod(PyObject *obj, PyObject *name, PyObject **method) {
    PyObject *attr;
#if CYTHON_UNPACK_METHODS && CYTHON_COMPILING_IN_CPYTHON && CYTHON_USE_PYTYPE_LOOKUP
    __Pyx_TypeName type_name;
    PyTypeObject *tp = Py_TYPE(obj);
    PyObject *descr;
    descrgetfunc f = NULL;
    PyObject **dictptr, *dict;
    int meth_found = 0;
    assert (*method == NULL);
    if (unlikely(tp->tp_getattro != PyObject_GenericGetAttr)) {
        attr = __Pyx_PyObject_GetAttrStr(obj, name);
        goto try_unpack;
    }
    if (unlikely(tp->tp_dict == NULL) && unlikely(PyType_Ready(tp) < 0)) {
        return 0;
    }
    descr = _PyType_Lookup(tp, name);
    if (likely(descr != NULL)) {
        Py_INCREF(descr);
#if defined(Py_TPFLAGS_METHOD_DESCRIPTOR) && Py_TPFLAGS_METHOD_DESCRIPTOR
        if (__Pyx_PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_METHOD_DESCRIPTOR))
#elif PY_MAJOR_VERSION >= 3
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr) || __Pyx_IS_TYPE(descr, &PyMethodDescr_Type)))
        #endif
#else
        #ifdef __Pyx_CyFunction_USED
        if (likely(PyFunction_Check(descr) || __Pyx_CyFunction_Check(descr)))
        #else
        if (likely(PyFunction_Check(descr)))
        #endif
#endif
        {
            meth_found = 1;
        } else {
            f = Py_TYPE(descr)->tp_descr_get;
            if (f != NULL && PyDescr_IsData(descr)) {
                attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
                Py_DECREF(descr);
                goto try_unpack;
            }
        }
    }
    dictptr = _PyObject_GetDictPtr(obj);
    if (dictptr != NULL && (dict = *dictptr) != NULL) {
        Py_INCREF(dict);
        attr = __Pyx_PyDict_GetItemStr(dict, name);
        if (attr != NULL) {
            Py_INCREF(attr);
            Py_DECREF(dict);
            Py_XDECREF(descr);
            goto try_unpack;
        }
        Py_DECREF(dict);
    }
    if (meth_found) {
        *method = descr;
        return 1;
    }
    if (f != NULL) {
        attr = f(descr, obj, (PyObject *)Py_TYPE(obj));
        Py_DECREF(descr);
        goto try_unpack;
    }
    if (likely(descr != NULL)) {
        *method = descr;
        return 0;
    }
    type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return 0;
#else
    attr = __Pyx_PyObject_GetAttrStr(obj, name);
    goto try_unpack;
#endif
try_unpack:
#if CYTHON_UNPACK_METHODS
    if (likely(attr) && PyMethod_Check(attr) && likely(PyMethod_GET_SELF(attr) == obj)) {
        PyObject *function = PyMethod_GET_FUNCTION(attr);
        Py_INCREF(function);
        Py_DECREF(attr);
        *method = function;
        return 1;
    }
#endif
    *method = attr;
    return 0;
}

/* PyObjectCallMethod0 */
static PyObject* __Pyx_PyObject_CallMethod0(PyObject* obj, PyObject* method_name) {
    PyObject *method = NULL, *result = NULL;
    int is_method = __Pyx_PyObject_GetMethod(obj, method_name, &method);
    if (likely(is_method)) {
        result = __Pyx_PyObject_CallOneArg(method, obj);
        Py_DECREF(method);
        return result;
    }
    if (unlikely(!method)) goto bad;
    result = __Pyx_PyObject_CallNoArg(method);
    Py_DECREF(method);
bad:
    return result;
}

/* RaiseNeedMoreValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
    PyErr_Format(PyExc_ValueError,
                 "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
                 index, (index == 1) ? "" : "s");
}

/* RaiseTooManyValuesToUnpack */
static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
    PyErr_Format(PyExc_ValueError,
                 "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
}

/* UnpackItemEndCheck */
static int __Pyx_IternextUnpackEndCheck(PyObject *retval, Py_ssize_t expected) {
    if (unlikely(retval)) {
        Py_DECREF(retval);
        __Pyx_RaiseTooManyValuesError(expected);
        return -1;
    } else {
        return __Pyx_IterFinish();
    }
    return 0;
}

/* RaiseNoneIterError */
static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
    PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
}

/* UnpackTupleError */
static void __Pyx_UnpackTupleError(PyObject *t, Py_ssize_t index) {
    if (t == Py_None) {
      __Pyx_RaiseNoneNotIterableError();
    } else if (PyTuple_GET_SIZE(t) < index) {
      __Pyx_RaiseNeedMoreValuesError(PyTuple_GET_SIZE(t));
    } else {
      __Pyx_RaiseTooManyValuesError(index);
    }
}

/* UnpackTuple2 */
static CYTHON_INLINE int __Pyx_unpack_tuple2_exact(
        PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2, int decref_tuple) {
    PyObject *value1 = NULL, *value2 = NULL;
#if CYTHON_COMPILING_IN_PYPY
    value1 = PySequence_ITEM(tuple, 0);  if (unlikely(!value1)) goto bad;
    value2 = PySequence_ITEM(tuple, 1);  if (unlikely(!value2)) goto bad;
#else
    value1 = PyTuple_GET_ITEM(tuple, 0);  Py_INCREF(value1);
    value2 = PyTuple_GET_ITEM(tuple, 1);  Py_INCREF(value2);
#endif
    if (decref_tuple) {
        Py_DECREF(tuple);
    }
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
#if CYTHON_COMPILING_IN_PYPY
bad:
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
#endif
}
static int __Pyx_unpack_tuple2_generic(PyObject* tuple, PyObject** pvalue1, PyObject** pvalue2,
                                       int has_known_size, int decref_tuple) {
    Py_ssize_t index;
    PyObject *value1 = NULL, *value2 = NULL, *iter = NULL;
    iternextfunc iternext;
    iter = PyObject_GetIter(tuple);
    if (unlikely(!iter)) goto bad;
    if (decref_tuple) { Py_DECREF(tuple); tuple = NULL; }
    iternext = __Pyx_PyObject_GetIterNextFunc(iter);
    value1 = iternext(iter); if (unlikely(!value1)) { index = 0; goto unpacking_failed; }
    value2 = iternext(iter); if (unlikely(!value2)) { index = 1; goto unpacking_failed; }
    if (!has_known_size && unlikely(__Pyx_IternextUnpackEndCheck(iternext(iter), 2))) goto bad;
    Py_DECREF(iter);
    *pvalue1 = value1;
    *pvalue2 = value2;
    return 0;
unpacking_failed:
    if (!has_known_size && __Pyx_IterFinish() == 0)
        __Pyx_RaiseNeedMoreValuesError(index);
bad:
    Py_XDECREF(iter);
    Py_XDECREF(value1);
    Py_XDECREF(value2);
    if (decref_tuple) { Py_XDECREF(tuple); }
    return -1;
}

/* dict_iter */
static CYTHON_INLINE PyObject* __Pyx_dict_iterator(PyObject* iterable, int is_dict, PyObject* method_name,
                                                   Py_ssize_t* p_orig_length, int* p_source_is_dict) {
    is_dict = is_dict || likely(PyDict_CheckExact(iterable));
    *p_source_is_dict = is_dict;
    if (is_dict) {
#if !CYTHON_COMPILING_IN_PYPY
        *p_orig_length = PyDict_Size(iterable);
        Py_INCREF(iterable);
        return iterable;
#elif PY_MAJOR_VERSION >= 3
        static PyObject *py_items = NULL, *py_keys = NULL, *py_values = NULL;
        PyObject **pp = NULL;
        if (method_name) {
            const char *name = PyUnicode_AsUTF8(method_name);
            if (strcmp(name, "iteritems") == 0) pp = &py_items;
            else if (strcmp(name, "iterkeys") == 0) pp = &py_keys;
            else if (strcmp(name, "itervalues") == 0) pp = &py_values;
            if (pp) {
                if (!*pp) {
                    *pp = PyUnicode_FromString(name + 4);
                    if (!*pp)
                        return NULL;
                }
                method_name = *pp;
            }
        }
#endif
    }
    *p_orig_length = 0;
    if (method_name) {
        PyObject* iter;
        iterable = __Pyx_PyObject_CallMethod0(iterable, method_name);
        if (!iterable)
            return NULL;
#if !CYTHON_COMPILING_IN_PYPY
        if (PyTuple_CheckExact(iterable) || PyList_CheckExact(iterable))
            return iterable;
#endif
        iter = PyObject_GetIter(iterable);
        Py_DECREF(iterable);
        return iter;
    }
    return PyObject_GetIter(iterable);
}
static CYTHON_INLINE int __Pyx_dict_iter_next(
        PyObject* iter_obj, CYTHON_NCP_UNUSED Py_ssize_t orig_length, CYTHON_NCP_UNUSED Py_ssize_t* ppos,
        PyObject** pkey, PyObject** pvalue, PyObject** pitem, int source_is_dict) {
    PyObject* next_item;
#if !CYTHON_COMPILING_IN_PYPY
    if (source_is_dict) {
        PyObject *key, *value;
        if (unlikely(orig_length != PyDict_Size(iter_obj))) {
            PyErr_SetString(PyExc_RuntimeError, "dictionary changed size during iteration");
            return -1;
        }
        if (unlikely(!PyDict_Next(iter_obj, ppos, &key, &value))) {
            return 0;
        }
        if (pitem) {
            PyObject* tuple = PyTuple_New(2);
            if (unlikely(!tuple)) {
                return -1;
            }
            Py_INCREF(key);
            Py_INCREF(value);
            PyTuple_SET_ITEM(tuple, 0, key);
            PyTuple_SET_ITEM(tuple, 1, value);
            *pitem = tuple;
        } else {
            if (pkey) {
                Py_INCREF(key);
                *pkey = key;
            }
            if (pvalue) {
                Py_INCREF(value);
                *pvalue = value;
            }
        }
        return 1;
    } else if (PyTuple_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyTuple_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyTuple_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else if (PyList_CheckExact(iter_obj)) {
        Py_ssize_t pos = *ppos;
        if (unlikely(pos >= PyList_GET_SIZE(iter_obj))) return 0;
        *ppos = pos + 1;
        next_item = PyList_GET_ITEM(iter_obj, pos);
        Py_INCREF(next_item);
    } else
#endif
    {
        next_item = PyIter_Next(iter_obj);
        if (unlikely(!next_item)) {
            return __Pyx_IterFinish();
        }
    }
    if (pitem) {
        *pitem = next_item;
    } else if (pkey && pvalue) {
        if (__Pyx_unpack_tuple2(next_item, pkey, pvalue, source_is_dict, source_is_dict, 1))
            return -1;
    } else if (pkey) {
        *pkey = next_item;
    } else {
        *pvalue = next_item;
    }
    return 1;
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_TrueDivideObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
            if (8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53))) {
                return PyFloat_FromDouble((double)a / (double)b);
            }
            return PyInt_Type.tp_as_number->nb_true_divide(op1, op2);
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (unlikely(size == 0)) {
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT && 1 * PyLong_SHIFT < 53) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT && 2 * PyLong_SHIFT < 53) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT && 3 * PyLong_SHIFT < 53) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            }
        }
                if ((8 * sizeof(long) <= 53 || likely(labs(a) <= ((PY_LONG_LONG)1 << 53)))
                        || __Pyx_sst_abs(size) <= 52 / PyLong_SHIFT) {
                    return PyFloat_FromDouble((double)a / (double)b);
                }
                return PyLong_Type.tp_as_number->nb_true_divide(op1, op2);
            return PyLong_FromLong(x);
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("divide", return NULL)
            result = ((double)a) / (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceTrueDivide : PyNumber_TrueDivide)(op1, op2);
}
#endif

/* None */
static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
    PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
}

/* PyIntBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyInt_MultiplyObjC(PyObject *op1, PyObject *op2, long intval, int inplace, int zerodivision_check) {
    CYTHON_MAYBE_UNUSED_VAR(intval);
    CYTHON_MAYBE_UNUSED_VAR(inplace);
    CYTHON_UNUSED_VAR(zerodivision_check);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        const long b = intval;
        long a = PyInt_AS_LONG(op1);
        
#ifdef HAVE_LONG_LONG
            if (sizeof(PY_LONG_LONG) > sizeof(long)) {
                PY_LONG_LONG result = (PY_LONG_LONG)a * (PY_LONG_LONG)b;
                return (result >= LONG_MIN && result <= LONG_MAX) ?
                    PyInt_FromLong((long)result) : PyLong_FromLongLong(result);
            }
#endif
#if CYTHON_USE_TYPE_SLOTS
            return PyInt_Type.tp_as_number->nb_multiply(op1, op2);
#else
            return PyNumber_Multiply(op1, op2);
#endif
    }
    #endif
    #if CYTHON_USE_PYLONG_INTERNALS
    if (likely(PyLong_CheckExact(op1))) {
        const long b = intval;
        long a, x;
#ifdef HAVE_LONG_LONG
        const PY_LONG_LONG llb = intval;
        PY_LONG_LONG lla, llx;
#endif
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        if (unlikely(size == 0)) {
            return __Pyx_NewRef(op1);
        }
        if (likely(__Pyx_sst_abs(size) <= 1)) {
            a = likely(size) ? digits[0] : 0;
            if (size == -1) a = -a;
        } else {
            switch (size) {
                case -2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 2:
                    if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT+30) {
                        a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 3:
                    if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT+30) {
                        a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case -4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                case 4:
                    if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT+30) {
                        a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                        break;
                    #ifdef HAVE_LONG_LONG
                    } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT+30) {
                        lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
                        goto long_long;
                    #endif
                    }
                    CYTHON_FALLTHROUGH;
                default: return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
            }
        }
                (void)a; (void)b;
                #ifdef HAVE_LONG_LONG
                lla = a;
                goto long_long;
                #else
                return PyLong_Type.tp_as_number->nb_multiply(op1, op2);
                #endif
            return PyLong_FromLong(x);
#ifdef HAVE_LONG_LONG
        long_long:
                llx = lla * llb;
            return PyLong_FromLongLong(llx);
#endif
        
        
    }
    #endif
    if (PyFloat_CheckExact(op1)) {
        const long b = intval;
#if CYTHON_COMPILING_IN_LIMITED_API
        double a = __pyx_PyFloat_AsDouble(op1);
#else
        double a = PyFloat_AS_DOUBLE(op1);
#endif
            double result;
            
            PyFPE_START_PROTECT("multiply", return NULL)
            result = ((double)a) * (double)b;
            PyFPE_END_PROTECT(result)
            return PyFloat_FromDouble(result);
    }
    return (inplace ? PyNumber_InPlaceMultiply : PyNumber_Multiply)(op1, op2);
}
#endif

/* PyFloatBinop */
#if !CYTHON_COMPILING_IN_PYPY
static PyObject* __Pyx_PyFloat_AddObjC(PyObject *op1, PyObject *op2, double floatval, int inplace, int zerodivision_check) {
    const double b = floatval;
    double a, result;
    (void)inplace; (void)zerodivision_check;
    if (likely(PyFloat_CheckExact(op1))) {
#if CYTHON_COMPILING_IN_LIMITED_API
        a = __pyx_PyFloat_AsDouble(op1);
#else
        a = PyFloat_AS_DOUBLE(op1);
#endif
        
    } else
    #if PY_MAJOR_VERSION < 3
    if (likely(PyInt_CheckExact(op1))) {
        a = (double) PyInt_AS_LONG(op1);
        
    } else
    #endif
    if (likely(PyLong_CheckExact(op1))) {
        #if CYTHON_USE_PYLONG_INTERNALS
        const digit* digits = ((PyLongObject*)op1)->ob_digit;
        const Py_ssize_t size = Py_SIZE(op1);
        switch (size) {
            case  0: a = 0.0;  break;
            case -1: a = -(double) digits[0]; break;
            case  1: a = (double) digits[0]; break;
            case -2:
            case 2:
                if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (1 * PyLong_SHIFT < 53))) {
                    a = (double) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -2)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -3:
            case 3:
                if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (2 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -3)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            case -4:
            case 4:
                if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT && ((8 * sizeof(unsigned long) < 53) || (3 * PyLong_SHIFT < 53))) {
                    a = (double) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
                    if ((8 * sizeof(unsigned long) < 53) || (4 * PyLong_SHIFT < 53) || (a < (double) ((PY_LONG_LONG)1 << 53))) {
                        if (size == -4)
                            a = -a;
                        break;
                    }
                }
                CYTHON_FALLTHROUGH;
            default:
        #else
        {
        #endif
            a = PyLong_AsDouble(op1);
            if (unlikely(a == -1.0 && PyErr_Occurred())) return NULL;
        }
    } else {
        return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
    }
        PyFPE_START_PROTECT("add", return NULL)
        result = a + b;
        PyFPE_END_PROTECT(result)
        return PyFloat_FromDouble(result);
}
#endif

/* CallUnboundCMethod1 */
  #if CYTHON_COMPILING_IN_CPYTHON
static CYTHON_INLINE PyObject* __Pyx_CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg) {
    if (likely(cfunc->func)) {
        int flag = cfunc->flag;
        if (flag == METH_O) {
            return (*(cfunc->func))(self, arg);
        } else if ((PY_VERSION_HEX >= 0x030600B1) && flag == METH_FASTCALL) {
            if ((PY_VERSION_HEX >= 0x030700A0)) {
                return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, &arg, 1);
            } else {
                return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
            }
        } else if ((PY_VERSION_HEX >= 0x030700A0) && flag == (METH_FASTCALL | METH_KEYWORDS)) {
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, &arg, 1, NULL);
        }
    }
    return __Pyx__CallUnboundCMethod1(cfunc, self, arg);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod1(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(1);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 0, arg);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg);
        PyTuple_SET_ITEM(args, 1, arg);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(2, self, arg);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* CallUnboundCMethod2 */
  #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030600B1
static CYTHON_INLINE PyObject *__Pyx_CallUnboundCMethod2(__Pyx_CachedCFunction *cfunc, PyObject *self, PyObject *arg1, PyObject *arg2) {
    if (likely(cfunc->func)) {
        PyObject *args[2] = {arg1, arg2};
        if (cfunc->flag == METH_FASTCALL) {
            #if PY_VERSION_HEX >= 0x030700A0
            return (*(__Pyx_PyCFunctionFast)(void*)(PyCFunction)cfunc->func)(self, args, 2);
            #else
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
            #endif
        }
        #if PY_VERSION_HEX >= 0x030700A0
        if (cfunc->flag == (METH_FASTCALL | METH_KEYWORDS))
            return (*(__Pyx_PyCFunctionFastWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, 2, NULL);
        #endif
    }
    return __Pyx__CallUnboundCMethod2(cfunc, self, arg1, arg2);
}
#endif
static PyObject* __Pyx__CallUnboundCMethod2(__Pyx_CachedCFunction* cfunc, PyObject* self, PyObject* arg1, PyObject* arg2){
    PyObject *args, *result = NULL;
    if (unlikely(!cfunc->func && !cfunc->method) && unlikely(__Pyx_TryUnpackUnboundCMethod(cfunc) < 0)) return NULL;
#if CYTHON_COMPILING_IN_CPYTHON
    if (cfunc->func && (cfunc->flag & METH_VARARGS)) {
        args = PyTuple_New(2);
        if (unlikely(!args)) goto bad;
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 0, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 1, arg2);
        if (cfunc->flag & METH_KEYWORDS)
            result = (*(PyCFunctionWithKeywords)(void*)(PyCFunction)cfunc->func)(self, args, NULL);
        else
            result = (*cfunc->func)(self, args);
    } else {
        args = PyTuple_New(3);
        if (unlikely(!args)) goto bad;
        Py_INCREF(self);
        PyTuple_SET_ITEM(args, 0, self);
        Py_INCREF(arg1);
        PyTuple_SET_ITEM(args, 1, arg1);
        Py_INCREF(arg2);
        PyTuple_SET_ITEM(args, 2, arg2);
        result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
    }
#else
    args = PyTuple_Pack(3, self, arg1, arg2);
    if (unlikely(!args)) goto bad;
    result = __Pyx_PyObject_Call(cfunc->method, args, NULL);
#endif
bad:
    Py_XDECREF(args);
    return result;
}

/* dict_getitem_default */
  static PyObject* __Pyx_PyDict_GetItemDefault(PyObject* d, PyObject* key, PyObject* default_value) {
    PyObject* value;
#if PY_MAJOR_VERSION >= 3 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM >= 0x07020000)
    value = PyDict_GetItemWithError(d, key);
    if (unlikely(!value)) {
        if (unlikely(PyErr_Occurred()))
            return NULL;
        value = default_value;
    }
    Py_INCREF(value);
    if ((1));
#else
    if (PyString_CheckExact(key) || PyUnicode_CheckExact(key) || PyInt_CheckExact(key)) {
        value = PyDict_GetItem(d, key);
        if (unlikely(!value)) {
            value = default_value;
        }
        Py_INCREF(value);
    }
#endif
    else {
        if (default_value == Py_None)
            value = __Pyx_CallUnboundCMethod1(&__pyx_umethod_PyDict_Type_get, d, key);
        else
            value = __Pyx_CallUnboundCMethod2(&__pyx_umethod_PyDict_Type_get, d, key, default_value);
    }
    return value;
}

/* Import */
  static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
    PyObject *module = 0;
    PyObject *empty_dict = 0;
    PyObject *empty_list = 0;
    #if PY_MAJOR_VERSION < 3
    PyObject *py_import;
    py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
    if (unlikely(!py_import))
        goto bad;
    if (!from_list) {
        empty_list = PyList_New(0);
        if (unlikely(!empty_list))
            goto bad;
        from_list = empty_list;
    }
    #endif
    empty_dict = PyDict_New();
    if (unlikely(!empty_dict))
        goto bad;
    {
        #if PY_MAJOR_VERSION >= 3
        if (level == -1) {
            if ((1) && (strchr(__Pyx_MODULE_NAME, '.'))) {
                #if CYTHON_COMPILING_IN_LIMITED_API
                module = PyImport_ImportModuleLevelObject(
                    name, empty_dict, empty_dict, from_list, 1);
                #else
                module = PyImport_ImportModuleLevelObject(
                    name, __pyx_d, empty_dict, from_list, 1);
                #endif
                if (unlikely(!module)) {
                    if (unlikely(!PyErr_ExceptionMatches(PyExc_ImportError)))
                        goto bad;
                    PyErr_Clear();
                }
            }
            level = 0;
        }
        #endif
        if (!module) {
            #if PY_MAJOR_VERSION < 3
            PyObject *py_level = PyInt_FromLong(level);
            if (unlikely(!py_level))
                goto bad;
            module = PyObject_CallFunctionObjArgs(py_import,
                name, __pyx_d, empty_dict, from_list, py_level, (PyObject *)NULL);
            Py_DECREF(py_level);
            #else
            #if CYTHON_COMPILING_IN_LIMITED_API
            module = PyImport_ImportModuleLevelObject(
                name, empty_dict, empty_dict, from_list, level);
            #else
            module = PyImport_ImportModuleLevelObject(
                name, __pyx_d, empty_dict, from_list, level);
            #endif
            #endif
        }
    }
bad:
    Py_XDECREF(empty_dict);
    Py_XDECREF(empty_list);
    #if PY_MAJOR_VERSION < 3
    Py_XDECREF(py_import);
    #endif
    return module;
}

/* ImportFrom */
  static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
    PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
    if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
        PyErr_Format(PyExc_ImportError,
        #if PY_MAJOR_VERSION < 3
            "cannot import name %.230s", PyString_AS_STRING(name));
        #else
            "cannot import name %S", name);
        #endif
    }
    return value;
}

/* GetAttr */
  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
#if CYTHON_USE_TYPE_SLOTS
#if PY_MAJOR_VERSION >= 3
    if (likely(PyUnicode_Check(n)))
#else
    if (likely(PyString_Check(n)))
#endif
        return __Pyx_PyObject_GetAttrStr(o, n);
#endif
    return PyObject_GetAttr(o, n);
}

/* HasAttr */
  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
    PyObject *r;
    if (unlikely(!__Pyx_PyBaseString_Check(n))) {
        PyErr_SetString(PyExc_TypeError,
                        "hasattr(): attribute name must be string");
        return -1;
    }
    r = __Pyx_GetAttr(o, n);
    if (!r) {
        PyErr_Clear();
        return 0;
    } else {
        Py_DECREF(r);
        return 1;
    }
}

/* FastTypeChecks */
  #if CYTHON_COMPILING_IN_CPYTHON
static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
    while (a) {
        a = a->tp_base;
        if (a == b)
            return 1;
    }
    return b == &PyBaseObject_Type;
}
static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (a == b) return 1;
    mro = a->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(a, b);
}
static CYTHON_INLINE int __Pyx_IsAnySubtype2(PyTypeObject *cls, PyTypeObject *a, PyTypeObject *b) {
    PyObject *mro;
    if (cls == a || cls == b) return 1;
    mro = cls->tp_mro;
    if (likely(mro)) {
        Py_ssize_t i, n;
        n = PyTuple_GET_SIZE(mro);
        for (i = 0; i < n; i++) {
            PyObject *base = PyTuple_GET_ITEM(mro, i);
            if (base == (PyObject *)a || base == (PyObject *)b)
                return 1;
        }
        return 0;
    }
    return __Pyx_InBases(cls, a) || __Pyx_InBases(cls, b);
}
#if PY_MAJOR_VERSION == 2
static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
    PyObject *exception, *value, *tb;
    int res;
    __Pyx_PyThreadState_declare
    __Pyx_PyThreadState_assign
    __Pyx_ErrFetch(&exception, &value, &tb);
    res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
    if (unlikely(res == -1)) {
        PyErr_WriteUnraisable(err);
        res = 0;
    }
    if (!res) {
        res = PyObject_IsSubclass(err, exc_type2);
        if (unlikely(res == -1)) {
            PyErr_WriteUnraisable(err);
            res = 0;
        }
    }
    __Pyx_ErrRestore(exception, value, tb);
    return res;
}
#else
static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
    if (exc_type1) {
        return __Pyx_IsAnySubtype2((PyTypeObject*)err, (PyTypeObject*)exc_type1, (PyTypeObject*)exc_type2);
    } else {
        return __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
    }
}
#endif
static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
    Py_ssize_t i, n;
    assert(PyExceptionClass_Check(exc_type));
    n = PyTuple_GET_SIZE(tuple);
#if PY_MAJOR_VERSION >= 3
    for (i=0; i<n; i++) {
        if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
    }
#endif
    for (i=0; i<n; i++) {
        PyObject *t = PyTuple_GET_ITEM(tuple, i);
        #if PY_MAJOR_VERSION < 3
        if (likely(exc_type == t)) return 1;
        #endif
        if (likely(PyExceptionClass_Check(t))) {
            if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
        } else {
        }
    }
    return 0;
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
    if (likely(err == exc_type)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        if (likely(PyExceptionClass_Check(exc_type))) {
            return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
        } else if (likely(PyTuple_Check(exc_type))) {
            return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
        } else {
        }
    }
    return PyErr_GivenExceptionMatches(err, exc_type);
}
static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
    assert(PyExceptionClass_Check(exc_type1));
    assert(PyExceptionClass_Check(exc_type2));
    if (likely(err == exc_type1 || err == exc_type2)) return 1;
    if (likely(PyExceptionClass_Check(err))) {
        return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
    }
    return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
}
#endif

/* PyObject_GenericGetAttrNoDict */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
    __Pyx_TypeName type_name = __Pyx_PyType_GetName(tp);
    PyErr_Format(PyExc_AttributeError,
#if PY_MAJOR_VERSION >= 3
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%U'",
                 type_name, attr_name);
#else
                 "'" __Pyx_FMT_TYPENAME "' object has no attribute '%.400s'",
                 type_name, PyString_AS_STRING(attr_name));
#endif
    __Pyx_DECREF_TypeName(type_name);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
    PyObject *descr;
    PyTypeObject *tp = Py_TYPE(obj);
    if (unlikely(!PyString_Check(attr_name))) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    assert(!tp->tp_dictoffset);
    descr = _PyType_Lookup(tp, attr_name);
    if (unlikely(!descr)) {
        return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
    }
    Py_INCREF(descr);
    #if PY_MAJOR_VERSION < 3
    if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
    #endif
    {
        descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
        if (unlikely(f)) {
            PyObject *res = f(descr, obj, (PyObject *)tp);
            Py_DECREF(descr);
            return res;
        }
    }
    return descr;
}
#endif

/* PyObject_GenericGetAttr */
  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
    if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
        return PyObject_GenericGetAttr(obj, attr_name);
    }
    return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
}
#endif

/* PyType_Ready */
  #if CYTHON_COMPILING_IN_CPYTHON || CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_PyType_Ready(PyTypeObject *t) {
    int r;
    PyObject *bases = t->tp_bases;
    if (bases)
    {
        Py_ssize_t i, n = PyTuple_GET_SIZE(bases);
        for (i = 1; i < n; i++)
        {
            PyObject *b0 = PyTuple_GET_ITEM(bases, i);
            PyTypeObject *b;
#if PY_MAJOR_VERSION < 3
            if (PyClass_Check(b0))
            {
                PyErr_Format(PyExc_TypeError, "base class '%.200s' is an old-style class",
                             PyString_AS_STRING(((PyClassObject*)b0)->cl_name));
                return -1;
            }
#endif
            b = (PyTypeObject*)b0;
            if (!__Pyx_PyType_HasFeature(b, Py_TPFLAGS_HEAPTYPE))
            {
                __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                PyErr_Format(PyExc_TypeError,
                    "base class '" __Pyx_FMT_TYPENAME "' is not a heap type", b_name);
                __Pyx_DECREF_TypeName(b_name);
                return -1;
            }
            if (t->tp_dictoffset == 0 && b->tp_dictoffset)
            {
                __Pyx_TypeName t_name = __Pyx_PyType_GetName(t);
                __Pyx_TypeName b_name = __Pyx_PyType_GetName(b);
                PyErr_Format(PyExc_TypeError,
                    "extension type '" __Pyx_FMT_TYPENAME "' has no __dict__ slot, "
                    "but base type '" __Pyx_FMT_TYPENAME "' has: "
                    "either add 'cdef dict __dict__' to the extension type "
                    "or add '__slots__ = [...]' to the base type",
                    t_name, b_name);
                __Pyx_DECREF_TypeName(t_name);
                __Pyx_DECREF_TypeName(b_name);
                return -1;
            }
        }
    }
#if PY_VERSION_HEX >= 0x03050000
    {
        int gc_was_enabled;
    #if PY_VERSION_HEX >= 0x030A00b1
        gc_was_enabled = PyGC_Disable();
        (void)__Pyx_PyObject_CallMethod0;
    #else
        PyObject *ret, *py_status;
        PyObject *gc = NULL;
        #if PY_VERSION_HEX >= 0x030700a1 && (!CYTHON_COMPILING_IN_PYPY || PYPY_VERSION_NUM+0 >= 0x07030400)
        gc = PyImport_GetModule(__pyx_kp_u_gc);
        #endif
        if (unlikely(!gc)) gc = PyImport_Import(__pyx_kp_u_gc);
        if (unlikely(!gc)) return -1;
        py_status = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_isenabled);
        if (unlikely(!py_status)) {
            Py_DECREF(gc);
            return -1;
        }
        gc_was_enabled = __Pyx_PyObject_IsTrue(py_status);
        Py_DECREF(py_status);
        if (gc_was_enabled > 0) {
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_disable);
            if (unlikely(!ret)) {
                Py_DECREF(gc);
                return -1;
            }
            Py_DECREF(ret);
        } else if (unlikely(gc_was_enabled == -1)) {
            Py_DECREF(gc);
            return -1;
        }
    #endif
        t->tp_flags |= Py_TPFLAGS_HEAPTYPE;
#else
        (void)__Pyx_PyObject_CallMethod0;
#endif
    r = PyType_Ready(t);
#if PY_VERSION_HEX >= 0x03050000
        t->tp_flags &= ~Py_TPFLAGS_HEAPTYPE;
    #if PY_VERSION_HEX >= 0x030A00b1
        if (gc_was_enabled)
            PyGC_Enable();
    #else
        if (gc_was_enabled) {
            PyObject *tp, *v, *tb;
            PyErr_Fetch(&tp, &v, &tb);
            ret = __Pyx_PyObject_CallMethod0(gc, __pyx_kp_u_enable);
            if (likely(ret || r == -1)) {
                Py_XDECREF(ret);
                PyErr_Restore(tp, v, tb);
            } else {
                Py_XDECREF(tp);
                Py_XDECREF(v);
                Py_XDECREF(tb);
                r = -1;
            }
        }
        Py_DECREF(gc);
    #endif
    }
#endif
    return r;
}
#endif

/* SetupReduce */
  #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
  int ret;
  PyObject *name_attr;
  name_attr = __Pyx_PyObject_GetAttrStrNoError(meth, __pyx_n_s_name);
  if (likely(name_attr)) {
      ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
  } else {
      ret = -1;
  }
  if (unlikely(ret < 0)) {
      PyErr_Clear();
      ret = 0;
  }
  Py_XDECREF(name_attr);
  return ret;
}
static int __Pyx_setup_reduce(PyObject* type_obj) {
    int ret = 0;
    PyObject *object_reduce = NULL;
    PyObject *object_reduce_ex = NULL;
    PyObject *reduce = NULL;
    PyObject *reduce_ex = NULL;
    PyObject *reduce_cython = NULL;
    PyObject *setstate = NULL;
    PyObject *setstate_cython = NULL;
#if CYTHON_USE_PYTYPE_LOOKUP
    if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#else
    if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto __PYX_GOOD;
#endif
#if CYTHON_USE_PYTYPE_LOOKUP
    object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#else
    object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto __PYX_BAD;
#endif
    reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto __PYX_BAD;
    if (reduce_ex == object_reduce_ex) {
#if CYTHON_USE_PYTYPE_LOOKUP
        object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#else
        object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto __PYX_BAD;
#endif
        reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto __PYX_BAD;
        if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
            reduce_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_reduce_cython);
            if (likely(reduce_cython)) {
                ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
            } else if (reduce == object_reduce || PyErr_Occurred()) {
                goto __PYX_BAD;
            }
            setstate = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate);
            if (!setstate) PyErr_Clear();
            if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
                setstate_cython = __Pyx_PyObject_GetAttrStrNoError(type_obj, __pyx_n_s_setstate_cython);
                if (likely(setstate_cython)) {
                    ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                    ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto __PYX_BAD;
                } else if (!setstate || PyErr_Occurred()) {
                    goto __PYX_BAD;
                }
            }
            PyType_Modified((PyTypeObject*)type_obj);
        }
    }
    goto __PYX_GOOD;
__PYX_BAD:
    if (!PyErr_Occurred()) {
        __Pyx_TypeName type_obj_name =
            __Pyx_PyType_GetName((PyTypeObject*)type_obj);
        PyErr_Format(PyExc_RuntimeError,
            "Unable to initialize pickling for " __Pyx_FMT_TYPENAME, type_obj_name);
        __Pyx_DECREF_TypeName(type_obj_name);
    }
    ret = -1;
__PYX_GOOD:
#if !CYTHON_USE_PYTYPE_LOOKUP
    Py_XDECREF(object_reduce);
    Py_XDECREF(object_reduce_ex);
#endif
    Py_XDECREF(reduce);
    Py_XDECREF(reduce_ex);
    Py_XDECREF(reduce_cython);
    Py_XDECREF(setstate);
    Py_XDECREF(setstate_cython);
    return ret;
}
#endif

/* SetVTable */
  #if CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_SetVtable(PyObject *type, void *vtable) {
#else
static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
#endif
    PyObject *ob = PyCapsule_New(vtable, 0, 0);
    if (!ob)
        goto bad;
#if CYTHON_COMPILING_IN_LIMITED_API
    if (PyObject_SetAttr(type, __pyx_n_s_pyx_vtable, ob) < 0)
#else
    if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
#endif
        goto bad;
    Py_DECREF(ob);
    return 0;
bad:
    Py_XDECREF(ob);
    return -1;
}

/* GetVTable */
    static void* __Pyx_GetVtable(PyTypeObject *type) {
    void* ptr;
#if CYTHON_COMPILING_IN_LIMITED_API
    PyObject *ob = PyObject_GetAttr((PyObject *)type, __pyx_n_s_pyx_vtable);
#else
    PyObject *ob = PyObject_GetItem(type->tp_dict, __pyx_n_s_pyx_vtable);
#endif
    if (!ob)
        goto bad;
    ptr = PyCapsule_GetPointer(ob, 0);
    if (!ptr && !PyErr_Occurred())
        PyErr_SetString(PyExc_RuntimeError, "invalid vtable found for imported type");
    Py_DECREF(ob);
    return ptr;
bad:
    Py_XDECREF(ob);
    return NULL;
}

/* MergeVTables */
    #if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_MergeVtables(PyTypeObject *type) {
    int i;
    void** base_vtables;
    __Pyx_TypeName tp_base_name;
    __Pyx_TypeName base_name;
    void* unknown = (void*)-1;
    PyObject* bases = type->tp_bases;
    int base_depth = 0;
    {
        PyTypeObject* base = type->tp_base;
        while (base) {
            base_depth += 1;
            base = base->tp_base;
        }
    }
    base_vtables = (void**) malloc(sizeof(void*) * (base_depth + 1));
    base_vtables[0] = unknown;
    for (i = 1; i < PyTuple_GET_SIZE(bases); i++) {
        void* base_vtable = __Pyx_GetVtable(((PyTypeObject*)PyTuple_GET_ITEM(bases, i)));
        if (base_vtable != NULL) {
            int j;
            PyTypeObject* base = type->tp_base;
            for (j = 0; j < base_depth; j++) {
                if (base_vtables[j] == unknown) {
                    base_vtables[j] = __Pyx_GetVtable(base);
                    base_vtables[j + 1] = unknown;
                }
                if (base_vtables[j] == base_vtable) {
                    break;
                } else if (base_vtables[j] == NULL) {
                    goto bad;
                }
                base = base->tp_base;
            }
        }
    }
    PyErr_Clear();
    free(base_vtables);
    return 0;
bad:
    tp_base_name = __Pyx_PyType_GetName(type->tp_base);
    base_name = __Pyx_PyType_GetName((PyTypeObject*)PyTuple_GET_ITEM(bases, i));
    PyErr_Format(PyExc_TypeError,
        "multiple bases have vtable conflict: '" __Pyx_FMT_TYPENAME "' and '" __Pyx_FMT_TYPENAME "'", tp_base_name, base_name);
    __Pyx_DECREF_TypeName(tp_base_name);
    __Pyx_DECREF_TypeName(base_name);
    free(base_vtables);
    return -1;
}
#endif

/* Py3UpdateBases */
    static PyObject*
__Pyx_PEP560_update_bases(PyObject *bases)
{
    Py_ssize_t i, j, size_bases;
    PyObject *base, *meth, *new_base, *result, *new_bases = NULL;
    size_bases = PyTuple_GET_SIZE(bases);
    for (i = 0; i < size_bases; i++) {
        base  = PyTuple_GET_ITEM(bases, i);
        if (PyType_Check(base)) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        meth = __Pyx_PyObject_GetAttrStrNoError(base, __pyx_n_s_mro_entries);
        if (!meth && PyErr_Occurred()) {
            goto error;
        }
        if (!meth) {
            if (new_bases) {
                if (PyList_Append(new_bases, base) < 0) {
                    goto error;
                }
            }
            continue;
        }
        new_base = __Pyx_PyObject_CallOneArg(meth, bases);
        Py_DECREF(meth);
        if (!new_base) {
            goto error;
        }
        if (!PyTuple_Check(new_base)) {
            PyErr_SetString(PyExc_TypeError,
                            "__mro_entries__ must return a tuple");
            Py_DECREF(new_base);
            goto error;
        }
        if (!new_bases) {
            if (!(new_bases = PyList_New(i))) {
                goto error;
            }
            for (j = 0; j < i; j++) {
                base = PyTuple_GET_ITEM(bases, j);
                PyList_SET_ITEM(new_bases, j, base);
                Py_INCREF(base);
            }
        }
        j = PyList_GET_SIZE(new_bases);
        if (PyList_SetSlice(new_bases, j, j, new_base) < 0) {
            goto error;
        }
        Py_DECREF(new_base);
    }
    if (!new_bases) {
        Py_INCREF(bases);
        return bases;
    }
    result = PyList_AsTuple(new_bases);
    Py_DECREF(new_bases);
    return result;
error:
    Py_XDECREF(new_bases);
    return NULL;
}

/* CalculateMetaclass */
    static PyObject *__Pyx_CalculateMetaclass(PyTypeObject *metaclass, PyObject *bases) {
    Py_ssize_t i, nbases = PyTuple_GET_SIZE(bases);
    for (i=0; i < nbases; i++) {
        PyTypeObject *tmptype;
        PyObject *tmp = PyTuple_GET_ITEM(bases, i);
        tmptype = Py_TYPE(tmp);
#if PY_MAJOR_VERSION < 3
        if (tmptype == &PyClass_Type)
            continue;
#endif
        if (!metaclass) {
            metaclass = tmptype;
            continue;
        }
        if (PyType_IsSubtype(metaclass, tmptype))
            continue;
        if (PyType_IsSubtype(tmptype, metaclass)) {
            metaclass = tmptype;
            continue;
        }
        PyErr_SetString(PyExc_TypeError,
                        "metaclass conflict: "
                        "the metaclass of a derived class "
                        "must be a (non-strict) subclass "
                        "of the metaclasses of all its bases");
        return NULL;
    }
    if (!metaclass) {
#if PY_MAJOR_VERSION < 3
        metaclass = &PyClass_Type;
#else
        metaclass = &PyType_Type;
#endif
    }
    Py_INCREF((PyObject*) metaclass);
    return (PyObject*) metaclass;
}

/* PyObjectCall2Args */
    static CYTHON_INLINE PyObject* __Pyx_PyObject_Call2Args(PyObject* function, PyObject* arg1, PyObject* arg2) {
    PyObject *args[3] = {NULL, arg1, arg2};
    return __Pyx_PyObject_FastCall(function, args+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET);
}

/* PyObjectLookupSpecial */
    #if CYTHON_USE_PYTYPE_LOOKUP && CYTHON_USE_TYPE_SLOTS
static CYTHON_INLINE PyObject* __Pyx__PyObject_LookupSpecial(PyObject* obj, PyObject* attr_name, int with_error) {
    PyObject *res;
    PyTypeObject *tp = Py_TYPE(obj);
#if PY_MAJOR_VERSION < 3
    if (unlikely(PyInstance_Check(obj)))
        return with_error ? __Pyx_PyObject_GetAttrStr(obj, attr_name) : __Pyx_PyObject_GetAttrStrNoError(obj, attr_name);
#endif
    res = _PyType_Lookup(tp, attr_name);
    if (likely(res)) {
        descrgetfunc f = Py_TYPE(res)->tp_descr_get;
        if (!f) {
            Py_INCREF(res);
        } else {
            res = f(res, obj, (PyObject *)tp);
        }
    } else if (with_error) {
        PyErr_SetObject(PyExc_AttributeError, attr_name);
    }
    return res;
}
#endif

/* Py3ClassCreate */
    static PyObject *__Pyx_Py3MetaclassPrepare(PyObject *metaclass, PyObject *bases, PyObject *name,
                                           PyObject *qualname, PyObject *mkw, PyObject *modname, PyObject *doc) {
    PyObject *ns;
    if (metaclass) {
        PyObject *prep = __Pyx_PyObject_GetAttrStrNoError(metaclass, __pyx_n_s_prepare);
        if (prep) {
            PyObject *pargs[3] = {NULL, name, bases};
            ns = __Pyx_PyObject_FastCallDict(prep, pargs+1, 2 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET, mkw);
            Py_DECREF(prep);
        } else {
            if (unlikely(PyErr_Occurred()))
                return NULL;
            ns = PyDict_New();
        }
    } else {
        ns = PyDict_New();
    }
    if (unlikely(!ns))
        return NULL;
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_module, modname) < 0)) goto bad;
#if PY_VERSION_HEX >= 0x03030000
    if (unlikely(PyObject_SetItem(ns, __pyx_n_s_qualname, qualname) < 0)) goto bad;
#else
    CYTHON_MAYBE_UNUSED_VAR(qualname);
#endif
    if (unlikely(doc && PyObject_SetItem(ns, __pyx_n_s_doc, doc) < 0)) goto bad;
    return ns;
bad:
    Py_DECREF(ns);
    return NULL;
}
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
static int __Pyx_SetNamesPEP487(PyObject *type_obj) {
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *names_to_set, *key, *value, *set_name, *tmp;
    Py_ssize_t i = 0;
#if CYTHON_USE_TYPE_SLOTS
    names_to_set = PyDict_Copy(type->tp_dict);
#else
    {
        PyObject *d = PyObject_GetAttr(type_obj, __pyx_n_s_dict);
        names_to_set = NULL;
        if (likely(d)) {
            PyObject *names_to_set = PyDict_New();
            int ret = likely(names_to_set) ? PyDict_Update(names_to_set, d) : -1;
            Py_DECREF(d);
            if (unlikely(ret < 0))
                Py_CLEAR(names_to_set);
        }
    }
#endif
    if (unlikely(names_to_set == NULL))
        goto bad;
    while (PyDict_Next(names_to_set, &i, &key, &value)) {
        set_name = __Pyx_PyObject_LookupSpecialNoError(value, __pyx_n_s_set_name);
        if (unlikely(set_name != NULL)) {
            tmp = __Pyx_PyObject_Call2Args(set_name, type_obj, key);
            Py_DECREF(set_name);
            if (unlikely(tmp == NULL)) {
                __Pyx_TypeName value_type_name =
                    __Pyx_PyType_GetName(Py_TYPE(value));
                __Pyx_TypeName type_name = __Pyx_PyType_GetName(type);
                PyErr_Format(PyExc_RuntimeError,
#if PY_MAJOR_VERSION >= 3
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %R " "in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name, key, type_name);
#else
                    "Error calling __set_name__ on '" __Pyx_FMT_TYPENAME "' instance %.100s in '" __Pyx_FMT_TYPENAME "'",
                    value_type_name,
                    PyString_Check(key) ? PyString_AS_STRING(key) : "?",
                    type_name);
#endif
                goto bad;
            } else {
                Py_DECREF(tmp);
            }
        }
        else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
    Py_DECREF(names_to_set);
    return 0;
bad:
    Py_XDECREF(names_to_set);
    return -1;
}
static PyObject *__Pyx_InitSubclassPEP487(PyObject *type_obj, PyObject *mkw) {
#if CYTHON_USE_TYPE_SLOTS && CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    PyTypeObject *type = (PyTypeObject*) type_obj;
    PyObject *mro = type->tp_mro;
    Py_ssize_t i, nbases;
    if (unlikely(!mro)) goto done;
    (void) &__Pyx_GetBuiltinName;
    Py_INCREF(mro);
    nbases = PyTuple_GET_SIZE(mro);
    assert(PyTuple_GET_ITEM(mro, 0) == type_obj);
    for (i = 1; i < nbases-1; i++) {
        PyObject *base, *dict, *meth;
        base = PyTuple_GET_ITEM(mro, i);
        dict = ((PyTypeObject *)base)->tp_dict;
        meth = __Pyx_PyDict_GetItemStrWithError(dict, __pyx_n_s_init_subclass);
        if (unlikely(meth)) {
            descrgetfunc f = Py_TYPE(meth)->tp_descr_get;
            PyObject *res;
            Py_INCREF(meth);
            if (likely(f)) {
                res = f(meth, NULL, type_obj);
                Py_DECREF(meth);
                if (unlikely(!res)) goto bad;
                meth = res;
            }
            res = __Pyx_PyObject_FastCallDict(meth, NULL, 0, mkw);
            Py_DECREF(meth);
            if (unlikely(!res)) goto bad;
            Py_DECREF(res);
            goto done;
        } else if (unlikely(PyErr_Occurred())) {
            goto bad;
        }
    }
done:
    Py_XDECREF(mro);
    return type_obj;
bad:
    Py_XDECREF(mro);
    Py_DECREF(type_obj);
    return NULL;
#else
    PyObject *super_type, *super, *func, *res;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    super_type = __Pyx_GetBuiltinName(__pyx_n_s_super);
#else
    super_type = (PyObject*) &PySuper_Type;
    (void) &__Pyx_GetBuiltinName;
#endif
    super = likely(super_type) ? __Pyx_PyObject_Call2Args(super_type, type_obj, type_obj) : NULL;
#if CYTHON_COMPILING_IN_PYPY && !defined(PySuper_Type)
    Py_XDECREF(super_type);
#endif
    if (unlikely(!super)) {
        Py_CLEAR(type_obj);
        goto done;
    }
    func = __Pyx_PyObject_GetAttrStrNoError(super, __pyx_n_s_init_subclass);
    Py_DECREF(super);
    if (likely(!func)) {
        if (unlikely(PyErr_Occurred()))
            Py_CLEAR(type_obj);
        goto done;
    }
    res = __Pyx_PyObject_FastCallDict(func, NULL, 0, mkw);
    Py_DECREF(func);
    if (unlikely(!res))
        Py_CLEAR(type_obj);
    Py_XDECREF(res);
done:
    return type_obj;
#endif
}
#endif
static PyObject *__Pyx_Py3ClassCreate(PyObject *metaclass, PyObject *name, PyObject *bases,
                                      PyObject *dict, PyObject *mkw,
                                      int calculate_metaclass, int allow_py2_metaclass) {
    PyObject *result;
    PyObject *owned_metaclass = NULL;
    PyObject *margs[4] = {NULL, name, bases, dict};
    if (allow_py2_metaclass) {
        owned_metaclass = PyObject_GetItem(dict, __pyx_n_s_metaclass);
        if (owned_metaclass) {
            metaclass = owned_metaclass;
        } else if (likely(PyErr_ExceptionMatches(PyExc_KeyError))) {
            PyErr_Clear();
        } else {
            return NULL;
        }
    }
    if (calculate_metaclass && (!metaclass || PyType_Check(metaclass))) {
        metaclass = __Pyx_CalculateMetaclass((PyTypeObject*) metaclass, bases);
        Py_XDECREF(owned_metaclass);
        if (unlikely(!metaclass))
            return NULL;
        owned_metaclass = metaclass;
    }
    result = __Pyx_PyObject_FastCallDict(metaclass, margs+1, 3 | __Pyx_PY_VECTORCALL_ARGUMENTS_OFFSET,
#if PY_VERSION_HEX < 0x030600A4
        (metaclass == (PyObject*)&PyType_Type) ? NULL : mkw
#else
        mkw
#endif
    );
    Py_XDECREF(owned_metaclass);
#if PY_VERSION_HEX < 0x030600A4 && CYTHON_PEP487_INIT_SUBCLASS
    if (likely(result) && likely(PyType_Check(result))) {
        if (unlikely(__Pyx_SetNamesPEP487(result) < 0)) {
            Py_CLEAR(result);
        } else {
            result = __Pyx_InitSubclassPEP487(result, mkw);
        }
    }
#else
    (void) &__Pyx_GetBuiltinName;
#endif
    return result;
}

/* FetchCommonType */
    static PyObject *__Pyx_FetchSharedCythonABIModule(void) {
    PyObject *abi_module = PyImport_AddModule((char*) __PYX_ABI_MODULE_NAME);
    if (!abi_module) return NULL;
    Py_INCREF(abi_module);
    return abi_module;
}
static int __Pyx_VerifyCachedType(PyObject *cached_type,
                               const char *name,
                               Py_ssize_t basicsize,
                               Py_ssize_t expected_basicsize) {
    if (!PyType_Check(cached_type)) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s is not a type object", name);
        return -1;
    }
    if (basicsize != expected_basicsize) {
        PyErr_Format(PyExc_TypeError,
            "Shared Cython type %.200s has the wrong size, try recompiling",
            name);
        return -1;
    }
    return 0;
}
static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
    PyObject* abi_module;
    PyTypeObject *cached_type = NULL;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = (PyTypeObject*) PyObject_GetAttrString(abi_module, type->tp_name);
    if (cached_type) {
        if (__Pyx_VerifyCachedType(
              (PyObject *)cached_type,
              type->tp_name,
              cached_type->tp_basicsize,
              type->tp_basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    if (PyType_Ready(type) < 0) goto bad;
    if (PyObject_SetAttrString(abi_module, type->tp_name, (PyObject *)type) < 0)
        goto bad;
    Py_INCREF(type);
    cached_type = type;
done:
    Py_DECREF(abi_module);
    return cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#if CYTHON_COMPILING_IN_LIMITED_API
static PyTypeObject *__Pyx_FetchCommonTypeFromSpec(PyType_Spec *spec, PyObject *bases) {
    PyObject *abi_module, *py_basicsize, *cached_type = NULL;
    Py_ssize_t basicsize;
    abi_module = __Pyx_FetchSharedCythonABIModule();
    if (!abi_module) return NULL;
    cached_type = PyObject_GetAttrString(abi_module, spec->name);
    if (cached_type) {
        py_basicsize = PyObject_GetAttrString(cached_type, "__basicsize__");
        if (!py_basicsize) goto bad;
        basicsize = PyLong_AsSsize_t(py_basicsize);
        Py_DECREF(py_basicsize);
        py_basicsize = 0;
        if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred()) goto bad;
        if (__Pyx_VerifyCachedType(
              cached_type,
              spec->name,
              basicsize,
              spec->basicsize) < 0) {
            goto bad;
        }
        goto done;
    }
    if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
    PyErr_Clear();
    cached_type = PyType_FromSpecWithBases(spec, bases);
    if (unlikely(!cached_type)) goto bad;
    if (PyObject_SetAttrString(abi_module, spec->name, cached_type) < 0) goto bad;
done:
    Py_DECREF(abi_module);
    assert(cached_type == NULL || PyType_Check(cached_type));
    return (PyTypeObject *) cached_type;
bad:
    Py_XDECREF(cached_type);
    cached_type = NULL;
    goto done;
}
#endif

/* PyVectorcallFastCallDict */
    #if CYTHON_METH_FASTCALL
static PyObject *__Pyx_PyVectorcall_FastCallDict_kw(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    PyObject *res = NULL;
    PyObject *kwnames;
    PyObject **newargs;
    PyObject **kwvalues;
    Py_ssize_t i, pos;
    size_t j;
    PyObject *key, *value;
    unsigned long keys_are_strings;
    Py_ssize_t nkw = PyDict_GET_SIZE(kw);
    newargs = (PyObject **)PyMem_Malloc((nargs + (size_t)nkw) * sizeof(args[0]));
    if (unlikely(newargs == NULL)) {
        PyErr_NoMemory();
        return NULL;
    }
    for (j = 0; j < nargs; j++) newargs[j] = args[j];
    kwnames = PyTuple_New(nkw);
    if (unlikely(kwnames == NULL)) {
        PyMem_Free(newargs);
        return NULL;
    }
    kwvalues = newargs + nargs;
    pos = i = 0;
    keys_are_strings = Py_TPFLAGS_UNICODE_SUBCLASS;
    while (PyDict_Next(kw, &pos, &key, &value)) {
        keys_are_strings &= Py_TYPE(key)->tp_flags;
        Py_INCREF(key);
        Py_INCREF(value);
        PyTuple_SET_ITEM(kwnames, i, key);
        kwvalues[i] = value;
        i++;
    }
    if (unlikely(!keys_are_strings)) {
        PyErr_SetString(PyExc_TypeError, "keywords must be strings");
        goto cleanup;
    }
    res = vc(func, newargs, nargs, kwnames);
cleanup:
    Py_DECREF(kwnames);
    for (i = 0; i < nkw; i++)
        Py_DECREF(kwvalues[i]);
    PyMem_Free(newargs);
    return res;
}
static CYTHON_INLINE PyObject *__Pyx_PyVectorcall_FastCallDict(PyObject *func, __pyx_vectorcallfunc vc, PyObject *const *args, size_t nargs, PyObject *kw)
{
    if (likely(kw == NULL) || PyDict_GET_SIZE(kw) == 0) {
        return vc(func, args, nargs, NULL);
    }
    return __Pyx_PyVectorcall_FastCallDict_kw(func, vc, args, nargs, kw);
}
#endif

/* CythonFunctionShared */
    #include <structmember.h>
static PyObject *
__Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, void *closure)
{
    CYTHON_UNUSED_VAR(closure);
    if (unlikely(op->func_doc == NULL)) {
        if (op->func.m_ml->ml_doc) {
#if PY_MAJOR_VERSION >= 3
            op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
#else
            op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
#endif
            if (unlikely(op->func_doc == NULL))
                return NULL;
        } else {
            Py_INCREF(Py_None);
            return Py_None;
        }
    }
    Py_INCREF(op->func_doc);
    return op->func_doc;
}
static int
__Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (value == NULL) {
        value = Py_None;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_doc, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_name == NULL)) {
#if PY_MAJOR_VERSION >= 3
        op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
#else
        op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
#endif
        if (unlikely(op->func_name == NULL))
            return NULL;
    }
    Py_INCREF(op->func_name);
    return op->func_name;
}
static int
__Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__name__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_name, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_qualname);
    return op->func_qualname;
}
static int
__Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
#if PY_MAJOR_VERSION >= 3
    if (unlikely(value == NULL || !PyUnicode_Check(value)))
#else
    if (unlikely(value == NULL || !PyString_Check(value)))
#endif
    {
        PyErr_SetString(PyExc_TypeError,
                        "__qualname__ must be set to a string object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_qualname, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(op->func_dict == NULL)) {
        op->func_dict = PyDict_New();
        if (unlikely(op->func_dict == NULL))
            return NULL;
    }
    Py_INCREF(op->func_dict);
    return op->func_dict;
}
static int
__Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value, void *context)
{
    CYTHON_UNUSED_VAR(context);
    if (unlikely(value == NULL)) {
        PyErr_SetString(PyExc_TypeError,
               "function's dictionary may not be deleted");
        return -1;
    }
    if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
               "setting function's dictionary to a non-dict");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_dict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(op->func_globals);
    return op->func_globals;
}
static PyObject *
__Pyx_CyFunction_get_closure(__pyx_CyFunctionObject *op, void *context)
{
    CYTHON_UNUSED_VAR(op);
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(Py_None);
    return Py_None;
}
static PyObject *
__Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op, void *context)
{
    PyObject* result = (op->func_code) ? op->func_code : Py_None;
    CYTHON_UNUSED_VAR(context);
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
    int result = 0;
    PyObject *res = op->defaults_getter((PyObject *) op);
    if (unlikely(!res))
        return -1;
    #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
    op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
    Py_INCREF(op->defaults_tuple);
    op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
    Py_INCREF(op->defaults_kwdict);
    #else
    op->defaults_tuple = PySequence_ITEM(res, 0);
    if (unlikely(!op->defaults_tuple)) result = -1;
    else {
        op->defaults_kwdict = PySequence_ITEM(res, 1);
        if (unlikely(!op->defaults_kwdict)) result = -1;
    }
    #endif
    Py_DECREF(res);
    return result;
}
static int
__Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyTuple_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__defaults__ must be set to a tuple object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_tuple, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_tuple;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_tuple;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value) {
        value = Py_None;
    } else if (unlikely(value != Py_None && !PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__kwdefaults__ must be set to a dict object");
        return -1;
    }
    Py_INCREF(value);
    __Pyx_Py_XDECREF_SET(op->defaults_kwdict, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->defaults_kwdict;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        if (op->defaults_getter) {
            if (unlikely(__Pyx_CyFunction_init_defaults(op) < 0)) return NULL;
            result = op->defaults_kwdict;
        } else {
            result = Py_None;
        }
    }
    Py_INCREF(result);
    return result;
}
static int
__Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value, void *context) {
    CYTHON_UNUSED_VAR(context);
    if (!value || value == Py_None) {
        value = NULL;
    } else if (unlikely(!PyDict_Check(value))) {
        PyErr_SetString(PyExc_TypeError,
                        "__annotations__ must be set to a dict object");
        return -1;
    }
    Py_XINCREF(value);
    __Pyx_Py_XDECREF_SET(op->func_annotations, value);
    return 0;
}
static PyObject *
__Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op, void *context) {
    PyObject* result = op->func_annotations;
    CYTHON_UNUSED_VAR(context);
    if (unlikely(!result)) {
        result = PyDict_New();
        if (unlikely(!result)) return NULL;
        op->func_annotations = result;
    }
    Py_INCREF(result);
    return result;
}
static PyObject *
__Pyx_CyFunction_get_is_coroutine(__pyx_CyFunctionObject *op, void *context) {
    int is_coroutine;
    CYTHON_UNUSED_VAR(context);
    if (op->func_is_coroutine) {
        return __Pyx_NewRef(op->func_is_coroutine);
    }
    is_coroutine = op->flags & __Pyx_CYFUNCTION_COROUTINE;
#if PY_VERSION_HEX >= 0x03050000
    if (is_coroutine) {
        PyObject *module, *fromlist, *marker = __pyx_n_s_is_coroutine;
        fromlist = PyList_New(1);
        if (unlikely(!fromlist)) return NULL;
        Py_INCREF(marker);
        PyList_SET_ITEM(fromlist, 0, marker);
        module = PyImport_ImportModuleLevelObject(__pyx_n_s_asyncio_coroutines, NULL, NULL, fromlist, 0);
        Py_DECREF(fromlist);
        if (unlikely(!module)) goto ignore;
        op->func_is_coroutine = __Pyx_PyObject_GetAttrStr(module, marker);
        Py_DECREF(module);
        if (likely(op->func_is_coroutine)) {
            return __Pyx_NewRef(op->func_is_coroutine);
        }
ignore:
        PyErr_Clear();
    }
#endif
    op->func_is_coroutine = __Pyx_PyBool_FromLong(is_coroutine);
    return __Pyx_NewRef(op->func_is_coroutine);
}
static PyGetSetDef __pyx_CyFunction_getsets[] = {
    {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "__doc__",  (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
    {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
    {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
    {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
    {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
    {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
    {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
    {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
    {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
    {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
    {(char *) "_is_coroutine", (getter)__Pyx_CyFunction_get_is_coroutine, 0, 0, 0},
    {0, 0, 0, 0, 0}
};
static PyMemberDef __pyx_CyFunction_members[] = {
    {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
#if CYTHON_COMPILING_IN_LIMITED_API
    {(char *) "__dictoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_dict), READONLY, 0},
#if PY_VERSION_HEX < 0x030500A0
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(__pyx_CyFunctionObject, func_weakreflist), READONLY, 0},
#else
    {(char *) "__weaklistoffset__", T_PYSSIZET, offsetof(PyCFunctionObject, m_weakreflist), READONLY, 0},
#endif
#endif
    {0, 0, 0,  0, 0}
};
static PyObject *
__Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, PyObject *args)
{
    CYTHON_UNUSED_VAR(args);
#if PY_MAJOR_VERSION >= 3
    Py_INCREF(m->func_qualname);
    return m->func_qualname;
#else
    return PyString_FromString(m->func.m_ml->ml_name);
#endif
}
static PyMethodDef __pyx_CyFunction_methods[] = {
    {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
    {0, 0, 0, 0}
};
#if PY_VERSION_HEX < 0x030500A0
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
#else
#define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
#endif
static PyObject *__Pyx_CyFunction_Init(__pyx_CyFunctionObject *op, PyMethodDef *ml, int flags, PyObject* qualname,
                                       PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    if (unlikely(op == NULL))
        return NULL;
    op->flags = flags;
    __Pyx_CyFunction_weakreflist(op) = NULL;
    op->func.m_ml = ml;
    op->func.m_self = (PyObject *) op;
    Py_XINCREF(closure);
    op->func_closure = closure;
    Py_XINCREF(module);
    op->func.m_module = module;
    op->func_dict = NULL;
    op->func_name = NULL;
    Py_INCREF(qualname);
    op->func_qualname = qualname;
    op->func_doc = NULL;
    op->func_classobj = NULL;
    op->func_globals = globals;
    Py_INCREF(op->func_globals);
    Py_XINCREF(code);
    op->func_code = code;
    op->defaults_pyobjects = 0;
    op->defaults_size = 0;
    op->defaults = NULL;
    op->defaults_tuple = NULL;
    op->defaults_kwdict = NULL;
    op->defaults_getter = NULL;
    op->func_annotations = NULL;
    op->func_is_coroutine = NULL;
#if CYTHON_METH_FASTCALL
    switch (ml->ml_flags & (METH_VARARGS | METH_FASTCALL | METH_NOARGS | METH_O | METH_KEYWORDS)) {
    case METH_NOARGS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_NOARGS;
        break;
    case METH_O:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_O;
        break;
    case METH_FASTCALL | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS;
        break;
    case METH_VARARGS | METH_KEYWORDS:
        __Pyx_CyFunction_func_vectorcall(op) = NULL;
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        Py_DECREF(op);
        return NULL;
    }
#endif
    return (PyObject *) op;
}
static int
__Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
{
    Py_CLEAR(m->func_closure);
    Py_CLEAR(m->func.m_module);
    Py_CLEAR(m->func_dict);
    Py_CLEAR(m->func_name);
    Py_CLEAR(m->func_qualname);
    Py_CLEAR(m->func_doc);
    Py_CLEAR(m->func_globals);
    Py_CLEAR(m->func_code);
    Py_CLEAR(m->func_classobj);
    Py_CLEAR(m->defaults_tuple);
    Py_CLEAR(m->defaults_kwdict);
    Py_CLEAR(m->func_annotations);
    Py_CLEAR(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_XDECREF(pydefaults[i]);
        PyObject_Free(m->defaults);
        m->defaults = NULL;
    }
    return 0;
}
static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    if (__Pyx_CyFunction_weakreflist(m) != NULL)
        PyObject_ClearWeakRefs((PyObject *) m);
    __Pyx_CyFunction_clear(m);
    PyObject_GC_Del(m);
}
static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
{
    PyObject_GC_UnTrack(m);
    __Pyx__CyFunction_dealloc(m);
}
static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
{
    Py_VISIT(m->func_closure);
    Py_VISIT(m->func.m_module);
    Py_VISIT(m->func_dict);
    Py_VISIT(m->func_name);
    Py_VISIT(m->func_qualname);
    Py_VISIT(m->func_doc);
    Py_VISIT(m->func_globals);
    Py_VISIT(m->func_code);
    Py_VISIT(m->func_classobj);
    Py_VISIT(m->defaults_tuple);
    Py_VISIT(m->defaults_kwdict);
    Py_VISIT(m->func_is_coroutine);
    if (m->defaults) {
        PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
        int i;
        for (i = 0; i < m->defaults_pyobjects; i++)
            Py_VISIT(pydefaults[i]);
    }
    return 0;
}
static PyObject*
__Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
{
#if PY_MAJOR_VERSION >= 3
    return PyUnicode_FromFormat("<cyfunction %U at %p>",
                                op->func_qualname, (void *)op);
#else
    return PyString_FromFormat("<cyfunction %s at %p>",
                               PyString_AsString(op->func_qualname), (void *)op);
#endif
}
static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
    PyCFunctionObject* f = (PyCFunctionObject*)func;
    PyCFunction meth = f->m_ml->ml_meth;
    Py_ssize_t size;
    switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
    case METH_VARARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0))
            return (*meth)(self, arg);
        break;
    case METH_VARARGS | METH_KEYWORDS:
        return (*(PyCFunctionWithKeywords)(void*)meth)(self, arg, kw);
    case METH_NOARGS:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 0))
                return (*meth)(self, NULL);
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    case METH_O:
        if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
            size = PyTuple_GET_SIZE(arg);
            if (likely(size == 1)) {
                PyObject *result, *arg0;
                #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
                arg0 = PyTuple_GET_ITEM(arg, 0);
                #else
                arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
                #endif
                result = (*meth)(self, arg0);
                #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
                Py_DECREF(arg0);
                #endif
                return result;
            }
            PyErr_Format(PyExc_TypeError,
                "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
                f->m_ml->ml_name, size);
            return NULL;
        }
        break;
    default:
        PyErr_SetString(PyExc_SystemError, "Bad call flags for CyFunction");
        return NULL;
    }
    PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
                 f->m_ml->ml_name);
    return NULL;
}
static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
    return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
}
static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
    PyObject *result;
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
#if CYTHON_METH_FASTCALL
     __pyx_vectorcallfunc vc = __Pyx_CyFunction_func_vectorcall(cyfunc);
    if (vc) {
#if CYTHON_ASSUME_SAFE_MACROS
        return __Pyx_PyVectorcall_FastCallDict(func, vc, &PyTuple_GET_ITEM(args, 0), (size_t)PyTuple_GET_SIZE(args), kw);
#else
        (void) &__Pyx_PyVectorcall_FastCallDict;
        return PyVectorcall_Call(func, args, kw);
#endif
    }
#endif
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        Py_ssize_t argc;
        PyObject *new_args;
        PyObject *self;
        argc = PyTuple_GET_SIZE(args);
        new_args = PyTuple_GetSlice(args, 1, argc);
        if (unlikely(!new_args))
            return NULL;
        self = PyTuple_GetItem(args, 0);
        if (unlikely(!self)) {
            Py_DECREF(new_args);
            return NULL;
        }
        result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
        Py_DECREF(new_args);
    } else {
        result = __Pyx_CyFunction_Call(func, args, kw);
    }
    return result;
}
#if CYTHON_METH_FASTCALL
static CYTHON_INLINE int __Pyx_CyFunction_Vectorcall_CheckArgs(__pyx_CyFunctionObject *cyfunc, Py_ssize_t nargs, PyObject *kwnames)
{
    int ret = 0;
    if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
        if (unlikely(nargs < 1)) {
            PyErr_Format(PyExc_TypeError, "%.200s() needs an argument",
                         cyfunc->func.m_ml->ml_name);
            return -1;
        }
        ret = 1;
    }
    if (unlikely(kwnames) && unlikely(PyTuple_GET_SIZE(kwnames))) {
        PyErr_Format(PyExc_TypeError,
                     "%.200s() takes no keyword arguments", cyfunc->func.m_ml->ml_name);
        return -1;
    }
    return ret;
}
static PyObject * __Pyx_CyFunction_Vectorcall_NOARGS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = cyfunc->func.m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = cyfunc->func.m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 0)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, NULL);
}
static PyObject * __Pyx_CyFunction_Vectorcall_O(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = cyfunc->func.m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, kwnames)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = cyfunc->func.m_self;
        break;
    default:
        return NULL;
    }
    if (unlikely(nargs != 1)) {
        PyErr_Format(PyExc_TypeError,
            "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
            def->ml_name, nargs);
        return NULL;
    }
    return def->ml_meth(self, args[0]);
}
static PyObject * __Pyx_CyFunction_Vectorcall_FASTCALL_KEYWORDS(PyObject *func, PyObject *const *args, size_t nargsf, PyObject *kwnames)
{
    __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *)func;
    PyMethodDef* def = cyfunc->func.m_ml;
#if CYTHON_BACKPORT_VECTORCALL
    Py_ssize_t nargs = (Py_ssize_t)nargsf;
#else
    Py_ssize_t nargs = PyVectorcall_NARGS(nargsf);
#endif
    PyObject *self;
    switch (__Pyx_CyFunction_Vectorcall_CheckArgs(cyfunc, nargs, NULL)) {
    case 1:
        self = args[0];
        args += 1;
        nargs -= 1;
        break;
    case 0:
        self = cyfunc->func.m_self;
        break;
    default:
        return NULL;
    }
    return ((_PyCFunctionFastWithKeywords)(void(*)(void))def->ml_meth)(self, args, nargs, kwnames);
}
#endif
#if CYTHON_COMPILING_IN_LIMITED_API
static PyType_Slot __pyx_CyFunctionType_slots[] = {
    {Py_tp_dealloc, (void *)__Pyx_CyFunction_dealloc},
    {Py_tp_repr, (void *)__Pyx_CyFunction_repr},
    {Py_tp_call, (void *)__Pyx_CyFunction_CallAsMethod},
    {Py_tp_traverse, (void *)__Pyx_CyFunction_traverse},
    {Py_tp_clear, (void *)__Pyx_CyFunction_clear},
    {Py_tp_methods, (void *)__pyx_CyFunction_methods},
    {Py_tp_members, (void *)__pyx_CyFunction_members},
    {Py_tp_getset, (void *)__pyx_CyFunction_getsets},
    {Py_tp_descr_get, (void *)__Pyx_PyMethod_New},
    {0, 0},
};
static PyType_Spec __pyx_CyFunctionType_spec = {
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    __pyx_CyFunctionType_slots
};
#else
static PyTypeObject __pyx_CyFunctionType_type = {
    PyVarObject_HEAD_INIT(0, 0)
    __PYX_TYPE_MODULE_PREFIX "cython_function_or_method",
    sizeof(__pyx_CyFunctionObject),
    0,
    (destructor) __Pyx_CyFunction_dealloc,
#if !CYTHON_METH_FASTCALL
    0,
#elif CYTHON_BACKPORT_VECTORCALL
    (printfunc)offsetof(__pyx_CyFunctionObject, func_vectorcall),
#else
    offsetof(__pyx_CyFunctionObject, func.vectorcall),
#endif
    0,
    0,
#if PY_MAJOR_VERSION < 3
    0,
#else
    0,
#endif
    (reprfunc) __Pyx_CyFunction_repr,
    0,
    0,
    0,
    0,
    __Pyx_CyFunction_CallAsMethod,
    0,
    0,
    0,
    0,
#ifdef Py_TPFLAGS_METHOD_DESCRIPTOR
    Py_TPFLAGS_METHOD_DESCRIPTOR |
#endif
#ifdef _Py_TPFLAGS_HAVE_VECTORCALL
    _Py_TPFLAGS_HAVE_VECTORCALL |
#endif
    Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
    0,
    (traverseproc) __Pyx_CyFunction_traverse,
    (inquiry) __Pyx_CyFunction_clear,
    0,
#if PY_VERSION_HEX < 0x030500A0
    offsetof(__pyx_CyFunctionObject, func_weakreflist),
#else
    offsetof(PyCFunctionObject, m_weakreflist),
#endif
    0,
    0,
    __pyx_CyFunction_methods,
    __pyx_CyFunction_members,
    __pyx_CyFunction_getsets,
    0,
    0,
    __Pyx_PyMethod_New,
    0,
    offsetof(__pyx_CyFunctionObject, func_dict),
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
#if PY_VERSION_HEX >= 0x030400a1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b1
    0,
#endif
#if PY_VERSION_HEX >= 0x030800b4 && PY_VERSION_HEX < 0x03090000
    0,
#endif
#if CYTHON_COMPILING_IN_PYPY && PYPY_VERSION_NUM+0 >= 0x06000000
    0,
#endif
};
#endif
static int __pyx_CyFunction_init(void) {
#if CYTHON_COMPILING_IN_LIMITED_API
    __pyx_CyFunctionType = __Pyx_FetchCommonTypeFromSpec(&__pyx_CyFunctionType_spec, NULL);
#else
    __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
#endif
    if (unlikely(__pyx_CyFunctionType == NULL)) {
        return -1;
    }
    return 0;
}
static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults = PyObject_Malloc(size);
    if (unlikely(!m->defaults))
        return PyErr_NoMemory();
    memset(m->defaults, 0, size);
    m->defaults_pyobjects = pyobjects;
    m->defaults_size = size;
    return m->defaults;
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_tuple = tuple;
    Py_INCREF(tuple);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->defaults_kwdict = dict;
    Py_INCREF(dict);
}
static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
    __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
    m->func_annotations = dict;
    Py_INCREF(dict);
}

/* CythonFunction */
    static PyObject *__Pyx_CyFunction_New(PyMethodDef *ml, int flags, PyObject* qualname,
                                      PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
    PyObject *op = __Pyx_CyFunction_Init(
        PyObject_GC_New(__pyx_CyFunctionObject, __pyx_CyFunctionType),
        ml, flags, qualname, closure, module, globals, code
    );
    if (likely(op)) {
        PyObject_GC_Track(op);
    }
    return op;
}

/* CLineInTraceback */
    #ifndef CYTHON_CLINE_IN_TRACEBACK
static int __Pyx_CLineForTraceback(CYTHON_NCP_UNUSED PyThreadState *tstate, int c_line) {
    PyObject *use_cline;
    PyObject *ptype, *pvalue, *ptraceback;
#if CYTHON_COMPILING_IN_CPYTHON
    PyObject **cython_runtime_dict;
#endif
    if (unlikely(!__pyx_cython_runtime)) {
        return c_line;
    }
    __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
#if CYTHON_COMPILING_IN_CPYTHON
    cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
    if (likely(cython_runtime_dict)) {
        __PYX_PY_DICT_LOOKUP_IF_MODIFIED(
            use_cline, *cython_runtime_dict,
            __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback))
    } else
#endif
    {
      PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStrNoError(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
      if (use_cline_obj) {
        use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
        Py_DECREF(use_cline_obj);
      } else {
        PyErr_Clear();
        use_cline = NULL;
      }
    }
    if (!use_cline) {
        c_line = 0;
        PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
    }
    else if (use_cline == Py_False || (use_cline != Py_True && PyObject_Not(use_cline) != 0)) {
        c_line = 0;
    }
    __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
    return c_line;
}
#endif

/* CodeObjectCache */
    #if !CYTHON_COMPILING_IN_LIMITED_API
static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
    int start = 0, mid = 0, end = count - 1;
    if (end >= 0 && code_line > entries[end].code_line) {
        return count;
    }
    while (start < end) {
        mid = start + (end - start) / 2;
        if (code_line < entries[mid].code_line) {
            end = mid;
        } else if (code_line > entries[mid].code_line) {
             start = mid + 1;
        } else {
            return mid;
        }
    }
    if (code_line <= entries[mid].code_line) {
        return mid;
    } else {
        return mid + 1;
    }
}
static PyCodeObject *__pyx_find_code_object(int code_line) {
    PyCodeObject* code_object;
    int pos;
    if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
        return NULL;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
        return NULL;
    }
    code_object = __pyx_code_cache.entries[pos].code_object;
    Py_INCREF(code_object);
    return code_object;
}
static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
    int pos, i;
    __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
    if (unlikely(!code_line)) {
        return;
    }
    if (unlikely(!entries)) {
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
        if (likely(entries)) {
            __pyx_code_cache.entries = entries;
            __pyx_code_cache.max_count = 64;
            __pyx_code_cache.count = 1;
            entries[0].code_line = code_line;
            entries[0].code_object = code_object;
            Py_INCREF(code_object);
        }
        return;
    }
    pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
    if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
        PyCodeObject* tmp = entries[pos].code_object;
        entries[pos].code_object = code_object;
        Py_DECREF(tmp);
        return;
    }
    if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
        int new_max = __pyx_code_cache.max_count + 64;
        entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
            __pyx_code_cache.entries, ((size_t)new_max) * sizeof(__Pyx_CodeObjectCacheEntry));
        if (unlikely(!entries)) {
            return;
        }
        __pyx_code_cache.entries = entries;
        __pyx_code_cache.max_count = new_max;
    }
    for (i=__pyx_code_cache.count; i>pos; i--) {
        entries[i] = entries[i-1];
    }
    entries[pos].code_line = code_line;
    entries[pos].code_object = code_object;
    __pyx_code_cache.count++;
    Py_INCREF(code_object);
}
#endif

/* AddTraceback */
    #include "compile.h"
#include "frameobject.h"
#include "traceback.h"
#if CYTHON_COMPILING_IN_LIMITED_API
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    if (c_line) {
        (void) __pyx_cfilenm;
        c_line = __Pyx_CLineForTraceback(__Pyx_PyThreadState_Current, c_line);
    }
    _PyTraceback_Add(funcname, filename, c_line ? -c_line : py_line);
}
#else
static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
            const char *funcname, int c_line,
            int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyObject *py_srcfile = 0;
    PyObject *py_funcname = 0;
    #if PY_MAJOR_VERSION < 3
    py_srcfile = PyString_FromString(filename);
    #else
    py_srcfile = PyUnicode_FromString(filename);
    #endif
    if (!py_srcfile) goto bad;
    if (c_line) {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #else
        py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
        #endif
    }
    else {
        #if PY_MAJOR_VERSION < 3
        py_funcname = PyString_FromString(funcname);
        #else
        py_funcname = PyUnicode_FromString(funcname);
        #endif
    }
    if (!py_funcname) goto bad;
    py_code = __Pyx_PyCode_New(
        0,
        0,
        0,
        0,
        0,
        0,
        __pyx_empty_bytes, /*PyObject *code,*/
        __pyx_empty_tuple, /*PyObject *consts,*/
        __pyx_empty_tuple, /*PyObject *names,*/
        __pyx_empty_tuple, /*PyObject *varnames,*/
        __pyx_empty_tuple, /*PyObject *freevars,*/
        __pyx_empty_tuple, /*PyObject *cellvars,*/
        py_srcfile,   /*PyObject *filename,*/
        py_funcname,  /*PyObject *name,*/
        py_line,
        __pyx_empty_bytes  /*PyObject *lnotab*/
    );
    Py_DECREF(py_srcfile);
    Py_DECREF(py_funcname);
    return py_code;
bad:
    Py_XDECREF(py_srcfile);
    Py_XDECREF(py_funcname);
    return NULL;
}
static void __Pyx_AddTraceback(const char *funcname, int c_line,
                               int py_line, const char *filename) {
    PyCodeObject *py_code = 0;
    PyFrameObject *py_frame = 0;
    PyThreadState *tstate = __Pyx_PyThreadState_Current;
    if (c_line) {
        c_line = __Pyx_CLineForTraceback(tstate, c_line);
    }
    py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
    if (!py_code) {
        py_code = __Pyx_CreateCodeObjectForTraceback(
            funcname, c_line, py_line, filename);
        if (!py_code) goto bad;
        __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
    }
    py_frame = PyFrame_New(
        tstate,            /*PyThreadState *tstate,*/
        py_code,           /*PyCodeObject *code,*/
        __pyx_d,    /*PyObject *globals,*/
        0                  /*PyObject *locals*/
    );
    if (!py_frame) goto bad;
    __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
    PyTraceBack_Here(py_frame);
bad:
    Py_XDECREF(py_code);
    Py_XDECREF(py_frame);
}
#endif

/* CIntFromPyVerify */
    #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
#define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
    __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
#define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
    {\
        func_type value = func_value;\
        if (sizeof(target_type) < sizeof(func_type)) {\
            if (unlikely(value != (func_type) (target_type) value)) {\
                func_type zero = 0;\
                if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
                    return (target_type) -1;\
                if (is_unsigned && unlikely(value < zero))\
                    goto raise_neg_overflow;\
                else\
                    goto raise_overflow;\
            }\
        }\
        return (target_type) value;\
    }

static PyObject* __pyx_convert__to_py_ClimateStruct(ClimateStruct s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(6); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.Rad); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Rad, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.Tmax); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Tmax, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.Tmin); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Tmin, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.Rain); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Rain, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.Wind); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Wind, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.Tdew); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_Tdew, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_MainStemLeaf(MainStemLeaf s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(6); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.leaf_area); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_area, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.petiole_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_petiole_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.potential_growth_for_leaf_area); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth_for_leaf_area, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.potential_growth_for_leaf_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth_for_leaf_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.potential_growth_for_petiole_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth_for_petiole_wei, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Leaf(Leaf s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(4); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.age); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_age, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.area); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_area, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_struct__SquareStruct(struct SquareStruct s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(2); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Boll(Boll s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.age); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_age, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Burr(Burr s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(2); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Petiole(Petiole s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(2); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_FruitingSite(FruitingSite s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(10); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.age); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_age, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.fraction); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_fraction, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.average_temperature); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_average_temperature, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.ginning_percent); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_ginning_percent, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_enum__Stage(s.stage); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_stage, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Leaf(s.leaf); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_struct__SquareStruct(s.square); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_square, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Boll(s.boll); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_boll, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Burr(s.burr); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_burr, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Petiole(s.petiole); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_petiole, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_FruitingBranch(FruitingBranch s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(4); if (unlikely(!res)) return NULL;
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_fruiting_nodes); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_fruiting_nodes, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.delay_for_new_node); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_delay_for_new_node, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_MainStemLeaf(s.main_stem_leaf); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_main_stem_leaf, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_FruitingSite(s.nodes, 5); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nodes, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_VegetativeBranch(VegetativeBranch s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL;
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_fruiting_branches); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_fruiting_branches, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.delay_for_new_fruiting_branch); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_delay_for_new_fruiting_branch, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_FruitingBranch(s.fruiting_branches, 30); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_fruiting_branches, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Hour(Hour s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(11); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.temperature); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_temperature, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.radiation); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_radiation, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.cloud_cov); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cloud_cov, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.cloud_cor); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cloud_cor, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.et1); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_et1, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.et2); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_et2, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.ref_et); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_ref_et, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.wind_speed); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_wind_speed, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.dew_point); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_dew_point, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.humidity); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_humidity, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.albedo); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_albedo, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_SoilLayer(SoilLayer s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(2); if (unlikely(!res)) return NULL;
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_left_columns_with_root); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_left_columns_with_root, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_right_columns_with_root); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_right_columns_with_roo, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Root(Root s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(6); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.potential_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_potential_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.growth_factor); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_growth_factor, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.actual_growth); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_actual_growth, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.age); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_age, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.weight_capable_uptake); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight_capable_uptake, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_double(s.weight, 3); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_SoilCell(SoilCell s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL;
      member = PyFloat_FromDouble(s.nitrate_nitrogen_content); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nitrate_nitrogen_content, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.fresh_organic_matter); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_fresh_organic_matter, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Root(s.root); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_root, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_Soil(Soil s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(3); if (unlikely(!res)) return NULL;
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_layers_with_root); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_layers_with_root, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_SoilLayer(s.layers, 40); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_layers, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_SoilCell___5b_20_5d_(s.cells, 40); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cells, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    static PyObject* __pyx_convert__to_py_State(State s) {
      PyObject* res;
      PyObject* member;
      res = __Pyx_PyDict_NewPresized(67); if (unlikely(!res)) return NULL;
      member = __Pyx_PyInt_From_unsigned_int(s.daynum); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_daynum, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_unsigned_int(s.kday); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_kday, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.day_inc); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_day_inc, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.lint_yield); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_lint_yield, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.bloom_weight_loss); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_bloom_weight_loss, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.abscised_fruit_sites); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_abscised_fruit_sites, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.abscised_leaf_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_abscised_leaf_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.cumulative_nitrogen_loss); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cumulative_nitrogen_loss, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.applied_water); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_applied_water, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.water_stress); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_water_stress, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.water_stress_stem); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_water_stress_stem, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.carbon_stress); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_carbon_stress, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.extra_carbon); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_extra_carbon, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.day_length); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_day_length, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.plant_height); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_plant_height, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.plant_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_plant_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.stem_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_stem_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.square_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_square_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.green_bolls_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_green_bolls_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.green_bolls_burr_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_green_bolls_burr_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.open_bolls_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_open_bolls_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.open_bolls_burr_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_open_bolls_burr_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.runoff); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_runoff, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.solar_noon); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_solar_noon, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.net_radiation); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_net_radiation, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.evapotranspiration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_evapotranspiration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.actual_transpiration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_actual_transpiration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.cumulative_transpiration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cumulative_transpiration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.actual_soil_evaporation); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_actual_soil_evaporation, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.cumulative_evaporation); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_cumulative_evaporation, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.light_interception); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_light_interception, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_vegetative_branches); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_vegetative_branches, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_unsigned_int(s.number_of_fruiting_sites); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_fruiting_sites, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.number_of_squares); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_squares, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.number_of_green_bolls); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_green_bolls, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.number_of_open_bolls); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_open_bolls, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.nitrogen_stress); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nitrogen_stress, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.nitrogen_stress_vegetative); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nitrogen_stress_vegetative, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.nitrogen_stress_fruiting); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nitrogen_stress_fruiting, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.nitrogen_stress_root); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_nitrogen_stress_root, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.total_required_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_total_required_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_area_index); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_area_index, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_area); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_area, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_weight); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_weight, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_double(s.leaf_weight_pre_fruiting, 9); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_weight_pre_fruiting, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_weight_area_ratio); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_weight_area_ratio, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_nitrogen_concentration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_nitrogen_concentration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.leaf_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.petiole_nitrogen_concentration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_petiole_nitrogen_concentration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.seed_nitrogen_concentration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_seed_nitrogen_concentration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.seed_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_seed_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.root_nitrogen_concentration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_root_nitrogen_concentration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.square_nitrogen_concentration); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_square_nitrogen_concentration, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.burr_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_burr_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.square_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_square_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.stem_nitrogen); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_stem_nitrogen, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.fruit_growth_ratio); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_fruit_growth_ratio, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.ginning_percent); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_ginning_percent, member) < 0)) goto bad;
      Py_DECREF(member);
      member = PyFloat_FromDouble(s.average_temperature); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_average_temperature, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyBool_FromLong(s.pollination_switch); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_pollination_switch, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_double(s.age_of_pre_fruiting_nodes, 9); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_age_of_pre_fruiting_nodes, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_PyInt_From_int(s.number_of_pre_fruiting_nodes); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_number_of_pre_fruiting_nodes, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_double(s.leaf_area_pre_fruiting, 9); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_leaf_area_pre_fruiting, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_double(s.delay_for_new_branch, 3); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_delay_for_new_branch, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_VegetativeBranch(s.vegetative_branches, 3); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_vegetative_branches, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __Pyx_carray_to_py_Hour(s.hours, 24); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_hours, member) < 0)) goto bad;
      Py_DECREF(member);
      member = __pyx_convert__to_py_Soil(s.soil); if (unlikely(!member)) goto bad;
      if (unlikely(PyDict_SetItem(res, __pyx_n_s_soil, member) < 0)) goto bad;
      Py_DECREF(member);
      return res;
      bad:
      Py_XDECREF(member);
      Py_DECREF(res);
      return NULL;
    }
    /* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_unsigned_int(unsigned int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(unsigned int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(unsigned int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(unsigned int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(unsigned int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(unsigned int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
    static CYTHON_INLINE unsigned int __Pyx_PyInt_As_unsigned_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const unsigned int neg_one = (unsigned int) -1, const_zero = (unsigned int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(unsigned int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(unsigned int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (unsigned int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int, digit, digits[0])
                case 2:
                    if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 2 * PyLong_SHIFT)) {
                            return (unsigned int) (((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 3 * PyLong_SHIFT)) {
                            return (unsigned int) (((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) >= 4 * PyLong_SHIFT)) {
                            return (unsigned int) (((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (unsigned int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(unsigned int) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(unsigned int) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (unsigned int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(unsigned int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(unsigned int,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(unsigned int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(unsigned int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(unsigned int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(unsigned int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((((unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(unsigned int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned int) (((unsigned int)-1)*(((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(unsigned int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(unsigned int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(unsigned int) - 1 > 4 * PyLong_SHIFT)) {
                            return (unsigned int) ((((((((((unsigned int)digits[3]) << PyLong_SHIFT) | (unsigned int)digits[2]) << PyLong_SHIFT) | (unsigned int)digits[1]) << PyLong_SHIFT) | (unsigned int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(unsigned int) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(unsigned int) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(unsigned int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            unsigned int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (unsigned int) -1;
        }
    } else {
        unsigned int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (unsigned int) -1;
        val = __Pyx_PyInt_As_unsigned_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to unsigned int");
    return (unsigned int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to unsigned int");
    return (unsigned int) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(long) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (long) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case  1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 2 * PyLong_SHIFT)) {
                            return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 3 * PyLong_SHIFT)) {
                            return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) >= 4 * PyLong_SHIFT)) {
                            return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (long) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(long) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(long) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (long) 0;
                case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(long,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(long) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(long) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                            return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(long) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(long) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                            return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(long) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(long) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(long) - 1 > 4 * PyLong_SHIFT)) {
                            return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(long) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(long) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            long val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (long) -1;
        }
    } else {
        long val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (long) -1;
        val = __Pyx_PyInt_As_long(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to long");
    return (long) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to long");
    return (long) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const long neg_one = (long) -1, const_zero = (long) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(long) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(long) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(long) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(long),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
    static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(int) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (int) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case  1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 2 * PyLong_SHIFT)) {
                            return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 3 * PyLong_SHIFT)) {
                            return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) >= 4 * PyLong_SHIFT)) {
                            return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (int) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(int) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(int) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (int) 0;
                case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(int,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(int) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(int) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                            return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(int) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(int) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                            return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(int) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(int) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(int) - 1 > 4 * PyLong_SHIFT)) {
                            return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(int) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(int) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            int val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (int) -1;
        }
    } else {
        int val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (int) -1;
        val = __Pyx_PyInt_As_int(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to int");
    return (int) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to int");
    return (int) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__Stage(enum Stage value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum Stage neg_one = (enum Stage) -1, const_zero = (enum Stage) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(enum Stage) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(enum Stage) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Stage) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(enum Stage) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(enum Stage) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(enum Stage),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
    static CYTHON_INLINE enum Stage __Pyx_PyInt_As_enum__Stage(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const enum Stage neg_one = (enum Stage) -1, const_zero = (enum Stage) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(enum Stage) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(enum Stage, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (enum Stage) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum Stage) 0;
                case  1: __PYX_VERIFY_RETURN_INT(enum Stage, digit, digits[0])
                case 2:
                    if ((8 * sizeof(enum Stage) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) >= 2 * PyLong_SHIFT)) {
                            return (enum Stage) (((((enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum Stage) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) >= 3 * PyLong_SHIFT)) {
                            return (enum Stage) (((((((enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum Stage) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) >= 4 * PyLong_SHIFT)) {
                            return (enum Stage) (((((((((enum Stage)digits[3]) << PyLong_SHIFT) | (enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (enum Stage) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(enum Stage) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(enum Stage, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(enum Stage) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(enum Stage, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (enum Stage) 0;
                case -1: __PYX_VERIFY_RETURN_INT(enum Stage, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(enum Stage,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(enum Stage) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum Stage) (((enum Stage)-1)*(((((enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(enum Stage) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 2 * PyLong_SHIFT)) {
                            return (enum Stage) ((((((enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(enum Stage) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum Stage) (((enum Stage)-1)*(((((((enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(enum Stage) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 3 * PyLong_SHIFT)) {
                            return (enum Stage) ((((((((enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(enum Stage) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum Stage) (((enum Stage)-1)*(((((((((enum Stage)digits[3]) << PyLong_SHIFT) | (enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(enum Stage) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(enum Stage, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(enum Stage) - 1 > 4 * PyLong_SHIFT)) {
                            return (enum Stage) ((((((((((enum Stage)digits[3]) << PyLong_SHIFT) | (enum Stage)digits[2]) << PyLong_SHIFT) | (enum Stage)digits[1]) << PyLong_SHIFT) | (enum Stage)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(enum Stage) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(enum Stage, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(enum Stage) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(enum Stage, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            enum Stage val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (enum Stage) -1;
        }
    } else {
        enum Stage val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (enum Stage) -1;
        val = __Pyx_PyInt_As_enum__Stage(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to enum Stage");
    return (enum Stage) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to enum Stage");
    return (enum Stage) -1;
}

/* CIntToPy */
    static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const int neg_one = (int) -1, const_zero = (int) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
    if (is_unsigned) {
        if (sizeof(int) < sizeof(long)) {
            return PyInt_FromLong((long) value);
        } else if (sizeof(int) <= sizeof(unsigned long)) {
            return PyLong_FromUnsignedLong((unsigned long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
            return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
#endif
        }
    } else {
        if (sizeof(int) <= sizeof(long)) {
            return PyInt_FromLong((long) value);
#ifdef HAVE_LONG_LONG
        } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
            return PyLong_FromLongLong((PY_LONG_LONG) value);
#endif
        }
    }
    {
        int one = 1; int little = (int)*(unsigned char *)&one;
        unsigned char *bytes = (unsigned char *)&value;
        return _PyLong_FromByteArray(bytes, sizeof(int),
                                     little, !is_unsigned);
    }
}

/* CIntFromPy */
    static CYTHON_INLINE uint32_t __Pyx_PyInt_As_uint32_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const uint32_t neg_one = (uint32_t) -1, const_zero = (uint32_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(uint32_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(uint32_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (uint32_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t, digit, digits[0])
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) >= 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (uint32_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(uint32_t) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(uint32_t) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (uint32_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(uint32_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(uint32_t,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(uint32_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(uint32_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(uint32_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(uint32_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(uint32_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) (((uint32_t)-1)*(((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(uint32_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(uint32_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(uint32_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (uint32_t) ((((((((((uint32_t)digits[3]) << PyLong_SHIFT) | (uint32_t)digits[2]) << PyLong_SHIFT) | (uint32_t)digits[1]) << PyLong_SHIFT) | (uint32_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(uint32_t) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(uint32_t) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(uint32_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            uint32_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (uint32_t) -1;
        }
    } else {
        uint32_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (uint32_t) -1;
        val = __Pyx_PyInt_As_uint32_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to uint32_t");
    return (uint32_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to uint32_t");
    return (uint32_t) -1;
}

/* CIntFromPy */
    static CYTHON_INLINE size_t __Pyx_PyInt_As_size_t(PyObject *x) {
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wconversion"
#endif
    const size_t neg_one = (size_t) -1, const_zero = (size_t) 0;
#ifdef __Pyx_HAS_GCC_DIAGNOSTIC
#pragma GCC diagnostic pop
#endif
    const int is_unsigned = neg_one > const_zero;
#if PY_MAJOR_VERSION < 3
    if (likely(PyInt_Check(x))) {
        if ((sizeof(size_t) < sizeof(long))) {
            __PYX_VERIFY_RETURN_INT(size_t, long, PyInt_AS_LONG(x))
        } else {
            long val = PyInt_AS_LONG(x);
            if (is_unsigned && unlikely(val < 0)) {
                goto raise_neg_overflow;
            }
            return (size_t) val;
        }
    } else
#endif
    if (likely(PyLong_Check(x))) {
        if (is_unsigned) {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case  1: __PYX_VERIFY_RETURN_INT(size_t, digit, digits[0])
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 2 * PyLong_SHIFT)) {
                            return (size_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 3 * PyLong_SHIFT)) {
                            return (size_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) >= 4 * PyLong_SHIFT)) {
                            return (size_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
                        }
                    }
                    break;
            }
#endif
#if CYTHON_COMPILING_IN_CPYTHON
            if (unlikely(Py_SIZE(x) < 0)) {
                goto raise_neg_overflow;
            }
#else
            {
                int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
                if (unlikely(result < 0))
                    return (size_t) -1;
                if (unlikely(result == 1))
                    goto raise_neg_overflow;
            }
#endif
            if ((sizeof(size_t) <= sizeof(unsigned long))) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned long, PyLong_AsUnsignedLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(size_t) <= sizeof(unsigned PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
#endif
            }
        } else {
#if CYTHON_USE_PYLONG_INTERNALS
            const digit* digits = ((PyLongObject*)x)->ob_digit;
            switch (Py_SIZE(x)) {
                case  0: return (size_t) 0;
                case -1: __PYX_VERIFY_RETURN_INT(size_t, sdigit, (sdigit) (-(sdigit)digits[0]))
                case  1: __PYX_VERIFY_RETURN_INT(size_t,  digit, +digits[0])
                case -2:
                    if ((8 * sizeof(size_t) - 1 > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 2:
                    if ((8 * sizeof(size_t) > 1 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 2 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                            return (size_t) ((((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -3:
                    if ((8 * sizeof(size_t) - 1 > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 3:
                    if ((8 * sizeof(size_t) > 2 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 3 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                            return (size_t) ((((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case -4:
                    if ((8 * sizeof(size_t) - 1 > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) (((size_t)-1)*(((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
                case 4:
                    if ((8 * sizeof(size_t) > 3 * PyLong_SHIFT)) {
                        if ((8 * sizeof(unsigned long) > 4 * PyLong_SHIFT)) {
                            __PYX_VERIFY_RETURN_INT(size_t, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
                        } else if ((8 * sizeof(size_t) - 1 > 4 * PyLong_SHIFT)) {
                            return (size_t) ((((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0])));
                        }
                    }
                    break;
            }
#endif
            if ((sizeof(size_t) <= sizeof(long))) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, long, PyLong_AsLong(x))
#ifdef HAVE_LONG_LONG
            } else if ((sizeof(size_t) <= sizeof(PY_LONG_LONG))) {
                __PYX_VERIFY_RETURN_INT_EXC(size_t, PY_LONG_LONG, PyLong_AsLongLong(x))
#endif
            }
        }
        {
#if (CYTHON_COMPILING_IN_PYPY || CYTHON_COMPILING_IN_LIMITED_API) && !defined(_PyLong_AsByteArray)
            PyErr_SetString(PyExc_RuntimeError,
                            "_PyLong_AsByteArray() not available, cannot convert large numbers");
#else
            size_t val;
            PyObject *v = __Pyx_PyNumber_IntOrLong(x);
 #if PY_MAJOR_VERSION < 3
            if (likely(v) && !PyLong_Check(v)) {
                PyObject *tmp = v;
                v = PyNumber_Long(tmp);
                Py_DECREF(tmp);
            }
 #endif
            if (likely(v)) {
                int one = 1; int is_little = (int)*(unsigned char *)&one;
                unsigned char *bytes = (unsigned char *)&val;
                int ret = _PyLong_AsByteArray((PyLongObject *)v,
                                              bytes, sizeof(val),
                                              is_little, !is_unsigned);
                Py_DECREF(v);
                if (likely(!ret))
                    return val;
            }
#endif
            return (size_t) -1;
        }
    } else {
        size_t val;
        PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
        if (!tmp) return (size_t) -1;
        val = __Pyx_PyInt_As_size_t(tmp);
        Py_DECREF(tmp);
        return val;
    }
raise_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "value too large to convert to size_t");
    return (size_t) -1;
raise_neg_overflow:
    PyErr_SetString(PyExc_OverflowError,
        "can't convert negative value to size_t");
    return (size_t) -1;
}

/* FormatTypeName */
    #if CYTHON_COMPILING_IN_LIMITED_API
static __Pyx_TypeName
__Pyx_PyType_GetName(PyTypeObject* tp)
{
    PyObject *name = __Pyx_PyObject_GetAttrStr((PyObject *)tp,
                                               __pyx_n_s_name);
    if (unlikely(name == NULL) || unlikely(!PyUnicode_Check(name))) {
        PyErr_Clear();
        Py_XSETREF(name, __Pyx_NewRef(__pyx_n_s__213));
    }
    return name;
}
#endif

/* CheckBinaryVersion */
    static int __Pyx_check_binary_version(void) {
    char ctversion[4], rtversion[4];
    PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
    PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
    if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
        char message[200];
        PyOS_snprintf(message, sizeof(message),
                      "compiletime version %s of module '%.100s' "
                      "does not match runtime version %s",
                      ctversion, __Pyx_MODULE_NAME, rtversion);
        return PyErr_WarnEx(NULL, message, 1);
    }
    return 0;
}

/* InitStrings */
    #if PY_MAJOR_VERSION >= 3
static int __Pyx_InitString(__Pyx_StringTabEntry t, PyObject **str) {
    if (t.is_unicode | t.is_str) {
        if (t.intern) {
            *str = PyUnicode_InternFromString(t.s);
        } else if (t.encoding) {
            *str = PyUnicode_Decode(t.s, t.n - 1, t.encoding, NULL);
        } else {
            *str = PyUnicode_FromStringAndSize(t.s, t.n - 1);
        }
    } else {
        *str = PyBytes_FromStringAndSize(t.s, t.n - 1);
    }
    if (!*str)
        return -1;
    if (PyObject_Hash(*str) == -1)
        return -1;
    return 0;
}
#endif
#if !CYTHON_COMPILING_IN_LIMITED_API
static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
    while (t->p) {
        #if PY_MAJOR_VERSION >= 3
        __Pyx_InitString(*t, t->p);
        #else
        if (t->is_unicode) {
            *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
        } else if (t->intern) {
            *t->p = PyString_InternFromString(t->s);
        } else {
            *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
        }
        if (!*t->p)
            return -1;
        if (PyObject_Hash(*t->p) == -1)
            return -1;
        #endif
        ++t;
    }
    return 0;
}
#endif

static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
    return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
}
static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
    Py_ssize_t ignore;
    return __Pyx_PyObject_AsStringAndSize(o, &ignore);
}
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
#if !CYTHON_PEP393_ENABLED
static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    char* defenc_c;
    PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
    if (!defenc) return NULL;
    defenc_c = PyBytes_AS_STRING(defenc);
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    {
        char* end = defenc_c + PyBytes_GET_SIZE(defenc);
        char* c;
        for (c = defenc_c; c < end; c++) {
            if ((unsigned char) (*c) >= 128) {
                PyUnicode_AsASCIIString(o);
                return NULL;
            }
        }
    }
#endif
    *length = PyBytes_GET_SIZE(defenc);
    return defenc_c;
}
#else
static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
    if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
    if (likely(PyUnicode_IS_ASCII(o))) {
        *length = PyUnicode_GET_LENGTH(o);
        return PyUnicode_AsUTF8(o);
    } else {
        PyUnicode_AsASCIIString(o);
        return NULL;
    }
#else
    return PyUnicode_AsUTF8AndSize(o, length);
#endif
}
#endif
#endif
static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
#if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
    if (
#if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
            __Pyx_sys_getdefaultencoding_not_ascii &&
#endif
            PyUnicode_Check(o)) {
        return __Pyx_PyUnicode_AsStringAndSize(o, length);
    } else
#endif
#if (!CYTHON_COMPILING_IN_PYPY && !CYTHON_COMPILING_IN_LIMITED_API) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
    if (PyByteArray_Check(o)) {
        *length = PyByteArray_GET_SIZE(o);
        return PyByteArray_AS_STRING(o);
    } else
#endif
    {
        char* result;
        int r = PyBytes_AsStringAndSize(o, &result, length);
        if (unlikely(r < 0)) {
            return NULL;
        } else {
            return result;
        }
    }
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
   int is_true = x == Py_True;
   if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
   else return PyObject_IsTrue(x);
}
static CYTHON_INLINE int __Pyx_PyObject_IsTrueAndDecref(PyObject* x) {
    int retval;
    if (unlikely(!x)) return -1;
    retval = __Pyx_PyObject_IsTrue(x);
    Py_DECREF(x);
    return retval;
}
static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
    __Pyx_TypeName result_type_name = __Pyx_PyType_GetName(Py_TYPE(result));
#if PY_MAJOR_VERSION >= 3
    if (PyLong_Check(result)) {
        if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
                "__int__ returned non-int (type " __Pyx_FMT_TYPENAME ").  "
                "The ability to return an instance of a strict subclass of int is deprecated, "
                "and may be removed in a future version of Python.",
                result_type_name)) {
            __Pyx_DECREF_TypeName(result_type_name);
            Py_DECREF(result);
            return NULL;
        }
        __Pyx_DECREF_TypeName(result_type_name);
        return result;
    }
#endif
    PyErr_Format(PyExc_TypeError,
                 "__%.4s__ returned non-%.4s (type " __Pyx_FMT_TYPENAME ")",
                 type_name, type_name, result_type_name);
    __Pyx_DECREF_TypeName(result_type_name);
    Py_DECREF(result);
    return NULL;
}
static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
#if CYTHON_USE_TYPE_SLOTS
  PyNumberMethods *m;
#endif
  const char *name = NULL;
  PyObject *res = NULL;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_Check(x) || PyLong_Check(x)))
#else
  if (likely(PyLong_Check(x)))
#endif
    return __Pyx_NewRef(x);
#if CYTHON_USE_TYPE_SLOTS
  m = Py_TYPE(x)->tp_as_number;
  #if PY_MAJOR_VERSION < 3
  if (m && m->nb_int) {
    name = "int";
    res = m->nb_int(x);
  }
  else if (m && m->nb_long) {
    name = "long";
    res = m->nb_long(x);
  }
  #else
  if (likely(m && m->nb_int)) {
    name = "int";
    res = m->nb_int(x);
  }
  #endif
#else
  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
    res = PyNumber_Int(x);
  }
#endif
  if (likely(res)) {
#if PY_MAJOR_VERSION < 3
    if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
#else
    if (unlikely(!PyLong_CheckExact(res))) {
#endif
        return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
    }
  }
  else if (!PyErr_Occurred()) {
    PyErr_SetString(PyExc_TypeError,
                    "an integer is required");
  }
  return res;
}
static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
  Py_ssize_t ival;
  PyObject *x;
#if PY_MAJOR_VERSION < 3
  if (likely(PyInt_CheckExact(b))) {
    if (sizeof(Py_ssize_t) >= sizeof(long))
        return PyInt_AS_LONG(b);
    else
        return PyInt_AsSsize_t(b);
  }
#endif
  if (likely(PyLong_CheckExact(b))) {
    #if CYTHON_USE_PYLONG_INTERNALS
    const digit* digits = ((PyLongObject*)b)->ob_digit;
    const Py_ssize_t size = Py_SIZE(b);
    if (likely(__Pyx_sst_abs(size) <= 1)) {
        ival = likely(size) ? digits[0] : 0;
        if (size == -1) ival = -ival;
        return ival;
    } else {
      switch (size) {
         case 2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -2:
           if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -3:
           if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case 4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
         case -4:
           if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
             return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
           }
           break;
      }
    }
    #endif
    return PyLong_AsSsize_t(b);
  }
  x = PyNumber_Index(b);
  if (!x) return -1;
  ival = PyInt_AsSsize_t(x);
  Py_DECREF(x);
  return ival;
}
static CYTHON_INLINE Py_hash_t __Pyx_PyIndex_AsHash_t(PyObject* o) {
  if (sizeof(Py_hash_t) == sizeof(Py_ssize_t)) {
    return (Py_hash_t) __Pyx_PyIndex_AsSsize_t(o);
#if PY_MAJOR_VERSION < 3
  } else if (likely(PyInt_CheckExact(o))) {
    return PyInt_AS_LONG(o);
#endif
  } else {
    Py_ssize_t ival;
    PyObject *x;
    x = PyNumber_Index(o);
    if (!x) return -1;
    ival = PyInt_AsLong(x);
    Py_DECREF(x);
    return ival;
  }
}
static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
}
static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
    return PyInt_FromSize_t(ival);
}


/* #### Code section: end ### */
#endif /* Py_PYTHON_H */
