iterateyear - PIK-LPJmL/LPJmL GitHub Wiki
Time loop over tstart
to tend
with in iterate.c:
iterate()
{
for(year=config->firstyear-config->nspinup;year<=config->lastyear;year++) {
co2=getco2();
getclimate();
if(landuse) getlanduse(); /* reads landuse data for specific year, cft frac and irrigation frac*/
if(wateruse) getwateruse();
if(config->river_routing) iterateyear_river(); else iterateyear(); /* one year over all grid cells */
flux_sum();
if(year==config.restartyear) fwriterestart();
}
}
Yearly update of LPj grid in iterateyear.c:
iterateyear()
{
for(cell=0;cell<config.ngridcell;cell++) {
init_annual();
foreachmonth(month) {
foreachdayofmonth(dayofmonth,month)
update_daily(); /* daily update of individual cell ? foreachstand() ? daily_stand() is a makro expansion which applies different functions for different standtypes, it calls daily_natural, daily_agriculture, ... */
update_monthly();
}
update_annual();
}
}