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
Fixing the sum comparison #753
Comments
@PhilippBuehler - please provide the requested issue information. |
@jhamman edited it |
@PhilippBuehler -can you run with the code on the develop branch - make sure to rebuild the code. I think we already fixed this: https://github.com/UW-Hydro/VIC/blob/develop/vic/drivers/shared_image/src/vic_init.c#L1230-L1241 xref: #701 |
I tried with the developer branch again and the same error:
The errormessage occurs for all gridcells which arent exactly 1(int). (See my StackOverflow Problem) |
@PhilippBuehler - It seems this section of code may not be doing what we intended: VIC/vic/drivers/shared_image/src/vic_init.c Lines 1232 to 1241 in 26f8831
I'll mark this as a bug but it would be great if you can dig into this a bit more and figure out why VIC is making it into this Also, just to be clear, this is just a warning -- not an error. The model should be otherwise functioning normally despite printing this message. |
I pushed some changes into my fork: Read there about the changes. I hope I did everything right with GitHub, everything here is pretty new for me. Philipp |
@PhilippBuehler - you'll need to open a pull request. A general comment though, I think |
|
@PhilippBuehler - what dataset are you working with? My suspicion is that your |
You mean
I produced my own dataset with the nlcd_2011_landcover data to get small resolution grids. And again reffering you to my StackOverflow problem, maybe it helps clearing things up. |
VIC-Version:
VIC 5.0.1 and Developer version
OS and compiler:
Ubuntu + gcc
Model settings:
default
Error message:
[WARN] ../shared_image/src/vic_init.c:1235: errno: Numerical argument out of domain: Cv != 1.0 (1.000000) at grid cell 0. Exiting ...
Description
This error message shouldn't appear since the input argument are doubles, so the sum can sometimes not be exactly 1:
Eventually compare within a tolerance of 1% ?
I also have a StackOverflow question open regarding that topic:
https://stackoverflow.com/questions/46942196/sum-of-fractions-of-1-not-exactly-equally-1
The text was updated successfully, but these errors were encountered: