Slide 1

Slide 1 text

DSSAT Cropping System Model 101 March 25, 2014 IFDC, Muscle Shoals, AL Cheryl Porter

Slide 2

Slide 2 text

Modular Structure

Slide 3

Slide 3 text

Modular Structure

Slide 4

Slide 4 text

Modular Structure • DYNAMIC variable is used to control processing • DYNAMIC is a component of the composite CONTROL variable • Example SoilKi.for

Slide 5

Slide 5 text

Module Functions Each module should: 1. Read its own parameters (see IP* routines); 2. Initialize its own variables; 3. Accept variables passed to it from other modules and the environment ; 4. Pass variables that are computed within the module; 5. Own its set of state variables; 6. Compute rates of change for its state variables; 7. Integrate its state variables; 8. Write its own variables as output (see OP* routines); and 9. Operate when linked to a dummy test program.

Slide 6

Slide 6 text

Method 1: Explicitly pass variables thru argument lists Passing variables around

Slide 7

Slide 7 text

Modular Structure

Slide 8

Slide 8 text

Passing variables around • Method 2: Composite variables – ModuleDefs.for • Method 3: Global constants – ModuleDefs.for • Method 4: GET and PUT routines – CROPGRO.FOR & ETPHOT.FOR • Method 5: (Avoid!) COMMON blocks – COMGEN.BLK & IPVAR.FOR

Slide 9

Slide 9 text

Versioning • ModuleDefs.for • Each output file is branded with the model version and build number and the development branch *GROWTH ASPECTS OUTPUT FILE *DSSAT Cropping System Model Ver. 4.6.0.025 -develop DEC 08, 2013; 19:40:33 *RUN 1 : Sprinkler IR, 0 kg N/ha SGCER046 CSKU8201 1 MODEL : SGCER046 - Grain sorghum EXPERIMENT : CSKU8201 SG KUNNUNURRA IRRIGATION EXP 1982 DATA PATH : C:\DSSAT45\Sorghum\ TREATMENT 1 : Sprinkler IR, 0 kg N/ha SGCER046 ! ! @YEAR DOY DAS DAP L#SD GSTD LAID LWAD SWAD GWAD RWAD VWAD CWAD 1982 146 2 0 0.0 0 0.00 0 0 0 0 0 0 1982 147 3 1 0.0 0 0.00 0 0 0 0 0 0 1982 148 4 2 0.0 0 0.00 0 0 0 0 0 0 1982 149 5 3 0.0 0 0.00 0 0 0 0 0 0

Slide 10

Slide 10 text

Common utilities • ModuleDefs.for (data types, GET, PUT, …) • Date utilities (DATES.for) • Message reporting (INFO, WARNING, ERROR) • Input module • Generic outputs (File headers, Summary, Overview) • File reading utilities (READS.for) • Generic utilities (UTILS.for)

Slide 11

Slide 11 text

Coding code of conduct • Documentation • Development branch branding (outputs linked to version and branch) • Use existing utilities as much as possible (rather than add new code for existing functions) • TESTING!