Skip to content

Support for flux output over the Basic Model Interface and other BMI improvements - #111

Merged
analytophile merged 4 commits into
CSHS-CWRA:mainfrom
robmtud:robmtud/bmi_flux_output
Sep 18, 2026
Merged

analytophile merged 4 commits into
CSHS-CWRA:mainfrom
robmtud:robmtud/bmi_flux_output

Conversation

@robmtud

@robmtud robmtud commented Sep 18, 2026 •

Copy link
Copy Markdown
Contributor

Important

This pull request contains changes which are also included in pull request #112. In case pull request #112 gets accepted, this one here should be closed without accepting. Please see issue #110 for a discussion of both pull requests.

This pull requests adds support for accessing fluxes through Raven's Basic Model Interface (BMI) and has additional improvements and fixes to the BMI.

BMI flux output

The implementation of the access to flux output variables during runtime follows Raven's CustomOutput functionality for fluxes. The configuration in the BMI config.txt for fluxes uses a similar syntax, e.g.:

output_vars:
- To:SOIL[0]: flux
- From:SOIL[0]: flux
- Between:SOIL[0].And.SOIL[1]: flux

BMI: more initialization / config checks

  • check if state var named in config.txt is present in model
  • check if model was previously initialized when executing 'CRavenBMI::Finalize'

BMI: fix index error in 'GetValueAtIndices'

  • previously the output array was indexed by the values in the index array e.g requesting indices [0, 5, 10] would try to write to out[0], out[5] and out[10]
  • now the output array is indexed by the the position of the index in the index array

robmtud and others added 4 commits September 18, 2026 14:10
- BMI only supports flux output for now
- config variables are the same as for CustomOutput:
    - To:SOIL[0]: flux
    - From:SOIL[0]: flux
    - Between:SOIL[0].And.SOIL[1]: flux
- check if state var named in config.txt is present in model
- check if model was previously initialized when executing 'CRavenBMI::Finalize'
- previously the output array was indexed by the values in the index array
  e.g requesting indices [0, 5, 10] would try to write to out[0], out[5]
  and out[10]
- now the output array is indexed by the the position of the index in
  the index array
@analytophile
analytophile merged commit c9e5c92 into CSHS-CWRA:main Sep 18, 2026
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants