You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Nov 30, 2022. It is now read-only.
How should we handle conditionally allocated variables in the BMI? PRMS has variables that are conditionally allocated. For example upslope_hortonian which is allocated depending on the state cascade_flag.
So in a BMI get_value call how should the return be handled when the variable is not allocated? And should the return status be SUCCESS or FAILURE if it's not allocated. Likewise if the variable was an input variable how should we handle the set_value call?
One possibility is
case('upslope_hortonian')
if(this%model%control_data%cascade_flag%value == 1) then
dest = [this%model%model_simulation%runoff%upslope_hortonian]
bmi_status = BMI_SUCCESS
else
dest(:) =-1.d0
bmi_status = BMI_SUCCESS
endif
The text was updated successfully, but these errors were encountered:
@rmcd-mscb I like what you've done. It causes the least amount of disruption, and minimizes changes to your BMI implementation.
The value of -1 is good; it matches what we use as a "bad" return from other BMI methods. Plus, if it was omitted, dest would return with numbers that may be mistaken for data.
I think get_value should return BMI_FAILURE if the variable is conditionally undefined. This would be in line with getting the value of any other undefined variable. Likewise for set_value.
@pnorton-usgs and @mdpiper
How should we handle conditionally allocated variables in the BMI? PRMS has variables that are conditionally allocated. For example upslope_hortonian which is allocated depending on the state cascade_flag.
So in a BMI get_value call how should the return be handled when the variable is not allocated? And should the return status be SUCCESS or FAILURE if it's not allocated. Likewise if the variable was an input variable how should we handle the set_value call?
One possibility is
The text was updated successfully, but these errors were encountered: