Skip to content

Initial time step too small #2

@Peter9192

Description

@Peter9192

The call to BMI update needs to use the model's time step, which is calculated on the fly. However, the initial time step is so small, that the model never seems to get going. Forcing the timestep to 1 in the c++ wrapper solves the issue, but a hardcoded time step is obviously not desirable.

See the following example:

from grpc4bmi.bmi_client_docker import BmiClientDocker
model = BmiClientDocker(image='sfincs-bmiserver', image_port=50051, work_dir="./")
model.initialize('sfincs.inp')
for i in range(10):
    print(model.get_current_time(), model.get_time_step())
    model.update()

which gives:

950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07
950400.0 9.999999974752427e-07

Perhaps there needs to be some spinup? Should that be done in the call to initialize()?

Also see example notebook in this repo.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions