<jupyter_start><jupyter_text>Example of SpafHy-Peat model runIn this example the model is run with the general parameters defined in [parameters.py](parameters.py), the node-specific parameters in [example_inputs/parameters/](example_inputs/parameters/) and the forcing data files in [example_inputs/forcing/](example_inputs/forcing/). The simulation  is for 1000 nodes and covers 10 years. Node-specific parameters include: - [cf.dat](example_inputs/parameters/cf.dat): canopy closure [-] - [hc.dat](example_inputs/parameters/hc.dat): stand height [m] - [LAI_decid.dat](example_inputs/parameters/LAI_decid.dat), [LAI_conif.dat](example_inputs/parameters/LAI_conif.dat): one-sided leaf area index of decidious trees and conifers [m2/m2] - [ditch_depth.dat](example_inputs/parameters/ditch_depth.dat): ditch depth [m] - [ditch_spacing.dat](example_inputs/parameters/ditch_spacing.dat): ditch spacing [m] - [latitude.dat](example_inputs/parameters/latitude.dat), [longitude.dat](example_inputs/parameters/longitude.dat): latitude and longitude [deg] - [soil_id.dat](soil_id/parameters/cf.dat): id connecting node to soil profile parameterization (see parameters.peat_soilprofiles) - [forcing_id.dat](example_inputs/parameters/forcing_id.dat): id connecting node to forcing file in forcing folder [cf.dat](example_inputs/parameters/cf.dat), [hc.dat](example_inputs/parameters/hc.dat), [LAI_decid.dat](example_inputs/parameters/LAI_decid.dat), [LAI_conif.dat](example_inputs/parameters/LAI_conif.dat) can be alternatively given for each year separately to represent stand development (value in each column represents one year). In this case, pgen['stand_development'] needs to be defined as True in [parameters.py](parameters.py).Model has also alternatives to be run with a single forcing file, stand parameterization or soil parameterization. For alternatives see [parameters.py](parameters.py). Running model<jupyter_code>from model_driver import driver

outputfile = driver(create_ncf=True, folder='example_inputs')<jupyter_output>*** Running model ***
*** Writing results to netCDF4-file, subset 1/10 ***
*** Writing results to netCDF4-file, subset 2/10 ***
*** Writing results to netCDF4-file, subset 3/10 ***
*** Writing results to netCDF4-file, subset 4/10 ***
*** Writing results to netCDF4-file, subset 5/10 ***
*** Writing results to netCDF4-file, subset 6/10 ***
*** Writing results to netCDF4-file, subset 7/10 ***
*** Writing results to netCDF4-file, subset 8/10 ***
*** Writing results to netCDF4-file, subset 9/10 ***
*** Writing results to netCDF4-file, subset 10/10 ***
--- Running time 23.07 seconds ---
--- Results are in file: results/example_inputs.nc ---<jupyter_text>Reading resultsModel results are written in netCDF4-file, which can be imported as axarray. Output variables stored during simulation can be controlled in parameters.py.<jupyter_code>from iotools import read_results

results = read_results(outputfile)

print(results)<jupyter_output><xarray.Dataset>
Dimensions:                         (date: 3651, i: 1, j: 1000)
Coordinates:
  * date                            (date) datetime64[ns] 1982-01-02 ... 1991...
  * i                               (i) int32 0
  * j                               (j) int32 0 1 2 3 4 ... 995 996 997 998 999
Data variables:
    parameters_lai_conif            (i, j) float32 ...
    parameters_lai_decid_max        (i, j) float32 ...
    parameters_cf                   (i, j) float32 ...
    parameters_ditch_depth          (i, j) float32 ...
    parameters_ditch_spacing        (i, j) float32 ...
    parameters_lat                  (i, j) float32 ...
    parameters_lon                  (i, j) float32 ...
    forcing_air_temperature         (date, i, j) float32 ...
    forcing_precipitation           (date, i, j) float32 ...
    forcing_vapor_pressure_deficit  (date, i, j) float32 ...
    forcing_global_radiation        (date, i, j) float32 ...
    forcing_CO2                     (date, i, j) flo[...]<jupyter_text>Plotting some resultsFigures show ground water level [m] and canopy transpiration [mm/d] for 10 first nodes.<jupyter_code>fig = results['soil_ground_water_level'][:,0,:10].plot.line(x='date')
fig = results['canopy_transpiration'][:,0,:10].plot.line(x='date')<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.11971007715688567, 'fraction_numerical': 0.031096563011456628, 'mean_word_length': 3.7533333333333334, 'pattern_counts': {'":': 0, '<': 12, '<?xml version=': 0, '>': 12, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '144290', 'license': 'MIT', 'n_tokens_mistral': 1378, 'n_tokens_neox': 1265, 'n_words': 362, 'path': 'demo.ipynb', 'repo_name': 'slauniainen/SpaFHy-Peat', 'size': '4277'}