csdms / help-desk

The CSDMS Help Desk. Ask questions. Get answers (about CSDMS products and services).
MIT License
6 stars 1 forks source link

Can the set of input variables of a BMI-compliant model be defined only at the initialization? #225

Closed adlzanchetta closed 9 months ago

adlzanchetta commented 9 months ago

Scenario:

Lets say I have a hydrological model that, depending on its config file, may require one of the following sets of inputs:

  1. precipitation;
  2. mean hourly temperature.

or

  1. precipitation;
  2. minimum daily temperature;
  3. maximum daily temperature.

or

  1. accumulated rainfall;
  2. accumulated snowfall;
  3. mean daily temperature;
  4. mean daily wind speed.

So that I can only determine the return of get_input_item_count() and get_input_var_names() AFTER initialize() is called.

Question:

Does the BMI standard requires functions like get_input_item_count() and get_input_var_names() to be able to return a valid value even BEFORE initialize() is called? Or can I assume that a whatever uses my model via its BMI interface will ALWAYS call initialize() before trying to call get_input_item_count() or get_input_var_names() ?

PS:

I apologize if this is not the correct place for this sort of discussion and kindly request for suggestions where I can ask it.

mdpiper commented 9 months ago

Hi @adlzanchetta -- There's currently no rule to call initialize first.

It might be good to bring this up to the BMI community, either through an issue or a discussion post in the BMI repo. At the very least, the current behavior should be clarified and documented.

adlzanchetta commented 9 months ago

Thanks for pointing out the right place to go, @mdpiper .