Forum

Accessing dflowfm via BMI

Veethahavya Kootanoor Sheshadrivasan, modified 2 Years ago.

Accessing dflowfm via BMI

Youngling Posts: 3 Join Date: 8/8/22 Recent Posts
Hi,

I am trying to use BMI to initialize the model via a fortran program.

I was able to successfuly test out the bmi-python library [https://github.com/openearth/bmi-python] with my compiled dflowfm kernel and the provided e02..._westerscheldt example.

However, I would really like to access the BMI exposed routines via fortran.

I was able to compile a test program as shown below and link it to the shared dflowfm library. But while running the compiled executable, I receive a  segmentation fault error that doesn't tell me much. So any help on how to successfully make BMI calls to the dflowfm kernel via fortran is highly appreciated. Thanks in advance!

Source code:
program test_df_bmi
    character(len=100) :: config_file
    config_file = "/home/bmi-python/test_data/e02_f14_c040_westerscheldt/westerscheldt.mdu"
    call bmi_initialize(trim(config_file))
end program test_df_bmi

compiled successfully via ifort so: ifort -o testbmifort bmi_fort-test.f90 -L/opt/dflowfm/lib/ -ldflowfm