#include #include "delta.h" /*************************************************************************** ShowAdult() This function displays adult in a cell. Arguments: struct Plant ***plant location of plant pointer array struct Basin *basin location of basin parameters struct Run *run location of run parameters Return Value: void ****************************************************************************/ void ShowAdult(struct Basin *basin, struct Plant ***plant, struct Run *run, double **topo, double *water) { int x, y, adult; char code[MAXSP] = {"0RPSVTA"}; double depth; if(run->showadult[0]) { #ifdef UNIX if(basin->xmax[0] > 150 || basin->ymax[0] > 155) { #else if(basin->xmax[0] > 73 || basin->ymax[0] > 21) { #endif printf("\nMatrix exceeds screen space."); printf("\nxmax must be less than 16 and ymax must be less than 21"); printf("\n xmax = %d\n ymax = %d",basin->xmax[0], basin->ymax[0]); } else { printf("\n"); for (y = 0; y < basin->ymax[0]; y++) { for (x = 0; x < basin->xmax[0]; x++) { #ifdef ANSI adult = plant[x][y][0].adult[0]; GetDepth(basin, run, topo, water, &depth, x, y); if(depth > 0.7) {/*don't show plant when depth is > 0.7 m */ adult = 0; } if(adult) { if(adult == -9999) printf("*"); else printf("%c",code[adult]); } else { printf(" "); } #else textbackground( plant[x][y][0].adult[0]); cprintf("%4d ", plant[x][y][0].adult[0]); #endif } printf("\n"); } ScreenPause(); } } } /*************************************************************************** ShowBasin() This function calculates a z value for a given (x,y) pair. Arguments: struct Basin *basin pointer to basin parameters Return Value: void ****************************************************************************/ void ShowBasin(struct Basin *basin, struct Run *run, double **topo) { double d; int x, y, z; if(run->showbasin[0]) { printf("\n\nHere's the basin, kids: \n"); for (y = 0; y < basin->ymax[0]; y++) { for (x = 0; x < basin->xmax[0]; x++) { GetElev(basin, run, topo, &d, x, y); printf("\t%4.2f", d); } printf("\n"); } } } /*************************************************************************** ShowPlant() This function displays values in the plant structure in a table of matrices with three columns (adults, seedlings seeds) and MAXMEM rows. Arguments: struct Plant ***plant location of plant pointer array struct Basin *basin location of basin parameters struct Run *run location of run parameters Return Value: void ****************************************************************************/ void ShowPlant(struct Basin *basin, struct Plant ***plant, struct Run *run) { int x, y, t; if(run->showplant[0]) { if(basin->xmax[0] > 5 || basin->ymax[0]*2 > 18) { printf("\nMatrix exceeds screen space."); printf("\nxmax must be less than 5 and ymax * 2 must be less than 18"); printf("\n xmax = %d\n ymax = %d\n",basin->xmax[0], basin->ymax[0]); } else { printf("\n"); for(t=0; t < 2; t++) { for(y=0; y < basin->ymax[0]; y++) { for(x=0; x < basin->xmax[0]; x++) { printf("%4d", plant[x][y][t].adult[0]); } printf(" ##"); for(x=0; x < basin->xmax[0]; x++) { printf("%4d", plant[x][y][t].reproduce[0]); } printf(" ##"); for(x=0; x < basin->xmax[0]; x++) { printf("%4d", plant[x][y][t].seed[4]); } printf("\n"); } printf("\n"); } ScreenPause(); } } } /*************************************************************************** ShowRunParam() This function shows the parameters for a model run. Arguments: struct Run *runprm pointer to run parameter struct struct Basin *basin pointer to basin parameter struct struct Lifehist *lifehist pointer to life history struct Return Value: void ****************************************************************************/ void ShowRunParam(struct Basin *basin, struct Lifehist *lifehist, struct Run *run) { int i; if(run->showrun[0]) { printf("\nrunname =\t"); for(i=0; i < 4; i++) { printf("%c",run->runname[i]); } printf("\nrunlength =\t%3d qtrs.", run->runlength[0]); printf("\nwaterfile =\t%3d .", run->waterfile[0]); printf("\nmaxrhiz =\t%7.3f", run->maxrhiz[0]); printf("\nwritebasin =\t%3d", run->writebasin[0]); printf("\nwriteadult =\t%3d", run->writeadult[0]); printf("\nshowrun =\t%3d", run->showrun[0]); printf("\nshowplant =\t%3d", run->showplant[0]); printf("\nshowadult =\t%3d", run->showadult[0]); printf("\nshowwater =\t%3d", run->showwater[0]); printf("\nshowbasin =\t%3d", run->showbasin[0]); printf("\ncellsize =\t%7.3f m", basin->cellsize[0]); printf("\narea =\t\t%3ld m^2", basin->area[0]); printf("\nbuffer =\t%3d cells", basin->buffer[0]); printf("\nzmin =\t\t%7.3f m", basin->zmin[0]); printf("\nzmax =\t\t%7.3f m", basin->zmax[0]); printf("\nxyratio =\t%7.3f", basin->xyratio[0]); printf("\ncurve =\t\t%7.3f", basin->curve[0]); printf("\nwatercos =\t%3d", basin->watercos[0]); printf("\nminwater =\t%7.3f m", basin->yearint[0]); printf("\ndrawint =\t%7.3f", basin->drawint[0]); printf("\ndrawfreq =\t%3d years", basin->drawfreq[0]); ScreenPause(); printf("\n\n\t\tSdSurv\tGrmRte\tSdMin\tSdMax\tDpthMn\tDpthWdth"); for(i=0; i < MAXSP; i++) { printf("\nSpecies %d:\t%6.2f\t%6.2f\t%6.2f\t%6.2f", lifehist->species[i], lifehist->seedsurv[i], lifehist->germrate[i], lifehist->depthmean[i], lifehist->depthwidth[i]); } printf("\n\n\t\tintbnk\tsdprd\tlngdsp\tperen\trhiz"); for(i=0; i < MAXSP; i++) { printf("\nspecies %d:\t%4d%4d\t%4d\t%4d", lifehist->species[i], lifehist->seedprod[i], lifehist->longdisp[i], lifehist->peren[i], lifehist->rhizome[i]); } ScreenPause(); } }