Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DSSAT Cropping System Model 101

DSSAT Cropping System Model 101

Presented by Cheryl Porter at the DSSAT Development Sprint Workshop 2014 at IFDC-HQ in Muscle Shoals, AL, on March 24, 2014.

DSSAT Foundation

March 24, 2014
Tweet

More Decks by DSSAT Foundation

Other Decks in Technology

Transcript

  1. Modular Structure • DYNAMIC variable is used to control processing

    • DYNAMIC is a component of the composite CONTROL variable • Example SoilKi.for
  2. 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.
  3. 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
  4. 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
  5. 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)
  6. 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!