The two months whose mid-month values bracket the given date, and the weight of the second, as in real.exe's monthly_interp_to_date: each monthly value is taken to apply on the 15th of its month, and values in between are interpolated linearly in time.
58 const int year = std::stoi(date.substr(0,4));
59 const int month = std::stoi(date.substr(5,2));
60 const int day = std::stoi(date.substr(8,2));
61 const int hour = std::stoi(date.substr(11,2));
63 const bool leap = (year % 4 == 0 && year % 100 != 0) || (year % 400 == 0);
64 const int days_in_month[12] = {31, leap ? 29 : 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
69 for (
int m = 0; m < 12; ++m) {
71 start += days_in_month[m];
73 const int days_in_year = start;
75 for (
int m = 0; m < month-1; ++m) { doy += days_in_month[m]; }
78 if (
t < mid[0] ||
t >= mid[11]) {
85 w1 = (tt -
t0) / (t1 -
t0);
88 while (
t >= mid[m0+1]) { ++m0; }
90 w1 = (
t - mid[m0]) / (mid[m1] - mid[m0]);
@ t
Definition: ERF_WSM6.H:293
real(c_double), parameter t0
Definition: ERF_module_model_constants.F90:39