<jupyter_start><jupyter_text>Simple model run exampleThis Jupyter Notebook shows how to configure and run a model simulation, and how to examine the model outputs.This document supplements the [10-minute tutorial](https://deltarcm.org/pyDeltaRCM/guides/10min.html) and [User Guide](https://deltarcm.org/pyDeltaRCM/guides/user_guide.html), but is not a complete guide to the model.<jupyter_code>import pyDeltaRCM
import os
import numpy as np
import netCDF4
import matplotlib.pyplot as plt<jupyter_output><empty_output><jupyter_text>First, we will configure a YAML file to input to the model.<jupyter_code>%%writefile eg_config.yaml

f_bedload: 0.25
h0: 2
u0: 1.1
save_eta_figs: True
save_eta_grids: True
save_velocity_grids: True
save_dt: 250000<jupyter_output><empty_output><jupyter_text>In the following cell, we instantiate the model with the yaml file we just created, run the model for 1000 steps, and finalize.**WARNING** executing the run will likely take 30-40 minutes.<jupyter_code>mdl = pyDeltaRCM.DeltaModel('eg_config.yaml')

for _ in range(0, 1000):
   mdl.update()

mdl.finalize()<jupyter_output><empty_output><jupyter_text>With the model completed, we can see the final state:<jupyter_code>fig, ax = plt.subplots()
ax.imshow(mdl.eta, cmap='cividis')
plt.show()<jupyter_output><empty_output><jupyter_text>We can also access the history of the run in the output NetCDF4 file.<jupyter_code>data = netCDF4.Dataset(os.path.join('deltaRCM_Output', 'pyDeltaRCM_output.nc')) # this is the default location for the output file
nt = 3
ts = np.linspace(0, data['eta'].shape[0]-1,
                 num=nt, dtype=int)  # linearly interpolate ts

# make the timeseries plot
fig, ax = plt.subplots(1, nt, figsize=(11, 2), dpi=300)
for i, t in enumerate(ts):
    ax[i].imshow(data['eta'][t, :, :], cmap='cividis')
    ax[i].axes.get_xaxis().set_ticks([])
    ax[i].axes.get_yaxis().set_ticks([])

plt.tight_layout()
plt.show()<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11821903787103377, 'fraction_numerical': 0.02302968270214944, 'mean_word_length': 5.835664335664336, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '5', 'dir': 'jupyter-structured-clean-dedup', 'id': '616403', 'license': 'MIT', 'n_tokens_mistral': 743, 'n_tokens_neox': 701, 'n_words': 185, 'path': 'docs/source/examples/simple_example.ipynb', 'repo_name': 'elbeejay/pyDeltaRCM_WMT', 'size': '1954'}