fastscape-lem / fastscapelib-fortran

A Fortran (+ Python bindings) library of efficient algorithms for landscape evolution modeling
https://fastscape-lem.github.io/fastscapelib-fortran/
GNU General Public License v3.0
23 stars 17 forks source link

Regression in 2.8 #28

Closed benbovy closed 4 years ago

benbovy commented 4 years ago

There might be an issue introduced between versions 2.7 and 2.8.

Taking the example in the notebook FastScape_test included in the examples, plotting the topography after half the total simulation time,

The results for version 2.7 and 2.8 in MacOS, and 2.7 in Linux:

ok

And the results for version 2.8 in Linux:

ko

The model doesn't crash, but it seems that SPL sediment transport is not working properly, only for Linux and version 2.8.

This is weird! Maybe it has something to do with how the Python bindings are compiled with F2PY. I haven't checked the output from Fortran examples in Linux, though. Maybe related to https://github.com/fastscape-lem/fastscape/issues/7.

Any idea @jeanbraun ?

benbovy commented 4 years ago

I have the same issue when running the Fan.f90 example, so it does not seem to be related to Python bindings only.

benbovy commented 4 years ago

Regression has been introduced in #23.

benbovy commented 4 years ago

So the reason seems to be that call set_bc is missing in StreamPowerLaw routines (bc is allocated but not set properly). Or better would be to add bc in context to avoid unnecessarily calling set_bc multiple times.

benbovy commented 4 years ago

Also, hwater should not be deallocated in StreamPowerLawSingleFlowDirection.