Skip to content

[feature] Crop model config file

Summary

Add a "config" parameter to run_crop_simu(), containing names of all needed parameter files.

Current behavior

Crop parameters and init files are hard-coded in "run_model()" functions (see https://gitlab.uliege.be/deal-public/pase/-/blob/69-feature-grassim-refactoring/MODULES/CROPS/GRASSIM/run_grassim.py)

This prevents running different crop simulations easily.

Desired behavior

Users should be able to generate multiple crop_plots and soil_plots for different scenarios in the same launch file (main.py) by changing a single parameter. This "config" param is a dictionary containing crop model and parameter/init file names. The files are then loaded in each "run_model" function

Example :

Soil_plot_1, Crop_plot_1 = run_crop_simu(config='crop_config_1.yaml', 
                                     option_2D, WD.nyears_daily_data, 
                                     L.daily_irr_spat,
                                     Loc_1)

Soil_plot_2, Crop_plot_2 = run_crop_simu(config='crop_config_2.yaml', 
                                     option_2D, WD.nyears_daily_data, 
                                     L.daily_irr_spat,
                                     Loc_1)

with crop_config_1.yaml:

crop_model: grassim
crop_init: crop_init_1.yaml
soil_init: soil_init_1.yaml
PFT_composition: pft_composition_1.yaml
PFT_values: pft_values_1.csv
Kc_values: kc_values.yaml
management: management_1.yaml

with crop_config_2.yaml:

crop_model: simple
crop_init: crop_init_2.yaml
soil_init: soil_init_2.yaml
crop_parameters: crop_parameters.yaml

Sources

/

Linked features or branches

Adresses #71 (closed)