Model setup

create_adm_map_pdf()

Creates a pdf file with maps of administrative unit locations

create_adm_list()

create file with information on how administrative units are nested

create_grid()

Create spam country grid

create_spam_folders()

Create spam folder structure

rasterize_adm_map()

Rasterizes the map with the location of the subnational administrative units

spam_par()

Sets spam parameters

Proces subnational statistics

check_statistics()

Checks the consistency of the subnational statistics

create_statistics_template()

Create template for raw subnational crop statistics

reaggregate_statistics()

Reaggregates subnational statistics from the bottom up so they are consistent

Prepare input data

combine_inputs()

Combines all inputs into a GAMS gdx file that can be used by SPAMc as input

harmonize_inputs()

Harmonizes the subnational statistics, the cropland extent and the irrigated area

prepare_cropland()

Prepares the synergy cropland area for SPAM

prepare_irrigated_area()

Prepares the synergy irrigated area for SPAM

prepare_physical_area()

Prepares the physical area subnational statistics so they can be used as input for SPAM.

prepare_priors_and_scores()

Prepares priors and scores for all farming systems, crops and grid cells

Run model

combine_results()

Combines SPAMc GAMS output into a single rds file

run_spam()

Runs SPAMc at the set administrative unit level

Post processing

create_all_tif()

Create tif files of all SPAMc maps

create_globiom_input()

Create land cover and crop distribution gdx files for use with GLOBIOM

view_panel()

Show crop distributions maps using a panel for each farming system

view_stack()

Show crop distributions maps using a stack for each farming system

General

load_data()

Load model input data for further processing

plus()

Sum of vector elements but now NA + NA = NA not 0 as in sum