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

Function _sxw_sw_setup unnecessarily calls SW_VPD_init #335

Closed
dschlaep opened this issue Jul 8, 2019 · 2 comments
Closed

Function _sxw_sw_setup unnecessarily calls SW_VPD_init #335

dschlaep opened this issue Jul 8, 2019 · 2 comments
Assignees
Labels
enhancement in progress Task is currently in progress
Milestone

Comments

@dschlaep
Copy link
Member

dschlaep commented Jul 8, 2019

The SOILWAT2 function SW_VPD_init is called by _begin_year which in turn is called by SW_CTL_run_current_year. That the function _begin_year calls SW_VPD_init is "new" since SOILWAT2 incorporated CO2-effects (commit DrylandEcology/SOILWAT2@1755c28 merged into v3.5.0).

Thus, the STEPWAT2 function _sxw_sw_setup no longer needs to call SW_VPD_init because it will be called anyhow in due time by SOILWAT2.

--> suggested fix: remove the call to SW_VPD_init from function _sxw_sw_setup

This should make a run ever so slightly faster as we remove one of two yearly calls to SW_VPD_init which loops seven times through each day of the year for each of the four SOILWAT2 vegetation types...

@dschlaep dschlaep added enhancement in progress Task is currently in progress labels Jul 8, 2019
@dschlaep dschlaep added this to the feature_space milestone Jul 8, 2019
@dschlaep dschlaep self-assigned this Jul 8, 2019
dschlaep added a commit that referenced this issue Jul 8, 2019
…D_init`

- close #335

The `SOILWAT2` function `SW_VPD_init` is called by `_begin_year` which in turn is called by `SW_CTL_run_current_year`. That the function `_begin_year` calls `SW_VPD_init` is "new" since `SOILWAT2` incorporated CO2-effects (commit DrylandEcology/SOILWAT2@1755c28 merged into [v3.5.0](https://github.com/DrylandEcology/SOILWAT2/releases/tag/v3.5.0)).

Thus, the `STEPWAT2` function `_sxw_sw_setup` no longer needs to call `SW_VPD_init` because it will be called anyhow in due time by `SOILWAT2`.

- this commit does not change testing output
@dschlaep
Copy link
Member Author

dschlaep commented Jul 8, 2019

closed by 35f66d1

@dschlaep dschlaep closed this as completed Jul 8, 2019
@kpalmqui
Copy link
Member

kpalmqui commented Jul 8, 2019

@dschlaep thanks for catching this and documenting!

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

No branches or pull requests

2 participants