/*This version has no age specific mortality; data is store in a 3-D array of pointers with two times - t= 0 for the working copy which is changed within a step and t= 1 for the copy which is updated only at the end of a step*/ #define PI 3.141592654 #define EVER ;; #define MAXSP 7 #define MAXSTRING 120 #define NEIGHBORS 8 #define DISPERSE 0.5 #define NODEBUG #define NOSCREENIO #define ANSI #define UNIX #define STARTHIGH extern FILE *fpin, *fpout; struct Plant { long seed[MAXSP]; /*number of seeds in a cell of a given sp.*/ int adult[1]; /*sp of adult in a cell*/ int reproduce[1]; int origx[1]; /*origin of adult*/ int origy[1]; int sdlng[MAXSP]; /*number of seeds in a cell of a given sp.*/ }; struct Lifehist { int species[MAXSP]; /*species designation*/ double seedsurv[MAXSP]; /*propertion of seeds surviving between time steps*/ double germrate[MAXSP]; /*proportion of seeds germinating in an open cell*/ double seedvar[MAXSP]; /*variance of seed density estimates*/ double seedb0[MAXSP]; /*intercept for model of seed density elevation relationship*/ double seedb1[MAXSP]; /*linear slope parameter for model of seed density elevation relationship*/ double seedb2[MAXSP]; /*quadratic slope parameter for model of seed density elevation relationship*/ int seedprod[MAXSP]; /*number of seeds produced per cell*/ int longdisp[MAXSP]; /*1 indicates the capacity to disperse outside neighborhood*/ int peren[MAXSP]; /*1 indicates a perenial sp*/ int rhizome[MAXSP]; /*1 indicates a rhizomatous sp*/ double depthmean[MAXSP]; /*depth tolerances*/ double depthwidth[MAXSP]; }; struct Basin { double cellsize[1]; long area[1]; int buffer[1]; int xmax[1]; int ymax[1]; double zmin[1]; double zmax[1]; double xyratio[1]; double curve[1]; int watercos[1]; /*1 activates cos water function*/ double yearint[1]; /*the annual drop in water level in m*/ double drawint[1]; /*the max range in between year water level in m*/ int drawfreq[1]; /*period between drawdowns in years*/ }; struct Run { char runname[4]; char watername[20]; char basinname[20]; char adultname[20]; int runlength[1]; int h2olength[1]; int waterfile[1]; int basinfile[1]; int adultfile[1]; int writebasin[1]; int writeadult[1]; int showrun[1]; int showplant[1]; int showadult[1]; int showbasin[1]; int showwater[1]; double maxrhiz[1]; /*max distance a rhizome can grow in a time step*/ }; struct Summary { int yr[1]; int richness[1]; int cells[MAXSP]; }; struct Local { int sp[1]; int x[1]; int y[1]; int t[1]; }; struct Time { long init[1]; long hours[1]; long minutes[1]; long seconds[1]; }; void AgeSeed(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant), CheckRunParam(struct Basin *basin, struct Lifehist *lifehist, struct Run *run), DisperseVege(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo, double *water), Germinate(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo, double *water), GetAdults(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo, double *water), GetBasinParams(struct Basin *basin), GetBasinTopo(double **topo, struct Basin *basin), GetDepth(struct Basin *basin, struct Run *run, double **topo, double *water, double *depth, int x, int y), GetElev(struct Basin *basin, struct Run *run, double **topo, double *z, int x, int y), GetFilename(char *filename), GetFilenameDate(struct Run *run, char filename[], int year), GetNeighbors(struct Basin *basin, struct Local *local, int x, int y), GetProb(double *probptr, int *adltptr, double *dpthptr), GetRunParam(struct Basin *basin, struct Lifehist *lifehist, struct Run *run), GetSize(struct Basin *basin), GetNewRunlength(struct Run *run), GetWaterElev(struct Basin *basin, double *water, int step), GetWaterRegime(double *h20regime, struct Run *run), InitAdults(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo, double *water), InitSeeds(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo), KillAnnuals(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant), KillSeedling(struct Basin *basin, struct Plant ***plant), MemStep(struct Basin *basin, struct Plant ***plant), OpenFile(char *filename, char *mode), PrintTime(long time), ScreenPause(void), SelectAdult(struct Basin *basin, struct Plant ***plant), ShowAdult(struct Basin *basin, struct Plant ***plant, struct Run *run, double **topo, double *water), ShowBasin(struct Basin *basin, struct Run *run, double **topo), ShowPlant(struct Basin *basin, struct Plant ***plant, struct Run *run), ShowRunParam(struct Basin *basin, struct Lifehist *lifehist, struct Run *run), WaterDeath(struct Basin *basin, struct Lifehist *lifehist, struct Plant ***plant, struct Run *run, double **topo, double *water), WriteAdult(struct Basin *basin, struct Plant ***plant, struct Run *run, int year, double **topo, double *water), WriteBasin(struct Basin *basin, struct Run *run, double **topo);