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

Some changes for more flexibility downstream #25

Closed benbovy closed 4 years ago

benbovy commented 5 years ago

Those changes are needed to fully leverage fastscapelib-fortran in fastscape while enabling more customization.

I exploit the fact that all variables declared in FastScapeContext are exposed to python (i.e., from fastscapelib_fortran.fastscapecontext attribute), which allows me to do more customization than what is possible by using the API (FastScape_api.f90).

benbovy commented 5 years ago

@jeanbraun when you have time could you review these changes?

It addresses #24. There is no breaking change. The only change in the API is when a negative value is set for g1 (aka g in the documentation), the array values won't be set unless accessing directly to the FastScapeContext. Users should never do that, but I hack this way from Python (xarray-simlab wrappers) to have more control on the array values. From the API point of view, I guess it is fine since the bedrock dimensionless deposition/transport coefficient should always have a value >=0?

I haven't done any deep checking, but everything compiles and the examples look all good.