Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Some changes for more flexibility downstream #25

Merged
merged 6 commits into from
Nov 25, 2019
Merged

Conversation

benbovy
Copy link
Member

@benbovy benbovy commented Oct 5, 2019

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).

This allows more control from downstream libraries (power users) on
setting the spatially variable 'g' value, than g1 (bedrock) and g2 (sediment).
Allows more flexibility downstream (i.e., use other expressions for
computing its value than the one hard-coded in `find_mult_rec`).

There is no breaking change.
@benbovy
Copy link
Member Author

benbovy commented Oct 7, 2019

@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.

@benbovy benbovy merged commit 7ddf763 into master Nov 25, 2019
@benbovy benbovy deleted the make-xsimlab-compliant branch November 25, 2019 10:51
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.

None yet

1 participant