Add wolf-sheep-soil-creep tutorial#793
Conversation
There was a problem hiding this comment.
Hi @joargu! This PR is coming out of the blue for me, but it might be the cleanest PR I have ever reviewed for a new tutorial! 😄
I can run the tutorial on my system, which completes in a few seconds (very good for a tutorial). There are no external adapters used, since the two codes are given (both in Python, both already with requirements.txt). I think this would be a nice tutorial, both to showcase coupling with an ABM code, and to showcase a very different application.
You could also add the two codes in the list of third-party adapters, including contact details. At the moment, I have no idea of the context/contact.
I only have two points where this needs improvement: a bit more description, and a fix in the plotting.
Time-wise, this is also good: We are about to make a new release of the tutorials, and it would be great to have this in there.
|
|
||
| ## Setup | ||
|
|
||
| This is an implementation of Landlab's [Wolf-Sheep-Grass Model with Soil Creep](https://landlab.csdms.io/tutorials/agent_based_modeling/wolf_sheep/wolf_sheep_with_soil_creep.html) example, coupled via preCICE. We couple the [Wolf-Sheep model from MESA](https://mesa.readthedocs.io/latest/examples/advanced/wolf_sheep.html) with a soil creep model implemented in Landlab. |
There was a problem hiding this comment.
Since this tutorial is rather novel for our community, could you please extend this paragraph with a few sentences on the general concept?
| cmap="coolwarm_r", | ||
| colorbar_label="Depth of soil accumulation (+) or loss (-), m", | ||
| ) | ||
| plt.show() |
There was a problem hiding this comment.
From these three plt.show(), I am getting:
UserWarning: FigureCanvasAgg is non-interactive, and thus cannot be shown
and no images are generated. The simplest solution (and the one that would fit automated testing the most) would be to write the images to disk, instead of showing them.
| --- | ||
| title: Wolf-sheep-grass model with soil creep | ||
| permalink: tutorials-wolf-sheep-soil-creep.html | ||
| keywords: MESA, Landlab, wolf-sheep-grass, soil creep, ABM |
There was a problem hiding this comment.
| keywords: MESA, Landlab, wolf-sheep-grass, soil creep, ABM | |
| keywords: MESA, Landlab, wolf-sheep-grass, soil creep, ABM, agent-based modeling |
|
|
||
| ## Setup | ||
|
|
||
| This is an implementation of Landlab's [Wolf-Sheep-Grass Model with Soil Creep](https://landlab.csdms.io/tutorials/agent_based_modeling/wolf_sheep/wolf_sheep_with_soil_creep.html) example, coupled via preCICE. We couple the [Wolf-Sheep model from MESA](https://mesa.readthedocs.io/latest/examples/advanced/wolf_sheep.html) with a soil creep model implemented in Landlab. |
There was a problem hiding this comment.
Here would also be a good place to explicitly link to the sources (not just the rendering) and mention that they are licensed under MIT.
|
|
||
| ## Running the simulation | ||
|
|
||
| Open two separate terminals and start the soil creep and wolf sheep participant by calling the respective run scripts `run.sh` located in each of the participants' directory. For example: |
There was a problem hiding this comment.
| Open two separate terminals and start the soil creep and wolf sheep participant by calling the respective run scripts `run.sh` located in each of the participants' directory. For example: | |
| Open two separate terminals and start the soil creep and wolf sheep participants by calling the respective run scripts `run.sh` located in each of the participants' directories. For example: |
|
|
||
| ## Post-processing | ||
|
|
||
| The Soil-Creep participant generates Python-based visualizations. The following examples were generated by setting rng=42 in the WolfSheepScenario for the wolf-sheep-grass participant. |
There was a problem hiding this comment.
| The Soil-Creep participant generates Python-based visualizations. The following examples were generated by setting rng=42 in the WolfSheepScenario for the wolf-sheep-grass participant. | |
| The Soil-Creep participant generates Python-based visualizations. The following examples were generated by setting `rng=42` in the WolfSheepScenario for the wolf-sheep-grass participant. |
and please add this line in the example above. Also for regression testing, this will be important.
| hstar = 0.2 | ||
| fast_creep = 0.1 | ||
| slow_creep = 0.001 |
There was a problem hiding this comment.
Could you add some comments here on what these parameters mean?
| creep_coef = rmg.add_zeros("creep_coefficient", at="node") | ||
|
|
||
| # Create a soil-thickness field | ||
| soil = rmg.add_zeros("soil__depth", at="node") |
There was a problem hiding this comment.
| soil = rmg.add_zeros("soil__depth", at="node") | |
| soil = rmg.add_zeros("soil_depth", at="node") |
or what is the definition behind using two "_"?
|
|
||
| # Run the soil-creep model | ||
| prior_elev[:] = elev | ||
| diffuser.run_one_step(dt) |
There was a problem hiding this comment.
I guess this updates elev? Where could I see more about this?
(a comment could probably be good here)
| # Use dx of Raster Model Grid from Soil Creep for solver_dt calculation | ||
| dx = 1.0 | ||
| fast_creep = 0.1 |
There was a problem hiding this comment.
The dx here also makes sense from the perspective of MESA, right? But the fast_creep doesn't.
Maybe it could be easier to simply hard-code the solver_dt here and comment that we do this to ensure matching time step sizes.
Description
Added a new wolf-sheep-soil-creep tutorial coupling Mesa (ABM) and Landlab (PDE) via preCICE.
Checklist
changelog-entries/<PRnumber>.md.