-
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
Miscellaneous clean-up and minor fixes. #723
Conversation
tbohn
commented
Jul 11, 2017
•
edited
Loading
edited
- closes Add support for veg_hist forcings (non-climatological) #404, Possibly unnecessary logic in nveg and nv_active relationship in drivers/shared_image #705, Cleanup: miscellaneous cleanup of vic_run #722, Cleanup: How to optimize static array limits MAX_VEG, MAX_BAND, etc #759, Cleanup: Change forcing variable LAI_IN to LAI #763, Cleanup: Change netcdf names for vegetation forcing variables fcanopy and albedo #764
- tests passed
- new tests added
- science test figures
- ran uncrustify prior to final commit
- ReleaseNotes entry
Thanks @tbohn. Can you update your branch with the updates I merged in to |
Actually, @jhamman @dgergel and @bartnijssen can you hold on a little bit? The pull request isn't final yet; I may make another simplification. I will definitely merge the latest develop mods into my branch too. I'll let you know when this is ready. Thanks! |
@tbohn sure. Just let me know when it's ready. |
…ell_data and energy_bal structs (removed loop over bands).
c857d47
to
acb99ae
Compare
vic/vic_run/include/vic_run.h
Outdated
double penman(double, double, double, double, double, double, double); | ||
void photosynth(char, double, double, double, double, double, double, double, | ||
double, double, char *, double *, double *, double *, double *, | ||
double *); | ||
void polint(double xa[], double ya[], int n, double x, double *y, double *dy); | ||
void prepare_full_energy(int, all_vars_struct *, soil_con_struct *, double *, | ||
void prepare_full_energy(cell_data_struct *, energy_bal_struct *, | ||
soil_con_struct *, double *, | ||
double *); |
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.
The change to prepare_full_energy() is the only non-format modification. The rest of the changes in vic_run.h came from running uncrustify.
…e consistent with vic_init.c
…located using these terms with dynamically allocated arrays.
…R. Updated netcdf names of forcing variables from fcan and alb to fcanopy and albedo.
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.
@@ -218,7 +218,7 @@ The following options describe the input parameter files. | |||
| VEGPARAM_ALB | string | TRUE or FALSE | If TRUE the vegetation parameter file contains an extra line for each vegetation type that defines monthly ALBEDO values for each vegetation type for each grid cell. Default = FALSE. | | |||
| ALB_SRC | string | N/A | This option tells VIC where to look for ALBEDO values:FROM_VEGLIB = Use the ALBEDO values listed in the vegetation library file. FROM_VEGPARAM = Use the ALBEDO values listed in the vegetation parameter file. Note: for this to work, VEGPARAM_ALB must be TRUE.FROM_VEGHIST = Use the ALBEDO values listed in the veg_hist forcing files. Note: for this to work, ALBEDO must be supplied in the veg_hist files and listed in the global parameter file as one of the variables in the files. Default = FROM_VEGLIB. | | |||
| VEGPARAM_LAI | string | TRUE or FALSE | If TRUE the vegetation parameter file contains an extra line for each vegetation type that defines monthly LAI values for each vegetation type for each grid cell. Default = FALSE. | | |||
| LAI_SRC | string | N/A | This option tells VIC where to look for LAI values:FROM_VEGLIB = Use the LAI values listed in the vegetation library file.FROM_VEGPARAM = Use the LAI values listed in the vegetation parameter file. Note: for this to work, VEGPARAM_LAI must be TRUE.FROM_VEGHIST = Use the LAI values listed in the veg_hist forcing files. Note: for this to work, LAI_IN must be supplied in the veg_hist files and listd in the global parameter file as one of the variables in the files. Default = FROM_VEGLIB. | | |||
| LAI_SRC | string | N/A | This option tells VIC where to look for LAI values:FROM_VEGLIB = Use the LAI values listed in the vegetation library file.FROM_VEGPARAM = Use the LAI values listed in the vegetation parameter file. Note: for this to work, VEGPARAM_LAI must be TRUE.FROM_VEGHIST = Use the LAI values listed in the veg_hist forcing files. Note: for this to work, LAI must be supplied in the veg_hist files and listd in the global parameter file as one of the variables in the files. Default = FROM_VEGLIB. | |
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.
it looks like these typos were already present but can you add a space after values:
and after TRUE.
?
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, done.
@@ -176,7 +176,7 @@ The following options describe the input parameter files. | |||
| JULY_TAVG_SUPPLIED | string | TRUE or FALSE | If TRUE then VIC will expect an additional variable in the parameter file (July_Tavg) to contain the grid cell's average July temperature. *NOTE*: Supplying July average temperature is only required if the COMPUTE_TREELINE option is set to TRUE. <br><br>Default = FALSE. | | |||
| ORGANIC_FRACT | string | TRUE or FALSE | TRUE = the parameter file contains extra variables: the organic fraction, and the bulk density and soil particle density of the organic matter in each soil layer. FALSE = the parameter file does not contain any information about organic soil, and organic fraction should be assumed to be 0. <br><br>Default = FALSE. | | |||
| ALB_SRC | string | N/A | This option tells VIC where to look for ALBEDO values: if FROM_VEGLIB or FROM_VEGPARAM = Use the ALBEDO values from the parameter file.FROM_VEGPARAM = Use the ALBEDO values listed in the vegetation parameter file. If FROM_VEGHIST = Use the ALBEDO values from the veg_hist forcing files. Note: for this to work, ALBEDO must be supplied in the veg_hist files and listed in the global parameter file as one of the variables in the files. <br><br>Default = FROM_VEGLIB. | | |||
| LAI_SRC | string | N/A | This option tells VIC where to look for LAI values: FROM_VEGLIB = Use the LAI values listed in the vegetation library file.FROM_VEGPARAM = Use the LAI values listed in the vegetation parameter file. Note: for this to work, VEGPARAM_LAI must be TRUE.FROM_VEGHIST = Use the LAI values listed in the veg_hist forcing files. Note: for this to work, LAI_IN must be supplied in the veg_hist files and listd in the global parameter file as one of the variables in the files. Default = FROM_VEGLIB. | | |||
| LAI_SRC | string | N/A | This option tells VIC where to look for LAI values: FROM_VEGLIB = Use the LAI values listed in the vegetation library file.FROM_VEGPARAM = Use the LAI values listed in the vegetation parameter file. Note: for this to work, VEGPARAM_LAI must be TRUE.FROM_VEGHIST = Use the LAI values listed in the veg_hist forcing files. Note: for this to work, LAI must be supplied in the veg_hist files and listd in the global parameter file as one of the variables in the files. Default = FROM_VEGLIB. | |
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.
Add space in the middle of TRUE.FROM_VEGHIST
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, done.
else { | ||
log_warn("Sum of the snow band area fractions is 0, " | ||
"setting first fraction to 1\n%s", locstr); | ||
soil_con[i].AreaFract[0] = 1.; |
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 think if there were no fractions in the elevation dimension, then we should raise an error, no?
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, done.
…n snow band areas sum to 0.
Also, what type of comments should I add to ReleaseNotes.md? Should I describe all the code changes (briefly of course) or just the changes to the user interface (changed name of some variables/options)? |
I'll leave the content in the release note up to you. Look at what we wrote leading up to 5.0. |
Running so, I ran uncrustify via the |
… into feature/clean_up_vic_run
I've found a potential bug in my changes - nothing major; can fix it by moving a block of code. But please wait before merging this PR until I've properly fixed the problem. |
@tbohn - is this ready to go? |
yes, this is ready. |
@yixinmao - can you look into why these tests are failing now? Is it a Python library version issue? |
@tbohn : I briefly looked at the test results, and it seems like for the classic driver, there are some |
@yixinmao : strange, no, I don't know what is causing those NaNs. The only things I did were to (a) merge in the latest develop changes and (b) move a block of code to a different place in vic_run.c. It is, of course, possible that I caused the NaNs by doing so, although in my tests on my own machine those didn't occur. I'll take a look. |
@tbohn hmm weird. Did all tests pass on your machine? They do fail on mine the same way that travis tests fail (i.e., system test failure as well as out of time). Let me know what you find (or can't find). |
@yixinmao I wasn't referring to travis tests on my system; I was referring to tests at my own test sites. Another shortcoming of my tests, which is completely my fault, is that I was using a copy of my git repository for dev/testing, and then ported the changes into git. So there's a chance that the testing version of the code was fine but my port somehow messed things up. |
@tbohn OK. The tests failed on my local machine without travis (I fetched your branch directly). Do you think you could take a look to see what might be going on? It's probably faster than me looking from scratch. But if you still can't find anything, let me know and I can take a closer look. |
@yixinmao yes, I will take a look this afternoon - I don't expect you to do that investigation; it's my responsibility to debug it, I think. I only needed help earlier in understanding the nature of the travis errors (the messages were not clear to me). |
This looks good to me but I'd like @bartnijssen to give it a final look before merging. |