Skip to main content

DSSAT itself, through xdssat

Six training modules, adapted from the International Training Program on DSSAT, with the real engine behind every chart

From the case studies to the whole model

The case studies use a narrow slice of DSSAT. The Java rice case study, for one, runs one crop model, two water regimes, one cultivar and a calibration of a single soil fertility factor. DSSAT does far more: its engine carries cultivar files for 48 crop codes (59 files in the engine’s Genotype folder), and it simulates phenology and growth, the water and nitrogen balance of the soil, the effect of management, and seasons, risks and rotations over many years. The bridge that xdssat builds between DSSAT and Python is just as useful for exploring all of that. The modules below do it with the course material of a DSSAT training, one module per training day, every exercise rebuilt in Python on top of xdssat’s modules.

Based on the DSSAT training in Chiang Mai, 2018. The following material is based on the DSSAT training I attended in Chiang Mai, Thailand, in 2018. The trainers were Prof. Gerrit Hoogenboom from the University of Florida, USA, and Prof. Attachai Jintrawet from Chiang Mai University.

The training ran from 27 August to 1 September 2018, as described in my blog post about it. The modules follow its day-by-day syllabus and its exercises. They are written for this site: the course’s slides and exercise sheets are not reproduced. Where the course handed out data files for an exercise, the notebooks use them (they are in docs/notebooks/course-data/); everything else comes from DSSAT’s openly published example data, DSSAT/dssat-csm-data. Two parts of the syllabus are handled differently: day 5’s demonstration of a spatial decision support tool (MWCropDSS) is replaced by the sections “From one field to a grid: xdssat” at the end of modules 1, 2, 3 and 5, and day 6, for which no course material is used here, follows DSSAT’s own sequence examples and documentation (module 6). The course worked in the DSSAT shell; here every step is code that can be read, rerun and changed:

DSSAT shell tool Here
XBuild (experiment files) filex.FileX and filex.build_filex from xdssat, or the file’s sections edited in code
WeatherMan (weather files) pandas and wth.write_wth / wth.read_wth (module 2)
SBuild (soil profiles) sol.SoilProfile, soils.saxton_rawls (module 3)
Sensitivity Analysis tool one FileX with a treatment per value, learnlib.write_cultivar_variants
GBuild (graphs) the interactive charts on these pages, matplotlib in the notebooks
GLUE (cultivar calibration) glue.py, a Python port of DSSAT’s GLUE method (module 3)
ATCreate (observed data files) learnlib.write_observed (module 4)
Seasonal and Sequence analysis multi-season runs, the engine’s sequence mode and pandas (modules 5 and 6)

The syllabus, topic by topic

Every topic of the course’s six days, and where these modules cover it. “Differently” marks the topics taught another way here, for the reasons above.

Day Course topic Where Here
1 History and overview of DSSAT Module 1, section 0 covered
1 Running a crop model Module 1, sections 1 and 2 covered
1 Phenological development Module 1, section 3 covered
1 Potential production, creating the experiment file Module 1, section 4 covered
1 Sensitivity analysis Module 1, section 5 differently: one experiment file with a treatment per value
2 Basic growth processes Module 2, section 1 covered
2 Weather data and utilities, weather generators Module 2, section 2 differently: code in place of WeatherMan
2 Minimum data set, the DSSAT file system Module 2, section 3 covered
2 Species, ecotype and cultivar coefficients; cultivar sensitivity Module 2, section 4 covered
2-3 Estimating cultivar coefficients: concepts, GLUE, in-season data Module 3, section 1 differently: a Python port of GLUE
3 Soil data and utilities Module 3, section 2 differently: code in place of SBuild
3 Water-limited production, soil and paddy flood water Module 3, section 3 covered
4 Experimental data collection and files, model evaluation Module 4, section 1 differently: code in place of ATCreate
4 Nitrogen-limited production: soil and plant, N fixation Module 4, section 2 covered
5 Spatial decision support (MWCropDSS demonstration) “From one field to a grid: xdssat”, modules 1, 2, 3 and 5 differently: xdssat in place of MWCropDSS
5 Uncertainty and risk, seasonal analysis, environmental outcomes Module 5 covered
6 Crop rotations, creating a sequence experiment Module 6, sections 1 to 4 differently: DSSAT’s own sequence examples (no course material)
6 Applications and needs Module 6, section 5 covered

What the DSSAT engine can do beyond the course, and which of it xdssat runs on a grid, is on What xdssat covers.

Modules

Every module has a reading page (the links above) and a notebook in the Notebooks section. The pages never run the engine: their charts read the small CSV files the notebooks wrote.

What you need to run the notebooks

  • The DSSAT engine (dscsm048, version 4.8), built or installed as in Getting started.
  • A short work folder outside OneDrive (XDSSAT_WORK, default C:/TEMP/dsn/work); the engine keeps file paths in fixed-length buffers.
  • DSSAT/dssat-csm-data cloned next to the xdssat folder; the notebooks pin one commit.
  • A Python environment with pandas, numpy and matplotlib (the one used for xdssat), and xlrd for the course’s spreadsheets.
Back to top