-
Notifications
You must be signed in to change notification settings - Fork 405
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
Feature/clean up esoil #777
Conversation
845cca0
to
d071912
Compare
This looks good to me. Let's sort out #779 before we merge this though. |
vic/vic_run/src/canopy_evap.c
Outdated
evaporation is taken from the wetter layer. Otherwise layers | ||
contribute to evapotransipration based on root fraction. | ||
transpiration is taken from the wetter layer. Otherwise layers | ||
contribute to transipration based on root fraction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transipration --> transpiration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will fix.
vic/vic_run/src/canopy_evap.c
Outdated
@@ -494,32 +495,32 @@ transpiration(layer_data_struct *layer, | |||
} | |||
|
|||
/**************************************************************** | |||
Check that evapotransipration does not cause soil moisture to | |||
Check that transipration does not cause soil moisture to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
transipration --> transpiration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
OK, will fix.
transp[i] = layer[i].evap; | ||
layer[i].evap = 0.; | ||
} | ||
for (i=0; i<options.Nlayer; i++) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
did you already run uncrustify? this line has some formatting issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'll fix it by hand. Unfortunately, when I run uncrustify on my system, using the provided config file, it makes a ton of unwanted changes in files that I've never touched. Not sure why.
Evap = 0.; | ||
if (!SNOWING) { | ||
if (VEG && veg_var->fcanopy > 0) { | ||
Evap = canopy_evap(layer, veg_var, true, veg_class, Wdew, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not taking issue with this, but I don't understand the motivation behind separating out the (!SNOWING)
from the VEG
and veg_var->fcanopy
into separate lines?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I minimized redundant code. If you start with a condition that links the 3 conditions VEG
, !SNOWING
, and fcanopy > 0
, you'll necessarily need further compound conditions later on to handle all possible cases. The most important case is simply !SNOWING
. If it is snowing, Evap
is 0
. So, I separated that from the other conditions. Then, the nested check on VEG
and fcanopy > 0
determines whether we call canopy_evap()
and how SurfRad
is set. Note: I'm now removing lines 782-784, since they were redundant with my initialization of Evap
to 0 on line 751.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it - thanks for clarifying
veg_var->throughfall; | ||
veg_var->canopyevap *= veg_var->fcanopy; | ||
veg_var->Wdew *= veg_var->fcanopy; | ||
SurfRad = surf_atten*NetBareRad; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
more formatting issues
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix by hand (see previous formatting comment).
This looks good to me, just a few small comments and a question. Also it looks like |
d864718
to
edf426f
Compare
Just to reiterate, I can't run |
I run |
Understood. |
OK, fixed the uncrustify issue on my machine, and have run uncrustify on the code. |
outflow, | ||
storage, | ||
save_data-> | ||
total_moist_storage); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this reformatting looks off to me
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, the original exceeded the 80-character limit, as far as I can tell, so it looks to me like the reformatting did the right thing in that respect... How exactly should it look?
I could change it by hand but then uncrustify might attempt to change it again in future PRs...
@tbohn looks good to me, I just had one small comment where the formatting looks funky |
…en reformatted by uncrustify in a weird way.
I went ahead and changed the formatting by hand anyway. |
I think this all looks good. @jhamman? |
Description: