AmericasWater / awash

America's Water AWASH Model
GNU General Public License v3.0
4 stars 6 forks source link

Allow multiple months of precipitation to go into each yield estimate #28

Closed jrising closed 7 years ago

jrising commented 7 years ago

The total production to use should then be the maximum over any year of whatever periods are in that year. Since the market is also saturated on a monthly timestep, this allows the whole agriculture and market system to work as almost-expected. We still should have agriculture just run on a different timestep, so it doesn't report producing yield every month, but that can wait for the agtimefix branch to be ready.

jrising commented 7 years ago

Do you want to sanity check this change? It's meant to calculate the precipitation for use in yields as the sum of the past 12 months of precipitation, producing that value as a rolling sum for each month.

LaurelineJ commented 7 years ago

Hi James, Sorry for my late reply. I just tried to run simulation on that branch for the standard configuration file (10 years at 2 stepsperyear). I am getting NaNs and negative precipitation. But I think this is only because the second cumulative sum is not performed on the second dimension :

rollingsum = cumsum(precip, 2) - cumsum([zeros(numcounties, stepsperyear) precip[:, 1:size(precip)[2] - stepsperyear]],2)

jrising commented 7 years ago

Oh, I feel dumb for missing that! Thanks!