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

RVIC ignoring fraction #114

Open
ghuidobro opened this issue Aug 8, 2018 · 9 comments
Open

RVIC ignoring fraction #114

ghuidobro opened this issue Aug 8, 2018 · 9 comments

Comments

@ghuidobro
Copy link
Contributor

Hi, my issue is that I ran VIC (image driver, v 5.0.1) and RVIC (v 1.1.1) on my basin, and doing some comparisons I found that my resulting streamflow was greater than the sum of runoff and baseflow, and greater than the total precipitation, all this using the real area of the basin to convert those last ones from mm/day to m3/s.
When I changed the basin area to the greater one without considering the fraction of the border cells (an area 1.4 times bigger) I got a streamflow slightly smaller than the precipitation, and exactly the same than the sum of the runoff and the baseflow, which means that this was the area that the model was using.
Trying to debug the problem I found that RVIC is reading the fraction from the domain file in the parameter run (the parameters file has the correct area of the basin), and for the convolution run the part of the code that reads the domain is also reading the fraction. After that the code got too complicated to me (I don't know that much of python). I tried to see if the fractions were supposed to be used at some point during the calculations of the convolution itself but I couldn't find it.

Here are my configuration files in case they're useful:
rvic.parameters.rlp.txt
rvic.convolution.rlp.txt

And the log from the convolution file:
RVIC-20180808-040836.log.txt

(Sorry if I didn't explain myself well enough, or if there are spelling mistakes but english isn't my first language)

@jhamman
Copy link
Member

jhamman commented Aug 25, 2018

Are you using the remap option in RVIC's parameter module?

@ghuidobro
Copy link
Contributor Author

ghuidobro commented Aug 25, 2018 via email

@jhamman
Copy link
Member

jhamman commented Aug 28, 2018

Hmmm, I'm not sure why your setup isn't working as you would expect. I suggest looking at the diagnostic plots that RVIC generates during the parameters step and evaluating whether those make sense.

@ghuidobro
Copy link
Contributor Author

Thanks for making me look in the parameters step (I was looking in the convolution before), the plots had in fact some problems and the solution was a very small thing.

In the parameter configuration file I had the option "CONSTRAIN_FRACTIONS: False", because it said "# True when routing to coastal grid cells, else False" and I don't have coastal cells inside my basin (I thought that that's what it meant, maybe my english failed). But I set it to True and now the fraction created during the parameters step is the same as the one in the domain, and the streamflows generated in the convolution step are the right ones.

I thought that I've changed everything to see if something worked, but I must have missed that one.

@jhamman
Copy link
Member

jhamman commented Sep 4, 2018

Thanks for sticking with this @ghuidobro. I think it generally makes sense to use CONSTRAIN_FRACTIONS=TRUE as a default value. Would you be willing to update the documentation to this effect?

@ghuidobro
Copy link
Contributor Author

I'm not entirely sure of how to do that.
The change must be done here?:
https://github.com/UW-Hydro/RVIC/blob/master/docs/user-guide/parameters.md

You want me to delete "Note: True when routing to coastal grid cells, else False."?
Or change it to something like "Default: True"
I guess that that note must be there for some reason.

@jhamman
Copy link
Member

jhamman commented Sep 5, 2018

All my use cases have required constraining the fractions and I'm not aware of any specific applications that need the converse. So, yes, your proposed edits seem reasonable. It would be worth checking in the code to make sure there isn't a default=True value somewhere.

@ghuidobro
Copy link
Contributor Author

Ok, I've never done this so I hope it's ok.
I made a pull request, do you have to merge it?
#115
And I didn't get the last thing you said, what you wanted to be checked

@kwhitney727
Copy link

kwhitney727 commented Dec 29, 2021

@jhamman I have a related question/issue. I am also finding that the domain-wide sum of grid-cell runoff and baseflow volumes (volume computed as flux multiplied by grid-cell area and grid-cell fraction from the domain file) is less than the total streamflow produced at the main outlet (by about 10% in any given year). In my case, I am routing using nested basins and so I cannot use the "constrain_fractions" option (the documentation states that this variable "should be set to True unless routing is being done to nested basins, in which case, this should be set to False."). When I compute the domain-wide sum of runoff and baseflow volume without accounting for the grid-cell fraction (i.e., volume = flux * grid-cell area), the value is roughly equal to the domain-wide streamflow. So I believe the issue is that the source area fractions are not adjusted to account for the domain fraction values of the grid-cells along the edge of the basin (these cells have contributing cell fractions less than 1).

I've compared the diagnostic plots for the various fractions computed in RVIC (domain fractions, aggregated fractions, adjusted fractions, ratio fractions). It does see that "adjusted fractions" are the same as "aggregated fractions", not accounting for the basin boundary cells of fractions less than one (which can be seen in the "domain fractions" plot). Is there a way to adjust the fractions (e.g., set "constrain_fractions" to "True") to account for the domain fractions when using nested basins? I have attached my configuration (file prefix "cfg."), log (file prefix "log.") and diagnostic plot (file suffix ".png") files in case that helps. I appreciate any help you can provide, thank you!
cfg.rvic.convolution.txt
cfg.rvic.parameters.txt
log.rvic.convolution.txt
log.rvic.parameters.txt
adjusted_fractions_crb
uhs_before_subset_crb
domain_fractions_crb
ratio_fractions_crb
sum_uh_before_crb
sum_uh_final_crb
uhs_after_subset_crb
aggregated_fractions_crb

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

3 participants