Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Coupling Timestep not calculating correct for hourly data #103

Open
PhilippBuehler opened this issue Nov 27, 2017 · 1 comment
Open

Coupling Timestep not calculating correct for hourly data #103

PhilippBuehler opened this issue Nov 27, 2017 · 1 comment

Comments

@PhilippBuehler
Copy link

PhilippBuehler commented Nov 27, 2017

I'm getting this error running RVIC in hourly timesteps.

INFO:get_time_mode>> Coupling Timestep is (seconds): 3599.99999665
INFO:get_time_mode>> RVIC Timestep is (seconds): 86400.0

This problem seems to be (another) floating-point problem since the internal calculation does compute 1/24*8640 which ends up being an double instead of an int:

self.secs_per_step = (t1 - t0) * SECSPERDAY

I worked around it by rounding the result whoch gives me 3600 seconds :

        self.secs_per_step = round((t1 - t0) * SECSPERDAY)

See thecommit in my fork:
PhilippBuehler@8f333ce

I also created a pull request:
#104

I have to do additional testing of any of the other errors are related to my tweak (right now I'm getting ERROR:write>> local variable 'end_timestamp' referenced before assignment)

Philipp

@PhilippBuehler PhilippBuehler changed the title Convolution not working for hourly timesteps Coupling Timestep not calculating correct for hourly data Nov 27, 2017
@PhilippBuehler
Copy link
Author

I tried to make it work out, but the problem is deep within the code and the use of datenum which is not working out. One fix could be to change the internal time format to "hours since xxx" instead of "days since xxx", but this is marked in the function as "DO NOT CHANGE".. So there probably needs to be a bigger fix for this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant