Skip to content

Instantly share code, notes, and snippets.

@jhamman
Last active August 29, 2015 14:26
Show Gist options
  • Save jhamman/91f2a4a87736f62f4e91 to your computer and use it in GitHub Desktop.
Save jhamman/91f2a4a87736f62f4e91 to your computer and use it in GitHub Desktop.
VIC python driver preprocessed header
typedef float float_t;
typedef double double_t;
extern int __math_errhandling(void);
extern int __fpclassifyf(float);
extern int __fpclassifyd(double);
extern int __fpclassifyl(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinitef(float);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinited(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinitel(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinff(float);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinfd(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinfl(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnanf(float);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnand(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnanl(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormalf(float);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormald(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormall(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitf(float);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitd(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitl(long double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinitef(float __x) {
return __x == __x && __builtin_fabsf(__x) != __builtin_inff();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinited(double __x) {
return __x == __x && __builtin_fabs(__x) != __builtin_inf();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinitel(long double __x) {
return __x == __x && __builtin_fabsl(__x) != __builtin_infl();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinff(float __x) {
return __builtin_fabsf(__x) == __builtin_inff();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinfd(double __x) {
return __builtin_fabs(__x) == __builtin_inf();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isinfl(long double __x) {
return __builtin_fabsl(__x) == __builtin_infl();
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnanf(float __x) {
return __x != __x;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnand(double __x) {
return __x != __x;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnanl(long double __x) {
return __x != __x;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitf(float __x) {
union { float __f; unsigned int __u; } __u;
__u.__f = __x;
return (int)(__u.__u >> 31);
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitd(double __x) {
union { double __f; unsigned long long __u; } __u;
__u.__f = __x;
return (int)(__u.__u >> 63);
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_signbitl(long double __x) {
union {
long double __ld;
struct{ unsigned long long __m; unsigned short __sexp; } __p;
} __u;
__u.__ld = __x;
return (int)(__u.__p.__sexp >> 15);
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormalf(float __x) {
return __inline_isfinitef(__x) && __builtin_fabsf(__x) >= 1.17549435082228750797e-38F;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormald(double __x) {
return __inline_isfinited(__x) && __builtin_fabs(__x) >= ((double)2.22507385850720138309e-308L);
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isnormall(long double __x) {
return __inline_isfinitel(__x) && __builtin_fabsl(__x) >= 3.36210314311209350626e-4932L;
}
extern float acosf(float);
extern double acos(double);
extern long double acosl(long double);
extern float asinf(float);
extern double asin(double);
extern long double asinl(long double);
extern float atanf(float);
extern double atan(double);
extern long double atanl(long double);
extern float atan2f(float, float);
extern double atan2(double, double);
extern long double atan2l(long double, long double);
extern float cosf(float);
extern double cos(double);
extern long double cosl(long double);
extern float sinf(float);
extern double sin(double);
extern long double sinl(long double);
extern float tanf(float);
extern double tan(double);
extern long double tanl(long double);
extern float acoshf(float);
extern double acosh(double);
extern long double acoshl(long double);
extern float asinhf(float);
extern double asinh(double);
extern long double asinhl(long double);
extern float atanhf(float);
extern double atanh(double);
extern long double atanhl(long double);
extern float coshf(float);
extern double cosh(double);
extern long double coshl(long double);
extern float sinhf(float);
extern double sinh(double);
extern long double sinhl(long double);
extern float tanhf(float);
extern double tanh(double);
extern long double tanhl(long double);
extern float expf(float);
extern double exp(double);
extern long double expl(long double);
extern float exp2f(float);
extern double exp2(double);
extern long double exp2l(long double);
extern float expm1f(float);
extern double expm1(double);
extern long double expm1l(long double);
extern float logf(float);
extern double log(double);
extern long double logl(long double);
extern float log10f(float);
extern double log10(double);
extern long double log10l(long double);
extern float log2f(float);
extern double log2(double);
extern long double log2l(long double);
extern float log1pf(float);
extern double log1p(double);
extern long double log1pl(long double);
extern float logbf(float);
extern double logb(double);
extern long double logbl(long double);
extern float modff(float, float *);
extern double modf(double, double *);
extern long double modfl(long double, long double *);
extern float ldexpf(float, int);
extern double ldexp(double, int);
extern long double ldexpl(long double, int);
extern float frexpf(float, int *);
extern double frexp(double, int *);
extern long double frexpl(long double, int *);
extern int ilogbf(float);
extern int ilogb(double);
extern int ilogbl(long double);
extern float scalbnf(float, int);
extern double scalbn(double, int);
extern long double scalbnl(long double, int);
extern float scalblnf(float, long int);
extern double scalbln(double, long int);
extern long double scalblnl(long double, long int);
extern float fabsf(float);
extern double fabs(double);
extern long double fabsl(long double);
extern float cbrtf(float);
extern double cbrt(double);
extern long double cbrtl(long double);
extern float hypotf(float, float);
extern double hypot(double, double);
extern long double hypotl(long double, long double);
extern float powf(float, float);
extern double pow(double, double);
extern long double powl(long double, long double);
extern float sqrtf(float);
extern double sqrt(double);
extern long double sqrtl(long double);
extern float erff(float);
extern double erf(double);
extern long double erfl(long double);
extern float erfcf(float);
extern double erfc(double);
extern long double erfcl(long double);
extern float lgammaf(float);
extern double lgamma(double);
extern long double lgammal(long double);
extern float tgammaf(float);
extern double tgamma(double);
extern long double tgammal(long double);
extern float ceilf(float);
extern double ceil(double);
extern long double ceill(long double);
extern float floorf(float);
extern double floor(double);
extern long double floorl(long double);
extern float nearbyintf(float);
extern double nearbyint(double);
extern long double nearbyintl(long double);
extern float rintf(float);
extern double rint(double);
extern long double rintl(long double);
extern long int lrintf(float);
extern long int lrint(double);
extern long int lrintl(long double);
extern float roundf(float);
extern double round(double);
extern long double roundl(long double);
extern long int lroundf(float);
extern long int lround(double);
extern long int lroundl(long double);
extern long long int llrintf(float);
extern long long int llrint(double);
extern long long int llrintl(long double);
extern long long int llroundf(float);
extern long long int llround(double);
extern long long int llroundl(long double);
extern float truncf(float);
extern double trunc(double);
extern long double truncl(long double);
extern float fmodf(float, float);
extern double fmod(double, double);
extern long double fmodl(long double, long double);
extern float remainderf(float, float);
extern double remainder(double, double);
extern long double remainderl(long double, long double);
extern float remquof(float, float, int *);
extern double remquo(double, double, int *);
extern long double remquol(long double, long double, int *);
extern float copysignf(float, float);
extern double copysign(double, double);
extern long double copysignl(long double, long double);
extern float nanf(const char *);
extern double nan(const char *);
extern long double nanl(const char *);
extern float nextafterf(float, float);
extern double nextafter(double, double);
extern long double nextafterl(long double, long double);
extern double nexttoward(double, long double);
extern float nexttowardf(float, long double);
extern long double nexttowardl(long double, long double);
extern float fdimf(float, float);
extern double fdim(double, double);
extern long double fdiml(long double, long double);
extern float fmaxf(float, float);
extern double fmax(double, double);
extern long double fmaxl(long double, long double);
extern float fminf(float, float);
extern double fmin(double, double);
extern long double fminl(long double, long double);
extern float fmaf(float, float, float);
extern double fma(double, double, double);
extern long double fmal(long double, long double, long double);
extern float __inff(void) __attribute__((deprecated));
extern double __inf(void) __attribute__((deprecated));
extern long double __infl(void) __attribute__((deprecated));
extern float __nan(void) ;
extern float __exp10f(float) ;
extern double __exp10(double) ;
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincosf(float __x, float *__sinp, float *__cosp) ;
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincos(double __x, double *__sinp, double *__cosp) ;
extern float __cospif(float) ;
extern double __cospi(double) ;
extern float __sinpif(float) ;
extern double __sinpi(double) ;
extern float __tanpif(float) ;
extern double __tanpi(double) ;
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincospif(float __x, float *__sinp, float *__cosp) ;
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincospi(double __x, double *__sinp, double *__cosp) ;
struct __float2 { float __sinval; float __cosval; };
struct __double2 { double __sinval; double __cosval; };
extern struct __float2 __sincosf_stret(float);
extern struct __double2 __sincos_stret(double);
extern struct __float2 __sincospif_stret(float);
extern struct __double2 __sincospi_stret(double);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincosf(float __x, float *__sinp, float *__cosp) {
const struct __float2 __stret = __sincosf_stret(__x);
*__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincos(double __x, double *__sinp, double *__cosp) {
const struct __double2 __stret = __sincos_stret(__x);
*__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincospif(float __x, float *__sinp, float *__cosp) {
const struct __float2 __stret = __sincospif_stret(__x);
*__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
}
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) void __sincospi(double __x, double *__sinp, double *__cosp) {
const struct __double2 __stret = __sincospi_stret(__x);
*__sinp = __stret.__sinval; *__cosp = __stret.__cosval;
}
extern double j0(double) ;
extern double j1(double) ;
extern double jn(int, double) ;
extern double y0(double) ;
extern double y1(double) ;
extern double yn(int, double) ;
extern double scalb(double, double);
extern int signgam;
extern long int rinttol(double) __attribute__((deprecated));
extern long int roundtol(double) __attribute__((deprecated));
extern double drem(double, double) __attribute__((deprecated));
extern int finite(double) __attribute__((deprecated));
extern double gamma(double) __attribute__((deprecated));
extern double significand(double) __attribute__((deprecated));
struct exception {
int type;
char *name;
double arg1;
double arg2;
double retval;
};
extern int matherr(struct exception *) __attribute__((deprecated));
typedef __builtin_va_list __gnuc_va_list;
typedef __gnuc_va_list va_list;
typedef signed char __int8_t;
typedef unsigned char __uint8_t;
typedef short __int16_t;
typedef unsigned short __uint16_t;
typedef int __int32_t;
typedef unsigned int __uint32_t;
typedef long long __int64_t;
typedef unsigned long long __uint64_t;
typedef long __darwin_intptr_t;
typedef unsigned int __darwin_natural_t;
typedef int __darwin_ct_rune_t;
typedef union {
char __mbstate8[128];
long long _mbstateL;
} __mbstate_t;
typedef __mbstate_t __darwin_mbstate_t;
typedef long int __darwin_ptrdiff_t;
typedef long unsigned int __darwin_size_t;
typedef __builtin_va_list __darwin_va_list;
typedef int __darwin_wchar_t;
typedef __darwin_wchar_t __darwin_rune_t;
typedef int __darwin_wint_t;
typedef unsigned long __darwin_clock_t;
typedef __uint32_t __darwin_socklen_t;
typedef long __darwin_ssize_t;
typedef long __darwin_time_t;
typedef __int64_t __darwin_blkcnt_t;
typedef __int32_t __darwin_blksize_t;
typedef __int32_t __darwin_dev_t;
typedef unsigned int __darwin_fsblkcnt_t;
typedef unsigned int __darwin_fsfilcnt_t;
typedef __uint32_t __darwin_gid_t;
typedef __uint32_t __darwin_id_t;
typedef __uint64_t __darwin_ino64_t;
typedef __darwin_ino64_t __darwin_ino_t;
typedef __darwin_natural_t __darwin_mach_port_name_t;
typedef __darwin_mach_port_name_t __darwin_mach_port_t;
typedef __uint16_t __darwin_mode_t;
typedef __int64_t __darwin_off_t;
typedef __int32_t __darwin_pid_t;
typedef __uint32_t __darwin_sigset_t;
typedef __int32_t __darwin_suseconds_t;
typedef __uint32_t __darwin_uid_t;
typedef __uint32_t __darwin_useconds_t;
typedef unsigned char __darwin_uuid_t[16];
typedef char __darwin_uuid_string_t[37];
struct __darwin_pthread_handler_rec {
void (*__routine)(void *);
void *__arg;
struct __darwin_pthread_handler_rec *__next;
};
struct _opaque_pthread_attr_t {
long __sig;
char __opaque[56];
};
struct _opaque_pthread_cond_t {
long __sig;
char __opaque[40];
};
struct _opaque_pthread_condattr_t {
long __sig;
char __opaque[8];
};
struct _opaque_pthread_mutex_t {
long __sig;
char __opaque[56];
};
struct _opaque_pthread_mutexattr_t {
long __sig;
char __opaque[8];
};
struct _opaque_pthread_once_t {
long __sig;
char __opaque[8];
};
struct _opaque_pthread_rwlock_t {
long __sig;
char __opaque[192];
};
struct _opaque_pthread_rwlockattr_t {
long __sig;
char __opaque[16];
};
struct _opaque_pthread_t {
long __sig;
struct __darwin_pthread_handler_rec *__cleanup_stack;
char __opaque[8176];
};
typedef struct _opaque_pthread_attr_t __darwin_pthread_attr_t;
typedef struct _opaque_pthread_cond_t __darwin_pthread_cond_t;
typedef struct _opaque_pthread_condattr_t __darwin_pthread_condattr_t;
typedef unsigned long __darwin_pthread_key_t;
typedef struct _opaque_pthread_mutex_t __darwin_pthread_mutex_t;
typedef struct _opaque_pthread_mutexattr_t __darwin_pthread_mutexattr_t;
typedef struct _opaque_pthread_once_t __darwin_pthread_once_t;
typedef struct _opaque_pthread_rwlock_t __darwin_pthread_rwlock_t;
typedef struct _opaque_pthread_rwlockattr_t __darwin_pthread_rwlockattr_t;
typedef struct _opaque_pthread_t *__darwin_pthread_t;
typedef int __darwin_nl_item;
typedef int __darwin_wctrans_t;
typedef __uint32_t __darwin_wctype_t;
typedef __darwin_va_list va_list;
typedef __darwin_size_t size_t;
int renameat(int, const char *, int, const char *) ;
typedef __darwin_off_t fpos_t;
struct __sbuf {
unsigned char *_base;
int _size;
};
struct __sFILEX;
typedef struct __sFILE {
unsigned char *_p;
int _r;
int _w;
short _flags;
short _file;
struct __sbuf _bf;
int _lbfsize;
void *_cookie;
int (*_close)(void *);
int (*_read) (void *, char *, int);
fpos_t (*_seek) (void *, fpos_t, int);
int (*_write)(void *, const char *, int);
struct __sbuf _ub;
struct __sFILEX *_extra;
int _ur;
unsigned char _ubuf[3];
unsigned char _nbuf[1];
struct __sbuf _lb;
int _blksize;
fpos_t _offset;
} FILE;
extern FILE *__stdinp;
extern FILE *__stdoutp;
extern FILE *__stderrp;
void clearerr(FILE *);
int fclose(FILE *);
int feof(FILE *);
int ferror(FILE *);
int fflush(FILE *);
int fgetc(FILE *);
int fgetpos(FILE * restrict, fpos_t *);
char *fgets(char * restrict, int, FILE *);
FILE *fopen(const char * restrict, const char * restrict) __asm("_" "fopen" );
int fprintf(FILE * restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3)));
int fputc(int, FILE *);
int fputs(const char * restrict, FILE * restrict) __asm("_" "fputs" );
size_t fread(void * restrict, size_t, size_t, FILE * restrict);
FILE *freopen(const char * restrict, const char * restrict,
FILE * restrict) __asm("_" "freopen" );
int fscanf(FILE * restrict, const char * restrict, ...) __attribute__((__format__ (__scanf__, 2, 3)));
int fseek(FILE *, long, int);
int fsetpos(FILE *, const fpos_t *);
long ftell(FILE *);
size_t fwrite(const void * restrict, size_t, size_t, FILE * restrict) __asm("_" "fwrite" );
int getc(FILE *);
int getchar(void);
char *gets(char *);
void perror(const char *);
int printf(const char * restrict, ...) __attribute__((__format__ (__printf__, 1, 2)));
int putc(int, FILE *);
int putchar(int);
int puts(const char *);
int remove(const char *);
int rename (const char *, const char *);
void rewind(FILE *);
int scanf(const char * restrict, ...) __attribute__((__format__ (__scanf__, 1, 2)));
void setbuf(FILE * restrict, char * restrict);
int setvbuf(FILE * restrict, char * restrict, int, size_t);
int sprintf(char * restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3)));
int sscanf(const char * restrict, const char * restrict, ...) __attribute__((__format__ (__scanf__, 2, 3)));
FILE *tmpfile(void);
__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tmpnam(3), it is highly recommended that you use mkstemp(3) instead.")))
char *tmpnam(char *);
int ungetc(int, FILE *);
int vfprintf(FILE * restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0)));
int vprintf(const char * restrict, va_list) __attribute__((__format__ (__printf__, 1, 0)));
int vsprintf(char * restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0)));
char *ctermid(char *);
FILE *fdopen(int, const char *) __asm("_" "fdopen" );
int fileno(FILE *);
int pclose(FILE *);
FILE *popen(const char *, const char *) __asm("_" "popen" );
int __srget(FILE *);
int __svfscanf(FILE *, const char *, va_list) __attribute__((__format__ (__scanf__, 2, 0)));
int __swbuf(int, FILE *);
extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __sputc(int _c, FILE *_p) {
if (--_p->_w >= 0 || (_p->_w >= _p->_lbfsize && (char)_c != '\n'))
return (*_p->_p++ = _c);
else
return (__swbuf(_c, _p));
}
void flockfile(FILE *);
int ftrylockfile(FILE *);
void funlockfile(FILE *);
int getc_unlocked(FILE *);
int getchar_unlocked(void);
int putc_unlocked(int, FILE *);
int putchar_unlocked(int);
int getw(FILE *);
int putw(int, FILE *);
__attribute__((deprecated("This function is provided for compatibility reasons only. Due to security concerns inherent in the design of tempnam(3), it is highly recommended that you use mkstemp(3) instead.")))
char *tempnam(const char *, const char *) __asm("_" "tempnam" );
typedef __darwin_off_t off_t;
int fseeko(FILE *, off_t, int);
off_t ftello(FILE *);
int snprintf(char * restrict, size_t, const char * restrict, ...) __attribute__((__format__ (__printf__, 3, 4)));
int vfscanf(FILE * restrict, const char * restrict, va_list) __attribute__((__format__ (__scanf__, 2, 0)));
int vscanf(const char * restrict, va_list) __attribute__((__format__ (__scanf__, 1, 0)));
int vsnprintf(char * restrict, size_t, const char * restrict, va_list) __attribute__((__format__ (__printf__, 3, 0)));
int vsscanf(const char * restrict, const char * restrict, va_list) __attribute__((__format__ (__scanf__, 2, 0)));
typedef __darwin_ssize_t ssize_t;
int dprintf(int, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3))) ;
int vdprintf(int, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0))) ;
ssize_t getdelim(char ** restrict, size_t * restrict, int, FILE * restrict) ;
ssize_t getline(char ** restrict, size_t * restrict, FILE * restrict) ;
extern const int sys_nerr;
extern const char *const sys_errlist[];
int asprintf(char ** restrict, const char * restrict, ...) __attribute__((__format__ (__printf__, 2, 3)));
char *ctermid_r(char *);
char *fgetln(FILE *, size_t *);
const char *fmtcheck(const char *, const char *);
int fpurge(FILE *);
void setbuffer(FILE *, char *, int);
int setlinebuf(FILE *);
int vasprintf(char ** restrict, const char * restrict, va_list) __attribute__((__format__ (__printf__, 2, 0)));
FILE *zopen(const char *, const char *, int);
FILE *funopen(const void *,
int (*)(void *, char *, int),
int (*)(void *, const char *, int),
fpos_t (*)(void *, fpos_t, int),
int (*)(void *));
extern int __sprintf_chk (char * restrict, int, size_t,
const char * restrict, ...);
extern int __snprintf_chk (char * restrict, size_t, int, size_t,
const char * restrict, ...);
extern int __vsprintf_chk (char * restrict, int, size_t,
const char * restrict, va_list);
extern int __vsnprintf_chk (char * restrict, size_t, int, size_t,
const char * restrict, va_list);
typedef enum {
P_ALL,
P_PID,
P_PGID
} idtype_t;
typedef __darwin_pid_t pid_t;
typedef __darwin_id_t id_t;
typedef int sig_atomic_t;
struct __darwin_i386_thread_state
{
unsigned int __eax;
unsigned int __ebx;
unsigned int __ecx;
unsigned int __edx;
unsigned int __edi;
unsigned int __esi;
unsigned int __ebp;
unsigned int __esp;
unsigned int __ss;
unsigned int __eflags;
unsigned int __eip;
unsigned int __cs;
unsigned int __ds;
unsigned int __es;
unsigned int __fs;
unsigned int __gs;
};
struct __darwin_fp_control
{
unsigned short __invalid :1,
__denorm :1,
__zdiv :1,
__ovrfl :1,
__undfl :1,
__precis :1,
:2,
__pc :2,
__rc :2,
:1,
:3;
};
typedef struct __darwin_fp_control __darwin_fp_control_t;
struct __darwin_fp_status
{
unsigned short __invalid :1,
__denorm :1,
__zdiv :1,
__ovrfl :1,
__undfl :1,
__precis :1,
__stkflt :1,
__errsumm :1,
__c0 :1,
__c1 :1,
__c2 :1,
__tos :3,
__c3 :1,
__busy :1;
};
typedef struct __darwin_fp_status __darwin_fp_status_t;
struct __darwin_mmst_reg
{
char __mmst_reg[10];
char __mmst_rsrv[6];
};
struct __darwin_xmm_reg
{
char __xmm_reg[16];
};
struct __darwin_i386_float_state
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
char __fpu_rsrv4[14*16];
int __fpu_reserved1;
};
struct __darwin_i386_avx_state
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
char __fpu_rsrv4[14*16];
int __fpu_reserved1;
char __avx_reserved1[64];
struct __darwin_xmm_reg __fpu_ymmh0;
struct __darwin_xmm_reg __fpu_ymmh1;
struct __darwin_xmm_reg __fpu_ymmh2;
struct __darwin_xmm_reg __fpu_ymmh3;
struct __darwin_xmm_reg __fpu_ymmh4;
struct __darwin_xmm_reg __fpu_ymmh5;
struct __darwin_xmm_reg __fpu_ymmh6;
struct __darwin_xmm_reg __fpu_ymmh7;
};
struct __darwin_i386_exception_state
{
__uint16_t __trapno;
__uint16_t __cpu;
__uint32_t __err;
__uint32_t __faultvaddr;
};
struct __darwin_x86_debug_state32
{
unsigned int __dr0;
unsigned int __dr1;
unsigned int __dr2;
unsigned int __dr3;
unsigned int __dr4;
unsigned int __dr5;
unsigned int __dr6;
unsigned int __dr7;
};
struct __darwin_x86_thread_state64
{
__uint64_t __rax;
__uint64_t __rbx;
__uint64_t __rcx;
__uint64_t __rdx;
__uint64_t __rdi;
__uint64_t __rsi;
__uint64_t __rbp;
__uint64_t __rsp;
__uint64_t __r8;
__uint64_t __r9;
__uint64_t __r10;
__uint64_t __r11;
__uint64_t __r12;
__uint64_t __r13;
__uint64_t __r14;
__uint64_t __r15;
__uint64_t __rip;
__uint64_t __rflags;
__uint64_t __cs;
__uint64_t __fs;
__uint64_t __gs;
};
struct __darwin_x86_float_state64
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
struct __darwin_xmm_reg __fpu_xmm8;
struct __darwin_xmm_reg __fpu_xmm9;
struct __darwin_xmm_reg __fpu_xmm10;
struct __darwin_xmm_reg __fpu_xmm11;
struct __darwin_xmm_reg __fpu_xmm12;
struct __darwin_xmm_reg __fpu_xmm13;
struct __darwin_xmm_reg __fpu_xmm14;
struct __darwin_xmm_reg __fpu_xmm15;
char __fpu_rsrv4[6*16];
int __fpu_reserved1;
};
struct __darwin_x86_avx_state64
{
int __fpu_reserved[2];
struct __darwin_fp_control __fpu_fcw;
struct __darwin_fp_status __fpu_fsw;
__uint8_t __fpu_ftw;
__uint8_t __fpu_rsrv1;
__uint16_t __fpu_fop;
__uint32_t __fpu_ip;
__uint16_t __fpu_cs;
__uint16_t __fpu_rsrv2;
__uint32_t __fpu_dp;
__uint16_t __fpu_ds;
__uint16_t __fpu_rsrv3;
__uint32_t __fpu_mxcsr;
__uint32_t __fpu_mxcsrmask;
struct __darwin_mmst_reg __fpu_stmm0;
struct __darwin_mmst_reg __fpu_stmm1;
struct __darwin_mmst_reg __fpu_stmm2;
struct __darwin_mmst_reg __fpu_stmm3;
struct __darwin_mmst_reg __fpu_stmm4;
struct __darwin_mmst_reg __fpu_stmm5;
struct __darwin_mmst_reg __fpu_stmm6;
struct __darwin_mmst_reg __fpu_stmm7;
struct __darwin_xmm_reg __fpu_xmm0;
struct __darwin_xmm_reg __fpu_xmm1;
struct __darwin_xmm_reg __fpu_xmm2;
struct __darwin_xmm_reg __fpu_xmm3;
struct __darwin_xmm_reg __fpu_xmm4;
struct __darwin_xmm_reg __fpu_xmm5;
struct __darwin_xmm_reg __fpu_xmm6;
struct __darwin_xmm_reg __fpu_xmm7;
struct __darwin_xmm_reg __fpu_xmm8;
struct __darwin_xmm_reg __fpu_xmm9;
struct __darwin_xmm_reg __fpu_xmm10;
struct __darwin_xmm_reg __fpu_xmm11;
struct __darwin_xmm_reg __fpu_xmm12;
struct __darwin_xmm_reg __fpu_xmm13;
struct __darwin_xmm_reg __fpu_xmm14;
struct __darwin_xmm_reg __fpu_xmm15;
char __fpu_rsrv4[6*16];
int __fpu_reserved1;
char __avx_reserved1[64];
struct __darwin_xmm_reg __fpu_ymmh0;
struct __darwin_xmm_reg __fpu_ymmh1;
struct __darwin_xmm_reg __fpu_ymmh2;
struct __darwin_xmm_reg __fpu_ymmh3;
struct __darwin_xmm_reg __fpu_ymmh4;
struct __darwin_xmm_reg __fpu_ymmh5;
struct __darwin_xmm_reg __fpu_ymmh6;
struct __darwin_xmm_reg __fpu_ymmh7;
struct __darwin_xmm_reg __fpu_ymmh8;
struct __darwin_xmm_reg __fpu_ymmh9;
struct __darwin_xmm_reg __fpu_ymmh10;
struct __darwin_xmm_reg __fpu_ymmh11;
struct __darwin_xmm_reg __fpu_ymmh12;
struct __darwin_xmm_reg __fpu_ymmh13;
struct __darwin_xmm_reg __fpu_ymmh14;
struct __darwin_xmm_reg __fpu_ymmh15;
};
struct __darwin_x86_exception_state64
{
__uint16_t __trapno;
__uint16_t __cpu;
__uint32_t __err;
__uint64_t __faultvaddr;
};
struct __darwin_x86_debug_state64
{
__uint64_t __dr0;
__uint64_t __dr1;
__uint64_t __dr2;
__uint64_t __dr3;
__uint64_t __dr4;
__uint64_t __dr5;
__uint64_t __dr6;
__uint64_t __dr7;
};
struct __darwin_mcontext32
{
struct __darwin_i386_exception_state __es;
struct __darwin_i386_thread_state __ss;
struct __darwin_i386_float_state __fs;
};
struct __darwin_mcontext_avx32
{
struct __darwin_i386_exception_state __es;
struct __darwin_i386_thread_state __ss;
struct __darwin_i386_avx_state __fs;
};
struct __darwin_mcontext64
{
struct __darwin_x86_exception_state64 __es;
struct __darwin_x86_thread_state64 __ss;
struct __darwin_x86_float_state64 __fs;
};
struct __darwin_mcontext_avx64
{
struct __darwin_x86_exception_state64 __es;
struct __darwin_x86_thread_state64 __ss;
struct __darwin_x86_avx_state64 __fs;
};
typedef struct __darwin_mcontext64 *mcontext_t;
typedef __darwin_pthread_attr_t pthread_attr_t;
struct __darwin_sigaltstack
{
void *ss_sp;
__darwin_size_t ss_size;
int ss_flags;
};
typedef struct __darwin_sigaltstack stack_t;
struct __darwin_ucontext
{
int uc_onstack;
__darwin_sigset_t uc_sigmask;
struct __darwin_sigaltstack uc_stack;
struct __darwin_ucontext *uc_link;
__darwin_size_t uc_mcsize;
struct __darwin_mcontext64 *uc_mcontext;
};
typedef struct __darwin_ucontext ucontext_t;
typedef __darwin_sigset_t sigset_t;
typedef __darwin_uid_t uid_t;
union sigval {
int sival_int;
void *sival_ptr;
};
struct sigevent {
int sigev_notify;
int sigev_signo;
union sigval sigev_value;
void (*sigev_notify_function)(union sigval);
pthread_attr_t *sigev_notify_attributes;
};
typedef struct __siginfo {
int si_signo;
int si_errno;
int si_code;
pid_t si_pid;
uid_t si_uid;
int si_status;
void *si_addr;
union sigval si_value;
long si_band;
unsigned long __pad[7];
} siginfo_t;
union __sigaction_u {
void (*__sa_handler)(int);
void (*__sa_sigaction)(int, struct __siginfo *,
void *);
};
struct __sigaction {
union __sigaction_u __sigaction_u;
void (*sa_tramp)(void *, int, int, siginfo_t *, void *);
sigset_t sa_mask;
int sa_flags;
};
struct sigaction {
union __sigaction_u __sigaction_u;
sigset_t sa_mask;
int sa_flags;
};
typedef void (*sig_t)(int);
struct sigvec {
void (*sv_handler)(int);
int sv_mask;
int sv_flags;
};
struct sigstack {
char *ss_sp;
int ss_onstack;
};
void (*signal(int, void (*)(int)))(int);
typedef signed char int8_t;
typedef short int16_t;
typedef int int32_t;
typedef long long int64_t;
typedef unsigned char uint8_t;
typedef unsigned short uint16_t;
typedef unsigned int uint32_t;
typedef unsigned long long uint64_t;
typedef int8_t int_least8_t;
typedef int16_t int_least16_t;
typedef int32_t int_least32_t;
typedef int64_t int_least64_t;
typedef uint8_t uint_least8_t;
typedef uint16_t uint_least16_t;
typedef uint32_t uint_least32_t;
typedef uint64_t uint_least64_t;
typedef int8_t int_fast8_t;
typedef int16_t int_fast16_t;
typedef int32_t int_fast32_t;
typedef int64_t int_fast64_t;
typedef uint8_t uint_fast8_t;
typedef uint16_t uint_fast16_t;
typedef uint32_t uint_fast32_t;
typedef uint64_t uint_fast64_t;
typedef __darwin_intptr_t intptr_t;
typedef unsigned long uintptr_t;
typedef long int intmax_t;
typedef long unsigned int uintmax_t;
struct timeval
{
__darwin_time_t tv_sec;
__darwin_suseconds_t tv_usec;
};
typedef __uint64_t rlim_t;
struct rusage {
struct timeval ru_utime;
struct timeval ru_stime;
long ru_maxrss;
long ru_ixrss;
long ru_idrss;
long ru_isrss;
long ru_minflt;
long ru_majflt;
long ru_nswap;
long ru_inblock;
long ru_oublock;
long ru_msgsnd;
long ru_msgrcv;
long ru_nsignals;
long ru_nvcsw;
long ru_nivcsw;
};
typedef void *rusage_info_t;
struct rusage_info_v0 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
};
struct rusage_info_v1 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
uint64_t ri_child_user_time;
uint64_t ri_child_system_time;
uint64_t ri_child_pkg_idle_wkups;
uint64_t ri_child_interrupt_wkups;
uint64_t ri_child_pageins;
uint64_t ri_child_elapsed_abstime;
};
struct rusage_info_v2 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
uint64_t ri_child_user_time;
uint64_t ri_child_system_time;
uint64_t ri_child_pkg_idle_wkups;
uint64_t ri_child_interrupt_wkups;
uint64_t ri_child_pageins;
uint64_t ri_child_elapsed_abstime;
uint64_t ri_diskio_bytesread;
uint64_t ri_diskio_byteswritten;
};
struct rusage_info_v3 {
uint8_t ri_uuid[16];
uint64_t ri_user_time;
uint64_t ri_system_time;
uint64_t ri_pkg_idle_wkups;
uint64_t ri_interrupt_wkups;
uint64_t ri_pageins;
uint64_t ri_wired_size;
uint64_t ri_resident_size;
uint64_t ri_phys_footprint;
uint64_t ri_proc_start_abstime;
uint64_t ri_proc_exit_abstime;
uint64_t ri_child_user_time;
uint64_t ri_child_system_time;
uint64_t ri_child_pkg_idle_wkups;
uint64_t ri_child_interrupt_wkups;
uint64_t ri_child_pageins;
uint64_t ri_child_elapsed_abstime;
uint64_t ri_diskio_bytesread;
uint64_t ri_diskio_byteswritten;
uint64_t ri_cpu_time_qos_default;
uint64_t ri_cpu_time_qos_maintenance;
uint64_t ri_cpu_time_qos_background;
uint64_t ri_cpu_time_qos_utility;
uint64_t ri_cpu_time_qos_legacy;
uint64_t ri_cpu_time_qos_user_initiated;
uint64_t ri_cpu_time_qos_user_interactive;
uint64_t ri_billed_system_time;
uint64_t ri_serviced_system_time;
};
typedef struct rusage_info_v3 rusage_info_current;
struct rlimit {
rlim_t rlim_cur;
rlim_t rlim_max;
};
struct proc_rlimit_control_wakeupmon {
uint32_t wm_flags;
int32_t wm_rate;
};
int getpriority(int, id_t);
int getiopolicy_np(int, int) ;
int getrlimit(int, struct rlimit *) __asm("_" "getrlimit" );
int getrusage(int, struct rusage *);
int setpriority(int, id_t, int);
int setiopolicy_np(int, int, int) ;
int setrlimit(int, const struct rlimit *) __asm("_" "setrlimit" );
static inline
__uint16_t
_OSSwapInt16(
__uint16_t _data
)
{
return ((__uint16_t)((_data << 8) | (_data >> 8)));
}
static inline
__uint32_t
_OSSwapInt32(
__uint32_t _data
)
{
__asm__ ("bswap %0" : "+r" (_data));
return _data;
}
static inline
__uint64_t
_OSSwapInt64(
__uint64_t _data
)
{
__asm__ ("bswap %0" : "+r" (_data));
return _data;
}
union wait {
int w_status;
struct {
unsigned int w_Termsig:7,
w_Coredump:1,
w_Retcode:8,
w_Filler:16;
} w_T;
struct {
unsigned int w_Stopval:8,
w_Stopsig:8,
w_Filler:16;
} w_S;
};
pid_t wait(int *) __asm("_" "wait" );
pid_t waitpid(pid_t, int *, int) __asm("_" "waitpid" );
int waitid(idtype_t, id_t, siginfo_t *, int) __asm("_" "waitid" );
pid_t wait3(int *, int, struct rusage *);
pid_t wait4(pid_t, int *, int, struct rusage *);
void *alloca(size_t);
typedef __darwin_ct_rune_t ct_rune_t;
typedef __darwin_rune_t rune_t;
typedef __darwin_wchar_t wchar_t;
typedef struct {
int quot;
int rem;
} div_t;
typedef struct {
long quot;
long rem;
} ldiv_t;
typedef struct {
long long quot;
long long rem;
} lldiv_t;
extern int __mb_cur_max;
void abort(void) __attribute__((noreturn));
int abs(int) __attribute__((const));
int atexit(void (*)(void));
double atof(const char *);
int atoi(const char *);
long atol(const char *);
long long
atoll(const char *);
void *bsearch(const void *, const void *, size_t,
size_t, int (*)(const void *, const void *));
void *calloc(size_t, size_t);
div_t div(int, int) __attribute__((const));
void exit(int) __attribute__((noreturn));
void free(void *);
char *getenv(const char *);
long labs(long) __attribute__((const));
ldiv_t ldiv(long, long) __attribute__((const));
long long
llabs(long long);
lldiv_t lldiv(long long, long long);
void *malloc(size_t);
int mblen(const char *, size_t);
size_t mbstowcs(wchar_t * restrict , const char * restrict, size_t);
int mbtowc(wchar_t * restrict, const char * restrict, size_t);
int posix_memalign(void **, size_t, size_t) ;
void qsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int rand(void);
void *realloc(void *, size_t);
void srand(unsigned);
double strtod(const char *, char **) __asm("_" "strtod" );
float strtof(const char *, char **) __asm("_" "strtof" );
long strtol(const char *, char **, int);
long double
strtold(const char *, char **);
long long
strtoll(const char *, char **, int);
unsigned long
strtoul(const char *, char **, int);
unsigned long long
strtoull(const char *, char **, int);
int system(const char *) __asm("_" "system" ) ;
size_t wcstombs(char * restrict, const wchar_t * restrict, size_t);
int wctomb(char *, wchar_t);
void _Exit(int) __attribute__((noreturn));
long a64l(const char *);
double drand48(void);
char *ecvt(double, int, int *restrict, int *restrict);
double erand48(unsigned short[3]);
char *fcvt(double, int, int *restrict, int *restrict);
char *gcvt(double, int, char *);
int getsubopt(char **, char * const *, char **);
int grantpt(int);
char *initstate(unsigned, char *, size_t);
long jrand48(unsigned short[3]);
char *l64a(long);
void lcong48(unsigned short[7]);
long lrand48(void);
char *mktemp(char *);
int mkstemp(char *);
long mrand48(void);
long nrand48(unsigned short[3]);
int posix_openpt(int);
char *ptsname(int);
int putenv(char *) __asm("_" "putenv" );
long random(void);
int rand_r(unsigned *);
char *realpath(const char * restrict, char * restrict) __asm("_" "realpath" "$DARWIN_EXTSN");
unsigned short
*seed48(unsigned short[3]);
int setenv(const char *, const char *, int) __asm("_" "setenv" );
void setkey(const char *) __asm("_" "setkey" );
char *setstate(const char *);
void srand48(long);
void srandom(unsigned);
int unlockpt(int);
int unsetenv(const char *) __asm("_" "unsetenv" );
typedef unsigned char u_int8_t;
typedef unsigned short u_int16_t;
typedef unsigned int u_int32_t;
typedef unsigned long long u_int64_t;
typedef int64_t register_t;
typedef u_int64_t user_addr_t;
typedef u_int64_t user_size_t;
typedef int64_t user_ssize_t;
typedef int64_t user_long_t;
typedef u_int64_t user_ulong_t;
typedef int64_t user_time_t;
typedef int64_t user_off_t;
typedef u_int64_t syscall_arg_t;
typedef __darwin_dev_t dev_t;
typedef __darwin_mode_t mode_t;
u_int32_t arc4random(void);
void arc4random_addrandom(unsigned char * , int );
void arc4random_buf(void * , size_t ) ;
void arc4random_stir(void);
u_int32_t
arc4random_uniform(u_int32_t ) ;
char *cgetcap(char *, const char *, int);
int cgetclose(void);
int cgetent(char **, char **, const char *);
int cgetfirst(char **, char **);
int cgetmatch(const char *, const char *);
int cgetnext(char **, char **);
int cgetnum(char *, const char *, long *);
int cgetset(const char *);
int cgetstr(char *, const char *, char **);
int cgetustr(char *, const char *, char **);
int daemon(int, int) __asm("_" "daemon" "$1050") __attribute__((deprecated));
char *devname(dev_t, mode_t);
char *devname_r(dev_t, mode_t, char *buf, int len);
char *getbsize(int *, long *);
int getloadavg(double [], int);
const char
*getprogname(void);
int heapsort(void *, size_t, size_t,
int (*)(const void *, const void *));
int mergesort(void *, size_t, size_t,
int (*)(const void *, const void *));
void psort(void *, size_t, size_t,
int (*)(const void *, const void *)) ;
void psort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *)) ;
void qsort_r(void *, size_t, size_t, void *,
int (*)(void *, const void *, const void *));
int radixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void setprogname(const char *);
int sradixsort(const unsigned char **, int, const unsigned char *,
unsigned);
void sranddev(void);
void srandomdev(void);
void *reallocf(void *, size_t);
long long
strtoq(const char *, char **, int);
unsigned long long
strtouq(const char *, char **, int);
extern char *suboptarg;
void *valloc(size_t);
void *memchr(const void *, int, size_t);
int memcmp(const void *, const void *, size_t);
void *memcpy(void *, const void *, size_t);
void *memmove(void *, const void *, size_t);
void *memset(void *, int, size_t);
char *strcat(char *, const char *);
char *strchr(const char *, int);
int strcmp(const char *, const char *);
int strcoll(const char *, const char *);
char *strcpy(char *, const char *);
size_t strcspn(const char *, const char *);
char *strerror(int) __asm("_" "strerror" );
size_t strlen(const char *);
char *strncat(char *, const char *, size_t);
int strncmp(const char *, const char *, size_t);
char *strncpy(char *, const char *, size_t);
char *strpbrk(const char *, const char *);
char *strrchr(const char *, int);
size_t strspn(const char *, const char *);
char *strstr(const char *, const char *);
char *strtok(char *, const char *);
size_t strxfrm(char *, const char *, size_t);
char *strtok_r(char *, const char *, char **);
int strerror_r(int, char *, size_t);
char *strdup(const char *);
void *memccpy(void *, const void *, int, size_t);
char *stpcpy(char *, const char *);
char *stpncpy(char *, const char *, size_t) ;
char *strndup(const char *, size_t) ;
size_t strnlen(const char *, size_t) ;
char *strsignal(int sig);
void *memmem(const void *, size_t, const void *, size_t) ;
void memset_pattern4(void *, const void *, size_t) ;
void memset_pattern8(void *, const void *, size_t) ;
void memset_pattern16(void *, const void *, size_t) ;
char *strcasestr(const char *, const char *);
char *strnstr(const char *, const char *, size_t);
size_t strlcat(char *, const char *, size_t);
size_t strlcpy(char *, const char *, size_t);
void strmode(int, char *);
char *strsep(char **, const char *);
void swab(const void * restrict, void * restrict, ssize_t);
int bcmp(const void *, const void *, size_t) ;
void bcopy(const void *, void *, size_t) ;
void bzero(void *, size_t) ;
char *index(const char *, int) ;
char *rindex(const char *, int) ;
int ffs(int);
int strcasecmp(const char *, const char *);
int strncasecmp(const char *, const char *, size_t);
int ffsl(long) ;
int ffsll(long long) ;
int fls(int) ;
int flsl(long) ;
int flsll(long long) ;
extern int * __error(void);
FILE *LOG_DEST;
void finalize_logging(void);
void get_current_datetime(char *cdt);
void get_logname(const char *path, int id, char *filename);
void initialize_log(void);
void setup_logging(int id);
extern _Bool ref_veg_over[];
extern double ref_veg_rarc[];
extern double ref_veg_rmin[];
extern double ref_veg_lai[];
extern double ref_veg_albedo[];
extern double ref_veg_vegcover[];
extern double ref_veg_rough[];
extern double ref_veg_displ[];
extern double ref_veg_wind_h[];
extern double ref_veg_RGL[];
extern double ref_veg_rad_atten[];
extern double ref_veg_wind_atten[];
extern double ref_veg_trunk_ratio[];
extern _Bool ref_veg_ref_crop[];
extern size_t NR;
extern size_t NF;
enum
{
ASCII,
BINARY
};
enum
{
LITTLE,
BIG
};
enum
{
DENS_BRAS,
DENS_SNTHRM
};
enum
{
ARNO,
NIJSSEN2001
};
enum
{
AR_406,
AR_406_LS,
AR_406_FULL,
AR_410
};
enum
{
GF_406,
GF_410
};
enum
{
VP_ITER_NONE,
VP_ITER_ALWAYS,
VP_ITER_ANNUAL,
VP_ITER_CONVERGE
};
enum
{
LW_TVA,
LW_ANDERSON,
LW_BRUTSAERT,
LW_SATTERLUND,
LW_IDSO,
LW_PRATA
};
enum
{
LW_CLOUD_BRAS,
LW_CLOUD_DEARDORFF
};
enum
{
FROM_VEGLIB,
FROM_VEGPARAM
};
enum
{
LAI_FROM_VEGLIB,
LAI_FROM_VEGPARAM
};
enum
{
RC_JARVIS,
RC_PHOTO
};
enum
{
PS_FARQUHAR,
PS_MONTEITH
};
enum
{
PHOTO_C3,
PHOTO_C4
};
enum
{
AIR_TEMP,
ALBEDO,
CATM,
CHANNEL_IN,
CRAINF,
CSNOWF,
DENSITY,
FDIR,
LAI_IN,
LONGWAVE,
LSRAINF,
LSSNOWF,
PAR,
PREC,
PRESSURE,
QAIR,
RAINF,
REL_HUMID,
SHORTWAVE,
SNOWF,
TMAX,
TMIN,
TSKC,
VEGCOVER,
VP,
WIND,
WIND_E,
WIND_N,
SKIP,
N_FORCING_TYPES
};
enum
{
OUT_ASAT,
OUT_LAKE_AREA_FRAC,
OUT_LAKE_DEPTH,
OUT_LAKE_ICE,
OUT_LAKE_ICE_FRACT,
OUT_LAKE_ICE_HEIGHT,
OUT_LAKE_MOIST,
OUT_LAKE_SURF_AREA,
OUT_LAKE_SWE,
OUT_LAKE_SWE_V,
OUT_LAKE_VOLUME,
OUT_ROOTMOIST,
OUT_SMFROZFRAC,
OUT_SMLIQFRAC,
OUT_SNOW_CANOPY,
OUT_SNOW_COVER,
OUT_SNOW_DEPTH,
OUT_SOIL_ICE,
OUT_SOIL_LIQ,
OUT_SOIL_MOIST,
OUT_SOIL_WET,
OUT_SURFSTOR,
OUT_SURF_FROST_FRAC,
OUT_SWE,
OUT_WDEW,
OUT_ZWT,
OUT_ZWT_LUMPED,
OUT_BASEFLOW,
OUT_DELINTERCEPT,
OUT_DELSOILMOIST,
OUT_DELSURFSTOR,
OUT_DELSWE,
OUT_EVAP,
OUT_EVAP_BARE,
OUT_EVAP_CANOP,
OUT_INFLOW,
OUT_LAKE_BF_IN,
OUT_LAKE_BF_IN_V,
OUT_LAKE_BF_OUT,
OUT_LAKE_BF_OUT_V,
OUT_LAKE_CHAN_IN,
OUT_LAKE_CHAN_IN_V,
OUT_LAKE_CHAN_OUT,
OUT_LAKE_CHAN_OUT_V,
OUT_LAKE_DSTOR,
OUT_LAKE_DSTOR_V,
OUT_LAKE_DSWE,
OUT_LAKE_DSWE_V,
OUT_LAKE_EVAP,
OUT_LAKE_EVAP_V,
OUT_LAKE_PREC_V,
OUT_LAKE_RCHRG,
OUT_LAKE_RCHRG_V,
OUT_LAKE_RO_IN,
OUT_LAKE_RO_IN_V,
OUT_LAKE_VAPFLX,
OUT_LAKE_VAPFLX_V,
OUT_PET_SATSOIL,
OUT_PET_H2OSURF,
OUT_PET_SHORT,
OUT_PET_TALL,
OUT_PET_NATVEG,
OUT_PET_VEGNOCR,
OUT_PREC,
OUT_RAINF,
OUT_REFREEZE,
OUT_RUNOFF,
OUT_SNOW_MELT,
OUT_SNOWF,
OUT_SUB_BLOWING,
OUT_SUB_CANOP,
OUT_SUB_SNOW,
OUT_SUB_SURFACE,
OUT_TRANSP_VEG,
OUT_WATER_ERROR,
OUT_ALBEDO,
OUT_BARESOILT,
OUT_FDEPTH,
OUT_LAKE_ICE_TEMP,
OUT_LAKE_SURF_TEMP,
OUT_RAD_TEMP,
OUT_SALBEDO,
OUT_SNOW_PACK_TEMP,
OUT_SNOW_SURF_TEMP,
OUT_SNOWT_FBFLAG,
OUT_SOIL_TEMP,
OUT_SOIL_TNODE,
OUT_SOIL_TNODE_WL,
OUT_SOILT_FBFLAG,
OUT_SURF_TEMP,
OUT_SURFT_FBFLAG,
OUT_TCAN_FBFLAG,
OUT_TDEPTH,
OUT_TFOL_FBFLAG,
OUT_VEGT,
OUT_ADV_SENS,
OUT_ADVECTION,
OUT_DELTACC,
OUT_DELTAH,
OUT_ENERGY_ERROR,
OUT_FUSION,
OUT_GRND_FLUX,
OUT_IN_LONG,
OUT_LATENT,
OUT_LATENT_SUB,
OUT_MELT_ENERGY,
OUT_NET_LONG,
OUT_NET_SHORT,
OUT_R_NET,
OUT_RFRZ_ENERGY,
OUT_SENSIBLE,
OUT_SNOW_FLUX,
OUT_AERO_COND,
OUT_AERO_COND1,
OUT_AERO_COND2,
OUT_AERO_RESIST,
OUT_AERO_RESIST1,
OUT_AERO_RESIST2,
OUT_AIR_TEMP,
OUT_CATM,
OUT_COSZEN,
OUT_DENSITY,
OUT_FDIR,
OUT_LAI,
OUT_LONGWAVE,
OUT_PAR,
OUT_PRESSURE,
OUT_QAIR,
OUT_REL_HUMID,
OUT_SHORTWAVE,
OUT_SURF_COND,
OUT_TSKC,
OUT_VEGCOVER,
OUT_VP,
OUT_VPD,
OUT_WIND,
OUT_ADV_SENS_BAND,
OUT_ADVECTION_BAND,
OUT_ALBEDO_BAND,
OUT_DELTACC_BAND,
OUT_GRND_FLUX_BAND,
OUT_IN_LONG_BAND,
OUT_LATENT_BAND,
OUT_LATENT_SUB_BAND,
OUT_MELT_ENERGY_BAND,
OUT_NET_LONG_BAND,
OUT_NET_SHORT_BAND,
OUT_RFRZ_ENERGY_BAND,
OUT_SENSIBLE_BAND,
OUT_SNOW_CANOPY_BAND,
OUT_SNOW_COVER_BAND,
OUT_SNOW_DEPTH_BAND,
OUT_SNOW_FLUX_BAND,
OUT_SNOW_MELT_BAND,
OUT_SNOW_PACKT_BAND,
OUT_SNOW_SURFT_BAND,
OUT_SWE_BAND,
OUT_APAR,
OUT_GPP,
OUT_RAUT,
OUT_NPP,
OUT_LITTERFALL,
OUT_RHET,
OUT_NEE,
OUT_CLITTER,
OUT_CINTER,
OUT_CSLOW,
N_OUTVAR_TYPES
};
enum
{
OUT_TYPE_DEFAULT,
OUT_TYPE_CHAR,
OUT_TYPE_SINT,
OUT_TYPE_USINT,
OUT_TYPE_INT,
OUT_TYPE_FLOAT,
OUT_TYPE_DOUBLE
};
enum
{
AGG_TYPE_AVG,
AGG_TYPE_BEG,
AGG_TYPE_END,
AGG_TYPE_MAX,
AGG_TYPE_MIN,
AGG_TYPE_SUM
};
enum
{
DISP_VERSION,
DISP_COMPILE_TIME,
DISP_ALL
};
enum calendars
{
CALENDAR_STANDARD,
CALENDAR_GREGORIAN,
CALENDAR_PROLEPTIC_GREGORIAN,
CALENDAR_NOLEAP,
CALENDAR_365_DAY,
CALENDAR_360_DAY,
CALENDAR_JULIAN,
CALENDAR_ALL_LEAP,
CALENDAR_366_DAY
};
enum time_units
{
TIME_UNITS_SECONDS,
TIME_UNITS_MINUTES,
TIME_UNITS_HOURS,
TIME_UNITS_DAYS
};
typedef struct {
FILE *forcing[2];
FILE *globalparam;
FILE *constants;
FILE *domain;
FILE *init_state;
FILE *lakeparam;
FILE *snowband;
FILE *soilparam;
FILE *statefile;
FILE *veglib;
FILE *vegparam;
FILE *logfile;
} filep_struct;
typedef struct {
char forcing[2][2048];
char f_path_pfx[2][2048];
char global[2048];
char domain[2048];
char constants[2048];
char init_state[2048];
char lakeparam[2048];
char result_dir[2048];
char snowband[2048];
char soil[2048];
char statefile[2048];
char veg[2048];
char veglib[2048];
char log_path[2048];
} filenames_struct;
typedef struct {
short AboveTreelineVeg;
unsigned short int AERO_RESIST_CANSNOW;
_Bool BLOWING;
_Bool BLOWING_VAR_THRESHOLD;
_Bool BLOWING_CALC_PROB;
_Bool BLOWING_SIMPLE;
_Bool BLOWING_FETCH;
_Bool BLOWING_SPATIAL_WIND;
_Bool CARBON;
_Bool CLOSE_ENERGY;
_Bool COMPUTE_TREELINE;
_Bool CONTINUEONERROR;
_Bool CORRPREC;
_Bool EQUAL_AREA;
_Bool EXP_TRANS;
_Bool FROZEN_SOIL;
_Bool FULL_ENERGY;
unsigned short int GRND_FLUX_TYPE;
_Bool IMPLICIT;
_Bool JULY_TAVG_SUPPLIED;
_Bool LAKES;
unsigned short int LW_CLOUD;
unsigned short int LW_TYPE;
_Bool MTCLIM_SWE_CORR;
size_t Ncanopy;
size_t Nfrost;
size_t Nlakenode;
size_t Nlayer;
size_t Nnode;
_Bool NOFLUX;
size_t NVEGTYPES;
_Bool PLAPSE;
unsigned short int RC_MODE;
size_t ROOT_ZONES;
_Bool QUICK_FLUX;
_Bool QUICK_SOLVE;
_Bool SHARE_LAYER_MOIST;
unsigned short int SNOW_DENSITY;
size_t SNOW_BAND;
_Bool SPATIAL_FROST;
_Bool SPATIAL_SNOW;
_Bool TFALLBACK;
_Bool VP_INTERP;
unsigned short VP_ITER;
_Bool ALMA_INPUT;
_Bool BASEFLOW;
unsigned short int GRID_DECIMAL;
_Bool VEGLIB_PHOTO;
_Bool VEGLIB_VEGCOVER;
_Bool VEGPARAM_ALB;
_Bool VEGPARAM_LAI;
_Bool VEGPARAM_VEGCOVER;
unsigned short int ALB_SRC;
unsigned short int LAI_SRC;
unsigned short int VEGCOVER_SRC;
_Bool LAKE_PROFILE;
_Bool ORGANIC_FRACT;
_Bool BINARY_STATE_FILE;
_Bool INIT_STATE;
_Bool SAVE_STATE;
_Bool ALMA_OUTPUT;
_Bool BINARY_OUTPUT;
_Bool COMPRESS;
_Bool MOISTFRACT;
size_t Noutfiles;
_Bool OUTPUT_FORCE;
_Bool PRT_HEADER;
_Bool PRT_SNOW_BAND;
} option_struct;
typedef struct {
double measure_h;
double wind_h;
double resolution;
double dt;
double snow_dt;
double runoff_dt;
double atmos_dt;
double out_dt;
size_t model_steps_per_day;
size_t snow_steps_per_day;
size_t runoff_steps_per_day;
size_t atmos_steps_per_day;
size_t output_steps_per_day;
unsigned short int endday;
unsigned short int endmonth;
unsigned short int endyear;
unsigned short int forceday[2];
unsigned int forcesec[2];
unsigned short int forcemonth[2];
unsigned short int forceoffset[2];
unsigned int forceskip[2];
unsigned short int forceyear[2];
size_t nrecs;
unsigned short int skipyear;
unsigned short int startday;
unsigned int startsec;
unsigned short int startmonth;
unsigned short int startyear;
unsigned short int stateday;
unsigned short int statemonth;
unsigned short int stateyear;
unsigned short int calendar;
unsigned short int time_units;
double time_origin_num;
} global_param_struct;
typedef struct {
double LAPSE_RATE;
double GAUGE_HEIGHT;
double WIND_SPEED_DEFAULT;
double WIND_SPEED_MIN;
double HUGE_RESIST;
double ALBEDO_BARE_SOIL;
double ALBEDO_H20_SURF;
double EMISS_GRND;
double EMISS_VEG;
double EMISS_ICE;
double EMISS_SNOW;
double EMISS_H2O;
double SOIL_RESID_MOIST;
double SOIL_SLAB_MOIST_FRACT;
double VEG_LAI_SNOW_MULTIPLIER;
double VEG_MIN_INTERCEPTION_STORAGE;
double VEG_LAI_WATER_FACTOR;
double CANOPY_CLOSURE;
double CANOPY_RSMAX;
double CANOPY_VPDMINFACTOR;
double MTCLIM_TDAYCOEF;
double MTCLIM_SOLAR_CONSTANT;
double MTCLIM_SNOW_TCRIT;
double MTCLIM_SNOW_TRATE;
double MTCLIM_TBASE;
double MTCLIM_ABASE;
double MTCLIM_C;
double MTCLIM_B0;
double MTCLIM_B1;
double MTCLIM_B2;
double MTCLIM_RAIN_SCALAR;
double MTCLIM_DIF_ALB;
double MTCLIM_SC_INT;
double MTCLIM_SC_SLOPE;
double MTCLIM_SRADDT;
double MTCLIM_SW_PREC_THRESH;
double LAKE_TMELT;
double LAKE_MAX_SURFACE;
double LAKE_BETA;
double LAKE_FRACMIN;
double LAKE_FRACLIM;
double LAKE_DM;
double LAKE_SNOWCRIT;
double LAKE_ZWATER;
double LAKE_ZSNOW;
double LAKE_RHOSNOW;
double LAKE_CONDI;
double LAKE_CONDS;
double LAKE_LAMISW;
double LAKE_LAMILW;
double LAKE_LAMSSW;
double LAKE_LAMSLW;
double LAKE_LAMWSW;
double LAKE_LAMWLW;
double LAKE_A1;
double LAKE_A2;
double LAKE_QWTAU;
int LAKE_MAX_ITER;
double SVP_A;
double SVP_B;
double SVP_C;
double CARBON_CATMCURRENT;
double CARBON_SW2PAR;
double PHOTO_OMEGA;
double PHOTO_LAIMAX;
double PHOTO_LAILIMIT;
double PHOTO_LAIMIN;
double PHOTO_EPAR;
double PHOTO_FCMAX;
double PHOTO_FCMIN;
double PHOTO_ZENITHMIN;
double PHOTO_ZENITHMINPAR;
double PHOTO_ALBSOIPARMIN;
double PHOTO_MINMAXETRANS;
double PHOTO_MINSTOMCOND;
double PHOTO_FCI1C3;
double PHOTO_FCI1C4;
double PHOTO_OX;
double PHOTO_KC;
double PHOTO_KO;
double PHOTO_EC;
double PHOTO_EO;
double PHOTO_EV;
double PHOTO_ER;
double PHOTO_ALC3;
double PHOTO_FRDC3;
double PHOTO_EK;
double PHOTO_ALC4;
double PHOTO_FRDC4;
double PHOTO_THETA;
double PHOTO_FRLEAF;
double PHOTO_FRGROWTH;
double SRESP_E0_LT;
double SRESP_T0_LT;
double SRESP_WMINFM;
double SRESP_WMAXFM;
double SRESP_WOPTFM;
double SRESP_RHSAT;
double SRESP_RFACTOR;
double SRESP_TAULITTER;
double SRESP_TAUINTER;
double SRESP_TAUSLOW;
double SRESP_FAIR;
double SRESP_FINTER;
double SNOW_MAX_SURFACE_SWE;
double SNOW_LIQUID_WATER_CAPACITY;
double SNOW_NEW_SNOW_DENSITY;
double SNOW_DENS_DMLIMIT;
double SNOW_DENS_MAX_CHANGE;
double SNOW_DENS_ETA0;
double SNOW_DENS_C1;
double SNOW_DENS_C2;
double SNOW_DENS_C5;
double SNOW_DENS_C6;
double SNOW_DENS_F;
double SNOW_MIN_SWQ_EB_THRES;
double SNOW_A1;
double SNOW_A2;
double SNOW_L1;
double SNOW_L2;
double SNOW_NEW_SNOW_ALB;
double SNOW_ALB_ACCUM_A;
double SNOW_ALB_ACCUM_B;
double SNOW_ALB_THAW_A;
double SNOW_ALB_THAW_B;
double SNOW_TRACESNOW;
double SNOW_CONDUCT;
double SNOW_MAX_SNOW_TEMP;
double SNOW_MIN_RAIN_TEMP;
double BLOWING_KA;
double BLOWING_CSALT;
double BLOWING_UTHRESH;
double BLOWING_KIN_VIS;
int BLOWING_MAX_ITER;
int BLOWING_K;
double BLOWING_SETTLING;
int BLOWING_NUMINCS;
double TREELINE_TEMPERATURE;
double SNOW_DT;
double SURF_DT;
double SOIL_DT;
double CANOPY_DT;
double CANOPY_VP;
double TOL_GRND;
double TOL_OVER;
int FROZEN_MAXITER;
int NEWT_RAPH_MAXTRIAL;
double NEWT_RAPH_TOLX;
double NEWT_RAPH_TOLF;
double NEWT_RAPH_R_MAX;
double NEWT_RAPH_R_MIN;
double NEWT_RAPH_RELAX1;
double NEWT_RAPH_RELAX2;
double NEWT_RAPH_RELAX3;
double NEWT_RAPH_EPS2;
int ROOT_BRENT_MAXTRIES;
int ROOT_BRENT_MAXITER;
double ROOT_BRENT_TSTEP;
double ROOT_BRENT_T;
} parameters_struct;
typedef struct {
_Bool FS_ACTIVE;
double Ds;
double Dsmax;
double Ksat[3];
double Wcr[3];
double Wpwp[3];
double Ws;
double AlbedoPar;
double alpha[50];
double annual_prec;
double avg_temp;
double avgJulyAirTemp;
double b_infilt;
double beta[50];
double bubble[3];
double bubble_node[50];
double bulk_density[3];
double bulk_dens_min[3];
double bulk_dens_org[3];
double c;
double depth[3];
double dp;
double dz_node[50];
double Zsum_node[50];
double expt[3];
double expt_node[50];
double frost_fract[10];
double frost_slope;
double gamma[50];
double init_moist[3];
double max_infil;
double max_moist[3];
double max_moist_node[50];
double max_snow_distrib_slope;
double phi_s[3];
double porosity[3];
double quartz[3];
double organic[3];
double resid_moist[3];
double rough;
double snow_rough;
double soil_density[3];
double soil_dens_min[3];
double soil_dens_org[3];
double *BandElev;
double *AreaFract;
double *Pfactor;
double *Tfactor;
_Bool *AboveTreeLine;
double elevation;
double lat;
double lng;
double cell_area;
double time_zone_lng;
unsigned int gridcel;
double zwtvmoist_zwt[3 + 2][11];
double zwtvmoist_moist[3 + 2][11];
double slope;
double aspect;
double ehoriz;
double whoriz;
} soil_con_struct;
typedef struct {
double Cv;
double Cv_sum;
double root[3];
double *zone_depth;
double *zone_fract;
int veg_class;
size_t vegetat_type_num;
double sigma_slope;
double lag_one;
double fetch;
int LAKE;
double *CanopLayerBnd;
} veg_con_struct;
typedef struct {
_Bool overstory;
double LAI[12];
double vegcover[12];
double Wdmax[12];
double albedo[12];
double displacement[12];
double emissivity[12];
size_t NVegLibTypes;
double rad_atten;
double rarc;
double rmin;
double roughness[12];
double trunk_ratio;
double wind_atten;
double wind_h;
double RGL;
unsigned short int veg_class;
char Ctype;
double MaxCarboxRate;
double MaxETransport;
double CO2Specificity;
double LightUseEff;
_Bool NscaleFlag;
double Wnpp_inhib;
double NPPfactor_sat;
} veg_lib_struct;
typedef struct {
double *albedo;
double *LAI;
double *vegcover;
} veg_hist_struct;
typedef struct {
double *air_temp;
double *Catm;
double *channel_in;
double *coszen;
double *density;
double *fdir;
double *longwave;
double out_prec;
double out_rain;
double out_snow;
double *par;
double *prec;
double *pressure;
double *shortwave;
_Bool *snowflag;
double *tskc;
double *vp;
double *vpd;
double *wind;
} atmos_data_struct;
typedef struct {
unsigned short int day;
unsigned short int day_in_year;
unsigned short int month;
int year;
unsigned int dayseconds;
} dmy_struct;
typedef struct {
double Cs;
double T;
double bare_evap_frac;
double evap;
double ice[10];
double kappa;
double moist;
double phi;
double zwt;
} layer_data_struct;
typedef struct {
double aero_resist[2];
double asat;
double baseflow;
double CLitter;
double CInter;
double CSlow;
double inflow;
double pot_evap[0];
double runoff;
layer_data_struct layer[3];
double RhLitter;
double RhLitter2Atm;
double RhInter;
double RhSlow;
double RhTot;
double rootmoist;
double wetness;
double zwt;
double zwt_lumped;
} cell_data_struct;
typedef struct {
double AlbedoLake;
double AlbedoOver;
double AlbedoUnder;
double Cs[2];
double Cs_node[50];
double fdepth[3];
_Bool frozen;
double ice[50];
double kappa[2];
double kappa_node[50];
double moist[50];
size_t Nfrost;
size_t Nthaw;
double T[50];
_Bool T_fbflag[50];
unsigned int T_fbcount[50];
int T1_index;
double Tcanopy;
_Bool Tcanopy_fbflag;
unsigned int Tcanopy_fbcount;
double tdepth[3];
double Tfoliage;
_Bool Tfoliage_fbflag;
unsigned int Tfoliage_fbcount;
double Tsurf;
_Bool Tsurf_fbflag;
unsigned int Tsurf_fbcount;
double unfrozen;
double advected_sensible;
double advection;
double AtmosError;
double AtmosLatent;
double AtmosLatentSub;
double AtmosSensible;
double canopy_advection;
double canopy_latent;
double canopy_latent_sub;
double canopy_refreeze;
double canopy_sensible;
double deltaCC;
double deltaH;
double error;
double fusion;
double grnd_flux;
double latent;
double latent_sub;
double longwave;
double LongOverIn;
double LongUnderIn;
double LongUnderOut;
double melt_energy;
double NetLongAtmos;
double NetLongOver;
double NetLongUnder;
double NetShortAtmos;
double NetShortGrnd;
double NetShortOver;
double NetShortUnder;
double out_long_canopy;
double out_long_surface;
double refreeze_energy;
double sensible;
double shortwave;
double ShortOverIn;
double ShortUnderIn;
double snow_flux;
} energy_bal_struct;
typedef struct {
double albedo;
double canopyevap;
double LAI;
double throughfall;
double vegcover;
double Wdew;
double Wdmax;
double *NscaleFactor;
double *aPARLayer;
double *CiLayer;
double *rsLayer;
double aPAR;
double Ci;
double rc;
double NPPfactor;
double GPP;
double Rphoto;
double Rdark;
double Rmaint;
double Rgrowth;
double Raut;
double NPP;
double Litterfall;
double AnnualNPP;
double AnnualNPPPrev;
} veg_var_struct;
typedef struct {
double albedo;
double canopy_albedo;
double coldcontent;
double coverage;
double density;
double depth;
unsigned int last_snow;
double max_snow_depth;
_Bool MELTING;
double pack_temp;
double pack_water;
_Bool snow;
double snow_canopy;
double store_coverage;
_Bool store_snow;
double store_swq;
double surf_temp;
unsigned int surf_temp_fbcount;
_Bool surf_temp_fbflag;
double surf_water;
double swq;
double snow_distrib_slope;
double tmp_int_storage;
double blowing_flux;
double canopy_vapor_flux;
double mass_error;
double melt;
double Qnet;
double surface_flux;
double transport;
double vapor_flux;
} snow_data_struct;
typedef struct {
size_t numnod;
double z[20 + 1];
double basin[20 + 1];
double Cl[20 + 1];
double b;
double maxdepth;
double mindepth;
double maxvolume;
double minvolume;
double bpercent;
double rpercent;
double wfrac;
double depth_in;
int lake_idx;
} lake_con_struct;
typedef struct {
unsigned short int activenod;
double dz;
double surfdz;
double ldepth;
double surface[20 + 1];
double sarea;
double sarea_save;
double volume;
double volume_save;
double temp[20];
double tempavg;
double areai;
double new_ice_area;
double ice_water_eq;
double hice;
double tempi;
double swe;
double swe_save;
double surf_temp;
double pack_temp;
double coldcontent;
double surf_water;
double pack_water;
double SAlbedo;
double sdepth;
double aero_resist;
double density[20];
double baseflow_in;
double baseflow_out;
double channel_in;
double evapw;
double ice_throughfall;
double prec;
double recharge;
double runoff_in;
double runoff_out;
double snowmlt;
double vapor_flux;
snow_data_struct snow;
energy_bal_struct energy;
cell_data_struct soil;
} lake_var_struct;
typedef struct {
cell_data_struct **cell;
energy_bal_struct **energy;
lake_var_struct lake_var;
snow_data_struct **snow;
veg_var_struct **veg_var;
} all_vars_struct;
typedef struct {
double total_soil_moist;
double surfstor;
double swe;
double wdew;
} save_data_struct;
typedef struct {
char varname[20];
_Bool write;
char format[10];
unsigned short int type;
double mult;
unsigned short int aggtype;
unsigned int nelem;
double *data;
double *aggdata;
} out_data_struct;
typedef struct {
char prefix[20];
char filename[2048];
FILE *fh;
size_t nvars;
unsigned int *varid;
} out_data_file_struct;
typedef struct {
atmos_data_struct *atmos;
double dt;
energy_bal_struct *energy;
filep_struct filep;
size_t rec;
out_data_struct *out_data;
out_data_file_struct *out_data_files;
snow_data_struct *snow;
soil_con_struct soil_con;
veg_con_struct *veg_con;
veg_var_struct *veg_var;
} Error_struct;
void advect_carbon_storage(double, double, lake_var_struct *,
cell_data_struct *);
void advect_snow_storage(double, double, double, snow_data_struct *);
void advect_soil_veg_storage(double, double, double, double *,
soil_con_struct *, veg_con_struct *,
cell_data_struct *, veg_var_struct *,
lake_con_struct);
double advected_sensible_heat(double, double, double, double, double);
void alblake(double, double, double *, double *, double *, double *, double,
double, double, unsigned int *, double, _Bool *, unsigned short int,
double);
double arno_evap(layer_data_struct *, double, double, double, double, double,
double, double, double, double, double, double *);
double calc_atmos_energy_bal(double, double, double, double, double, double,
double, double, double, double, double, double,
double, double *, double *, double *, double *,
double *, double *, _Bool *, unsigned int*);
double calc_density(double);
double calc_energy_balance_error(int, double, double, double, double, double);
double calc_latent_heat_of_sublimation(double temp);
double calc_latent_heat_of_vaporization(double temp);
int calc_layer_average_thermal_props(energy_bal_struct *, layer_data_struct *,
soil_con_struct *, size_t, double *);
double calc_outgoing_longwave(double temp, double emis);
double calc_scale_height(double tair, double elevation);
double calc_sensible_heat(double atmos_density, double t1, double t0,
double Ra);
void calc_Nscale_factors(char, double *, double, double, double, double,
unsigned short int, double *);
double calc_rainonly(double, double, double, double);
double calc_rc(double, double, double, double, double, double, double, char);
void calc_rc_ps(char, double, double, double, double *, double, double,
double *, double, double, double *, double, double, double,
double *, double *);
double calc_snow_coverage(_Bool *, double, double, double, double, double,
double, double, double *, double, double *, double *,
double *);
int calc_soil_thermal_fluxes(int, double *, double *, char *, unsigned int *,
double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *,
double *, int, int, int);
double calc_surf_energy_bal(double, double, double, double, double, double,
double, double, double, double, double, double,
double, double, double, double, double, double,
double, double, double, double, double, double *,
double *, double *, double *, double *, double,
double *, double *, double, double *, double *, int,
int, size_t, size_t, double, size_t,
unsigned short int, int, int, unsigned short int,
double *, double *, atmos_data_struct *,
dmy_struct *, energy_bal_struct *,
layer_data_struct *, snow_data_struct *,
soil_con_struct *, veg_var_struct *);
double calc_veg_displacement(double);
double calc_veg_height(double);
double calc_veg_roughness(double);
double calc_water_balance_error(int, double, double, double);
int CalcAerodynamic(_Bool, double, double, double, double, double, double *,
double *, double *, double *, double *);
double CalcBlowingSnow(double, double, unsigned int, double, double, double,
double, double, double, double, double, double, double,
double, int, int, double, double, double, double *);
double CalcIcePackEnergyBalance(double Tsurf, ...);
double CalcSnowPackEnergyBalance(double Tsurf, ...);
double CalcSubFlux(double EactAir, double es, double Zrh, double AirDens,
double utshear, double ushear, double fe, double Tsnow,
double Tair, double U10, double Zo_salt, double F,
double *Transport);
void canopy_assimilation(char, double, double, double, double *, double, double,
double *, double, double, double *, double, char *,
double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *);
double canopy_evap(layer_data_struct *, veg_var_struct *, _Bool,
unsigned short int, double *, double, double, double, double,
double, double, double, double, double *, double *, double *,
double *, double *, double *, double, double, double *);
void colavg(double *, double *, double *, double, double *, int, double,
double);
void collect_eb_terms(energy_bal_struct, snow_data_struct, cell_data_struct,
int *, int *, int *, int *, int *, double, double, double,
int, int, double, int, int, double *, double,
out_data_struct *);
void collect_wb_terms(cell_data_struct, veg_var_struct, snow_data_struct,
double, double, double, int, double, int, double *,
double *, out_data_struct *);
double compute_coszen(double, double, double, unsigned short int, unsigned int);
void compute_pot_evap(unsigned short int, dmy_struct *, size_t, double, double,
double, double, double, double, double **, double *);
void compute_runoff_and_asat(soil_con_struct *, double *, double, double *,
double *);
void compute_soil_resp(int, double *, double, double, double *, double *,
double, double, double, double *, double *, double *);
void compute_soil_layer_thermal_properties(layer_data_struct *, double *,
double *, double *, double *,
double *, double *, double *,
double *, size_t);
double compute_zwt(soil_con_struct *, int, double);
void correct_precip(double *, double, double, double, double);
double darkinhib(double);
int distribute_node_moisture_properties(double *, double *, double *, double *,
double *, double *, double *, double *,
double *, double *, double *, double *,
double *, double *, double *, double *,
double *, int, int, char);
void eddy(int, double, double *, double *, double, int, double, double);
void energycalc(double *, double *, int, double, double, double *, double *,
double *);
double error_calc_atmos_energy_bal(double Tcanopy, ...);
double error_calc_atmos_moist_bal(double, ...);
double error_calc_canopy_energy_bal(double Tsurf, ...);
double error_calc_surf_energy_bal(double Tsurf, ...);
double error_print_atmos_energy_bal(double, va_list);
double error_print_atmos_moist_bal(double, va_list);
double error_print_canopy_energy_bal(double, va_list);
double error_print_solve_T_profile(double, va_list);
double error_print_surf_energy_bal(double, va_list);
double error_solve_T_profile(double Tsurf, ...);
double ErrorIcePackEnergyBalance(double Tsurf, ...);
double ErrorPrintIcePackEnergyBalance(double, va_list);
int ErrorPrintSnowPackEnergyBalance(double, va_list);
int ErrorSnowPackEnergyBalance(double Tsurf, ...);
int estimate_layer_ice_content(layer_data_struct *, double *, double *,
double *, double *, double *, double *, double *,
double, size_t, size_t, char);
int estimate_layer_ice_content_quick_flux(layer_data_struct *, double *, double,
double, double, double, double *,
double *, double *, double *, double,
char);
double estimate_T1(double, double, double, double, double, double, double,
double, double, double);
double exp_interp(double, double, double, double, double);
void faparl(double *, double, double, double, double, double *, double *);
void fda_heat_eqn(double *, double *, int, int, ...);
void fdjac3(double *, double *, double *, double *, double *, void (*vecfunc)(
double *, double *, int, int, ...), int);
void find_0_degree_fronts(energy_bal_struct *, double *, double *, int);
layer_data_struct find_average_layer(layer_data_struct *, layer_data_struct *,
double, double);
double func_atmos_energy_bal(double, va_list);
double func_atmos_moist_bal(double, va_list);
double func_canopy_energy_bal(double, va_list);
double func_surf_energy_bal(double, va_list);
double (*funcd)(double z, double es, double Wind, double AirDens, double ZO,
double EactAir, double F, double hsalt, double phi_r,
double ushear,
double Zrh);
int get_depth(lake_con_struct, double, double *);
double get_prob(double Tair, double Age, double SurfaceLiquidWater, double U10);
int get_sarea(lake_con_struct, double, double *);
void get_shear(double x, double *f, double *df, double Ur, double Zr);
double get_thresh(double Tair, double SurfaceLiquidWater, double Zo_salt);
int get_volume(lake_con_struct, double, double *);
double hiTinhib(double);
int initialize_lake(lake_var_struct *, lake_con_struct, soil_con_struct *,
cell_data_struct *, double, int);
int ice_melt(double, double, double *, double, snow_data_struct *,
lake_var_struct *, double, double, double, double, double, double,
double, double, double, double, double, double, double, double,
double, double *, double *, double *, double *, double *, double *,
double *, double *, double *);
double IceEnergyBalance(double, va_list);
void iceform(double *, double *, double, double, double *, int, double, double,
double, double *, double *, double *, double *, double);
void icerad(double, double, double, double *, double *, double *);
int lakeice(double, double, double, double, double, double *, double, double *,
double *, double, double);
void latent_heat_from_snow(double, double, double, double, double, double,
double, double *, double *, double *, double *,
double *);
void latsens(double, double, double, double, double, double, double, double,
double *, double *, double);
double linear_interp(double, double, double, double, double);
double lkdrag(double, double, double, double, double);
void MassRelease(double *, double *, double *, double *);
double maximum_unfrozen_water(double, double, double, double);
double modify_Ksat(double);
double new_snow_density(double);
int newt_raph(void (*vecfunc)(double *, double *, int, int,
...), double *, int);
double penman(double, double, double, double, double, double, double);
void photosynth(char, double, double, double, double, double, double, double,
double, double, char *, double *, double *, double *, double *,
double *);
void polint(double xa[], double ya[], int n, double x, double *y, double *dy);
void prepare_full_energy(int, all_vars_struct *, soil_con_struct *, double *,
double *);
int put_data(all_vars_struct *, atmos_data_struct *, soil_con_struct *,
veg_con_struct *, veg_lib_struct *veg_lib, lake_con_struct *,
out_data_struct *, save_data_struct *, int);
double qromb(
double (*sub_with_height)(), double es, double Wind, double AirDens, double ZO, double EactAir, double F, double hsalt, double phi_r, double ushear, double Zrh, double a,
double b);
void rescale_snow_energy_fluxes(double, double, snow_data_struct *,
energy_bal_struct *);
void rescale_snow_storage(double, double, snow_data_struct *);
void rescale_soil_veg_fluxes(double, double, cell_data_struct *,
veg_var_struct *);
void rhoinit(double *, double);
double root_brent(double, double, char *, double (*Function)(double,
va_list), ...);
double rtnewt(double x1, double x2, double xacc, double Ur, double Zr);
int runoff(cell_data_struct *, energy_bal_struct *, soil_con_struct *, double,
double *, double, int);
void set_node_parameters(double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *,
double *, int, int);
void shear_stress(double U10, double ZO, double *ushear, double *Zo_salt,
double utshear);
double snow_albedo(double, double, double, double, double, int, char);
double snow_density(snow_data_struct *, double, double, double, double);
int snow_intercept(double, double, double, double, double, double, double,
double, double, double, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, _Bool *, unsigned int *, double *, double *,
double *, double *, double *, double *, double *, int, int,
int, int, int, int, unsigned short int, double *, double *,
atmos_data_struct *, layer_data_struct *, soil_con_struct *,
veg_var_struct *);
int snow_melt(double, double, double, double, double *, double, double *,
double, double, double, double, double, double, double, double,
double, double, double, double, double, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, int, int, int, int,
snow_data_struct *);
double SnowPackEnergyBalance(double, va_list);
void soil_carbon_balance(soil_con_struct *, energy_bal_struct *,
cell_data_struct *, veg_var_struct *);
double soil_conductivity(double, double, double, double, double, double, double,
double);
double soil_thermal_eqn(double, va_list);
double solve_atmos_energy_bal(double Tcanopy, ...);
double solve_atmos_moist_bal(double, ...);
double solve_canopy_energy_bal(double Tfoliage, ...);
int solve_lake(double, double, double, double, double, double, double, double,
double, double, lake_var_struct *, soil_con_struct, double,
double, dmy_struct, double);
double solve_snow(char, double, double, double, double, double, double, double,
double, double, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, double *,
int, size_t, unsigned short int, unsigned short int, double,
size_t, size_t, int, int *, double *, double *, dmy_struct *,
atmos_data_struct *, energy_bal_struct *, layer_data_struct *,
snow_data_struct *, soil_con_struct *, veg_var_struct *);
double solve_surf_energy_bal(double Tsurf, ...);
int solve_T_profile(double *, double *, char *, unsigned int *, double *,
double *, double *, double *, double, double *, double *,
double *, double *, double *, double *, double *, double,
int, int *, int, int, int);
int solve_T_profile_implicit(double *, double *, char *, unsigned int *,
double *, double *, double *, double *, double,
double *, double *, double *, double *, double *,
double *, double *, double, int, int *, int, int,
double *, double *, double *, double *, double *,
double *, double *);
double specheat(double);
double StabilityCorrection(double, double, double, double, double, double);
double sub_with_height(double z, double es, double Wind, double AirDens,
double ZO, double EactAir, double F, double hsalt,
double phi_r, double ushear, double Zrh);
int surface_fluxes(_Bool, double, double, double, double, double *, double *,
double **, double *, double *, double *, double *, double *,
double *, double *, double *, double *, double *, size_t,
size_t, unsigned short int, double, unsigned short int,
size_t, unsigned short int, atmos_data_struct *,
dmy_struct *, energy_bal_struct *, global_param_struct *,
cell_data_struct *, snow_data_struct *, soil_con_struct *,
veg_var_struct *, double, double, double, double *);
double svp(double);
double svp_slope(double);
void temp_area(double, double, double, double *, double *, double *, double *,
double, double *, int, double, double, double *, double *,
double *);
void tracer_mixer(double *, int *, double *, int, double, double, double *);
void transpiration(layer_data_struct *, veg_var_struct *, unsigned short int,
double, double, double, double, double, double, double,
double, double *, double *, double *, double *, double *,
double *, double, double, double *);
double transport_with_height(double z, double es, double Wind, double AirDens,
double ZO, double EactAir, double F, double hsalt,
double phi_r, double ushear, double Zrh);
double trapzd(
double (*funcd)(), double es, double Wind, double AirDens, double ZO, double EactAir, double F, double hsalt, double phi_r, double ushear, double Zrh, double a, double b,
int n);
void tridia(int, double *, double *, double *, double *, double *);
void tridiag(double *, double *, double *, double *, unsigned int);
int vic_run(int, atmos_data_struct *, all_vars_struct *, dmy_struct *,
global_param_struct *, lake_con_struct *, soil_con_struct *,
veg_con_struct *, veg_lib_struct *, veg_hist_struct *veg_hist);
double volumetric_heat_capacity(double, double, double, double);
int water_balance(lake_var_struct *, lake_con_struct, double, all_vars_struct *,
int, int, int, double, soil_con_struct, veg_con_struct);
int water_energy_balance(int, double *, double *, double, double, double,
double, double, double, double, double, double, double,
double, double, double, double *, double *, double *,
double *, double *, double *, double *, double,
double *, double *, double *, double *, double *,
double);
int water_under_ice(int, double, double, double *, double *, double, int,
double, double, double, double *, double *, double *,
double *, int, double, double, double, double *);
void wrap_compute_zwt(soil_con_struct *, cell_data_struct *);
void write_layer(layer_data_struct *, int, double *);
void write_vegvar(veg_var_struct *, int);
void zero_output_list(out_data_struct *);
typedef struct {
size_t N_ELEM;
_Bool SIGNED;
_Bool SUPPLIED;
double multiplier;
} force_type_struct;
typedef struct {
force_type_struct TYPE[N_FORCING_TYPES];
double FORCE_DT[2];
size_t force_steps_per_day[2];
unsigned short int FORCE_ENDIAN[2];
int FORCE_FORMAT[2];
int FORCE_INDEX[2][N_FORCING_TYPES];
size_t N_TYPES[2];
} param_set_struct;
double all_30_day_from_dmy(dmy_struct *dmy);
double all_leap_from_dmy(dmy_struct *dmy);
void calc_root_fractions(veg_con_struct *veg_con, soil_con_struct *soil_con);
int check_date(unsigned short int calendar, dmy_struct *dmy);
void compute_treeline(atmos_data_struct *, dmy_struct *, double, double *,
_Bool *);
void cmd_proc(int argc, char **argv, char *globalfilename);
void compress_files(char string[]);
void get_current_datetime(char *cdt);
double date2num(double origin, dmy_struct *date, double tzoffset,
unsigned short int calendar, unsigned short int time_units);
void dmy_all_30_day(double julian, dmy_struct *dmy);
void dmy_all_leap(double julian, dmy_struct *dmy);
void dmy_julian_day(double julian, unsigned short int calendar,
dmy_struct *dmy);
void dmy_no_leap_day(double julian, dmy_struct *dmy);
void dt_seconds_to_time_units(unsigned short int time_units, double dt_seconds,
double *dt_time_units);
void display_current_settings(int);
double fractional_day_from_dmy(dmy_struct *dmy);
void free_all_vars(all_vars_struct *all_vars, int Nveg);
void free_dmy(dmy_struct **dmy);
void free_vegcon(veg_con_struct **veg_con);
double get_dist(double lat1, double long1, double lat2, double long2);
void get_next_time_step(unsigned short int *, unsigned short int *,
unsigned short int *, unsigned short int *,
unsigned short int *, unsigned short int);
void get_parameters(FILE *paramfile);
void initialize_forcing_files(void);
void initialize_filenames(void);
void initialize_fileps(void);
void initialize_global(void);
void initialize_options(void);
void initialize_parameters(void);
void initialize_snow(snow_data_struct **snow, size_t veg_num);
void initialize_soil(cell_data_struct **cell, soil_con_struct *soil_con,
size_t veg_num);
void initialize_time(void);
void initialize_veg(veg_var_struct **veg_var, size_t nveg);
double julian_day_from_dmy(dmy_struct *dmy, unsigned short int calendar);
_Bool leap_year(unsigned short int year, unsigned short int calendar);
all_vars_struct make_all_vars(size_t nveg);
cell_data_struct **make_cell_data(size_t veg_type_num);
dmy_struct *make_dmy(global_param_struct *global);
energy_bal_struct **make_energy_bal(size_t nveg);
void make_lastday(unsigned short int calendar, unsigned short int year,
unsigned short int lastday[]);
snow_data_struct **make_snow_data(size_t nveg);
veg_var_struct **make_veg_var(size_t veg_type_num);
double no_leap_day_from_dmy(dmy_struct *dmy);
void num2date(double origin, double time_value, double tzoffset,
unsigned short int calendar, unsigned short int time_units,
dmy_struct *date);
FILE *open_file(char string[], char type[]);
void print_cell_data(cell_data_struct *cell, size_t nlayers, size_t nfrost,
size_t npet);
void print_dmy(dmy_struct *dmy);
void print_energy_bal(energy_bal_struct *eb, size_t nnodes, size_t nfronts);
void print_filenames(filenames_struct *fnames);
void print_filep(filep_struct *fp);
void print_force_type(force_type_struct *force_type);
void print_global_param(global_param_struct *gp);
void print_lake_con(lake_con_struct *lcon, size_t nlnodes);
void print_lake_var(lake_var_struct *lvar, size_t nlnodes, size_t nfronts,
size_t nlayers, size_t nnodes, size_t nfrost, size_t npet);
void print_layer_data(layer_data_struct *ldata, size_t nfrost);
void print_license(void);
void print_option(option_struct *option);
void print_out_data(out_data_struct *out, size_t nelem);
void print_out_data_file(out_data_file_struct *outf);
void print_param_set(param_set_struct *param_set);
void print_parameters(parameters_struct *param);
void print_save_data(save_data_struct *save);
void print_snow_data(snow_data_struct *snow);
void print_soil_con(soil_con_struct *scon, size_t nlayers, size_t nnodes,
size_t nfrost, size_t nbands, size_t nzwt);
void print_veg_con(veg_con_struct *vcon, size_t nroots, char blowing, char lake,
char carbon, size_t ncanopy);
void print_veg_lib(veg_lib_struct *vlib, char carbon);
void print_veg_var(veg_var_struct *vvar, size_t ncanopy);
void print_version(char *);
void print_usage(char *);
void soil_moisture_from_water_table(soil_con_struct *soil_con, size_t nlayers);
int valid_date(unsigned short int calendar, dmy_struct *dmy);
void validate_parameters(void);
int flag;
size_t NR;
size_t NF;
global_param_struct global_param;
option_struct options;
parameters_struct param;
filenames_struct filenames;
filep_struct filep;
param_set_struct param_set;
---------------------------------------------------------------------------
ParseError Traceback (most recent call last)
/Users/me/anaconda/lib/python3.4/site-packages/cffi/cparser.py in _parse(self, csource)
127 try:
--> 128 ast = _get_parser().parse(csource)
129 except pycparser.c_parser.ParseError as e:
/Users/me/anaconda/lib/python3.4/site-packages/pycparser/c_parser.py in parse(self, text, filename, debuglevel)
145 lexer=self.clex,
--> 146 debug=debuglevel)
147
/Users/me/anaconda/lib/python3.4/site-packages/pycparser/ply/yacc.py in parse(self, input, lexer, debug, tracking, tokenfunc)
264 else:
--> 265 return self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)
266
/Users/me/anaconda/lib/python3.4/site-packages/pycparser/ply/yacc.py in parseopt_notrack(self, input, lexer, debug, tracking, tokenfunc)
1046 errtoken.lexer = lexer
-> 1047 tok = self.errorfunc(errtoken)
1048 del errok, token, restart # Delete special functions
/Users/me/anaconda/lib/python3.4/site-packages/pycparser/c_parser.py in p_error(self, p)
1679 self._coord(lineno=p.lineno,
-> 1680 column=self.clex.find_tok_column(p)))
1681 else:
/Users/me/anaconda/lib/python3.4/site-packages/pycparser/plyparser.py in _parse_error(self, msg, coord)
54 def _parse_error(self, msg, coord):
---> 55 raise ParseError("%s: %s" % (coord, msg))
ParseError: :10:17: before: __attribute__
During handling of the above exception, another exception occurred:
CDefError Traceback (most recent call last)
<ipython-input-24-92e757c8a633> in <module>()
5
6 with open('drivers/python/header.txt') as f_headers:
----> 7 ffi.cdef(f_headers.read())
8
9 ffi.compile()
/Users/me/anaconda/lib/python3.4/site-packages/cffi/api.py in cdef(self, csource, override, packed)
105 csource = csource.encode('ascii')
106 with self._lock:
--> 107 self._parser.parse(csource, override=override, packed=packed)
108 self._cdefsources.append(csource)
109 if override:
/Users/me/anaconda/lib/python3.4/site-packages/cffi/cparser.py in parse(self, csource, override, packed)
165 self._override = override
166 self._packed = packed
--> 167 self._internal_parse(csource)
168 finally:
169 self._override = prev_override
/Users/me/anaconda/lib/python3.4/site-packages/cffi/cparser.py in _internal_parse(self, csource)
171
172 def _internal_parse(self, csource):
--> 173 ast, macros, csource = self._parse(csource)
174 # add the macros
175 self._process_macros(macros)
/Users/me/anaconda/lib/python3.4/site-packages/cffi/cparser.py in _parse(self, csource)
128 ast = _get_parser().parse(csource)
129 except pycparser.c_parser.ParseError as e:
--> 130 self.convert_pycparser_error(e, csource)
131 finally:
132 if lock is not None:
/Users/me/anaconda/lib/python3.4/site-packages/cffi/cparser.py in convert_pycparser_error(self, e, csource)
157 else:
158 msg = 'parse error\n%s' % (msg,)
--> 159 raise api.CDefError(msg)
160
161 def parse(self, csource, override=False, packed=False):
CDefError: cannot parse "extern __inline __attribute__((__gnu_inline__)) __attribute__ ((__always_inline__)) int __inline_isfinitef(float);"
:10:17: before: __attribute__
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment