You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// If locEvent starts off NULL, this function will just fall through, as it should.
2286
-
constintyear=climate->year;
2287
-
constintday=climate->day;
2288
-
2289
-
// The events file has been tested on read, so we know this event list should be in chrono
2290
-
// order. However, we need to check to make sure the current event is not in the past, as
2291
-
// that would indicate an event that did not have a corresponding climate file record.
2292
-
while (locEvent!=NULL&&locEvent->year <= year&&locEvent->day <= day) {
2293
-
if (locEvent->year<year||locEvent->day<day) {
2294
-
printf("Agronomic event found for loc: %d year: %d day: %d that does not have a corresponding record in the climate file\n", locEvent->year, locEvent->year, locEvent->day);
2295
-
exit(1);
2296
-
}
2297
-
switch (locEvent->type) {
2298
-
// Implementation TBD, as we enable the various event types
2299
-
caseIRRIGATION:
2300
-
// TBD
2301
-
printf("Irrigation events not yet implemented\n");
2302
-
break;
2303
-
casePLANTING:
2304
-
// TBD
2305
-
printf("Planting events not yet implemented\n");
2306
-
break;
2307
-
caseHARVEST:
2308
-
// TBD
2309
-
printf("Harvest events not yet implemented\n");
2310
-
break;
2311
-
caseTILLAGE:
2312
-
// TBD
2313
-
printf("Tillage events not yet implemented\n");
2314
-
break;
2315
-
caseFERTILIZATION:
2316
-
// TBD
2317
-
printf("Fertilization events not yet implemented\n");
2318
-
break;
2319
-
default:
2320
-
printf("Unknown event type (%d) in processEvents()\n", locEvent->type);
2321
-
exit(1);
2322
-
}
2285
+
// If locEvent starts off NULL, this function will just fall through, as it should.
2286
+
constintyear=climate->year;
2287
+
constintday=climate->day;
2288
+
2289
+
// The events file has been tested on read, so we know this event list should be in chrono
2290
+
// order. However, we need to check to make sure the current event is not in the past, as
2291
+
// that would indicate an event that did not have a corresponding climate file record.
2292
+
while (locEvent!=NULL&&locEvent->year <= year&&locEvent->day <= day) {
2293
+
if (locEvent->year<year||locEvent->day<day) {
2294
+
printf("Agronomic event found for loc: %d year: %d day: %d that does not have a corresponding record in the climate file\n", locEvent->year, locEvent->year, locEvent->day);
2295
+
exit(1);
2296
+
}
2297
+
switch (locEvent->type) {
2298
+
// Implementation TBD, as we enable the various event types
2299
+
caseIRRIGATION:
2300
+
// TBD
2301
+
printf("Irrigation events not yet implemented\n");
2302
+
break;
2303
+
casePLANTING:
2304
+
// TBD
2305
+
printf("Planting events not yet implemented\n");
2306
+
break;
2307
+
caseHARVEST:
2308
+
// TBD
2309
+
printf("Harvest events not yet implemented\n");
2310
+
break;
2311
+
caseTILLAGE:
2312
+
// TBD
2313
+
printf("Tillage events not yet implemented\n");
2314
+
break;
2315
+
caseFERTILIZATION:
2316
+
// TBD
2317
+
printf("Fertilization events not yet implemented\n");
2318
+
break;
2319
+
default:
2320
+
printf("Unknown event type (%d) in processEvents()\n", locEvent->type);
2321
+
exit(1);
2322
+
}
2323
2323
2324
-
locEvent=locEvent->nextEvent;
2325
-
}
2324
+
locEvent=locEvent->nextEvent;
2325
+
}
2326
2326
#endif
2327
2327
}
2328
2328
@@ -2332,7 +2332,7 @@ void processEvents() {
2332
2332
// calculate all fluxes and update state for this time step
2333
2333
// we calculate all fluxes before updating state in case flux calculations depend on the old state
2334
2334
voidupdateState() {
2335
-
doublenpp; // net primary productivity, g C * m^-2 ground area * day^-1
2335
+
doublenpp; // net primary productivity, g C * m^-2 ground area * day^-1
2336
2336
doubleoldSoilWater; // how much soil water was there before we updated it? Used in trackers
2337
2337
interr;
2338
2338
oldSoilWater=envi.soilWater;
@@ -2341,40 +2341,39 @@ void updateState() {
2341
2341
2342
2342
// update the stocks, with fluxes adjusted for length of time step:
0 commit comments