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.

50524a6c17766c1b96df5199de528249?s=128

DSSAT Foundation

March 24, 2014
Tweet

More Decks by DSSAT Foundation

Other Decks in Technology

Transcript

  1. DSSAT Cropping System Model 101 March 25, 2014 IFDC, Muscle

    Shoals, AL Cheryl Porter
  2. Modular Structure

  3. Modular Structure

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

    • DYNAMIC is a component of the composite CONTROL variable • Example SoilKi.for
  5. 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.
  6. Method 1: Explicitly pass variables thru argument lists Passing variables

    around
  7. Modular Structure

  8. 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
  9. 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
  10. 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)
  11. 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!