void climate_initState() // // Input: none // Output: none // Purpose: initializes climate state variables. // { LastDay = NO_DATE; Temp.tmax = MISSING; Snow.removed = 0.0; NextEvapDate = StartDate; NextEvapRate = 0.0; // --- initialize variables for time series evaporation if ( Evap.type == TIMESERIES_EVAP && Evap.tSeries >= 0 ) { // --- initialize NextEvapDate & NextEvapRate to first entry of // time series whose date <= the simulation start date table_getFirstEntry(&Tseries[Evap.tSeries], &NextEvapDate, &NextEvapRate); if ( NextEvapDate < StartDate ) { setNextEvapDate(StartDate); } Evap.rate = NextEvapRate / UCF(EVAPRATE); // --- find the next time evaporation rates change after this setNextEvapDate(NextEvapDate); } }
void climate_initState() // // Input: none // Output: none // Purpose: initializes climate state variables. // { LastDay = NO_DATE; Temp.tmax = MISSING; Snow.removed = 0.0; NextEvapDate = StartDate; NextEvapRate = 0.0; // --- initialize variables for time series evaporation if ( Evap.type == TIMESERIES_EVAP && Evap.tSeries >= 0 ) { // --- initialize NextEvapDate & NextEvapRate to first entry of // time series whose date <= the simulation start date table_getFirstEntry(&Tseries[Evap.tSeries], &NextEvapDate, &NextEvapRate); if ( NextEvapDate < StartDate ) { setNextEvapDate(StartDate); } Evap.rate = NextEvapRate / UCF(EVAPRATE); // --- find the next time evaporation rates change after this setNextEvapDate(NextEvapDate); } //// Following section added to release 5.1.010. //// //(5.1.010) // --- initialize variables for temperature evaporation if ( Evap.type == TEMPERATURE_EVAP ) { Tma.maxCount = sizeof(Tma.ta) / sizeof(double); Tma.count = 0; Tma.front = 0; Tma.tAve = 0.0; Tma.tRng = 0.0; } //// }
void climate_setState(DateTime theDate) // // Input: theDate = simulation date // Output: none // Purpose: sets climate variables for current date. // { if ( Fclimate.mode == USE_FILE ) updateFileValues(theDate); if ( Temp.dataSource != NO_TEMP ) setTemp(theDate); setEvap(theDate); setWind(theDate); Adjust.rainFactor = Adjust.rain[datetime_monthOfYear(theDate)-1]; //(5.1.007) Adjust.hydconFactor = Adjust.hydcon[datetime_monthOfYear(theDate)-1]; //(5.1.008) setNextEvapDate(theDate); //(5.1.008) }