void landuse_getInitBuildup(Project* project, TLandFactor* landFactor, double* initBuildup, double area, double curb) // // Input: landFactor = array of land use factors // initBuildup = total initial buildup of each pollutant // area = subcatchment's area (ft2) // curb = subcatchment's curb length (users units) // Output: modifies each land use factor's initial pollutant buildup // Purpose: determines the initial buildup of each pollutant on // each land use for a given subcatchment. // // Notes: Contributions from co-pollutants to initial buildup are not // included since the co-pollutant mechanism only applies to // washoff. // { int i, p; double startDrySeconds; // antecedent dry period (sec) double f; // faction of total land area double fArea; // area of land use (ft2) double fCurb; // curb length of land use double buildup; // pollutant mass buildup // --- convert antecedent dry days into seconds startDrySeconds = project->StartDryDays*SECperDAY; // --- examine each land use for (i = 0; i < project->Nobjects[LANDUSE]; i++) { // --- initialize date when last swept landFactor[i].lastSwept = project->StartDateTime - project->Landuse[i].sweepDays0; // --- determine area and curb length covered by land use f = landFactor[i].fraction; fArea = f * area * UCF(project,LANDAREA); fCurb = f * curb; // --- determine buildup of each pollutant for (p = 0; p < project->Nobjects[POLLUT]; p++) { // --- if an initial loading was supplied, then use it to // find the starting buildup over the land use buildup = 0.0; if ( initBuildup[p] > 0.0 ) buildup = initBuildup[p] * fArea; // --- otherwise use the land use's buildup function to // compute a buildup over the antecedent dry period else buildup = landuse_getBuildup(project,i, p, fArea, fCurb, buildup, startDrySeconds); landFactor[i].buildup[p] = buildup; } } }
void subcatch_getBuildup(int j, double tStep) // // Input: j = subcatchment index // tStep = time step (sec) // Output: none // Purpose: adds to pollutant buildup on subcatchment. // { int i; // land use index int p; // pollutant index double f; // land use fraction double area; // land use area (acres or hectares) double curb; // land use curb length (user units) double oldBuildup; // buildup at start of time step double newBuildup; // buildup at end of time step // --- consider each landuse for (i = 0; i < Nobjects[LANDUSE]; i++) { // --- skip landuse if not in subcatch f = Subcatch[j].landFactor[i].fraction; if ( f == 0.0 ) continue; // --- get land area (in acres or hectares) & curb length area = f * Subcatch[j].area * UCF(LANDAREA); curb = f * Subcatch[j].curbLength; // --- examine each pollutant for (p = 0; p < Nobjects[POLLUT]; p++) { // --- see if snow-only buildup is in effect if (Pollut[p].snowOnly && Subcatch[j].newSnowDepth < 0.001/12.0) continue; // --- use land use's buildup function to update buildup amount oldBuildup = Subcatch[j].landFactor[i].buildup[p]; newBuildup = landuse_getBuildup(i, p, area, curb, oldBuildup, tStep); newBuildup = MAX(newBuildup, oldBuildup); Subcatch[j].landFactor[i].buildup[p] = newBuildup; massbal_updateLoadingTotals(BUILDUP_LOAD, p, (newBuildup - oldBuildup)); } } }