@@ -327,7 +327,7 @@ private static Dayfilerec GetDayRecFromMonthly(DateTime date)
327327
328328 var startTime = date ;
329329 var endTime = IncrementMeteoDate ( date ) ;
330- var startTimeMinus1 = startTime . AddDays ( - 1 ) ;
330+ var startTimeMinus1 = DecrementMeteoDate ( date ) ;
331331
332332 // get the monthly log file name
333333 var fileName = GetLogFileName ( startTimeMinus1 ) ;
@@ -431,7 +431,7 @@ private static Dayfilerec GetDayRecFromMonthly(DateTime date)
431431
432432 // are we within 24 hours of the start time?
433433 // if so initialise the 24 hour rain process
434- if ( entrydate >= startTimeMinus1 && entrydate < = startTime )
434+ if ( entrydate >= startTimeMinus1 && entrydate > = startTime )
435435 {
436436
437437 // logging format changed on with C1 v1.9.3 b1055 in Dec 2012
@@ -834,7 +834,10 @@ private static Dayfilerec GetDayRecFromMonthly(DateTime date)
834834 //var rolloverRain = double.Parse(st[9]); // 9 - rain so far today
835835 var rolloverRaincounter = double . Parse ( st [ 11 ] , inv ) ; // 11 - rain counter
836836
837- rec . TotalRain += ( rolloverRaincounter - lastentrycounter ) * cumulus . CalibRainMult ;
837+ if ( rolloverRaincounter > lastentrycounter )
838+ {
839+ rec . TotalRain += ( rolloverRaincounter - lastentrycounter ) * cumulus . CalibRainMult ;
840+ }
838841
839842
840843 //if (rolloverRain > 0)
@@ -1397,6 +1400,11 @@ private static DateTime IncrementMeteoDate(DateTime thedate)
13971400 return SetStartTime ( thedate . AddDays ( 1 ) ) ;
13981401 }
13991402
1403+ private static DateTime DecrementMeteoDate ( DateTime thedate )
1404+ {
1405+ return SetStartTime ( thedate . AddDays ( - 1 ) ) ;
1406+ }
1407+
14001408 private static bool GetUserConfirmation ( string msg )
14011409 {
14021410 do
0 commit comments