void parm_Initialize( Int iter) { /*======================================================*/ static Bool beenhere = FALSE; char filename[FILENAME_MAX]; if (beenhere) { if (BmassFlags.yearly) { sprintf(filename, "%s%0*d.out", Parm_name(F_BMassPre), Globals.bmass.suffixwidth, iter); if (Globals.bmass.fp_year != NULL) { LogError(logfp, LOGFATAL, "Programmer error: " "Globals.bmass.fp_year not null" " in parm_Initialize()"); } Globals.bmass.fp_year = OpenFile(filename, "w"); fprintf(Globals.bmass.fp_year, "%s\n", Globals.bmass.header_line); } if (MortFlags.yearly) { sprintf(filename, "%s%0*d.out", Parm_name(F_MortPre), Globals.mort.suffixwidth, iter); if (Globals.mort.fp_year != NULL) { LogError(logfp, LOGFATAL, "Programmer error: " "Globals.mort.fp_year not null" " in parm_Initialize()"); } Globals.mort.fp_year = OpenFile(filename, "w"); fprintf(Globals.mort.fp_year, "%s\n", Globals.mort.header_line); } } else { _globals_init(); _files_init(); _model_init(); _env_init(); _plot_init(); _bmassflags_init(); _mortflags_init(); _rgroup_init(); _species_init(); _check_species(); _bmasshdr_init(); _morthdr_create(); RandSeed(Globals.randseed); /* _recover_names(); */ beenhere = TRUE; } }
void plot_init(int width, int height, int levels, char *term) { if(!term) term = term_default; if(0) ; #ifdef PLOTX11 else if(strcmp(term, "x11") == 0) { _plot_init = x11plot_init; _plot_point = x11plot_point; _plot_line = x11plot_line; _plot_finish = x11plot_finish; } else if(strcmp(term, "X11") == 0) { _plot_init = X11plot_init; _plot_point = X11plot_point; _plot_line = X11plot_line; _plot_finish = X11plot_finish; } #endif #ifdef WIN32 else if(strcmp(term, "win") == 0) { _plot_init = winplot_init; _plot_point = winplot_point; _plot_line = winplot_line; _plot_finish = winplot_finish; } else if(strcmp(term, "Win") == 0) { _plot_init = Winplot_init; _plot_point = Winplot_point; _plot_line = Winplot_line; _plot_finish = Winplot_finish; } #endif #ifdef PLOTVGA else if(strcmp(term, "vga") == 0) { _plot_init = vgaplot_init; _plot_point = vgaplot_point; _plot_line = vgaplot_line; _plot_finish = vgaplot_finish; } #endif else if(strcmp(term, "ps") == 0) { _plot_init = psplot_init; _plot_point = psplot_point; _plot_line = psplot_line; _plot_finish = psplot_finish; } else if(strcmp(term, "pgm") == 0) { _plot_init = pgmplot_init; _plot_point = pgmplot_point; _plot_line = plot_line_internal; _plot_finish = pgmplot_finish; } else if(strcmp(term, "raw") == 0) { _plot_init = rawplot_init; _plot_point = rawplot_point; _plot_line = plot_line_internal; _plot_finish = rawplot_finish; } else if(strcmp(term, "none") == 0) { _plot_init = none_init; _plot_point = none_point; _plot_line = none_line; _plot_finish = none_finish; } else { plot_init(width, height, levels, term_default); return; } _plot_init(width, height, levels); plot_levels = levels; plot_width = width; plot_height = height; plot_xmin = 0.0; plot_xmax = width - 1; plot_ymin = height - 1; plot_ymax = 0.0; }